Big Yield
Time limit1sMemory limit1024 MB
Given the total milk L and the pouring time T, find the difference between the two buckets' amounts, where the longer pour equals the larger bucket.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Statement
Archip and Bronislav advanced to the final of a milk-yield contest called Big Yield. In each round, every participant milked one bucket of milk (possibly not full), then the results were written on a sheet of paper, and the buckets were tipped into a large vat at the same time. A mark on the vat showed that the total was liters. Just as the participants were distracted by the prize ceremony, a goat ate the sheet of paper.
Baba Nadya, who recently got a hearing aid, said she could recover the results by ear. From long experience, she knows that milk flows out of a bucket at 1 liter per second. By listening, she determined that the milk was pouring for seconds during the final. Help answer the question: by how many liters did the winner outpace the loser?
Input
The first line contains an integer , the number of liters of milk the finalists milked in total ().
The second line contains an integer , the time during which the milk was pouring (, ).
Output
Print a single integer: the difference between the amounts of milk, in liters, that the finalists milked.