#include <iostream>
using namespace std;

int main() {
    int out,in;
    int max = 0;
    int pepole = 0;
    for (int i = 0;i < 10;i++) {
        cin >> out >> in;
        pepole = pepole + in - out;
        if (pepole > max) {
            max = pepole;
        }
    }
    cout << max;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: