CSES - HIIT Open 2019 - Results
Submission details
Task:Alien Invasion II
Sender:Barely div 1
Submission time:2019-05-25 11:44:20 +0300
Language:Python3
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2ACCEPTED0.06 sdetails
#3ACCEPTED0.05 sdetails

Code

astr = str(input())
aint = int(astr)

import sys

for i in range(1, 10**5):
  newstr = str(i) + astr
  newint = int(newstr)
  if (newint % 3) == 0 and newint > 3:
    print(newstr)
    print('3 ' + str(newint//3))
    sys.exit()

sys.exit()

if (aint % 2) == 0 and aint > 2:
  print(astr)
  print('2 ' + str(aint/2))
else:
  for i in range(1, 10**5):
    newstr = str(i) + astr
    newint = int(newstr)
    if (newint % 3) == 0 and newint > 3:
      print(newstr)
      print('3 ' + str(newint/3))
      sys.exit()
    if (newint % 5) == 0 and newint > 5:
      print(newstr)
      print('5 ' + str(newint/5))
      sys.exit()
    if (newint % 7) == 0 and newint > 7:
      print(newstr)
      print('7 ' + str(newint/7))
      sys.exit()
  

Test details

Test 1

Verdict: ACCEPTED

input
2368469234876449

correct output
22368469234876449
3 7456156411625483

user output
22368469234876449
3 7456156411625483

Test 2

Verdict: ACCEPTED

input
292929292929292929292929292931

correct output
129292929292929292929292929293...

user output
129292929292929292929292929293...

Test 3

Verdict: ACCEPTED

input
292929292929292929292929292979

correct output
129292929292929292929292929297...

user output
129292929292929292929292929297...