Submission details
Task:Gas tank
Sender:aalto25k_001
Submission time:2025-11-12 17:13:27 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.07 sdetails
#20.06 sdetails
#30.06 sdetails
#40.07 sdetails
#50.06 sdetails
#60.07 sdetails
#70.06 sdetails
#80.06 sdetails
#90.06 sdetails
#100.06 sdetails
#110.06 sdetails
#120.06 sdetails
#130.06 sdetails
#140.06 sdetails
#150.06 sdetails
#160.06 sdetails
#170.06 sdetails
#180.06 sdetails
#190.06 sdetails
#200.06 sdetails
#210.06 sdetails
#220.06 sdetails
#230.06 sdetails
#240.06 sdetails
#250.06 sdetails
#260.06 sdetails
#270.06 sdetails
#280.07 sdetails
#290.06 sdetails
#300.06 sdetails
#310.06 sdetails
#320.06 sdetails
#330.06 sdetails
#340.06 sdetails
#350.06 sdetails
#360.06 sdetails
#370.06 sdetails
#380.07 sdetails
#390.07 sdetails
#400.06 sdetails
#410.06 sdetails
#420.06 sdetails
#430.06 sdetails
#440.06 sdetails
#450.06 sdetails
#460.06 sdetails
#470.06 sdetails
#480.06 sdetails
#490.06 sdetails
#500.06 sdetails
#510.07 sdetails
#520.06 sdetails
#530.06 sdetails
#540.07 sdetails
#550.06 sdetails
#560.06 sdetails
#570.06 sdetails
#580.06 sdetails
#590.06 sdetails
#600.06 sdetails
#610.07 sdetails
#620.06 sdetails
#630.06 sdetails
#640.06 sdetails
#650.06 sdetails
#660.06 sdetails
#670.06 sdetails
#680.06 sdetails
#690.06 sdetails
#700.06 sdetails
#710.06 sdetails
#720.06 sdetails
#730.06 sdetails
#740.06 sdetails
#750.06 sdetails
#760.06 sdetails
#770.07 sdetails
#780.06 sdetails
#790.06 sdetails
#800.06 sdetails

Code

import math
n = int(input())
min_diff = n
sol_a = 0
sol_b = 0
for A in range (1,int(math.cbrt(n))+3):
    B = int((-A**2+math.sqrt(A**4+4*A*n))/(2*A))
    curr_diff = n-A**2*B+B**2*A
    if curr_diff < min_diff:
        min_diff = curr_diff
        sol_a = A
        sol_b = B
print(sol_a, sol_b)

Test details

Test 1

Verdict:

input
8

correct output
2 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 2

Verdict:

input
7

correct output
2 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 3

Verdict:

input
46

correct output
6 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 4

Verdict:

input
28

correct output
4 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 5

Verdict:

input
40

correct output
5 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 6

Verdict:

input
34

correct output
5 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 7

Verdict:

input
39

correct output
5 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 8

Verdict:

input
38

correct output
5 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 9

Verdict:

input
25

correct output
4 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 10

Verdict:

input
26

correct output
4 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 11

Verdict:

input
549

correct output
7 6

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 12

Verdict:

input
418

correct output
13 2

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 13

Verdict:

input
436

correct output
6 6

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 14

Verdict:

input
551

correct output
7 6

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 15

Verdict:

input
968

correct output
21 2

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 16

Verdict:

input
222

correct output
14 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 17

Verdict:

input
893

correct output
13 4

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 18

Verdict:

input
77

correct output
8 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 19

Verdict:

input
874

correct output
29 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 20

Verdict:

input
11

correct output
2 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 21

Verdict:

input
772

correct output
12 4

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 22

Verdict:

input
181

correct output
5 4

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 23

Verdict:

input
155

correct output
11 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 24

Verdict:

input
778

correct output
12 4

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 25

Verdict:

input
514

correct output
15 2

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 26

Verdict:

input
849

correct output
8 7

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 27

Verdict:

input
224

correct output
14 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 28

Verdict:

input
295

correct output
11 2

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 29

Verdict:

input
651

correct output
25 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 30

Verdict:

input
98

correct output
6 2

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 31

Verdict:

input
588264

correct output
172 18

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 32

Verdict:

input
48736

correct output
80 7

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 33

Verdict:

input
208508

correct output
99 18

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 34

Verdict:

input
517415

correct output
172 16

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 35

Verdict:

input
960234

correct output
290 11

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 36

Verdict:

input
870321

correct output
111 49

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 37

Verdict:

input
308005

correct output
70 40

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 38

Verdict:

input
425818

correct output
652 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 39

Verdict:

input
729178

correct output
83 61

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 40

Verdict:

input
863955

correct output
535 3

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 41

Verdict:

input
116086

correct output
340 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 42

Verdict:

input
612309

correct output
782 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 43

Verdict:

input
375142

correct output
228 7

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 44

Verdict:

input
852178

correct output
161 28

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 45

Verdict:

input
151667

correct output
156 6

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 46

Verdict:

input
196137

correct output
103 16

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 47

Verdict:

input
375254

correct output
612 1

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 48

Verdict:

input
451513

correct output
298 5

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 49

Verdict:

input
942864

correct output
122 46

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 50

Verdict:

input
848035

correct output
215 17

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 51

Verdict:

input
727949226

correct output
1876 188

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 52

Verdict:

input
119540561

correct output
395 387

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 53

Verdict:

input
168568700

correct output
447 430

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 54

Verdict:

input
747828096

correct output
2098 158

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 55

Verdict:

input
113886324

correct output
949 113

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 56

Verdict:

input
544092912

correct output
2620 77

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 57

Verdict:

input
112927706

correct output
532 266

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 58

Verdict:

input
562461747

correct output
1803 159

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 59

Verdict:

input
930544437

correct output
7390 17

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 60

Verdict:

input
612603672

correct output
1128 364

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 61

Verdict:

input
575864416073

correct output
7427 5843

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 62

Verdict:

input
942935707814

correct output
63092 236

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 63

Verdict:

input
171264013251

correct output
14433 780

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 64

Verdict:

input
76712165827

correct output
8381 978

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 65

Verdict:

input
161612205399

correct output
7527 2206

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 66

Verdict:

input
641183113758

correct output
50116 254

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 67

Verdict:

input
87822361843

correct output
24538 145

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 68

Verdict:

input
550401843854

correct output
14093 2372

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 69

Verdict:

input
56603972680

correct output
10404 499

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 70

Verdict:

input
991404337870

correct output
109250 83

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 71

Verdict:

input
534149659344

correct output
53496 186

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 72

Verdict:

input
336010906011

correct output
183301 10

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 73

Verdict:

input
871714540470

correct output
214186 19

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 74

Verdict:

input
254659717917

correct output
17240 818

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 75

Verdict:

input
40507166127

correct output
3335 2196

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 76

Verdict:

input
445628406612

correct output
23039 811

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 77

Verdict:

input
822717753419

correct output
39363 524

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 78

Verdict:

input
40410210216

correct output
10096 382

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 79

Verdict:

input
366117794932

correct output
49165 151

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'

Test 80

Verdict:

input
657992849714

correct output
11698 3662

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 6, in <module>
    for A in range (1,int(math.cbrt(n))+3):
AttributeError: module 'math' has no attribute 'cbrt'