| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 191 | 71 | 58 | 34.524% |
The unique location of Venice in northeastern Italy poses a shipping problem in many cases due to the canals and whatnot. To transport large quantities of spaghetti from Milan to Venice, a company uses trucks capable of carrying A tons from Milan to Mestre, the city on the mainland closest to Venice, and boats capable of carrying B tons from Mestre to Venice. One day, the depot in Venice requests an arbitrary amount of spaghetti, but not less than C tons and the depot in Mestre requests exactly D tons. Write a program to determine the smallest number of trucks to be sent from Milan to satisfy both orders such that every truck and boat used for the transport is loaded to capacity.
There is a single line of input containing the four integers, A, B, C and D. (0 < A ≤ 100), (0 < B ≤ 20), (0 ≤ C ≤ 100), (0 ≤ D ≤ 100).
The single output line consists of the sentence: We need t trucks and b boats. Where t is the number of trucks required and b is the number of boats required. If t or b is 1, then you should not pluralize the words “truck” or “boat” respectively. If there is no solution that meets the criteria, output: No solution.
31 13 50 28
We need 3 trucks and 5 boats.
100 20 30 10
No solution.
1 1 1 100
We need 101 trucks and 1 boat.