QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#730766#1480. Von Neumann's FlyBackToSquare1100 ✓1ms3952kbC++20438b2024-11-09 21:35:472024-11-09 21:35:47

Judging History

This is the latest submission verdict.

  • [2024-11-09 21:35:47]
  • Judged
  • Verdict: 100
  • Time: 1ms
  • Memory: 3952kb
  • [2024-11-09 21:35:47]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;

typedef long double ld;

void solve() {

    int K;
    cin >> K;

    ld D, A, B, F;
    cin >> D >> A >> B >> F;

    ld time = D/(A+B);
    cout << K << ' ' << time*F << '\n';

    return;

}


int main() {
    cin.tie(0)->sync_with_stdio(0);
    cout << fixed << setprecision(2);

    int P;
    cin >> P;
    for(int i=0;i<P;i++) solve();

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests


Final Tests

Test #1:

score: 100
Accepted
time: 1ms
memory: 3952kb

input:

21
1 250 10 15 20
2 10.7 3.5 4.7 5.5
3 523.7 15.3 20.7 33.3
4 1000 30 30 50
5 500 15 15 25
6 10 1 1 1.1
7 10 1 1 50
8 10 30 30 50
9 10 30 30 30.1
10 10 30 30 30.01
11 10 1 30 30.1
12 10 30 1 30.1
13 1000 1 1 1.1
14 1000 1 1 50
15 999.9 29.9 29.9 49.9
16 250 20 40 50
17 300 16 32 48
18 10 2 4 8
19 17...

output:

1 200.00
2 7.18
3 484.42
4 833.33
5 416.67
6 5.50
7 250.00
8 8.33
9 5.02
10 5.00
11 9.71
12 9.71
13 550.00
14 25000.00
15 834.36
16 208.33
17 300.00
18 13.33
19 14.88
20 979.17
21 5857.38

result:

ok 42 numbers