Problem:


﻿Score: 100 points

Problem Statement

In 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.

One day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.

Takahashi, who is taking this exam, suddenly forgets his age.

He decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.

Write this program for him.  

Constraints

N is 1 or 2.

A is an integer between 1 and 9 (inclusive).

B is an integer between 1 and 9 (inclusive).

Input

Input is given from Standard Input in one of the following formats:  

1

2
A
B

Output

If N=1, print Hello World; if N=2, print A+B.  

Sample Input 1

1

Sample Output 1

Hello World

As N=1, Takahashi is one year old. Thus, we should print Hello World.

Sample Input 2

2
3
5

Sample Output 2

8

As N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5. 



Sample input:
1


Sample output:
Hello World

Submission status: Runtime Error

Solution code:
n = int(input())
if n == 1:
	print("Hello World")
elif n == 2:
	a = int(input())
    b = int(input())
    print(a+b)

Submission status: Runtime Error

Solution code:
N = int(input())
p = []
for i in range(N):
    X1, Y1, H1 = map(int, input().split())
    if H1 != 0:
        p.append([X1, Y1, H1])

if len(p) == 1:
    print(p[0][0], p[0][1], p[0][2])
    exit()


for i in range(101):
    for j in range(101):
        h = -1
        fg = True
        for t in p:
            if h == -1:
                h = t[2] + abs(i - t[0]) + abs(j - t[1])

            else:
                ht = t[2] + abs(i - t[0]) + abs(j - t[1])
                if h == ht:
                    h = ht
                else:
                    fg = False
                    break
        if fg:
            print(i, j, h)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n,t = map(int,input().split())
ans_no = 0
ans_cost = t

for i in range(n):
    a,b = map(int,input().split())
    if b<ans_cost:
        ans_no = a

if ans_no == 0:
    print("TLE")
else print(ans_no)

Submission status: Runtime Error

Solution code:
N = int(input())

p = []

for i in range(N):
    X1, Y1, H1 = map(int, input().split())
    if H1 != 0:
        p.append([X1, Y1, H1])

if len(p) == 1:
    print(p[0][0], p[0][1], p[0][2])
    exit()


for i in range(101):
    for j in range(101):
        h = -1
        fg = True
        for t in p:
            if h == -1:
                h = t[2] + abs(i - t[0]) + abs(j - t[1])

            else:
                ht = t[2] + abs(i - t[0]) + abs(j - t[1])
                if h == ht:
                    h = ht
                else:
                    fg = False
                    break

        if fg:
            print(i, j, h)
            exit()

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

if N == 1:
    print('Hello World')
elif N == 2:
    print(A+B)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

if N == 1:
    print('Hello World')
if N == 2:
    print(A+B)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

if(N == 1):
	print("Hello World")
else:
	print(A+B)

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())

if N==1:
    print("Hello World")
else:
    print(A+B)

Submission status: Runtime Error

Solution code:
import numpy as np
N, T = map(int, input().split())
costs = []
times = []
for i in np.arange(N):
    ci, ti = map(int, input().split())
    costs.append(ci)
    times.append(ti)
index = np.argmin(times)
t_min = times[index]
if t_min < T:
    print(costs[index])
else:
    print('TLE')

Submission status: Runtime Error

Solution code:
n = int(raw_input())

if n == 1:
  print("Hello World")
elif n == 2:
  a = int(raw_input())
  b = int(raw_input())
  print(a+b)

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input().split())
res = 1
max_res = m//n
for i in range(2, math.ceil(math.sqrt(m)) + 1):
  if m % i == 0:
     if i <= max_res:
        res = max(res, i)
     x = m//i
     if x <= max_res:
        res = max(res, x)
print(res)

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input.split())
res = 1
max_res = m//n
for i in range(2, math.ceil(math.sqrt(m)) + 1):
  if m % i == 0:
     if i <= max_res:
        res = max(res, i)
     x = m//i
     if x <= max_res:
        res = max(res, x)
print(res)

Submission status: Runtime Error

Solution code:
n, T = map(input().split(), int)
res = 2000
for _ in range(n):
  c, t = map(input().split(), int)
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

Submission status: Runtime Error

Solution code:
n, T = map(input.split(), int)
res = 2000
for _ in range(n):
  c, t = map(input.split(), int)
  if t > T: continue
  res = min(res, c)
if res == 2000:
  print('TLE')
else:
  print(res)

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b, c):
     if a ==1:
        print('Hallo world')
    else:
        s=b+c
        print(s)
        
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':

Submission status: Runtime Error

Solution code:
N = int(input(""))

if n == 1:
    print('Hello World')
elif n == 2:
    A= int(input("A"))
    B = int(input("B"))
    print(A + B)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
#n個に分けてあげなきゃいけない
#合計はmにならなきゃいけない。素数のときは1確定？
#10 123のとき12から試す。余りが０だといいけどこの場合は３余るこのときあまりは１〜１１
#結局この問題はmを素因数分解して２数の積で表現したときにn以上の数で表せるかって話なわけよ、
#約数っていうのはその数の二乗を境にペアになっているから小さい方で割れれば商が相方になっているというわけ
#できる限り平均的に分けてあげたほうがいいってことはわかる。
#大きい方から下って見つかって瞬間終わりにするほうが賢いかも
#候補のうち最大の数字は
i = int(m/n)
ans = 1
while i >= 1:
    if m % i == 0:
        if m / i >= n:
            ans = i
            break
    i = i-1
print(ans)

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input().split())

def IsPrime(num):
    if num < 2:
        return False
    elif num == 2:
        return True
    elif num % 2 == 0:
        return False

    sqrtNum = math.sqrt(num)
    for i in (3, sqrtNum + 1, 2):
        if num % i == 0:
            return False

    return True

if IsPrime(m):
    print(1)
    exit()


ans = 0
for i in range(m // n, -1, -1):
    #print(i)
    if m % i == 0 and m // i >= n:
        ans = i
        break

print(ans)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
#n個に分けてあげなきゃいけない
#できる限り平均的に分けてあげたほうがいいってことはわかる。
#大きい方から下って見つかって瞬間終わりにするほうが賢いかも
#候補のうち最大の数字は
i = int(m/n)
ans = 1
while n*i <= m:
    if m % i == 0 and m / i >= n:
        ans = i
        break
    i -= 1
print(ans)

Submission status: Runtime Error

Solution code:
if input() == 1:
  print("Hello World")
else:
  print(int(input())+int(input()))

Submission status: Runtime Error

Solution code:
n=int(input())
if n==1:
    print("Hello World")
else:
    a,b=map(int,input().split())
    print(a+b)

Submission status: Runtime Error

Solution code:
N = int(input())
data = []
for _ in range(N):
    x, y, h = list(map(int, input().split()))
    data.append([x,y,h])
for x in range(101):
    flag2 = True
    for y in range(101):
        result = abs(data[0][0] - x) + abs(data[0][1] - y) + data[0][2]
        flag = True
        for dat in data:
            if result != abs(dat[0] - x) + abs(dat[1] - y) + dat[2]:
                flag = False
                break
        if flag == True and result >= 0:
            print(x,y,result)
            Flag2 = False
            break
    if flag2 == False:break

Submission status: Runtime Error

Solution code:
n, t = map(int, input().split())

a = []

for i in range(n):
  cost, time = map(int, input().split())
  if time <= t:
    a.append(cost)

if len(a) is 0:
  print("TLE")
else:
  a.sort()
  print(a[0])

Submission status: Runtime Error

Solution code:
N = input()
if N == "1":
    print(""Hello Wolrd")
elif N == "2":
    a = int(input())
    b =int(input())
    print(a+b)

Submission status: Runtime Error

Solution code:
age = int(input())
if age == 1:
  print('Hello world")
elif age == 2:
  A = input()
  B = input()
  print(A+B)

Submission status: Runtime Error

Solution code:
N = input()
A = input()
B = input()

if N == "1":
    print("Hello World")
else:
    print(str(int(A) + int(B)))

Submission status: Runtime Error

Solution code:
N=input()

N=int(N)

x=list()
y=list()
h=list()
for i in range(N):
    temp=input().split(" ")
    x.append(int(temp[0]))
    y.append(int(temp[1]))
    h.append(int(temp[2]))
    
def pass_all_condition(x,y,h,x_i,y_i,h_i):
    result=True
    for  k in range(len(x)):
        if h[k]!=max(h_i-abs(x_i-x[k])-abs(y_i-y[k]),0):
            result=False
    return(result)
    
def print_answer(x,y,h):
    for x_i in range(100):
        for y_i in range(100):
            for h_i in range(1,100):
                if pass_all_condition(x,y,h,x_i,y_i,h_i):
                    print(x_i, y_i, h_i)
                    return

print_answer(x,y,h)

Submission status: Runtime Error

Solution code:
N=int(input())
xyh=[list(map(int,input().split())) for i in range(N)]
MAX=100
for PosY in range(MAX+1):
    for PosX in range(MAX+1):
        needH=-1
        for i in range(N):
             if xyh[i][2]>0:
                tmp=xyh[i][2]+abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH==-1:
                    needH=tmp
                else:
                    if needH!=tmp:
                        needH=-2
                        break
        if needH==-2:
            continue
        for i in range(N):
            if xyh[i][2]==0:
                dist=abs(PosX-xyh[i][0])+abs(PosY-xyh[i][1])
                if needH>dist:
                    needH=-2
                    break
        if needH==-2:
            continue
        print(PosX,PosY,needH)

Submission status: Runtime Error

Solution code:
n=int(input())
if n == 1:
  print("Hello World")
  
else:
	a=int(input())
	b=int(input())
    print(a+b)

Submission status: Runtime Error

Solution code:
n=int(input())
if n==1:
  print("Hello World")
a=int(input())
b=int(input())
else:
  print(a+b)

Submission status: Runtime Error

Solution code:
n=int(input())
a=int(input())
b=int(input())
if n==1:
  print("Hello World")
else:
  print(a+b)

Submission status: Runtime Error

Solution code:
N = int(input())

x_list=[]
y_list=[]
h_list=[]

def all_same(items):
	return all(map(lambda x: x == items[0], items))

for i in range(N):
	x,y,h=map(int, input().split())
	x_list.append(x)
	y_list.append(y)
	h_list.append(h)	
		
for cy in range(N+1):
	for cx in range(N+1):
		H_list = []
		for i in range(N):
			if h_list[i] != 0:
				H = abs(cx - x_list[i])+abs(cy - y_list[i])+h_list[i]
				H_list.append(H) 
			if h_list[i] == 0:
				H = abs(cx - x_list[i])+abs(cy - y_list[i])+h
				if H > 0:
					break
		else:
			if all_same(H_list):
				print(str(cx)+' '+str(cy)+' '+str(H_list[0]))
				break
		break				
	else:
		continue
	break

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
for i in range(n):
    a.append(list(map(int, input().split())))
a.sort(key=lambda x:(-x[2],x[0]+x[1]))
if n==1:
    print(a[0][0],a[0][1],a[0][2])
else:
    for i in range(101):
        for j in range(101):
            ansh=[0]*(n+2)
            for k,(x,y,h) in enumerate(a):
                ansh[k]=h+abs(i-x)+abs(j-y)
                if h==0:ansh[k]=min([ansh[k],max(ansh[:k])])
            if len(set(ansh))==2:
                print(i,j,ansh[1])

Submission status: Runtime Error

Solution code:
#!/usr/bin/env pypy3


def get_line():
    return input()


def get_tokens():
    return get_line().split()


def get_ints():
    return [int(_) for _ in get_tokens()]


def main():

    n, = get_ints()
    A, = get_ints()
    B, = get_ints()
    print('Hello World' if n == 1 else A + B)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import math

[N, M] = list(map(int, input().split()))
num = math.ceil(M / N)
if N > 1:
    num = min(num, int(math.sqrt(M+1)))
for i in range(num+1)[::-1]:
    if M % i == 0:
        print(i)
        break

Submission status: Runtime Error

Solution code:
import math

[N, M] = list(map(int, input().split()))
num = math.ceil(M / N)
if N ==1:
    print(M)
for i in range(num+1)[::-1]:
    if M % i == 0:
        print(i)
        break

Submission status: Runtime Error

Solution code:
border = 101


def manhattan_distance(Cx, Cy, H, X, Y):
    return max(H - abs(X - Cx) - abs(Y - Cy), 0)


def judge_center(Cx, Cy, cords):
    for x, y, h in cords:
        if h > 0:
            H = abs(cords[0][0] - Cx) + abs(cords[0][1] - Cy) + cords[0][2]
            break
    for x, y, h in cords:
        tmp = manhattan_distance(Cx, Cy, H, x, y)
        if (h > 0 and H != tmp) or (h == 0 and H > tmp):
            return -1
    return H


def main():
    N = int(input())
    cords = [list(map(int, input().split(' '))) for _ in range(N)]

    for tmp_Cx in range(border):
        for tmp_Cy in range(border):
            h = judge_center(tmp_Cx, tmp_Cy, cords)
            if h != -1:
                print('{} {} {}'.format(tmp_Cx, tmp_Cy, h))
                return 0


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import math
 
N,M = map(int,input().split())
 
ans = 1
for i in range(1,M+1):
  if M % i != 0:#約数ではないとき
    continue
  B = M / i
  
  if (i * N <= M):
    ans = max(ans,i)
  if (B * N <= M):
    ans = max(ans,B)

print(ans)

Submission status: Runtime Error

Solution code:
N=input()
if N==1:
  	print "Hello World"
else:
  	A=input()
    B=input()
   	print A+B

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input().split())
for i in range(m//n,1,-1):
  if m%i==0:
    print(i)
    break

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input().split())
for i in range(m//n,1):
  if m%i==0:
    print(i)
    break

Submission status: Runtime Error

Solution code:
import java.util.Scanner;

class Main{
public static void main(String[] a){
Scanner s=new Scanner(System.in);long N=s.nextLong();long M=s.nextLong();long X=1;
for(int i=1; i*i<=M; i++){
if(M%i==0 && i*N<=M)X=Math.max(X,i);
if(M%(M/i)==0 && (M/i)*N<=M)X=Math.max(X,(M/i));
}
System.out.println(X);
}
}

Submission status: Runtime Error

Solution code:
n, m = list(map(int,input().split()))
def solve():
    for i in range(m//n, 0, -1):
        if m % i == 0:
            print(i)
            break
solve()

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input().split())
X=1

for i in range(1,32000):
	if m%i==0:
		if i*n<=m:
			X=max(X, i)
		if (m//i)*n<=m:
			X=max(X, m//i)
print(X)

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input().split())
X=1

for i in range(1,int(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			X=max(X, i)
		if (m//i)*n<=m:
			X=max(X, m//i)
print(X)

Submission status: Runtime Error

Solution code:
import math
n, m = map(int, input().split())
kotae=1

for i in range(1,int(math.sqrt(m))+1):
	if m%i==0:
		if i*n<=m:
			kotae=max(kotae, i)
		if (m/i)*n<=m:
			kotae=max(kotae, i)
print(kotae)

Submission status: Runtime Error

Solution code:
# coding : utf-8

import math

N,M = map(int,input().split())

b = M//N

l = []
for i in range(1,int(math.sqrt(M)+1)):
    if M % i == 0:
        l.append(i)

ans = 1
for l_ in l:
    if l_ <= b:
        ans = max(ans,l_)

print(ans)

Submission status: Runtime Error

Solution code:
N, M = list(map(int,input().split()))
 
d = int(M/N)
 
if M%N == 0:
	print(d)
else: 
    ans = 1
    for i in range(m//n+1, 0, -1):
        if m % i == 0:
            if (m // i) >= n:
                print(i)
                break
	# i = 0
	# while True:
	# 	if M%(N+i+1) == 0:
	# 		print(int(M/(N+i+1)))
	# 		break
	# 	i += 1

Submission status: Runtime Error

Solution code:
#python D-Partition.py
"""
入力フォーマット
N M

出力:a_1+...+a_N=Mを満たす数列aについてmax(GCD(a_1,...,a_N))
"""
import math
line = list(map(int, input().split(" ")))
N = int(line[0])
M = int(line[1])

#TLE(実行時間制限超過)のコード
"""
for i in range(math.floor(M/N),0,-1):
	tmp = M-i*(N-1)
	if tmp%i==0:
		print(i)
		break
"""

#TLEを何とかしたコード（ポイント：素数判定と同じ要領で探索範囲をO(sqrt(M))にした
for i in range(sqrt(M)):
	tmp = M-(math.floor(M/N)-i)*(N-1)
	if tmp%(math.floor(M/N)-i)==0:
		print((math.floor(M/N)-i))
		break

Submission status: Runtime Error

Solution code:
import math


n, m = map(int, input().split())

for i in range(math.floor(m/n), 0, -1):
    if m % i == 0:
        ans = i
		break

print(ans)

Submission status: Runtime Error

Solution code:
n = 
if n==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)

Submission status: Runtime Error

Solution code:
n = 
if n==1:
    print("Hello World")
else:
    int(input())
    int(input())
    print(a+b)

Submission status: Runtime Error

Solution code:
n = input()
if n==1:
    print("Hello World")
else:
    a=input()
    b=input()
    print(a+b)

Submission status: Runtime Error

Solution code:
N=int(input())
lis=[]
for i in range(101):
    for j in range(101):
        lis.append([i,j])
l2=[]
for i in range(N):
    l2.append(list(map(int, input().split())))
for i in lis:
    n=N
    l=0
    for j in l2:
        k=abs(i[0]-j[0])+abs(i[1]-j[1])+j[2]
        if l==k or l==0:
            l=k
            n-=1
            if n==0:
                m=(i[0],i[1],l)
        else: break
    try:
        print('{} {} {}'.format(m[0],m[1],m[2]))
        break
    except NameError:
        continue

Submission status: Runtime Error

Solution code:
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

N,M=list(map(int,input().split()))
LIST=[]
divide_list = make_divisor_list(M)
if M%N==0:
    print(M//N)
else:
    x = M/N
    for i in divide_list:
       if i <= x:
          LIST.append(i)
    print(max(LIST))

Submission status: Runtime Error

Solution code:
n=int(inpit())
if n==1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)

Submission status: Runtime Error

Solution code:
N, M =map(int,input().split())
ans=1
for i in range (1,M//N):
    if M%i==0:
        if M//i>=N:
            ans=i
print(ans)

Submission status: Runtime Error

Solution code:
N = [int(input()) for _ in range(n)]
if N[0] == 1 then:
    print('Hello World')
else:
    print(N[1] + N[2])

Submission status: Runtime Error

Solution code:
import sys
import itertools

N = int(sys.stdin.readline().strip())

set_list = []
for line in sys.stdin.readlines():
    x, y, h = list(map(int, line.strip().split()))
    ans_set = set()
    for Cx, Cy in itertools.product(range(101), range(101)):
        dx = abs(x - Cx)
        dy = abs(y - Cy)
        d = dx + dy
        H = h + d
        # if H >= d:
        if H >= 1:
            ans_set.add((Cx, Cy, H))
    set_list.append(ans_set)

ans_set = set_list[0]
if len(set_list) > 1:
    for s in set_list[1:]:
        ans_set = ans_set & s

if len(ans_set) == 1:
    Cx, Cy, H = list(ans_set)[0]
    print(Cx, Cy, H)
#else:
#    for s in set_list:
#        Cx, Cy, H = list(ans_set)[0]
#        if H >= 1:
#            print(Cx, Cy, H)

Submission status: Runtime Error

Solution code:
from math import ceil
n, m = map(int, input().split())
for i in range(n, ceil(m**.5), 1):
    if not m % i:
        print(m//i)
        break
for i in range(int(min((m / n), m**.5)), 0, -1):
    if not m % i:
        print(i)
        break

Submission status: Runtime Error

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

n = int(input())
vh = {}
zx = []
zy = []
zh = []
for j in range(101):
    for k in range(101):
        vh[j, k] = -2
for i in range(n):
    x, y, h = list(map(int, input().split()))
    if h == 0:
        zx.append(x)
        zy.append(y)
        zh.append(h)
        continue
    for j in range(101):
        for k in range(101):
            hi = h + abs(j - x) + abs(k - y)
            if vh[j, k] == -2:
                vh[j, k] = hi
            elif vh[j, k] > -1:
                if vh[j, k] != hi:
                    vh[j, k] = -1

rs = 0
for j in range(101):
    for k in range(101):
        if vh[j, k] > -1:
            rs += 1
            rj = j
            rk = k

if rs == 1:
    print(rj, rk, vh[rj, rk])
else:
    for i in range(rs):
        dels = 0
        for j in range(101):
            for k in range(101):
                hi = zh + abs(j - zx) + abs(k - zy)
                if vh[j, k] > -1:
                    if vh[j, k] != hi:
                        dels += 1
        if dels == rs - 1:
            for j in range(101):
                for k in range(101):
                    hi = zh + abs(j - zx) + abs(k - zy)
                    if vh[j, k] > -1:
                        if vh[j, k] != hi:
                            vh[j, k] = -1
            for j in range(101):
                for k in range(101):
                    if vh[j, k] > -1:
                        print(j, k, vh[j, k])

Submission status: Runtime Error

Solution code:
#encoding utf-8

n = int(input())
data = []
for i in range(n):
    x,y,h=map(int,input().split())
    data.append([x,y,h])

def calH(cx,cy,data):
    return data[2]+abs(data[0]-cx)+abs(data[1]-cy)

def conh(temH,cx,cy,data):
    return temH-abs(data[0]-cx)-abs(data[1]-cy)


for i in range(101):
    for j in range(101):
        clear = 0
        count = 0
        for k in range(n):
            if clear == 0:
                temH = calH(i,j,data[k])
                if data[k][2] != 0:
                    clear = 1
                else:
                    if conh(temH,i,j,data[k]) < 0:
                        count += 1
                    else:
                        count += 1
                        clear = 1

        for k in range(count,n):
            print(k)
            ignore_flag = 0
            if data[k][2] == 0:
                if conh(temH,i,j,data[k]) < 0:
                    ignore_flag = 1
                    count += 1

            if ignore_flag == 0:
                if calH(i,j,data[k]) != temH:
                    break
                else:
                    count += 1
            if count == n:
                answer=[i,j,calH(i,j,data[0])]

print(answer[0],answer[1],answer[2])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())

x0, y0, h0 = map(int, input().split())
for i in range(N):
  xi, yi, hi = map(int, input().split())
  if xi-x0 == abs(xi-x0):
    hx = hi + (100 -xi)
  else:
    hx = hi +xi

  if yi-y0 == abs(yi-y0):
    hy = hx + (100 -yi)
  else:
    hy = hx +yi

print(hy)

Submission status: Runtime Error

Solution code:
str=input().split(' ')
a=[]
b=[]
c=[]
for i in range(2): a.append(int(str[i]))
for i in range(a[0]): b.append(input().split(' '))
for i in range(a[0]):
  for j in range(2):
    c.append(int(b[i][j]))
d=[]
e=[]
for i in range(a[0]):
  if(a[1]>=c[i*2-1]):
    d.append(c[i*2-2])
    e.append(c[i*2-1])
if(len(d)==0): print('TLE')
else: 
  num=min(d)
  print(num)

Submission status: Runtime Error

Solution code:
N,T = map(int, input().split())
minC = 1001
flag = False
for i in range(int(N)):
    c, t = map(int, input().split())
    if int(T) >= t and minC >= int(c):
        minC = c
        frag = True

if(flag == False):
    print("TLE")
else:
    print(minC)

Submission status: Runtime Error

Solution code:
x = input().split()
N,T = int(x[0]),int(x[1])
a,b,c,d = [],[],[],[]
for i in range(N):
    v = input().split()
    v = [int(s) for s in v]
    a.append(v)
for i in range(N):
    b.append(a[i][0])
for i in range(N):
    c.append(a[i][1])
for i in range(N):
    if b[i] < T:
        d.append(a[b.index(b[i])][0])
if len([i for i, x in enumerate(d) if x == min(d)]) == 1 and [i for i, x in enumerate(d) if x == min(d)] != [0]:
    print(min(d))
else:
    print('TLE')

Submission status: Runtime Error

Solution code:
x = input().split()
N,T = int(x[0]),int(x[1])
a = []
b = []
c = []
d = []
for i in range(N):
    v = input().split()
    v = [int(s) for s in v]
    a.append(v)
for i in range(N):
    b.append(a[i][0])
for i in range(N):
    c.append(a[i][1])
for i in range(N):
    if b[i] < T:
        d.append(a[b.index(b[i])][0])
if len([i for i, x in enumerate(d) if x == min(d)]) == 1 and [i for i, x in enumerate(d) if x == min(d)] != [0]:
    print(min(d))
else:
    print('TLE')

Submission status: Runtime Error

Solution code:

lis = []

N,M = [int(i) for i in input().split()]
M_ = M
i = 2

while True:
    if M % i == 0:
        M = M // i
        lis.append(i)
    elif M == 1:
        break
    else:
        i += 1
ans = M_

for n in range(2**len(lis)):
    m = bin(n)[-1:1:-1]
    ret = 1
    for l in range(len(m)):
        if int(m[l]):
            ret *= lis[l]
           # print(lis[l])
            if  ret >= N:
                break
    if ret >= N:
        #print(ret)
        ans = min(ans,ret)

print(M_//ans)

Submission status: Runtime Error

Solution code:
N,T = map(int, input().split())
minC = 1001
flag = False
for i in range(int(N)):
    c, t = map(int, input().split())
    if int(T) > t and minC > c:
        minC = c

print(minC)

Submission status: Runtime Error

Solution code:
    n=int(input())
    if n==1:print("Hello World")
    else:
        a=int(input())
        b=int(input())
        print(a+b)

Submission status: Runtime Error

Solution code:
n=int(input())
if n==1:print("Hello World)
else:
    a=int(input())
    b=int(input())
    print(a+b)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
from collections import defaultdict
from bisect import bisect
def inpl(): return list(map(int, input().split()))

def primes(N):
    sieve = [True]*(N+1)
    sieve[:2] = [False, False]
    for i in range(4, N+1, 2):
        sieve[i] = False

    for i in range(3, N+1, 2):
        if sieve:
            for j in range(2*i, N+1, i):
                sieve[j] = False
    P = []
    for i in range(N+1):
        if sieve[i]:
            P.append(i)
    return P

N, M = inpl()
P = primes(10**6)
searched = defaultdict(int)

Q = [1]

if N==1:
    print(M)
    exit()

if M%N == 0:
    ans = M//N
else:
    ans = 1
while Q:
    a = Q.pop()
    for p in P:
        c = a*p
        d = M - c*N
        if d < 0:
            break
        
        if d%c == 0:
            if not searched[c]:
                searched[c] = True
                ans = max(ans, c)
                Q.append(c)
print(ans)

Submission status: Runtime Error

Solution code:
def cal(X,Y,H):

    for i in range(0,101): #C_x
        for j in range(0,101): #C_y
            temp=H[0]+abs(X[0]-i)+abs(Y[0]-j)
            for l in range(1,N):
                if(H[l]!=0):
                    s=H[l]+abs(X[l]-i)+abs(Y[l]-j)
                    if(temp==s):
                        temp=s
                    else:
                        break
                else:
                    if(temp-abs(X[l]-i)-abs(Y[l]-j)>0):
                        break
            else:    
                return print("{} {} {}".format(i,j,temp))

N=int(input())
X=[]
Y=[]
H=[]
for i in range(N):
    x,y,h=list(map(int,input().split()))
    X.append(x)
    Y.append(y)
    H.append(h)
cal(X,Y,H)

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())

x=0

for i in range(m//n):
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Oct  6 21:37:39 2018

@author: ogura
"""
import math

n, m = map(int, input().split())

for i in range(10000):
    a = math.gcd(m, i)
    if a == 1:
        continue
    tmp = int(a *(1 - a ** n) // (1 - a))
    if tmp == m:
        break

print(a)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
if a == 1:
    print('Hello World')
else:
    print(b+c)

Submission status: Runtime Error

Solution code:
n=int(input())
a=input()
b=input()

if n==1 :
    print("Hello World")
else :
    print(int(a)+int(b))

Submission status: Runtime Error

Solution code:
N=int(input())
list1=[]
for i in range(N):
  x1=list(map(int,input().split()))
  list1.append(x1)
flag=0
for i in range(101):
  for j in range(101):
    list2=[]
    for k in range(N):
      Hx=list1[k][2]+abs(list1[k][0]-i)+abs(list1[k][1]-j)
      list2.append(Hx)
    if len(set(list2))==1:
      list3=[0]
      for l in range(N):
         d=Hx-abs(list1[l][0]-i)-abs(list1[l][1]-j)
         list3.append(d)
      if min(list3)>=0:
         print(i,j,Hx)
         flag=1
      else:
        pass
    else:
      pass
    if flag==1:
      break
  if flag==1:
    break

Submission status: Runtime Error

Solution code:
n = int(input())
x = []; y = []; h = []

xmin = 0; ymin = 0; xmax = 101; ymax = 101

for i in range(n):
    xx, yy, hh = list(map(int, input().split(' ')))
    x.append(xx)
    y.append(yy)
    h.append(hh)

field = []

for i in range(n):
    if i == 0:
        for xx in range(xmin, xmax):
            f = []
            for yy in range(ymin, ymax):
                f.append(max(abs(xx - x[i]) + abs(yy - y[i]) + h[i], 0))
            field.append(f)
    
    else:
        for xx in range(xmin, xmax):
            for yy in range(ymin, ymax):
                f = max(abs(xx - x[i]) + abs(yy - y[i]) + h[i], 0)
                if field[xx][yy] != f:
                    field[xx][yy] = -1

maxx = 0; maxy = 0; maxV = 0
for xx in range(xmin, xmax):
    for yy in range(ymin, ymax):
        if maxV <= field[xx][yy]:
            maxx = xx; maxy = yy; maxV = field[xx][yy]

print(str(maxx) + " " + str(maxy) + " " + str(maxV))

Submission status: Runtime Error

Solution code:
import math
N, M = map(int,input().split())
j=1
for i in range(1, int(math.sqrt(M))+2):
    if M%i==0:
        if i <= M//N and j < i:
            j=i
        if M/i <= M//N and j < M/i:
            j=M/i
print(j)

Submission status: Runtime Error

Solution code:
N,T = list(map(int, input().split()))
max = 10000
for i in range(N):
    c,t = list(map(int, input().split()))
    if t <= T and c < max:
        max = c
if max == 10000:
    print("TLE")
else:
    print(max)

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
for i in range(n,10000000000000000):
    if m%i == 0:
        n=i
        break
print(int(m/i))

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
cage,cage2=[],[]
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
      cage.append(c)
if cage is None:
  print("TLE")
else:
  print(min(cage))