Cod sursa(job #670712)

Utilizator ion824Ion Ureche ion824 Data 29 ianuarie 2012 20:54:07
Problema Stergeri Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.3 kb
#include<fstream>
using namespace std;

int main(void){
    ifstream fin("stergeri.in");
    ofstream fout("stergeri.out");
    int n,m,k,x,y;
    fin>>n>>m>>k; 
    while(m--){
               fin>>x>>y;
               if(k>=x)k+=y-x+1;           
               }
    fout<<k;
 return 0;   
}