Submission details
Task:Densest subgraph
Sender:ray_a
Submission time:2020-09-19 14:52:10 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.08 sdetails
#20.08 sdetails
#30.08 sdetails
#40.08 sdetails
#50.08 sdetails
#60.08 sdetails
#70.08 sdetails
#80.08 sdetails
#90.08 sdetails
#100.08 sdetails
#110.08 sdetails
#120.08 sdetails
#130.08 sdetails
#140.08 sdetails
#150.08 sdetails
#160.08 sdetails
#170.08 sdetails
#180.08 sdetails
#190.08 sdetails
#200.08 sdetails
#210.08 sdetails
#220.08 sdetails
#230.08 sdetails
#240.08 sdetails

Code

from queue import Queue


def main() :
    n = int(input())
    last_digit = (n % 10)
    if last_digit%2 == 0 :
        print(n)
        print(2,n//2)
    elif last_digit % 5 == 0 :
        print(n)
        print(5,(n//5))
    else : 
        temp = n
        sum = 0
        while temp > 0 :
            sum += temp %10
            temp //= 10
            if sum >= 10 :
                sum = sum//10 + sum%10
        print(sum)
        if sum%3 != 0 :
            total = int(str(3-sum%3) + str(n))
            print(total)
            print(3, total//3)
        else :
            print(n)
            print(3, n//3)

if __name__ == "__main__":
    main()

Test details

Test 1

Verdict:

input
8 11
1 2
2 3
3 4
4 5
...

correct output
7 10
2 3 4 5 6 7 8 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 2

Verdict:

input
100 100
1 97
2 14
2 81
3 34
...

correct output
28 37
3 6 7 9 10 12 15 21 23 27 28 3...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 3

Verdict:

input
100 200
1 99
2 11
2 28
2 59
...

correct output
71 156
2 3 4 6 7 9 10 11 14 15 16 18 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 4

Verdict:

input
100 300
1 24
1 38
1 65
1 83
...

correct output
93 284
1 2 3 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 5

Verdict:

input
100 400
1 44
1 56
1 77
1 87
...

correct output
91 368
1 2 3 4 5 6 8 9 10 11 12 13 14...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 6

Verdict:

input
100 500
1 19
1 40
1 51
1 66
...

correct output
92 465
1 2 4 5 6 7 8 9 10 11 12 13 14...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 7

Verdict:

input
32 496
1 2
1 3
1 4
1 5
...

correct output
32 496
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 8

Verdict:

input
44 462
1 2
1 3
1 4
1 5
...

correct output
44 462
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 9

Verdict:

input
56 495
1 2
1 3
1 4
1 5
...

correct output
38 342
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 10

Verdict:

input
32 495
1 2
1 3
1 4
1 5
...

correct output
32 495
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 11

Verdict:

input
44 461
1 2
1 3
1 4
1 5
...

correct output
22 231
23 24 25 26 27 28 29 30 31 32 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 12

Verdict:

input
56 494
1 2
1 3
1 4
1 5
...

correct output
19 171
20 21 22 23 24 25 26 27 28 29 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 13

Verdict:

input
20 1
5 18

correct output
2 1
5 18 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 14

Verdict:

input
20 10
2 15
2 16
4 16
5 10
...

correct output
10 9
2 4 5 7 8 10 12 15 16 19 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 15

Verdict:

input
20 20
1 13
1 14
1 15
1 19
...

correct output
9 13
1 4 11 12 13 14 15 19 20 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 16

Verdict:

input
20 50
1 3
1 19
2 13
2 14
...

correct output
17 44
2 3 4 5 6 8 9 10 11 12 13 14 1...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 17

Verdict:

input
20 100
1 2
1 6
1 7
1 8
...

correct output
19 96
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 18

Verdict:

input
20 190
1 2
1 3
1 4
1 5
...

correct output
20 190
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 19

Verdict:

input
20 90
1 2
1 3
1 4
1 5
...

correct output
10 45
1 2 3 4 5 6 7 8 9 10 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 20

Verdict:

input
20 50
1 2
1 4
1 6
1 7
...

correct output
10 28
1 2 3 4 5 6 7 8 9 10 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 21

Verdict:

input
20 20
1 9
2 6
2 7
2 9
...

correct output
7 10
2 4 6 7 8 9 10 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 22

Verdict:

input
20 10
2 7
4 10
5 7
12 19
...

correct output
5 4
12 13 14 15 19 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 23

Verdict:

input
20 10
8 11
8 13
9 11
10 11
...

correct output
3 3
10 11 12 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...

Test 24

Verdict:

input
20 50
1 2
1 4
1 5
2 3
...

correct output
7 20
8 9 10 11 12 13 14 

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 31, in <module>
    main()...