the Example description

Pozri:
https://kurzy.kpi.fei.tuke.sk/pvjc/2021/problemset.racer.html

je tam zhruba toto:


The simplified text of the example above in English.

There is an older car with a tachograph which has a needle.
One day the needle drop out from the axe. The driver puts the needle back to the axe
but probably not in the same angle. The driver start to record details data of his trip.
The trip consist from trip parts.
He record every trip part distance S[km], and trip part speed V[km/h].
But the showing speed V could be wrong (fictive) because of possible wrong needle angle.
(the needle angle should be shifted in clockwise or counterclockwise direction)
He also record the total trip time T[h] (Total time for all trip parts together).
The task is, to create the program which calculate the possible needle speed shift.

The program input:
N (1 ≤ N ≤ 1000) the number of trip parts (integer number)
T (1 ≤ T ≤ 10^6) the real total trip time [h] (integer number)
then N records which every contain
S (1 ≤ S ≤ 1000) the trip part distance [km] (integer number)
V (|V| ≤ 1000) the trip part fictive speed [km/h] (integer number)

The program output:
the needle speed shift in [km/h] with accuracy smaller then 10^-6
the program calculation time should be smaller than 1 sec.

e.g. input:
3; 5     N; T
4;-1      S1;V1
4; 0     S2;V2
10;3    S3;V3
output: 3.0000000 [km/h]

© 2018 Bruster
Powered by Webnode
Create your website for free! This website was made with Webnode. Create your own for free today! Get started