In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of October 19th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #02 exercise sheet]
Splitting the dinner bill can sometimes be confusing, especially when everyone wants to pay an equal share.
Write a program that asks for the total price of a dinner bill and the number of people having dinner. Calculate how much each person should pay and display the final amount. Use round to round the final value to two decimal places.
The first line contains T, a floating-point number representing the total price of the bill.
The second line contains N, an integer representing the number of people.
The output should be a single line with the amount each person must pay, rounded to two decimal places.
The following limits are guaranteed in all the test cases that will be given to your program:
0 < T < 1000 | Total amount to pay | |
1 ≤ N ≤ 50 | Number of people |
Example Input 1 | Example Output 1 |
65.5 4 |
16.38 |
Example Input 2 | Example Output 2 |
23.78 2 |
11.89 |