Rendimentos e Despesas
Este mês, decidiste acompanhar as tuas despesas e rendimentos. Anotaste todas as despesas no ficheiro
expenses.txt
, uma por linha, e registaste os rendimentos no ficheiro income.txt
, seguindo o mesmo formato.Agora, queres saber se gastaste mais do que ganhaste ou se te mantiveste dentro dos limites.
O programa deve imprimir
Great, you've stayed within the limits!
se as despesas não excederem os rendimentos, e We need to cut the spending the next month
caso contrário.expenses.txt | income.txt | Saída |
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: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB