problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03379
s527004028
Accepted
N = int(input()) X = list(map(int,input().split())) X.insert(0,0) A = sorted(X[:]) a = A[N//2] b = A[N//2+1] for i in range(1,N+1): if X[i]>a: print(a) else: print(b)
p02702
s504194302
Accepted
import numpy as np s = input().strip() t = 0 counts = np.array([0] * 2019) counts[0] += 1 m = 1 for a in reversed(s): t = (t + m * int(a)) % 2019 counts[t] += 1 m = m * 10 % 2019 print(int(np.sum(counts * (counts - 1) /2)))
p02900
s635444366
Accepted
from fractions import gcd A,B=map(int,input().split()) C=gcd(A,B) if C==1: print(1) else: count=1 C_copy=C n=2 while n**2<=C: flag=False while C_copy%n==0: C_copy//=n flag=True if flag: count+=1 n=n+1 if n==2 else n+2 else: n=n+1 if n==2 else n+2 if C_copy!=1: count+=1 print(count)
p03377
s507523096
Wrong Answer
a,b,c = map(int,input().split()) if a+b >= c: print('YES') else: print('NO')
p03073
s276268031
Accepted
S = input().rstrip() w = 0 b = 0 for i in range(len(S)): if i%2==0 and int(S[i])==0: w += 1 elif i%2==1 and int(S[i])==1: w += 1 elif i%2==0 and int(S[i])==1: b += 1 elif i%2==1 and int(S[i])==0: b += 1 print(min(w,b))
p03555
s774479058
Wrong Answer
a=input() b=input() if a[0]==b[2] or a[2]==b[2] or a[2]==b[0]: print('YES') else: print('NO')
p02820
s093096862
Accepted
N, K = [int(x) for x in input().split()] R, S, P = [int(x) for x in input().split()] T = input() point = {'r':P, 's':R, 'p':S} win = [False] * N total = 0 for i in range(N): if i < K or T[i] != T[i - K] or win[i - K] == False: total += point[T[i]] win[i] = True print(total)
p02724
s166584632
Accepted
X = int(input()) d1 = X // 500 X -= d1 * 500 d2 = X // 5 print(d1 * 1000 + d2 * 5)
p03524
s909400841
Wrong Answer
from collections import Counter s = dict(Counter(input())) a = [x for x in s.values()] if len(a) == 1 and a[0] == 1: print("YES") exit() if len(a) != 3 : print("NO") exit() print("YES" if a[0] >= a[1] >= a[2] else "NO")
p03127
s089911607
Accepted
n = int(input()) a = list(map(int,input().split())) def gcb(a, b): while b!=0: a,b=b,a%b return a for i in range(n - 1): a[i + 1] = gcb(a[i], a[i + 1]) print(a[n - 1])
p03239
s690839284
Accepted
n, T = map(int, input().split()) ans = 10**9 flg = False for i in range(n): c, t = map(int, input().split()) if T >= t: flg = True ans = min(ans, c) if flg: print(ans) else: print('TLE')
p02768
s625638880
Wrong Answer
n, a, b = map(int, input().split()) ans = 0 mod = 10**9+7 for i in range(2, n+1): ans += i*(i-1) ans -= a*(a-1) ans -= b*(b-1) ans /=2 print(int(ans % mod))
p02725
s889776899
Accepted
k, n = map(int, input().split()) a = list(map(int, input().split())) ans = 0 for i in range(1, n): ans = max(a[i] - a[i - 1], ans) ans = max(ans, a[0] + k - a[n - 1]) print(k - ans)
p02761
s112380278
Accepted
N,M = map(int,input().split()) array = [10]*N T_F = True for i in range(M): s,c = map(int,input().split()) if s>N or (array[s-1] != 10 and array[s-1] !=c) or (s == 1 and c == 0 and N != 1): T_F = False break else: array[s-1] = c ans = 0 if T_F: for i in range(N): if array[i] == 10: array[i] = 0 ans += array[i]*(10**(N-i-1)) if array[0] or N == 1: print(ans) else: print(ans+10**(N-1)) else: print(-1)
p02939
s947170112
Wrong Answer
s = list(input()) cnt = 0 for i in range(len(s)-1): if s[i] == s[i+1]: cnt += 1 if cnt > 0 and cnt % 2 == 0: print(len(s)-cnt+1) elif cnt > 0 and cnt % 2 != 0: print(len(s)-cnt) else: print(len(s))
p03331
s995374413
Accepted
N =input() ans = 0 for i in range(len(N)): ans += int(N[i]) if(N[0] == "1" and int(N)%10 == 0): print(ans*10) else: print(ans)
p03011
s520091139
Accepted
PQR=list(map(int,input().split())) PQR.sort() print(PQR[1]+PQR[0])
p02791
s422317884
Wrong Answer
list=list(map(int, input().split())) count=0 m=list[0] for i in list: a=i if m >= a: count+=1 m = a print(count)
p03719
s227942942
Accepted
A,B,C=map(int,input().split()) if C>=A and C<=B: print("Yes") else: print("No")
p03136
s345061944
Accepted
n = int(input()) l = list(map(int, input().split())) m = max(l) o = sum(l) - m if m < o: print('Yes') else: print('No')
p03062
s709858456
Wrong Answer
## https://atcoder.jp/contests/abc125/tasks/abc125_d N = int(input()) N_List = list(map(int,input().split())) dp = [[0] * 2 for i in range(N)] dp[1][False] = N_List[0] + N_List[1] dp[1][True] = (N_List[0] + N_List[1])*-1 for i in range(2,N): dp[i][False] = max(dp[i-1][True] + N_List[i],dp[i-1][False] + N_List[i]) dp[i][True] = max(dp[i-1][True] + N_List[i-1]*2 + N_List[i]*-1 ,dp[i-1][False] + N_List[i]*-2 + N_List[i]*-1) print(max(dp[N-1]))
p03721
s892082413
Accepted
def main(): from itertools import accumulate n, k, *ab = map(int, open(0).read().split()) c = list(zip(ab[::2], ab[1::2])) c.sort(key=lambda x: x[0]) count = 0 for i, j in c: count += j if k <= count: print(i) break if __name__ == '__main__': main()
p02983
s577446294
Accepted
L, R = map(int, input().split()) ans = 10 ** 100 for i in range(L, R+1): if ans == 0: break for j in range(i+1, R+1): ans = min(ans, i * j % 2019) if ans == 0: break print(ans)
p03524
s067267229
Accepted
S=input() A=S.count('a') B=S.count('b') C=S.count('c') if abs(A-B)<=1 and abs(C-B)<=1 and abs(A-C)<=1: print('YES') else: print('NO')
p02612
s001135616
Accepted
print((10000 - int(input())) % 1000)
p02953
s992475045
Accepted
n = int(input()) h = list(map(int, input().split())) h = h[::-1] for i in range(1, n): dh = h[i] - h[i - 1] if dh == 1: h[i] -= 1 elif dh > 1: print('No') exit() print('Yes')
p02987
s790631587
Wrong Answer
s=input() a=[] for i in s: a.append(i) if a[0]==a[1] and a[2]==a[3]: print('Yes') elif a[0]==a[2] and a[1]==a[3]: print('Yes') elif a[0]==a[3] and a[1]==a[2]: print('Yes') else: print('No')
p02948
s060925632
Wrong Answer
N,M = map(int,input().split()) A = [] for _ in range(N): Ai,Bi = map(int,input().split()) A.append([Ai,Bi]) A.sort(key=lambda x: x[0],reverse=True) A.sort(key=lambda x: x[1],reverse=True) sum_pay = 0 checked = [1]*N j=0 for i in range(M): while A[j][0] > M-i or checked[j] == 0: j += 1 if j == N: break if j == N: break sum_pay += A[j][1] checked[j] = 0 print(sum_pay)
p03427
s726199760
Wrong Answer
s = input() n = int(s) m = str(int(s[0]) - 1) + (len(s) - 1) * "9" ans1 = 0 for i in range(len(m)): ans1 += int(m[i]) if s[-1] != "9": n = n - int(s[-1]) +1 s = str(n) ans2 = 0 for i in range(len(s)): ans2 += int(s[i]) print(max(ans1, ans2))
p02847
s707456920
Accepted
S = input() if S == "SUN": print(7) if S == "MON": print(6) if S == "TUE": print(5) if S == "WED": print(4) if S == "THU": print(3) if S == "FRI": print(2) if S == "SAT": print(1)
p02684
s052835555
Wrong Answer
N,K=map(int,input().split()) A=list(map(int, input().split())) def has_duplicates(seq): return len(seq) != len(set(seq)) c=[1] while 1: if has_duplicates(c): break d=c[-1]-1 c.append(A[d]) p=c.pop() i=c.index(p) c_=c[i:] e=(K-i)%len(c_) print(c_[e])
p02657
s236058029
Accepted
X = str(input()) em = 0 Return = [] for spam in range(len(X)): if X[spam] == " ": Return.append(int(X[em:spam])) em = spam+1 Return.append(int(X[em:])) x = 1 for a in Return: x = x * a print(x)
p03803
s488171833
Wrong Answer
A, B = map(int, input().split()) if A == B: print('Draw') elif A > B != 1: print('Alice') else: print('Bob')
p03438
s189533815
Accepted
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) diff = [a - b for a, b in zip(A, B)] diff.sort() k = 0 for d in diff: if d < 0: if d % 2 == 0: k += -d // 2 else: k += -(d+1) // 2 elif d == 0: continue else: k -= d print(['Yes', 'No'][k<0])
p03379
s103818695
Accepted
n,*a=map(int,open(0).read().split()) b=sorted(a) c,d=b[n//2-1],b[n//2] for i in a: print(d if i<=c else c)
p03086
s595817118
Accepted
S = list(input()) A = ['A', 'C', 'G', 'T'] T = [] ans = 0 for e in S: if e in A: ans += 1 else: T.append(ans) ans = 0 T.append(ans) print(max(T))
p03379
s954841674
Accepted
import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) N = I() X = LI() sort_X = sorted(X) ans1,ans2 = sort_X[(N-1)//2],sort_X[N//2] for x in X: if x>=ans2: print(ans1) else: print(ans2)
p03087
s397077579
Accepted
N, Q = map(int, input().split()) S = input() a = [0] * N c = [False] * N for i in range(1, N): if S[i - 1:i + 1] == "AC": a[i] = a[i - 1] + 1 c[i] = True else: a[i] = a[i - 1] for i in range(Q): l, r = map(int, input().split()) if l - 1 == 0: print(a[r - 1]) elif c[l - 1] is True: print(a[r - 1] - a[l - 1]) else: print(a[r - 1] - a[l - 1])
p03632
s502992643
Accepted
a,b,c,d=map(int,input().split()) l=max(a,c) r=min(b,d) if l>r: print(0) else: print(r-l)
p02953
s281178667
Accepted
n = int(input()) h = list(map(int, input().split())) flag = True for i in range(n-1): if h[i] > h[i+1] + 1: flag = False break elif h[i] == h[i+1] + 1: h[i+1] += 1 if flag: print("Yes") else: print("No")
p03862
s590450947
Accepted
n,x = map(int,input().split()) a = list(input().split()) ans = 0 if int(a[0]) > x: ans += int(a[0])-x a[0] = x for i in range(n-1): c = int(a[i+1]) + int(a[i]) if c > x: ans += c-x a[i+1] = int(a[i+1])-(c-x) print(ans)
p02678
s092136212
Accepted
N, M = map(int, input().split()) to = [[] for _ in range(N)] ans = [-1] * N for _ in range(M): a, b = map(int, input().split()) a -= 1 b -= 1 to[a].append(b) to[b].append(a) from collections import deque Q = deque([0]) ans[0] = -2 while Q: v = Q.popleft() for s in to[v]: if ans[s] == -1: ans[s] = v Q.append(s) print("Yes") print(*(a + 1 for a in ans[1:]), sep="\n")
p02622
s881588978
Accepted
s=input() t=input() ans=0 for i in range(len(s)): if (s[i]!=t[i]): ans+=1 print(ans)
p02688
s459659901
Accepted
n, k = map(int, input().split()) sunuke = list() cnt = 0 for i in range(k): d = int(input()) a = list(map(int, input().split())) sunuke.extend(a) for j in range(1, n + 1): if j not in sunuke: cnt += 1 print(cnt)
p04034
s621429290
Accepted
n,m=map(int,input().split()) w=[1]*n p=[0]*n p[0]=1 for i in range(m): x,y=map(int,input().split()) x-=1 y-=1 if p[x]: p[y]=1 w[x]-=1 w[y]+=1 if w[x]==0: p[x]=0 print(sum(p))
p03556
s395907452
Wrong Answer
N=int(input()) max=0 for i in range(N+2,0,-1): s=int(i**(0.5)) if i==s**2: max=i break print(max)
p02657
s935723234
Wrong Answer
a = list(map(int, input().split())) print(f"a[0] * a[1]")
p02546
s749300833
Accepted
import math def a(): s=input() if s[-1] == 's': print(s+'es') else: print(s+'s') def b(): pass def c(): pass def d(): pass a() # b() # c() # d()
p02748
s306332958
Accepted
a, b, m = map(int,input().split()) rei = list(map(int,input().split())) den = list(map(int,input().split())) ans = [min(rei) + min(den)] for i in range(m): x,y,c = map(int,input().split()) ans.append(rei[x-1] + den[y-1] - c) print(min(ans))
p02555
s598369371
Accepted
MOD = 10 ** 9 + 7 s = int(input()) dp = [0] * (s + 1) dp[0] = 1 ans = 0 for i in range(s): tmp = 0 for j in range(s + 1): tmp += dp[j] dp[j] += tmp - dp[j] dp[j] %= MOD if s - (i + 1) * 3 < 0: break ans += dp[s - (i + 1) * 3] print(ans % MOD)
p03721
s394739386
Accepted
N,K = (int(T) for T in input().split()) Ins = [[] for T in range(0,N)] for TN in range(0,N): Ins[TN] = [int(T) for T in input().split()] InsSort = sorted(Ins) Total = 0 for TN in range(0,N): if Total<K<=Total+InsSort[TN][1]: print(InsSort[TN][0]) break else: Total += InsSort[TN][1]
p03556
s942168686
Accepted
N = int(input()) print(int(N**0.5)**2)
p02854
s524081880
Accepted
from itertools import accumulate import bisect n = int(input()) a = list(map(int, input().split())) acc = list(accumulate(a)) #idx = bisect.bisect_left(acc,acc[-1]//2) #print(idx) result = [] for i in range(n): result.append(abs((acc[-1] - acc[i] ) - acc[i])) print(min(result))
p03705
s121042947
Wrong Answer
import numpy as np import math import scipy import itertools def solve(): n, a, b = map(int, input().split()) print(max(b*(n-1)-a*(n-1)+1, 0)) return 0 if __name__ == "__main__": solve()
p02612
s546276265
Accepted
n = int(input()) a=((n//1000)+1)*1000-n if a == 1000: print(0) else: print(a)
p02690
s225173143
Accepted
import sys x = int(input()) for i in range(1000): for j in range(-1000,1000): if((i**5) - (j**5) == x): print(i,j) sys.exit()
p03469
s114367987
Accepted
print(input().replace("2017","2018"))
p02786
s358212118
Accepted
H = int(input()) cnt = 1 ans = 1 if H == 1: ans = 1 else: while True: if H // 2 > 1: H //= 2 ans += 2 ** cnt cnt += 1 else: ans += 2 ** cnt break print(ans)
p03720
s186447415
Accepted
n,m=map(int,input().split()) city=[0]*n for i in range(m): a,b=map(int,input().split()) city[a-1]+=1 city[b-1]+=1 for i in range(n): print(city[i])
p03210
s848492068
Accepted
x = int(input()) if x == 7 or x == 5 or x == 3: print('YES') else: print('NO')
p02817
s311065541
Wrong Answer
S, T = list(map(str,input().split())) print(S + T)
p02829
s741469594
Accepted
a = int(input()) b = int(input()) s = [1, 2, 3] s.remove(a) s.remove(b) print(s[0])
p02801
s211533955
Accepted
s = input() print(chr(ord(s)+1))
p02723
s650778044
Wrong Answer
def main(): s = input() if s[2]==s[3]: if s[3]!=s[4]: if s[4]==s[5]: print('Yes') else: print('No') main()
p02683
s015136675
Wrong Answer
def bitsearch(n, a, x): mincost = 10**10 for b in range(2**n): bit = format(b, f"0{n}b") total = [sum([int(bit[i])*a[i][j] for i in range(n)]) for j in range(m+1)] if min(total[1:]) >= x: mincost = min(mincost, total[0]) return mincost n, m, x = map(int, input().split()) a = [] for i in range(n): line = list(map(int, input().split())) a.append(line) print(bitsearch(n, a, x))
p03324
s706794003
Accepted
d, n = [int(x) for x in input().split()] x = 100 ** d if n == 100: n = 101 ans = n * x print(ans)
p02772
s860930438
Wrong Answer
n =int(input()) a = map(int, input().split()) t = False for i in a: if i%3 ==0 or i%5 == 0: t = True else: t = False if t: print("APPROVED") else: print("DENIED")
p02731
s070007533
Wrong Answer
L = int(input()) print(L//3 ** 3)
p03131
s306979789
Accepted
K, A, B = map(int, input().split()) ans = 1 if A >= B: ans += K else: restk = K # A < B restk -= A - 1 if restk <= 0: ans += K else: if restk > 1: ans = max(K+1, A + (restk // 2)*(B - A) + restk % 2) else: ans = A + 1 print(ans)
p03042
s490100706
Accepted
S=input() mae=int(S[:2]) ato=int(S[2:]) if (1<=mae<=12) and (1<=ato<=12): print('AMBIGUOUS') elif (1<=mae<=12) and (not (1<=ato<=12)): print('MMYY') elif (not (1<=mae<=12)) and (1<=ato<=12): print('YYMM') else: print('NA')
p03359
s601746718
Wrong Answer
a, b = map(int, input().split()) i = 1 for n in range(1, a): for m in range(1, b): if n == m: i += 1 print(int(i))
p02695
s154137400
Accepted
from itertools import combinations_with_replacement as comp_rplc n, m, q = list(map(int, input().split())) req = [list(map(int, input().split())) for _ in range(q)] ans = 0 for seq in comp_rplc(range(1, m + 1), n): score = 0 for a, b, c, d in req: if seq[b - 1] - seq[a - 1] == c: score += d ans = max(ans, score) print(ans)
p03329
s900181888
Accepted
n=int(input()) ans=float("INF") for i in range(n+1): d=0 temp=i while (temp>0): d+=temp%6 temp//=6 temp=n-i while(temp>0): d+=temp%9 temp//=9 ans=min(d,ans) print(ans)
p03852
s752588723
Accepted
c=input() if c in 'aiueo': print('vowel') else: print('consonant')
p02639
s201110043
Accepted
xs = map(int, input().split()) print(list(xs).index(0) + 1)
p03252
s596140520
Accepted
S = input() T = input() dic_S = {} dic_T = {} for i in range(len(S)): if S[i] not in dic_S: dic_S[S[i]] = T[i] elif dic_S[S[i]] != T[i]: print('No') exit() if T[i] not in dic_T: dic_T[T[i]] = S[i] elif dic_T[T[i]] != S[i]: print('No') exit() print('Yes')
p02953
s444693265
Wrong Answer
from sys import exit N = int(input()) h = list(map(int,input().split())) pre = 0 for i in range(N-1): if h[i] <= h[i+1]: pre = h[i] else: if h[i]-1 <= h[i+1]: if pre > h[i]-1: print("No") exit(0) else: pre = h[i]-1 else: print("No") exit(0) print("Yes")
p03557
s481562425
Accepted
import bisect N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() total=0 for j in range(N): b=B[j] p_a=bisect.bisect_left(A,b) p_b=bisect.bisect_right(C,b) total+=p_a*(N-p_b) print(total)
p03103
s063031995
Accepted
n , m = map(int , input().split()) ans = [] total = 0 for i in range(n): a = list(map(int , input().split())) ans.append(a) ans = sorted(ans, key=lambda x:x[0]) j = 0 while m > 0: small = min(ans[j][1] , m) total += ans[j][0] * small m -= small j += 1 print(total)
p03723
s237547175
Accepted
A, B, C = map(int,input().split()) if B %2 != 0: print(0) exit() if A == B == C: print(-1) exit() x = B/2 cnt = 0 while A % 2 == 0 and C % 2 == 0: tmp_a = A tmp_c = C A = tmp_c/2 + x C = tmp_a/2 + x cnt += 1 print(cnt)
p02658
s369321314
Accepted
n = int(input()) a = list(map(int, input().split())) x = 1 if 0 in a: x = 0 else: for i in range(n): if x != -1: x = x * a[i] if x > 10 ** 18: x = -1 print(x)
p03160
s726212134
Accepted
N = int(input()) l = list(map(int,input().split())) m = {0:0,1:abs(l[1]-l[0])} for i in range(2,N): m[i] = min(m[i-1]+abs(l[i]-l[i-1]),m[i-2]+abs(l[i]-l[i-2])) print (m[N-1])
p03380
s529719549
Accepted
import bisect n = int(input()) a = sorted(list(map(int,input().split()))) ans = 0 mini = float('inf') for i in range(n): if mini > abs(a[i]-a[n-1]/2): ans = i mini = abs(a[i]-a[n-1]/2) print(a[n-1],a[ans])
p03555
s848686018
Wrong Answer
C1 =str(input()) C2 =str(input()) if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]: print('Yes') else: print('No')
p03371
s014279235
Accepted
A, B, C, X, Y = map(int, input().split()) price = A*X + B*Y tmp = 0 for i in range(1, int(1 + 10e5)): tmp = 2*C*i + max(0, X-i)*A + max(0, Y-i)*B price = min(price, tmp) print(price)
p02720
s602685739
Accepted
def update_queue(n, queue): out = queue[n] mod10 = out % 10 if mod10 != 0: queue.append(10 * out + mod10 - 1) queue.append(10 * out + mod10) if mod10 != 9: queue.append(10 * out + mod10 + 1) return out, queue N = int(input()) Q = [1,2,3,4,5,6,7,8,9] for i in range(N): out, Q = update_queue(i, Q) print(out)
p03434
s547736387
Accepted
n=int(input()) a=list(map(int, input().split())) t=0 a.sort() for i in range(len(a)): if i%2==0: t+=a[n-i-1] else: t-=a[n-i-1] print(t)
p03632
s787853226
Accepted
a,b,c,d=map(int,input().split()) #a b #c d if b>=c and d>=a: print((min(b,d)-max(a,c))) else: print(0)
p02771
s076410425
Accepted
if(2 == len(set(input().split()))): print("Yes") else: print("No")
p03323
s640074147
Accepted
A, B = map(int, input().split()) if A <= 8 and B <= 8: print("Yay!") else: print(":(")
p03681
s748864453
Accepted
import math n,m = map(int,input().split()) rev = 10**9+7 if n-m==0: ans = 2 * math.factorial(n) * math.factorial(m) elif (abs(n-m)==1): ans = 1 * math.factorial(n) * math.factorial(m) else: ans = 0 print(ans%rev)
p02633
s719774022
Accepted
x=int(input()) import math K=360//math.gcd(x,360) print(K)
p03210
s462335832
Accepted
#!/usr/bin/env python3 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines s = int(input()) if s in [3,5,7]: print("YES") else: print("NO")
p02797
s568087515
Wrong Answer
# C - Subarray Sum def main(): N, K, S = map(int, input().split()) res = [S] * K + [1 if S == 10 ** 9 else S + 1] * (N - S) print(*res) if __name__ == "__main__": main()
p02909
s889723689
Accepted
S=["Sunny","Cloudy","Rainy"] s=input() if s=="Rainy": print("Sunny") else: print(S[S.index(s)+1])
p02742
s318726436
Accepted
H, W = map(int, input().split()) from math import ceil if H == 1 or W == 1: print(1) else: print(ceil(H*W/2))
p02707
s665558175
Accepted
n = int(input()) a = list(map(int, input().split())) from collections import Counter ca = Counter(a) for i in range(1, n+1): print(ca[i] if i in ca else 0)
p03293
s365162839
Wrong Answer
S=sorted(input()) T=sorted(input()) print("Yes" if S==T else "No")
p02554
s541156219
Accepted
N = int(input()) print(((10**N) - (2 * (9**N) - (8**N))) % ((10**9) + 7))
p02623
s415063266
Wrong Answer
n, m, k = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) i = 0 for s in range(n+m): if i>k: if a[0]>=b[0]: i = i + a[0] del a[0] else: i = i + b[0] del a[0] else: print(s)