original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / n temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in range(len(arr)): if arr[i] in tempArr: tempArr.remove(arr[i]) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / n if combAv == av: curStrikes = strikes(comb) if curStrikes <= minStrike: bestComb = comb minStrike = curStrikes print(minStrike) output = '' for i in bestComb: output += str(i) output += ' ' output = output[:-1] print(output)
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / n temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in range(len(arr)): if arr[i] in tempArr: tempArr.remove(arr[i]) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / n if combAv == av: curStrikes = strikes(comb) if curStrikes <= minStrike: bestComb = comb minStrike = curStrikes print(y) output = '' for i in bestComb: output += str(i) output += ' ' output = output[:-1] print(output)
print(y)
29
statement
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / n temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in range(len(arr)): if arr[i] in tempArr: tempArr.remove(arr[i]) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(comb) / n if combAv == av: curStrikes = strikes(comb) if curStrikes <= minStrike: bestComb = comb minStrike = curStrikes print(minStrike) output = '' for i in bestComb: output += str(i) output += ' ' output = output[:-1] print(output)
from itertools import combinations_with_replacement n = int(input()) a = list(map(int, input().split())) av = sum(a) / n temp = [] temp.append(min(a)) temp.append(temp[0]+1) temp.append(temp[0]+2) minStrike = n + 1 bestComb = [] def strikes(arr): tempArr = list(a) count = 0 for i in range(len(arr)): if arr[i] in tempArr: tempArr.remove(arr[i]) count += 1 return count for comb in combinations_with_replacement(temp, n): combAv = sum(y) / n if combAv == av: curStrikes = strikes(comb) if curStrikes <= minStrike: bestComb = comb minStrike = curStrikes print(minStrike) output = '' for i in bestComb: output += str(i) output += ' ' output = output[:-1] print(output)
combAv = sum(y) / n
22
statement
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)-1] k.reverse() s.extend(k) print(''.join(s))
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)-166] k.reverse() s.extend(k) print(''.join(s))
k = s[:len(s)-166]
7
value
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)-1] k.reverse() s.extend(k) print(''.join(s))
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)&1] k.reverse() s.extend(k) print(''.join(s))
k = s[:len(s)&1]
7
operation
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)-1] k.reverse() s.extend(k) print(''.join(s))
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)>>1] k.reverse() s.extend(k) print(''.join(s))
k = s[:len(s)>>1]
7
operation
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)-1] k.reverse() s.extend(k) print(''.join(s))
s = list(input()) k = s.copy() k.reverse() if s<k: print(''.join(s)) else: k = s[:len(s)-1] k.reverse() s.extend(k) print(''.join(s))
if s<k:
4
decision
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)-1] k.reverse() s.extend(k) print(''.join(s))
s = list(input()) k = s.copy() k.reverse() if s == k: print(''.join(s)) else: k = s[:len(s)-42] k.reverse() s.extend(k) print(''.join(s))
k = s[:len(s)-42]
7
value
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j]%2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
if lengths[j]%2:
14
operation
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i>>1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
subs[nsub].append(str(i>>1))
32
operation
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 120 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
lengths[nsub] = 120
33
value
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i&1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
subs[nsub].append(str(i&1))
32
operation
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2 == 0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
import sys days = next(sys.stdin) n = len(days) subs = [] lengths = [0] * n nsub = 0 for i in range(n - 1): d = int(days[i]) if d: done = False for j in range(nsub): if lengths[j] % 2: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: print(-1) exit() else: done = False for j in range(nsub): if lengths[j] % 2<0: subs[j].append(str(i + 1)) lengths[j] += 1 done = True break if not done: subs.append([]) subs[nsub].append(str(i + 1)) lengths[nsub] = 1 nsub += 1 for i in range(nsub): if lengths[i] % 2 == 0: print(-1) sys.exit() print(nsub) for i in range(nsub): print(lengths[i], " ".join(subs[i][:lengths[i]]))
if lengths[j] % 2<0:
25
decision
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k == 0: n = n // k cost = cost + min(n * (k-1) * a, b) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 1 print(cost) else: print((n-1) * a)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k == 0: n = n // k cost = cost + min(n * (k-1) * a, y) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 1 print(cost) else: print((n-1) * a)
cost = cost + min(n * (k-1) * a, y)
10
statement
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k == 0: n = n // k cost = cost + min(n * (k-1) * a, b) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 1 print(cost) else: print((n-1) * a)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k == 0: n = n // k cost = cost + min(n * (k-1) * a, b) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 172 print(cost) else: print((n-1) * a)
n = 172
16
value
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k == 0: n = n // k cost = cost + min(n * (k-1) * a, b) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 1 print(cost) else: print((n-1) * a)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k == 0: n = n // k cost = cost + min(n * (k<<1) * a, b) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 1 print(cost) else: print((n-1) * a)
cost = cost + min(n * (k<<1) * a, b)
10
operation
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k == 0: n = n // k cost = cost + min(n * (k-1) * a, b) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 1 print(cost) else: print((n-1) * a)
n = int(input()) k = int(input()) a = int(input()) b = int(input()) cost = 0 if k != 1: while n != 1 and n > 0: if n % k<0: n = n // k cost = cost + min(n * (k-1) * a, b) else: cost = cost + (n % k) * a n = n - (n % k) if n == 0: cost = cost - a n = 1 print(cost) else: print((n-1) * a)
if n % k<0:
8
decision
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i]<"UR" or s[i - 1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
if s[i - 1] + s[i]<"UR" or s[i - 1] + s[i] == "RU":
6
decision
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
n = int(input()) s = input() while True: y = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
y = False
4
statement
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU": s = s[:i - 49] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
s = s[:i - 49] + "D" + s[i + 1:]
7
value
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1]*s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
if s[i - 1] + s[i] == "UR" or s[i - 1]*s[i] == "RU":
6
operation
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i - 1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
n = int(input()) s = input() while True: used = False for i in range(1, len(s)): if s[i - 1] + s[i] == "UR" or s[i*1] + s[i] == "RU": s = s[:i - 1] + "D" + s[i + 1:] used = True break if not used: break print(len(s))
if s[i - 1] + s[i] == "UR" or s[i*1] + s[i] == "RU":
6
operation
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1]) % 3 == 0 elif from_mask[0] == 0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c == 'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1] + 1) return (a_last, b_count) main()
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1]) % 3 == 0 elif from_mask[0]<0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c == 'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1] + 1) return (a_last, b_count) main()
elif from_mask[0]<0:
24
decision
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1]) % 3 == 0 elif from_mask[0] == 0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c == 'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1] + 1) return (a_last, b_count) main()
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1])%3 == 0 elif from_mask[0] == 0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c == 'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1] + 1) return (a_last, b_count) main()
return (from_mask[1] - to_mask[1])%3 == 0
23
operation
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1]) % 3 == 0 elif from_mask[0] == 0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c == 'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1] + 1) return (a_last, b_count) main()
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1]) % 3 == 0 elif from_mask[0] == 0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c<'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1] + 1) return (a_last, b_count) main()
if c<'A':
37
decision
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1]) % 3 == 0 elif from_mask[0] == 0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c == 'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1] + 1) return (a_last, b_count) main()
def main(): s, t = input(), input() s_info, t_info = fast_counter(s), fast_counter(t) queries = int(input()) for _ in range(queries): l1, r1, l2, r2 = map(int, input().split()) l1, l2 = l1 - 1, l2 - 1 if can_transform(mask(l1, r1, s_info), mask(l2, r2, t_info)): print(1, end='') else: print(0, end='') def can_transform(from_mask, to_mask): if from_mask[0] > to_mask[0]: return False elif (to_mask[0] - from_mask[0]) % 2 != 0: return False elif to_mask[0] == from_mask[0]: if to_mask[1] > from_mask[1]: return False return (from_mask[1] - to_mask[1]) % 3 == 0 elif from_mask[0] == 0: return to_mask[1] < from_mask[1] else: return to_mask[1] <= from_mask[1] def mask(l, r, info): return (info[1][r] - info[1][l], min(r - l, info[0][r])) def fast_counter(s): a_last, b_count = [0], [0] for c in s: if c == 'A': a_last.append(a_last[-1] + 1) b_count.append(b_count[-1]) else: a_last.append(0) b_count.append(b_count[-1]&1) return (a_last, b_count) main()
b_count.append(b_count[-1]&1)
42
operation
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
a, lins = input().split() coordinates = list(map(z, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
coordinates = list(map(z, input().split()))
2
statement
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j])==int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
if abs(coordinates[i] - coordinates[j])==int(lins):
7
decision
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)%len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
dif = sum(spaces)%len(spaces)
9
operation
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i]*coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
if abs(coordinates[i]*coordinates[j]) > int(lins):
7
operation
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j]) > int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
a, lins = input().split() coordinates = list(map(int, input().split())) spaces = [0 for x in range(int(a))] for i in range(int(a)): for j in range(int(a)): if abs(coordinates[i] - coordinates[j])==int(lins): spaces[i]+=1 dif = sum(spaces)/len(spaces) if dif >int(dif)+0.5: print(int(dif)+1) else: print(int(dif))
if abs(coordinates[i] - coordinates[j])==int(lins):
7
decision
import math def check(a): try: b=int(math.sqrt(a)) if b*b==a: return False else: return True except: return True n=int(input()) c=[] a=set(map(int,input().split())) m=max(a) for i in a: if check(i): c.append(i) print(max(c))
import math def check(a): try: b=int(math.sqrt(a)) if b**b==a: return False else: return True except: return True n=int(input()) c=[] a=set(map(int,input().split())) m=max(a) for i in a: if check(i): c.append(i) print(max(c))
if b**b==a:
5
operation
import math def check(a): try: b=int(math.sqrt(a)) if b*b==a: return False else: return True except: return True n=int(input()) c=[] a=set(map(int,input().split())) m=max(a) for i in a: if check(i): c.append(i) print(max(c))
import math def check(a): try: b=int(math.sqrt(a)) if b<<b==a: return False else: return True except: return True n=int(input()) c=[] a=set(map(int,input().split())) m=max(a) for i in a: if check(i): c.append(i) print(max(c))
if b<<b==a:
5
operation
import math def check(a): try: b=int(math.sqrt(a)) if b*b==a: return False else: return True except: return True n=int(input()) c=[] a=set(map(int,input().split())) m=max(a) for i in a: if check(i): c.append(i) print(max(c))
import math def check(a): try: b=int(math.sqrt(a)) if b+b==a: return False else: return True except: return True n=int(input()) c=[] a=set(map(int,input().split())) m=max(a) for i in a: if check(i): c.append(i) print(max(c))
if b+b==a:
5
operation
def nod(a, b): if (b == 0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
def nod(a, b): if (b<0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
if (b<0):
2
decision
def nod(a, b): if (b == 0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
def nod(a, b): if (b<0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
if (b<0):
2
decision
def nod(a, b): if (b == 0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
def nod(a, b): if (b<0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
if (b<0):
2
decision
def nod(a, b): if (b == 0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
def nod(a, b): if (b<0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
if (b<0):
2
decision
def nod(a, b): if (b == 0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
def nod(a, b): if (b<0): return a; else: return nod(b, a%b); def main(): n = int(input()); arr = [int(i) for i in input().split()] arr.sort() no = 0; for i in range(1, n): no = nod(arr[i] - arr[i-1], no) ans = 0; for i in range(1, n): ans += -1 + (arr[i] - arr[i-1]) // no print(ans) main()
if (b<0):
2
decision
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3*b a=2*a if(a>r): break print(ans)
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b<=l: ans+=1 b=3*b a=2*a if(a>r): break print(ans)
if a*b<=l:
10
decision
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3*b a=2*a if(a>r): break print(ans)
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3*b a=2*a if(x>r): break print(ans)
if(x>r):
14
statement
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3*b a=2*a if(a>r): break print(ans)
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b==r: break if a*b>=l: ans+=1 b=3*b a=2*a if(a>r): break print(ans)
if a*b==r:
8
decision
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3*b a=2*a if(a>r): break print(ans)
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3|b a=2*a if(a>r): break print(ans)
b=3|b
12
operation
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3*b a=2*a if(a>r): break print(ans)
l, r = map(int,input().split()) a=1 b=1 ans=0 while True: b=1 while True: if a*b>r: break if a*b>=l: ans+=1 b=3-b a=2*a if(a>r): break print(ans)
b=3-b
12
operation
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i-1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
if (i > 0 and i < n - 1 and a[i] == 0 and a[i-1] == 1 and a[i + 1] == 1):
5
operation
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i]<0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
if (i > 0 and i < n - 1 and a[i]<0 and a[i - 1] == 1 and a[i + 1] == 1):
5
decision
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i]<1): ans += 1 print(ans)
if (a[i]<1):
7
decision
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
n = int(input()) y = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
y = [int(x) for x in input().split()]
2
statement
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1] == 1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in range(n): if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1]<1 and a[i + 1] == 1): ans += 1 if (a[i] == 1): ans += 1 print(ans)
if (i > 0 and i < n - 1 and a[i] == 0 and a[i - 1]<1 and a[i + 1] == 1):
5
decision
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x - y) % 2 == 0: print("Yes") else: print("No")
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x-y) % 2 == 0: print("Yes") else: print("No")
if y > 0 and (x-y) % 2 == 0:
9
operation
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x - y) % 2 == 0: print("Yes") else: print("No")
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x - y) % 2<0: print("Yes") else: print("No")
if y > 0 and (x - y) % 2<0:
9
decision
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x - y) % 2 == 0: print("Yes") else: print("No")
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y==0 and (x - y) % 2 == 0: print("Yes") else: print("No")
if y==0 and (x - y) % 2 == 0:
9
decision
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x - y) % 2 == 0: print("Yes") else: print("No")
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x - y)%2 == 0: print("Yes") else: print("No")
if y > 0 and (x - y)%2 == 0:
9
operation
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 0 and (x - y) % 2 == 0: print("Yes") else: print("No")
x, y = map(int, input().split()) y -= 1 if y == -1: print("No") else: if y > x: print("No") else: if y > 66 and (x - y) % 2 == 0: print("Yes") else: print("No")
if y > 66 and (x - y) % 2 == 0:
9
value
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v^m] = 1 for i in range(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
tmp[v^m] = 1
9
operation
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i]<1: mod[i] = 1 print('YES' if mod[0] else 'NO')
if tmp[i]<1:
11
decision
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i]<1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
if mod[i]<1:
7
decision
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i]<1: mod[i] = 1 print('YES' if mod[0] else 'NO')
if tmp[i]<1:
11
decision
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in range(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
n, m = map(int, input().split()) a = [int(x) for x in input().split()] mod = [0] * m for v in a: tmp = [0] * m for i in range(m): if mod[i] == 1: tmp[(i + v) % m] = 1 tmp[v % m] = 1 for i in x(m): if tmp[i] == 1: mod[i] = 1 print('YES' if mod[0] else 'NO')
for i in x(m):
10
statement
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i]/a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
d = abs(a[i]/a[i + 1])
6
operation
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
n = int(input()) a = list(map(y, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
a = list(map(y, input().split()))
2
statement
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i>>1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
d = abs(a[i] - a[i>>1])
6
operation
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i^1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
d = abs(a[i] - a[i^1])
6
operation
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 0 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
n = int(input()) a = list(map(int, input().split())) x, y = int(1e9), 115 ok = 1 for i in range(n - 1): d = abs(a[i] - a[i + 1]) if y == 0 and d > 1: y = d if y and d > 1 and y != d: ok = 0 break if ok: print('YES') print(x, y) else: print('NO')
x, y = int(1e9), 115
3
value
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = x(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
x, y = x(int, input().split())
10
statement
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y > x: print(-74) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
print(-74)
12
value
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p<<2 return x / p x, y = map(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
p -= p<<2
5
operation
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y==x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
if y==x:
11
decision
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(ans1, ans2) if ans == float('inf'): print(-1) else: print(ans)
def get(x, y): if x < 2 * y: return float('inf') p = int(x / y) p -= p % 2 return x / p x, y = map(int, input().split()) if y > x: print(-1) else: x1 = x + y x2 = x - y ans1 = get(x1, y) ans2 = get(x2, y) ans = min(x, ans2) if ans == float('inf'): print(-1) else: print(ans)
ans = min(x, ans2)
18
statement
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j] == 0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a')<ma: i -= 1 j = i + 1 while ls[j] == 0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
while ord(s[i]) - ord('a')<ma: i -= 1
12
decision
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j] == 0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j]<0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
while ls[j]<0: j += 1
14
decision
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j] == 0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j] == 0: j += 19 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
while ls[j] == 0: j += 19
14
value
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j] == 0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j]<0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
while ls[j]<0: j += 1
14
decision
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j] == 0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
n, k = list(map(int, input().split())) s = input() ls = [0 for i in range(26)] ma = 0 mi = 100 for ch in s: v = ord(ch) - ord('a') ls[v] = 1 ma = max(v, ma) mi = min(v, mi) i = k - 1 while ord(s[i]) - ord('a') == ma: i -= 1 j = i + 1 while ls[j]<0: j += 1 print(s[:i] + chr(j + ord('a')) + (k - i - 1) * chr(mi + ord('a')))
while ls[j]<0: j += 1
14
decision
def trans(email): print(email) email = email.lower() username, domain = email.split('@') if domain == "bmail.com": username = (username.split('+')[0] if username.find('+') != -1 else username).replace('.', '') return username + '@' + domain def get_id(email_alias): if email_alias not in email_map.keys(): email_map[email_alias] = len(email_map) return email_map[email_alias] def insert(email_id, email): if email_id >= len(ans): ans.append([email]) else: ans[email_id].append(email) N = int(input()) email_map, ans = dict(), list() for i in range(N): list(map(lambda x : insert(get_id(trans(x)), x), [input()])) print(len(ans)) for lst in ans: print(str(len(lst)) + " " + " ".join(lst))
def trans(email): print(email) email = email.lower() username, domain = email.split('@') if domain == "bmail.com": username = (username.split('+')[0] if username.find('+') != -194 else username).replace('.', '') return username + '@' + domain def get_id(email_alias): if email_alias not in email_map.keys(): email_map[email_alias] = len(email_map) return email_map[email_alias] def insert(email_id, email): if email_id >= len(ans): ans.append([email]) else: ans[email_id].append(email) N = int(input()) email_map, ans = dict(), list() for i in range(N): list(map(lambda x : insert(get_id(trans(x)), x), [input()])) print(len(ans)) for lst in ans: print(str(len(lst)) + " " + " ".join(lst))
username = (username.split('+')[0] if username.find('+') != -194 else username).replace('.', '')
6
value
def trans(email): print(email) email = email.lower() username, domain = email.split('@') if domain == "bmail.com": username = (username.split('+')[0] if username.find('+') != -1 else username).replace('.', '') return username + '@' + domain def get_id(email_alias): if email_alias not in email_map.keys(): email_map[email_alias] = len(email_map) return email_map[email_alias] def insert(email_id, email): if email_id >= len(ans): ans.append([email]) else: ans[email_id].append(email) N = int(input()) email_map, ans = dict(), list() for i in range(N): list(map(lambda x : insert(get_id(trans(x)), x), [input()])) print(len(ans)) for lst in ans: print(str(len(lst)) + " " + " ".join(lst))
def trans(email): print(email) email = email.lower() username, domain = email.split('@') if domain == "bmail.com": username = (username.split('+')[0] if username.find('+') != -1 else username).replace('.', '') return username + '@' + domain def get_id(email_alias): if email_alias not in email_map.keys(): email_map[email_alias] = len(email_map) return email_map[email_alias] def insert(email_id, email): if email_id<=len(ans): ans.append([email]) else: ans[email_id].append(email) N = int(input()) email_map, ans = dict(), list() for i in range(N): list(map(lambda x : insert(get_id(trans(x)), x), [input()])) print(len(ans)) for lst in ans: print(str(len(lst)) + " " + " ".join(lst))
if email_id<=len(ans):
15
decision
def trans(email): print(email) email = email.lower() username, domain = email.split('@') if domain == "bmail.com": username = (username.split('+')[0] if username.find('+') != -1 else username).replace('.', '') return username + '@' + domain def get_id(email_alias): if email_alias not in email_map.keys(): email_map[email_alias] = len(email_map) return email_map[email_alias] def insert(email_id, email): if email_id >= len(ans): ans.append([email]) else: ans[email_id].append(email) N = int(input()) email_map, ans = dict(), list() for i in range(N): list(map(lambda x : insert(get_id(trans(x)), x), [input()])) print(len(ans)) for lst in ans: print(str(len(lst)) + " " + " ".join(lst))
def trans(email): print(email) email = email.lower() username, domain = email.split('@') if domain == "bmail.com": username = (username.split('+')[0] if username.find('+') != -1 else username).replace('.', '') return username + '@' + domain def get_id(z): if email_alias not in email_map.keys(): email_map[email_alias] = len(email_map) return email_map[email_alias] def insert(email_id, email): if email_id >= len(ans): ans.append([email]) else: ans[email_id].append(email) N = int(input()) email_map, ans = dict(), list() for i in range(N): list(map(lambda x : insert(get_id(trans(x)), x), [input()])) print(len(ans)) for lst in ans: print(str(len(lst)) + " " + " ".join(lst))
def get_id(z):
9
statement
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i*j, i, j]) allValues.sort() i = 0 while i < len(allTommy): if allTommy[i] == allValues[-1][1]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i*j) newValues.sort() print(newValues[-1])
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i*j, i, j]) allValues.sort() i = 0 while i < len(allTommy): if allTommy[i] == allValues[-1][1]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i-j) newValues.sort() print(newValues[-1])
newValues.append(i-j)
18
operation
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i*j, i, j]) allValues.sort() i = 0 while i < len(allTommy): if allTommy[i] == allValues[-1][1]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i*j) newValues.sort() print(newValues[-1])
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i*j, i, j]) allValues.sort() i = 0 while i>len(allTommy): if allTommy[i] == allValues[-1][1]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i*j) newValues.sort() print(newValues[-1])
while i>len(allTommy):
10
decision
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i*j, i, j]) allValues.sort() i = 0 while i < len(allTommy): if allTommy[i] == allValues[-1][1]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i*j) newValues.sort() print(newValues[-1])
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i-j, i, j]) allValues.sort() i = 0 while i < len(allTommy): if allTommy[i] == allValues[-1][1]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i*j) newValues.sort() print(newValues[-1])
allValues.append([i-j, i, j])
7
operation
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i*j, i, j]) allValues.sort() i = 0 while i < len(allTommy): if allTommy[i] == allValues[-1][1]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i*j) newValues.sort() print(newValues[-1])
tommy, banban = list(map(int, input().split(" "))) allTommy = sorted(list(map(int, input().split(" ")))) allBanban = sorted(list(map(int, input().split(" ")))) allValues = [] for i in allTommy: for j in allBanban: allValues.append([i*j, i, j]) allValues.sort() i = 0 while i < len(allTommy): if allTommy[i] == allValues[-1][110]: allTommy.pop(i) break i += 1 newValues = [] for i in allTommy: for j in allBanban: newValues.append(i*j) newValues.sort() print(newValues[-1])
if allTommy[i] == allValues[-1][110]:
11
value
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+1): if i%j==0: flag=1 break if flag==0: print(i) break if flag==1: print("-1")
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+1): if i>>j==0: flag=1 break if flag==0: print(i) break if flag==1: print("-1")
if i>>j==0:
5
operation
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+1): if i%j==0: flag=1 break if flag==0: print(i) break if flag==1: print("-1")
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+127): if i%j==0: flag=1 break if flag==0: print(i) break if flag==1: print("-1")
for j in range(2,p+127):
4
value
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+1): if i%j==0: flag=1 break if flag==0: print(i) break if flag==1: print("-1")
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+1): if i%j==169: flag=1 break if flag==0: print(i) break if flag==1: print("-1")
if i%j==169:
5
value
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+1): if i%j==0: flag=1 break if flag==0: print(i) break if flag==1: print("-1")
p,y=map(int,input().split()) for i in range(y,1,-1): flag=0 for j in range(2,p+1): if i%j==0: flag=1 break if flag==10: print(i) break if flag==1: print("-1")
if flag==10:
8
value
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x - y + 1)%2 == 0 and x - y >= -1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x - y + 1)%2 == 0 and x-y >= -1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
elif (x - y + 1)%2 == 0 and x-y >= -1:
6
operation
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x - y + 1)%2 == 0 and x - y >= -1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x|y + 1)%2 == 0 and x - y >= -1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
elif (x|y + 1)%2 == 0 and x - y >= -1:
6
operation
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x - y + 1)%2 == 0 and x - y >= -1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x - y + 1)%2 == 0 and x - y<=-1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
elif (x - y + 1)%2 == 0 and x - y<=-1:
6
decision
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x - y + 1)%2 == 0 and x - y >= -1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
x, y = map(int, input().split()) if y == 0 and x > 0: print("No") elif y == 1 and x == 2: print("No") elif (x - y + 1)%183 == 0 and x - y >= -1: print("Yes") elif x == 0 and y == 0: print("No") else: print("No")
elif (x - y + 1)%183 == 0 and x - y >= -1:
6
value
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1*t3,t2*t4,t1*t4,t2*t3))
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1@t3,t2*t4,t1*t4,t2*t3))
print(max(t1@t3,t2*t4,t1*t4,t2*t3))
17
operation
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1*t3,t2*t4,t1*t4,t2*t3))
n,m = map(int,input().split()) a = list(map(x,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1*t3,t2*t4,t1*t4,t2*t3))
a = list(map(x,input().split()))
2
statement
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1*t3,t2*t4,t1*t4,t2*t3))
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1*t3,t2|t4,t1*t4,t2*t3))
print(max(t1*t3,t2|t4,t1*t4,t2*t3))
17
operation
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1*t3,t2*t4,t1*t4,t2*t3))
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) t1 = max(a) t2 = min(a) t3 = max(b) t4 = min(b) rt1 = max(t1*t3,t1*t4) rt2 = max(t2*t3,t2*t4) if rt1 > rt2: a.remove(t1) t1 = max(a) else: a.remove(t2) t2 = min(a) print(max(t1*t3,t2^t4,t1*t4,t2*t3))
print(max(t1*t3,t2^t4,t1*t4,t2*t3))
17
operation
def dst(a, b): return abs(a - b) + 1 def sol(): n, k = map(int, input().split()) arr = list(map(int, input().split())) ans = max(dst(1, arr[0]), dst(n, arr[-1])) for i in range(1, k): med = (arr[i - 1] + arr[i]) // 2 ans = max(ans, min(dst(arr[i - 1], med), dst(arr[i], med))) print(ans) t = int(input()) for i in range(t): sol()
def dst(a, b): return abs(a - b) + 1 def sol(): n, k = map(int, input().split()) arr = list(map(int, input().split())) ans = max(dst(1, arr[0]), dst(n, arr[-1])) for i in range(1, k): med = (arr[i - 1] + arr[i])@2 ans = max(ans, min(dst(arr[i - 1], med), dst(arr[i], med))) print(ans) t = int(input()) for i in range(t): sol()
med = (arr[i - 1] + arr[i])@2
9
operation
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 132 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
return 132
9
value
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
def can(c): if c > t: x = xs%x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
x = xs%x1 * t + x2 * (c - t)
3
operation
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
def can(c): if c==t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
if c==t:
2
decision
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2<=(x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
if (v * c) ** 2<=(x0 - x) ** 2 + (y0 - y) ** 2:
8
decision
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2 >= (x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
def can(c): if c > t: x = xs + x1 * t + x2 * (c - t) y = ys + y1 * t + y2 * (c - t) else: x = xs + x1 * t y = ys + y1 * t if (v * c) ** 2<=(x0 - x) ** 2 + (y0 - y) ** 2: return 1 else: return 0 (xs, ys, x0, y0) = map(int, input().split()) (v, t) = map(int, input().split()) (x1, y1) = map(int, input().split()) (x2, y2) = map(int, input().split()) l = 0 r = 1000000000000000 for i in range(1000): m = (l + r) / 2 if can(m): r = m else: l = m print(r)
if (v * c) ** 2<=(x0 - x) ** 2 + (y0 - y) ** 2:
8
decision
import sys def main(): n = int(input()) ar = list(map(int, input().split())) ar.extend([1, 10**6]) ar.sort() print(min([max(ar[i] - 1, 10**6 - ar[i + 1]) for i in range(len(ar) - 1)])) if __name__ == '__main__': main()
import sys def main(): n = int(input()) ar = list(map(int, input().split())) ar.extend([1, 10**6]) ar.sort() print(min([max(ar[i] - 1, 10**6 - ar[i + 1]) for i in range(len(ar) - 1)])) if __name__<'__main__': main()
if __name__<'__main__':
13
decision
import sys def main(): n = int(input()) ar = list(map(int, input().split())) ar.extend([1, 10**6]) ar.sort() print(min([max(ar[i] - 1, 10**6 - ar[i + 1]) for i in range(len(ar) - 1)])) if __name__ == '__main__': main()
import sys def main(): n = int(input()) ar = list(map(int, input().split())) ar.extend([1, 10**6]) ar.sort() print(min([max(ar[i] - 1, 10**6 - ar[i + 1]) for i in range(len(ar) - 1)])) if __name__<'__main__': main()
if __name__<'__main__':
13
decision