Submission details
Task:Alien Invasion II
Sender:toothfairy
Submission time:2020-09-19 13:46:14 +0300
Language:Python3 (CPython3)
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.02 sdetails
#2ACCEPTED0.02 sdetails
#3ACCEPTED0.02 sdetails

Code

# Python3 program to implement division  
# with large number  
import math 
  
# A function to perform division of  
# large numbers  
def longDivision(number, divisor):  
  
    # As result can be very large  
    # store it in string  
    ans = "";  
      
    # Find prefix of number that  
    # is larger than divisor.  
    idx = 0;  
    temp = ord(number[idx]) - ord('0'); 
    while (temp < divisor): 
        temp = (temp * 10 + ord(number[idx + 1]) -
                            ord('0')); 
        idx += 1; 
      
    idx += 1; 
  
    # Repeatedly divide divisor with temp.  
    # After every division, update temp to  
    # include one more digit.  
    while ((len(number)) > idx):  
          
        # Store result in answer i.e. temp / divisor  
        ans += chr(math.floor(temp // divisor) + ord('0'));  
          
        # Take next digit of number 
        temp = ((temp % divisor) * 10 + ord(number[idx]) -
                                        ord('0')); 
        idx += 1; 
  
    ans += chr(math.floor(temp // divisor) + ord('0')); 
      
    # If divisor is greater than number  
    if (len(ans) == 0):  
        return "0";  
      
    # else return ans  
    return ans;  
  




value = input()
arr = value.split("\t")
sum = 0;
for va in arr:
  sum+= int(va)

remainder = sum%3
value = str(3-remainder)+value
fac = longDivision(value, 3) 
print(value)
print(str(3)+" "+fac)
# print(str(int(fac*3)))

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...