Task: | Kasat |
Sender: | haapseem |
Submission time: | 2019-05-30 20:38:54 +0300 |
Language: | Python3 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.07 s | 1 | details |
#2 | WRONG ANSWER | 0.07 s | 2 | details |
#3 | WRONG ANSWER | 0.06 s | 3 | details |
Code
k = int(input()) a = [] for i in range(k): a.append(list(map(lambda x: int(x), input().split(" ")))) for l in a: n = l[3] a, b, c = l[:3] l.sort() a, b = min(a, b), max(a, b) b, c = min(b, c), max(b, c) a, b = min(a, b), max(a, b) # jos a,b,c keskiarvo - a on pienempi kuin n # c - n, a + n if (a+b+c) // 3 - a > n: a += n c -= n # jos b > c if b > c: ka = (b+c) // 2 if (b+c) % 2 == 0: b, c = ka, ka else: b, c = ka, ka+1 else: print("here") ka = (a+b+c) // 3 # jos c ero keskiarvoon suurempi, kuin n if c - ka > n: c -= ka # jos n parillinen a = b if n % 2 == 0: a, b = (a+b+n) // 2, (a+b+n) // 2 else: a, b = (a+b+n) // 2, (a+b+n) // 2 + 1 else: # c - ka < n if (a+b+c) % 3 == 0: if (n - (c - ka)) % 2 == 0: a, b, c = ka, ka, ka else: a, b, c = ka-1, ka, ka+1 elif (a+b+c) % 3 == 1: a, b, c = ka, ka, ka+1 else: a, b, c = ka, ka+1, ka+1 a, b = min(a, b), max(a, b) b, c = min(b, c), max(b, c) a, b = min(a, b), max(a, b) print(a, b, c)
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
1000 7 69 64 45 37 5 30 81 50 49 37 38 46 37 100 6 ... |
correct output |
---|
46 47 47 24 24 24 45 45 46 43 46 94 32 32 33 ... |
user output |
---|
here 46 47 47 here 24 24 24 here ... |
Test 2
Group: 2
Verdict: WRONG ANSWER
input |
---|
1000 19 13 88 978977859 67 57 39 960003440 81 16 67 971611942 92 96 2 957979201 ... |
correct output |
---|
39 40 41 54 54 55 54 55 55 63 63 64 36 37 38 ... |
user output |
---|
here 39 40 41 here 54 54 55 here ... |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000 211358104 753479603 549127067 ... |
correct output |
---|
504654924 504654925 504654925 589019272 589019272 589019273 101309993 101309994 101309994 436205296 436205297 436205298 351062567 351062568 351062568 ... |
user output |
---|
here 504654924 504654925 504654925 here 589019272 589019272 589019273 here ... |