#C2029. Expense Report Checker
Expense Report Checker
Expense Report Checker
In this problem, you are given the number of days (d) and the maximum daily budget (b). You are also given a list of expenses for each day. Your task is to determine on which days the expenses exceeded the given budget. For each day where the expense is greater than (b), you should output a line in the format:
Day i: expense
where i
is the 1-indexed day and expense
is the corresponding expense on that day. If no day's expense exceeds the budget, simply output a single line:
All days are within budget.
This problem tests your ability to process input from stdin, perform simple conditional checks and output the results to stdout.
inputFormat
The input is read from stdin and consists of two lines:
- The first line contains two integers \(d\) and \(b\), where \(d\) is the number of days and \(b\) is the maximum allowed daily expense.
- The second line contains \(d\) integers representing the expenses for each day, separated by spaces.
outputFormat
Output the results to stdout. For each day where the expense exceeds the budget (b), print a line in the format:
Day i: expense
with (i) as the 1-indexed day number. If no day exceeds the budget, print a single line:
All days are within budget.
## sample
3 500
400 300 450
All days are within budget.
</p>