Ingresos y gastos

Has decidido llevar un control de tus gastos e ingresos este mes. Has registrado todos los gastos en el archivo expenses.txt, cada uno en una línea separada, mientras que los ingresos los has registrado en el archivo income.txt siguiendo el mismo formato.

Ahora te gustaría saber si has gastado más de lo que has ganado o si te has mantenido dentro de los límites.

El programa debería imprimir Great, you've stayed within the limits! si los gastos no exceden los ingresos, y We need to cut the spending the next month de lo contrario.

expenses.txt

income.txt

Salida

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