Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
a = []
for i in range(q):
    a.append(list(map(int, input().split())))
lis = [[0, 0]]
count = 0
for i in range(n):
    if s[i] == 'A':
        if i + 1 != n - 1 and s[i+1] == 'C':
            count += 1
    lis.append([i+1, count])
for i in range(q):
    l = a[i][0] - 1
    r = a[i][1] - 1
    print(lis[r][1] - lis[l][1])




Fixed submission:
n, q = map(int, input().split())
s = input()
a = []
for i in range(q):
    a.append(list(map(int, input().split())))
lis = [[0, 0]]
count = 0
for i in range(n):
    if s[i] == 'A':
        if i+1 <= n-1 and s[i+1] == 'C':
            count += 1
    lis.append([i+1, count])
for i in range(q):
    l = a[i][0] - 1
    r = a[i][1] - 1
    print(lis[r][1] - lis[l][1])
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
f = a
for i in range(a + 1, b + 1):
    f ^= i
print(f)

Fixed submission:
a, b = map(int, input().split())

def xor(n):
    if n % 4 == 0:
        return 0 ^ n
    elif n % 4 == 1:
        return 1
    elif n % 4 == 2:
        return 1 ^ n
    else:
        return 0
fa = xor(a - 1)
fb = xor(b)
print(fa ^ fb)
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
    string s;
    cin >> s;
    if(s > "2019/04/30"){
        cout << "TBD" << "\n";
    }
    else{
        cout << "Heisei" << "\n";
    }
}


Fixed submission:
s = input()
s = s.split('/')

for i in range(len(s)):
	s[i] = int(s[i])

if s[0] >= 2019:
	if s[1] >= 5:
		print('TBD')
		exit()
	else:
		print('Heisei')
		exit()
else:
	print('Heisei')
	exit()
Buggy python submission (verdict: Runtime Error):
import bisect
import sys
input = sys.stdin.readline
a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    ans.append(min(x - min(s[idxs - 1], t[idxt -1]),
                     x - s[idxs - 1] + (t[idxt] - s[idxs - 1]),
                     t[idxt] - x + (t[idxt] - s[idxs - 1]),
                     x - t[idxt - 1] + (s[idxs] - t[idxt - 1]),
                     s[idxs] - x + (s[idxs] - t[idxt - 1]),
                     max(s[idxs], t[idxt]) - x,
                     min(x - min(s[idxs - 1], t[idxt -1]))))
for i in range(q):
    print(ans[i])





Fixed submission:
import bisect

a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    lis = []
    lis.append(x - min(s[idxs - 1], t[idxt -1]))
    lis.append(x - s[idxs - 1] + (t[idxt] - s[idxs - 1]))
    lis.append(t[idxt] - x + (t[idxt] - s[idxs - 1]))
    lis.append(x - t[idxt - 1] + (s[idxs] - t[idxt - 1]))
    lis.append(s[idxs] - x + (s[idxs] - t[idxt - 1]))
    lis.append(max(s[idxs], t[idxt]) - x)
    ans.append(min(lis))
for i in range(q):
    print(ans[i])

Buggy python submission (verdict: Runtime Error):
import bisect
import sys
input = sys.stdin.readline
a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    ans.append(min(x - min(s[idxs - 1], t[idxt -1]),
                     x - s[idxs - 1] + (t[idxt] - s[idxs - 1]),
                     t[idxt] - x + (t[idxt] - s[idxs - 1]),
                     x - t[idxt - 1] + (s[idxs] - t[idxt - 1]),
                     s[idxs] - x + (s[idxs] - t[idxt - 1]),
                     max(s[idxs], t[idxt]) - x,
                     min(x - min(s[idxs - 1], t[idxt -1]))
for i in range(q):
    print(ans[i])





Fixed submission:
import bisect

a, b, q = map(int, input().split())
INF = 10 ** 18
s = [-INF] + [int(input()) for i in range(a)] + [INF]
t = [-INF] + [int(input()) for i in range(b)] + [INF]
ans = []
for i in range(q):
    x = int(input())
    idxs = bisect.bisect(s, x)
    idxt = bisect.bisect(t, x)
    lis = []
    lis.append(x - min(s[idxs - 1], t[idxt -1]))
    lis.append(x - s[idxs - 1] + (t[idxt] - s[idxs - 1]))
    lis.append(t[idxt] - x + (t[idxt] - s[idxs - 1]))
    lis.append(x - t[idxt - 1] + (s[idxs] - t[idxt - 1]))
    lis.append(s[idxs] - x + (s[idxs] - t[idxt - 1]))
    lis.append(max(s[idxs], t[idxt]) - x)
    ans.append(min(lis))
for i in range(q):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    int ans, b;
    cin >> ans;
    for(int i = 1; i < n; ++i){
        cin >> b;
        ans = __gcd(ans,b);
    }
    cout << ans << endl;
}

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))

Buggy python submission (verdict: Runtime Error):
from math import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(math.gcd, a))

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))

Buggy python submission (verdict: Runtime Error):
import fraction
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(fraction.gcd, a))

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))

Buggy python submission (verdict: Runtime Error):
import fraction
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(fraction.gcd, a))

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(math.gcd, a))

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(math.gcd, a))

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

while(a[-1] != 1):
	for i in range(len[a]):
		if a[-i] == 0:
			continue
		else:
			m = a[-i]
			break
	b = []

	for i in range(len(a) - 1):
		b.append(a[i] % m)

	if  max(b) == 0:
		print(m)
		exit()
	else:
		b.append(m)
		a = sorted(b, reverse=True)
		print(b)
print('1')

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

while(a[-1] != 1):
	for i in range(a):
		if a[-i] == 0:
			continue
		else:
			m = a[-i]
			break
	b = []

	for i in range(len(a) - 1):
		b.append(a[i] % m)

	if  max(b) == 0:
		print(m)
		exit()
	else:
		b.append(m)
		a = sorted(b, reverse=True)
		print(b)
print('1')

Fixed submission:
from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))
Buggy python submission (verdict: Runtime Error):
num = int(input().split())
ans = num[0] / num[1]
print(ans)


Fixed submission:
num = list(map(int, input().split()))
ans = num[0] / num[1]
print(ans)
Buggy python submission (verdict: Runtime Error):
num = int(input())
l = list(map(int, input().split()))
max = l.pop(max(l))
for i in range(len(l)):
    if max < l[i]:
        print('No')
        exit(0)
print('Yes')


Fixed submission:
num = int(input())
l = list(map(int, input().split()))
max = l.pop(l.index(max(l)))
sum = 0
for i in range(len(l)):
    sum = sum + l[i]
if sum <= max:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
list1 = list(map(int, input().split()))
N = list1[0]
M = list1[1]
list2 = list(map(int, input().split()))
list2 = sorted(list2, reverse=True)
# print(list2)
list3 = []
for i in range(len(list2) - 1):
    list3.append(list2[i] - list2[i + 1])
list3 = sorted(list3, reverse=True)
print(list3)
sum = 0
for i in range(N - 1):
    sum = sum + list3.pop(0)
ans = list2[0] - list2[-1] - sum
print(ans)


Fixed submission:
list1 = list(map(int, input().split()))
N = list1[0]
M = list1[1]
list2 = list(map(int, input().split()))
if list1[0] - list1[1] >= 0:
    print(0)
    exit(0)
list2 = sorted(list2, reverse=True)
# print(list2)
list3 = []
for i in range(len(list2) - 1):
    list3.append(list2[i] - list2[i + 1])
list3 = sorted(list3, reverse=True)
# print(list3)
sum = 0
for i in range(N - 1):
    sum = sum + list3.pop(0)
ans = list2[0] - list2[-1] - sum
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
Sum = []
for i in range(l1[1] + 1):
    sum = 0
    for j in range(len(l2)):
        sum = sum + (i ^ l2[j])
    Sum.append(sum)
print(max(Sum))


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = 0
for i in range(40, -1, -1):
    j = 2 ** i
    count = len([1 for temp in a if temp&j > 0])
    if count < n - count and j <= k:
        k -= j
        count = n - count
    ans += j * count
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print('%d' % a*b/2)

Fixed submission:
a, b, c = map(int, input().split())
print(a*b//2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nms = lambda: map(str, sys.stdin.readline().split())
nl = lambda: list(nm())

n = ni()
h = nl()
INF = 10 ** 9
dp = [INF for i in range(n)]
dp[0] = 0
dp[1] = abs(h[0] - h[1])
for i in range(2, n):
    for j in h:
        dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))
print(dp[-1])

Fixed submission:
import sys

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nms = lambda: map(str, sys.stdin.readline().split())
nl = lambda: list(nm())

n = ni()
h = nl()
INF = 10 ** 9
dp = [INF for i in range(n)]
dp[0] = 0
dp[1] = abs(h[0] - h[1])
for i in range(2, n):
    dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nms = lambda: map(str, sys.stdin.readline().split())
nl = lambda: list(nm())

n, w = nm()
lis = [nl() for _ in range(n)]
lis.insert(0, [0, 0])
dp = [[0 for i in range(w + 1)] for j in range(n + 1)]

for i in range(1, n + 1):
    for j in range(w + 1):
        if j - lis[i][0] >= 0:
            dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - lis[i][0]] + lis[i][1])
        else:
            dp[i][j] = dp[i - 1][j]

for i in range(w, -1, -1):
    if dp[n][i] != 0:
        print(dp[n][i])
        exit()

Fixed submission:
import sys
import numpy as np

ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nms = lambda: map(str, sys.stdin.readline().split())
nl = lambda: list(nm())

n, w = nm()
lis = [nl() for _ in range(n)]
lis.insert(0, [0, 0])
dp = np.zeros(w + 1, dtype=np.int64)

for i in range(1, n + 1):
    dp[lis[i][0]:] = np.maximum(dp[lis[i][0]:], dp[:-lis[i][0]] + lis[i][1])

print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
count = 0

for i in range(1, n + 1, 2):
	c = collections.Counter(list(str(i)))
	if len(c.keys()) == 3:
		if (c['3'] != 0) and (c['5'] != 0) and (c['7'] != 0):
			count += 1
print(count)

Fixed submission:
n = int(input())
count = 0

def dfs(s):
	if int(s) > n:
		return 0
	if all(s.count(c) > 0 for c in '357'):
		count = 1
	else:
		count = 0
	count += dfs(s + '3')
	count += dfs(s + '5')
	count += dfs(s + '7')
	return count

print(dfs('0'))

Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
count = 0

for i in range(1, n + 1):
	c = collections.Counter(list(str(i)))
	if len(c.keys()) == 3:
		if (c['3'] != 0) and (c['5'] != 0) and (c['7'] != 0):
			count += 1
print(count)

Fixed submission:
n = int(input())
count = 0

def dfs(s):
	if int(s) > n:
		return 0
	if all(s.count(c) > 0 for c in '357'):
		count = 1
	else:
		count = 0
	count += dfs(s + '3')
	count += dfs(s + '5')
	count += dfs(s + '7')
	return count

print(dfs('0'))
Buggy python submission (verdict: Runtime Error):
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())
def comb(n, k):
    return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))

def era(n):
    lis = [i for i in range(3, n + 1, 2)]
    lis.insert(0, 2)
    for ll in lis:
        lis = [i for i in lis if (i == ll or i % ll != 0)]
    return lis


n = ni()
lis = era(n)
lis2 = [[lis[i], 0] for i in range(len(lis))]
for i in range(1, n + 1):
    for j in lis:
        count = 0
        while(i % j == 0):
            i //= j
            count += 1
        lis2[lis.index(j)][1] += count
c74 = 0
c24 = 0
c14 = 0
c4 = 0
c2 = 0
for i in range(len(lis2)):
    if lis2[i][1] >= 74:
        c74 += 1
    if lis2[i][1] >= 24:
        c24 += 1
    if lis2[i][1] >= 14:
        c14 += 1
    if lis2[i][1] >= 4:
        c4 += 1
    if lis2[i][1] >= 2:
        c2 += 1
ans = 0
ans += comb(c4, 2) * (c2 - 2)
ans += c24 * (c2 - 1)
ans += c14 * (c4 - 1)
ans += c74
print(ans)


Fixed submission:
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())
def comb(n, k):
    return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))

def era(n):
    lis = [i for i in range(3, n + 1, 2)]
    lis.insert(0, 2)
    for ll in lis:
        lis = [i for i in lis if (i == ll or i % ll != 0)]
    return lis


n = ni()
if n == 1:
    print(0)
    exit()
lis = era(n)
lis2 = [[lis[i], 0] for i in range(len(lis))]
for i in range(1, n + 1):
    for j in lis:
        count = 0
        while(i % j == 0):
            i //= j
            count += 1
        lis2[lis.index(j)][1] += count
c74 = 0
c24 = 0
c14 = 0
c4 = 0
c2 = 0
for i in range(len(lis2)):
    if lis2[i][1] >= 74:
        c74 += 1
    if lis2[i][1] >= 24:
        c24 += 1
    if lis2[i][1] >= 14:
        c14 += 1
    if lis2[i][1] >= 4:
        c4 += 1
    if lis2[i][1] >= 2:
        c2 += 1
ans = 0
ans += comb(c4, 2) * (c2 - 2)
ans += c24 * (c2 - 1)
ans += c14 * (c4 - 1)
ans += c74
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
ans = 1
for i in range(2, m + 1):
    if i * n > m:
        break
    if m % i == 0 and m // i >= n:
        ans = max(ans, i)
print(ans)


Fixed submission:
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
ans = 1
for i in range(1, int(math.sqrt(m)) + 2):
    if m % i == 0:
        if m // i >= n and i >= n:
            ans = max(ans, i, m // i)
        elif m // i >= n:
            ans = max(ans, i)
        elif i >= n:
            ans = max(ans, m // i)
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
for i in range(2, n + 1):
    if m % i == 0 and m // i >= n:
        ans = i
print(ans)


Fixed submission:
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n, m = nm()
ans = 1
for i in range(1, int(math.sqrt(m)) + 2):
    if m % i == 0:
        if m // i >= n and i >= n:
            ans = max(ans, i, m // i)
        elif m // i >= n:
            ans = max(ans, i)
        elif i >= n:
            ans = max(ans, m // i)
print(ans)
Buggy python submission (verdict: Runtime Error):
import collections

n = int(input())
v = list(map(int, input().split()))
odd = []
even = []
for i in range(0, n - 1, 2):
	odd.append(v[i])
	even.append(v[i + 1])

co = collections.Counter(odd)
ce = collections.Counter(even)

if len(co) >= 2 and len(ce) >= 2:
	if co.most_common()[0][1] == ce.most_common()[0][1]:
		if co.most_common()[1][1] > ce.most_common()[1][1]:
			oddval = co.most_common()[1][0]
			evenval = ce.most_common()[0][0]
		else:
			oddval = co.most_common()[0][0]
			evenval = ce.most_common()[1][0]
	else:
		oddval = co.most_common()[0][0]
		evenval = ce.most_common()[0][0]

if len(co) == 1 and len(ce) >= 2:
	if ce.most_common()[0][0] != odd[0]:
		oddval = odd[0]
		evenval = ce.most_common()[0][0]
	else:
		oddval = odd[0] + 1
		evenval = ce.most_common()[0][0]

if len(ce) >= 2 and len(ce) == 1:
	if co.most_common()[0][0] != even[0]:
		evenval = even[0]
		oddval = co.most_common()[0][0]
	else:
		evenval = even[0] + 1
		oddval = co.most_common()[0][0]

if len(co) == 1 and len(ce) == 1:
	if odd[0] != even[0]:
		oddval = odd[0]
		evenval = even[0]
	else:
		oddval = odd[0] + 1
		evenval = even[0]


count = 0
for i in range(0, n - 1, 2):
	count += abs(oddval - v[i]) + abs(evenval - v[i + 1])

print(count)

Fixed submission:
import collections

n = int(input())
v = list(map(int, input().split()))
odd = []
even = []
for i in range(0, n - 1, 2):
	odd.append(v[i])
	even.append(v[i + 1])
N = n // 2
co = collections.Counter(odd)
ce = collections.Counter(even)
omost = co.most_common(2)
emost = ce.most_common(2)
if len(omost) == 1 and len(emost) == 1:
	if omost[0][0] != emost[0][0]:
		print(0)
	else:
		print(N)
elif len(omost) == 1:
	print(N - emost[0][1])
elif len(emost) == 1:
	print(N - omost[0][1])
else:
	if omost[0][0] != emost[0][0]:
		print(n - omost[0][1] - emost[0][1])
	else:
		print(min(n - omost[0][1] - emost[1][1], n - omost[1][1] - emost[0][1]))
Buggy python submission (verdict: Runtime Error):

n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(y)

for i in range(len(x)):
	for j in range(i, len(x)):
		if (x[i] == y[j]) or (y[i] == x[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')

Fixed submission:

n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)

for i in range(len(x)):
	for j in range(len(y)):
		if (x[i] == y[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
if s == t:
	pritn('Yes')
	exit()
if len(s) == 1:
	if s != t:
		print('No')
		exit()
for i in range(len(t)):
	for j in range(len(t)):
		if t[i] == t[j] and s[i] != s[j]:
			print('No')
			exit()
print('Yes')


Fixed submission:
s = input()
t = input()

start = [-1]*26
goal = [-1]*26
for i in range(len(s)):
	a = ord(s[i]) - ord('a')
	b = ord(t[i]) - ord('a')
	if start[a] != -1 or goal[b] != -1:
		if start[a] != b or goal[b] != a:
			print('No')
			exit()
	start[a] = b
	goal[b] = a
print('Yes')

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
if s == t:
	pritn('Yes')
	exit()
if len(s) == 1:
	if s != t:
		print('No')
        exit(
for i in range(len(t)):
	for j in range(len(t)):
		if t[i] == t[j] and s[i] != s[j]:
			print('No')
			exit()
print('Yes')


Fixed submission:
s = input()
t = input()

start = [-1]*26
goal = [-1]*26
for i in range(len(s)):
	a = ord(s[i]) - ord('a')
	b = ord(t[i]) - ord('a')
	if start[a] != -1 or goal[b] != -1:
		if start[a] != b or goal[b] != a:
			print('No')
			exit()
	start[a] = b
	goal[b] = a
print('Yes')

Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())
if s == t:
	pritn('Yes')
	exit()
for i in range(len(t)):
	for j in range(len(t)):
		if t[i] == t[j] and s[i] != s[j]:
			print('No')
			exit()
print('Yes')


Fixed submission:
s = input()
t = input()

start = [-1]*26
goal = [-1]*26
for i in range(len(s)):
	a = ord(s[i]) - ord('a')
	b = ord(t[i]) - ord('a')
	if start[a] != -1 or goal[b] != -1:
		if start[a] != b or goal[b] != a:
			print('No')
			exit()
	start[a] = b
	goal[b] = a
print('Yes')
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i + 1])
else:
    print(1)

Fixed submission:
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i])
else:
    print(1)

Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

for i in range(1, len(s) + 1):
    if s[i - 1] == '1':
        continue
    else:
        break
if i == 1:
    print(s[0])
elif i >= k:
    print(1)
else:
    print(s[k])

Fixed submission:
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i])
else:
    print(1)

Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
if s[0] == '1':
    print(s[1])
else:
    print(s[0])

Fixed submission:
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i])
else:
    print(1)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
d, g = map(int, input().split())
a = []
c = []
for i in range(d):
    a.append(list(map(int, input().split())))
itr = [i for i in range(d)]
p = list(itertools.permutations(itr, len(itr)))
for b in p:
    count = 0
    r = g
    for i in b:
        if r <= 0:
            break
        temp = (i+1) * 100
        l = [temp] * a[i][0]
        l[-1] += a[i][1]
        for j in range(len(l)):
            count += 1
            r -= l[j]
            if r <= 0:
                c.append(count)
                break
print(min(c))


Fixed submission:
d, g = map(int, input().split())
a = []
c = []
for i in range(d):
    a.append(list(map(int, input().split())))
for i in range(2 ** d):
    summ = 0
    count = 0
    j = list(bin(i)[2:].zfill(len(bin(2 ** d - 1)[2:])))
    for k in range(len(j)):
        summ += int(j[k]) * a[k][0] * (k+1) * 100
        if j[k] == '1':
            count += a[k][0]
            summ += a[k][1]
    if summ >= g:
        c.append(count)
        continue
    elif summ < g:
        idx = 0
        for l in range(len(j) - 1, 0, -1):
            if j[l] == '0':
                idx = l
                break
        for m in range(1, a[idx][0]):
            summ += (idx+1) * 100
            count += 1
            if summ >= g:
                c.append(count)
                break

print(min(c))