CSES - Putka Open 2015 – 3/6 - Results
Submission details
Task:Onnenluku
Sender:
Submission time:2015-09-13 22:56:55 +0300
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
Test results
testverdicttimegroup
#10.07 s1details
#20.08 s1details
#30.08 s1details
#40.07 s1details
#50.09 s1details
#60.07 s2details
#70.08 s2details
#80.07 s2details
#90.07 s2details
#100.07 s2details
#110.08 s3details
#120.09 s3details
#130.09 s3details
#140.08 s3details
#150.08 s3details

Code

t = int(input())
while t > 0:
    a, b, c, n = (int(x) for x in input().split())
    D = sorted([a,b,c])

    d = min(D[1]-D[0], D[2]-D[1], n)
    D = [D[0]+d, D[1], D[2]-d]
    n = n - d

    if n > 0:
        d = n
        while d > 10:
            while D[1]-D[0] > 3*d and n >= 2*d:
                D = sorted([D[0]+2*d, D[1]-1*d, D[2]-1*d])
                n = n - 2*d
            while D[2]-D[1] > 3*d and n >= 2*d:
                D = sorted([D[0]+1*d, D[1]+1*d, D[2]-2*d])
                n = n - 2*d
            d = d / 2
        while n > 0:
            D = sorted([D[0]+1, D[1], D[2]-1])
            n = n - 1

    print(" ".join(str(x) for x in D))
    t = t - 1

Test details

Test 1

Group: 1

Verdict:

input
2157 93337

correct output
1421

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '2157 93337'

Test 2

Group: 1

Verdict:

input
4875 95124

correct output
1278

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '4875 95124'

Test 3

Group: 1

Verdict:

input
5577 96352

correct output
1245

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '5577 96352'

Test 4

Group: 1

Verdict:

input
8362 92950

correct output
1076

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '8362 92950'

Test 5

Group: 1

Verdict:

input
5658 96660

correct output
1238

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '5658 96660'

Test 6

Group: 2

Verdict:

input
51312303535233 994542403556353

correct output
1453976

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '51312303535233 994542403556353'

Test 7

Group: 2

Verdict:

input
25636920452341 934558290712847

correct output
1544072

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '25636920452341 934558290712847'

Test 8

Group: 2

Verdict:

input
7917952071965 985207415843573

correct output
1763176

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '7917952071965 985207415843573'

Test 9

Group: 2

Verdict:

input
48991581181227 907034837225965

correct output
1380248

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '48991581181227 907034837225965'

Test 10

Group: 2

Verdict:

input
47968703305149 924246001328437

correct output
1396632

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '47968703305149 924246001328437'

Test 11

Group: 3

Verdict:

input
292953755324413237753216241025...

correct output
53286731528535944

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '2929537553244132377532162410251823648052793051402 96463917346564188511882177515204779145810864670372'

Test 12

Group: 3

Verdict:

input
373990979330820426927419348165...

correct output
51580289482227600

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '3739909793308204269274193481652778070231729799623 97766875580288872905881695960460270094450336895482'

Test 13

Group: 3

Verdict:

input
701417326319476057561825658890...

correct output
42924933948374952

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '7014173263194760575618256588905321780224307828224 91832653840117061430228322343502759506423672596132'

Test 14

Group: 3

Verdict:

input
177202883511434557056457305647...

correct output
54500592365600640

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '1772028835114345570564573056473376348950033812085 91801935904110322340514736360767234352973177205455'

Test 15

Group: 3

Verdict:

input
977665117437419620152569155919...

correct output
38562071809359800

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 1, in <module>
    t = int(input())
ValueError: invalid literal for int() with base 10: '9776651174374196201525691559197038941654881320219 95075953292382735025808002911730639246390160004053'