Check out example codes for "usaco 2018 january contest". It will help you in understanding the concepts better.

Code Example 1

2 1 7 4
5 -1 10 3

Learn ReactJs, React Native from akashmittal.com