All submissions for this problem are available.
The formula for converting a Zahrenheit temperature G to the corresponding Xelsius temperature X is T=(Z-A)*B/C. An integer Zahrenheit temperature is converted to Xelsius and rounded to the nearest integer (rounding up to break the tie); the resulting integer Xelsius temperature is converted back to Zahrenheit and rounded to the nearest integer (rounding up to break the tie too). For how many Zahrenheit temperature T with A <= T <= N does the original temperature equal the final temperature?
Note: the given equation may not be Z=(X-32)*5/9.
There are multiple test cases.
Each test case consists of a single line containing the four intergers-A, B, C and N, listed in this order.
Input is terminated by EOF (End of File).
For each test case, output one line - the answer.
Input: 32 5 9 1000 Output: 539
|Time Limit:||0.2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, PYTH 3.5, PYPY, GO, NODEJS, rust, swift, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.