Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iomanip>
- #include <iostream>
- #include <functional>
- #include <algorithm>
- #include <math.h>
- #include <cmath>
- #include <string>
- using namespace std;
- int main(){
- int n;
- int s = 0, z, x, v = 1000000;
- cin >> n;
- for (int i = 0; i < n; i++){
- cin >> x >> z;
- s = s + z - x;
- if (s < v){
- v = s;
- }
- }
- cout << v;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement