Եկամուտ և ծախսեր

Դուք որոշել եք հետևել այս ամսվա ձեր ծախսերին և եկամուտներին: Գրանցել եք բոլոր ծախսերը expenses.txt ֆայլում (յուրաքանչյուրը` առանձին տողում) և միաժամանակ հետևում եք եկամուտներին income.txt ֆայլում՝ կիրառելով նույն ձևաչափը:

Այժմ ցանկանում եք պարզել՝ արդյոք ծախսել եք ավելին, քան վաստակել եք, թե մնացել եք ձեր ունեցած բյուջեի սահմաններում:

Ծրագիրը պետք է տպի Great, you've stayed within the limits!, եթե ծախսերը չեն գերազանցում եկամուտները, և We need to cut the spending the next month հակառակ դեպքում։

expenses.txt

income.txt

Ելք

200 300

100 400 500

Great, you've stayed within the limits!

100 200 890 654

345 234 123 1000 142

Great, you've stayed within the limits!

100 200 300

100 300

We need to cut the spending the next month

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue