← RoseCode

ROSECODE 556

The Two Cities

Philippe_57721 · Math ·

A traveler goes from city A to city B.

When traveling uphill, he moves at speed u km/h
When traveling on flat road, he moves at speed f km/h
When traveling downhill, he moves at speed d km/h
(Of course 0<u<f<d)

To go from A to B, it takes T1 hours.
To go from B to A, it takes T2 hours.


For some triples (u,f,d) these information are sufficient to determinate the distance between A and B
(For instance (30,35,42))

How many such triples of positive integers (u,f,d) with GCD(u,f,d)=1 are there if d<108?

[My timing: 40 sec]
All values in this problem (speed or distance) are assumed to be integers.