message
stringlengths
2
59.7k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
37
108k
cluster
float64
20
20
__index_level_0__
int64
74
217k
Provide tags and a correct Python 3 solution for this coding contest problem. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a ...
instruction
0
75,423
20
150,846
Tags: brute force, math Correct Solution: ``` x = int(input()) b = 0 a=0 while b < 50 : n = (b*(b+1)//2) if ( n == x): a = n print ("YES") break b = b+1 if ( a == 0 ): print ("NO") ```
output
1
75,423
20
150,847
Provide tags and a correct Python 3 solution for this coding contest problem. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a ...
instruction
0
75,424
20
150,848
Tags: brute force, math Correct Solution: ``` n=int(input()) f=0 for i in range(1,n+1): if (i*(i+1))//2==n: f=1 break if f==1: print("YES") else: print("NO") ```
output
1
75,424
20
150,849
Provide tags and a correct Python 3 solution for this coding contest problem. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a ...
instruction
0
75,425
20
150,850
Tags: brute force, math Correct Solution: ``` T=input("") t=int(T) a=0 i=0 while(a<t): a=i*(i+1)/2 i=i+1 if(t==0): print("NO") elif(a==t): print("YES") else: print("NO") ```
output
1
75,425
20
150,851
Provide tags and a correct Python 3 solution for this coding contest problem. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-th triangular number is the number of dots in a ...
instruction
0
75,426
20
150,852
Tags: brute force, math Correct Solution: ``` n = int(input()) possible = [0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496] if n in possible: print("YES") else: print("NO") ```
output
1
75,426
20
150,853
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,427
20
150,854
Yes
output
1
75,427
20
150,855
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,428
20
150,856
Yes
output
1
75,428
20
150,857
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,429
20
150,858
Yes
output
1
75,429
20
150,859
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,430
20
150,860
Yes
output
1
75,430
20
150,861
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,431
20
150,862
No
output
1
75,431
20
150,863
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,432
20
150,864
No
output
1
75,432
20
150,865
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,433
20
150,866
No
output
1
75,433
20
150,867
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A triangular number is the number of dots in an equilateral triangle uniformly filled with dots. For example, three dots can be arranged in a triangle; thus three is a triangular number. The n-t...
instruction
0
75,434
20
150,868
No
output
1
75,434
20
150,869
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,521
20
151,042
Tags: brute force, implementation, math, strings Correct Solution: ``` s=input() a=s[0] d,b=list(s[2:].split('e')) if a=='0': print(0 if d=='0' else '0.'+d) else: b=int(b) len_d=len(d) if b==0 and d=='0': print(a) else: print(a+d[:b]+'.'+d[b:] if b<len_d else a+d+'0'*(b-len_d)) ```
output
1
75,521
20
151,043
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,522
20
151,044
Tags: brute force, implementation, math, strings Correct Solution: ``` s = input() a = s[0] s = s[2:] b = s[:s.find('e')] d = int(s[s.find('e') + 1:]) s = '' if d < 0: s = '0.' + a d -= 1 s += '0' * -d d = 0 s += b else: s = a while d > 0: s += b[0] b = b[1:] + '0' ...
output
1
75,522
20
151,045
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,523
20
151,046
Tags: brute force, implementation, math, strings Correct Solution: ``` s = input() a, b = s.split('e') index = a.find('.') ans = '' if index == -1: b = '0' * (int(b)) ans = a + b else: a1, a2 = a[:index], a[index + 1:] if(int(a2) == 0): ans = a1 + '0' * int(b) elif len(a2) <= int(b): ...
output
1
75,523
20
151,047
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,524
20
151,048
Tags: brute force, implementation, math, strings Correct Solution: ``` from decimal import * n = Decimal(input()) if int(n) == n: print(int(n)) else: print(n) ```
output
1
75,524
20
151,049
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,525
20
151,050
Tags: brute force, implementation, math, strings Correct Solution: ``` s = input().split('.') s[1] = s[1].split('e') s = [s[0]] + s[1] a = int(s[0]) d = int(s[1]) b = int(s[2]) if b >= len(s[1]): ans = s[0] + s[1] + '0' * (b - len(s[1])) print(ans) else: ans = s[0] + s[1][:b] + '.' + s[1][b:] print(ans....
output
1
75,525
20
151,051
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,526
20
151,052
Tags: brute force, implementation, math, strings Correct Solution: ``` s = str(input()) a = s[0] d = s[2:s.find('e')] b = int(s[s.find('e') + 1:]) + 1 a += d while len(a) < b: a += '0' a = a[:b] + '.' + a[b:] while a[0] == '0': a = a[1:] while a[-1] == '0': a = a[:-1] if a[0] == '.': a = '0' + a if a[-1] ...
output
1
75,526
20
151,053
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,527
20
151,054
Tags: brute force, implementation, math, strings Correct Solution: ``` integer, fraction, degree = input().replace('e', '.').split('.') ans = integer for i in range(len(fraction)): if i == int(degree): ans += '.' ans += fraction[i] for i in range(int(degree) - len(fraction)): ans += '0' if '.' ...
output
1
75,527
20
151,055
Provide tags and a correct Python 3 solution for this coding contest problem. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <image> Barney asked the bar tender Carl about this...
instruction
0
75,528
20
151,056
Tags: brute force, implementation, math, strings Correct Solution: ``` s = input() d, tmp = s.split(".") r, exp = tmp.split("e") if((int(d) == 0) & (int(r) == 0)) : print("0") else : result = "" rlen = len(r) if(rlen <= int(exp)) : tmp = int(exp)-rlen zeros = "" while(tmp > 0) : zeros = zeros+"0" tmp...
output
1
75,528
20
151,057
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,529
20
151,058
Yes
output
1
75,529
20
151,059
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,530
20
151,060
Yes
output
1
75,530
20
151,061
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,531
20
151,062
Yes
output
1
75,531
20
151,063
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,532
20
151,064
Yes
output
1
75,532
20
151,065
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,533
20
151,066
No
output
1
75,533
20
151,067
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,534
20
151,068
No
output
1
75,534
20
151,069
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,535
20
151,070
No
output
1
75,535
20
151,071
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate. <imag...
instruction
0
75,536
20
151,072
No
output
1
75,536
20
151,073
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. It can be shown that any positive integer x can be uniquely represented as x = 1 + 2 + 4 + ... + 2k - 1 + r, where k and r are integers, k ≥ 0, 0 < r ≤ 2k. Let's call that representation prairie...
instruction
0
75,555
20
151,110
No
output
1
75,555
20
151,111
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. It can be shown that any positive integer x can be uniquely represented as x = 1 + 2 + 4 + ... + 2k - 1 + r, where k and r are integers, k ≥ 0, 0 < r ≤ 2k. Let's call that representation prairie...
instruction
0
75,556
20
151,112
No
output
1
75,556
20
151,113
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. It can be shown that any positive integer x can be uniquely represented as x = 1 + 2 + 4 + ... + 2k - 1 + r, where k and r are integers, k ≥ 0, 0 < r ≤ 2k. Let's call that representation prairie...
instruction
0
75,557
20
151,114
No
output
1
75,557
20
151,115
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,937
20
151,874
Tags: constructive algorithms, greedy, math Correct Solution: ``` n=int(input()) ans=[] bad=[0]*n curr=0 for i in range(n): s=input() num=[] for j in s: if j!='.': num.append(j) num=int(''.join(num)) if num%100000==0: bad[i]=1 curr+=num%100000 ans.append(num//100000) r=curr//100000 count=0 i...
output
1
75,937
20
151,875
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,938
20
151,876
Tags: constructive algorithms, greedy, math Correct Solution: ``` from math import floor from sys import stdin n = int(stdin.readline()) arr1,arr2,integers = [],[],[] for i in range(n): arr1.append(float(stdin.readline())) arr2.append(floor(arr1[-1])) integers.append(arr1[-1] == int(arr1[-1])) s = -sum(arr...
output
1
75,938
20
151,877
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,939
20
151,878
Tags: constructive algorithms, greedy, math Correct Solution: ``` n = int(input()) k = [] chisla = [] summa = 0 for i in range (n): x = float(input()) p = int(x) if x < 0 and p != x: k.append(-1) elif x > 0 and p != x: k.append(1) else: k.append(0) chisla.append(p) su...
output
1
75,939
20
151,879
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,940
20
151,880
Tags: constructive algorithms, greedy, math Correct Solution: ``` import math N = int(input()) arr = [0.0]*N s = 0 for i in range(N): n = float(input()) d = int(n) if d<=n: s += d elif d>n: s += d-1 #s += math.floor(n) arr[i] = n for i in range(N): num = 0 d = int(arr...
output
1
75,940
20
151,881
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,941
20
151,882
Tags: constructive algorithms, greedy, math Correct Solution: ``` from math import floor, ceil import sys def main(): n = int(sys.stdin.readline()) isum = 0 isumcopy = 0 for i in range(n): num = float(sys.stdin.readline()) if int(num) == num: print(int(num)) conti...
output
1
75,941
20
151,883
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,942
20
151,884
Tags: constructive algorithms, greedy, math Correct Solution: ``` g = 0 h = [] a = int(input()) for i in range(a): s = float(input()) g += int(s) if float(int(s)) == s: k = False else: k = True h.append([int(s), k, s > 0]) for i in range(len(h)): if g == 0: break if ...
output
1
75,942
20
151,885
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,943
20
151,886
Tags: constructive algorithms, greedy, math Correct Solution: ``` from math import floor,ceil n=int(input()) arr=[] arr2=[] for x in range(n): arr.append(float(input())) for x in arr: arr2.append(floor(x)) total=sum(arr2) if total<0: x=0 y=0 while(y<abs(total)): if floor(arr[x])!=arr[x]: arr2[x]+=1 y+=1 ...
output
1
75,943
20
151,887
Provide tags and a correct Python 3 solution for this coding contest problem. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and each b_i is either ⌊ a_i ⌋ or ⌈ a_i ⌉. In other w...
instruction
0
75,944
20
151,888
Tags: constructive algorithms, greedy, math Correct Solution: ``` numbers = [] d = [] # -1 - отр 0 - полож 1 - полож s = 0 for i in range(int(input())): n = input() if n[len(n) - 5:] == "00000": num = int(n[:len(n) - 6]) numbers.append(num) s += num d.append(0) elif n[0] == '...
output
1
75,944
20
151,889
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,945
20
151,890
Yes
output
1
75,945
20
151,891
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,946
20
151,892
Yes
output
1
75,946
20
151,893
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,947
20
151,894
Yes
output
1
75,947
20
151,895
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,948
20
151,896
Yes
output
1
75,948
20
151,897
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,949
20
151,898
No
output
1
75,949
20
151,899
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,950
20
151,900
No
output
1
75,950
20
151,901
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,951
20
151,902
No
output
1
75,951
20
151,903
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Vus the Cossack has n real numbers a_i. It is known that the sum of all numbers is equal to 0. He wants to choose a sequence b the size of which is n such that the sum of all numbers is 0 and ea...
instruction
0
75,952
20
151,904
No
output
1
75,952
20
151,905
Provide tags and a correct Python 3 solution for this coding contest problem. A positive (strictly greater than zero) integer is called round if it is of the form d00...0. In other words, a positive integer is round if all its digits except the leftmost (most significant) are equal to zero. In particular, all numbers ...
instruction
0
76,022
20
152,044
Tags: implementation, math Correct Solution: ``` def Number_As_A_Sum(N): L = [] Power = 1 while N > 0: use = N//10 update = use*10 K = N - update KP = K*Power if KP != 0: L.append(KP) Power = Power*10 N = N//10 return L T = int(input())...
output
1
76,022
20
152,045
Provide tags and a correct Python 3 solution for this coding contest problem. A positive (strictly greater than zero) integer is called round if it is of the form d00...0. In other words, a positive integer is round if all its digits except the leftmost (most significant) are equal to zero. In particular, all numbers ...
instruction
0
76,023
20
152,046
Tags: implementation, math Correct Solution: ``` t=int(input()) for i in range(t): x=int(input()) string=str(x) l=len(string) c=l li=[] for i in range(1,l+1): ans=int(string[i-1])*pow(10,c-i) if(int(ans)!=0): li.append(ans) co=len(li) print(co) for i in li...
output
1
76,023
20
152,047
Provide tags and a correct Python 3 solution for this coding contest problem. A positive (strictly greater than zero) integer is called round if it is of the form d00...0. In other words, a positive integer is round if all its digits except the leftmost (most significant) are equal to zero. In particular, all numbers ...
instruction
0
76,024
20
152,048
Tags: implementation, math Correct Solution: ``` testCount = int(input()) for _ in range(testCount): n = int(input()) addendums = [] currentBase = 1 while currentBase <= n: currentBase *= 10 addendum = n % currentBase if addendum > 0: n -= addendum ...
output
1
76,024
20
152,049