Problem:


Score: 100 points

Problem Statement

In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year.

For example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.  

In this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi.

How many days from 2018-1-1 through 2018-a-b are Takahashi?

Constraints

a is an integer between 1 and 12 (inclusive).

b is an integer between 1 and 31 (inclusive).

2018-a-b is a valid date in Gregorian calendar.

Input

Input is given from Standard Input in the following format:

a b

Output

Print the number of days from 2018-1-1 through 2018-a-b that are Takahashi.

Sample Input 1

5 5

Sample Output 1

5

There are five days that are Takahashi: 1-1, 2-2, 3-3, 4-4 and 5-5.

Sample Input 2

2 1

Sample Output 2

1

There is only one day that is Takahashi: 1-1.

Sample Input 3

11 30

Sample Output 3

11

There are eleven days that are Takahashi: 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10 and 11-11.



Sample input:
5 5


Sample output:
5

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
ct=0
for i in range(1,a+1):
    for j in range(1,32):
        if(a!=b):
            if(i==a):
                break
        else(i==j):
            ct=ct+1
               
print(ct)

Submission status: Runtime Error

Solution code:
a=list(map(int,input().split()))
a=sorted(a)
k=int(input())

for i in range(1,k+1):
       f=a[2]*2
       a[2]=f
       
c=a[0]+a[1]+a[2]
print(c)

Submission status: Runtime Error

Solution code:
a,b=[int(i) for i in input().sprit()]
if b>=a:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if a=<b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
flag=0
for a in range(1,a+1):
  for b in range(1,b+1);
   if(a==b):
      flag=flag+1
print(flag)

Submission status: Runtime Error

Solution code:
a,b = list(map(int,input()))
if a < b:
    print(a-1)
else:
    print(a)

Submission status: Runtime Error

Solution code:
a,b = map(int,ibput().split())
if a >= b:
  print(b)
else:
  print(a)

Submission status: Runtime Error

Solution code:
H, W = map(int, input().split())
s = [0 for _ in range(H)]
for i in range(H):
    s[i] = input()      # intをかけずにinputすると文字列として扱われる
# ここまでが入力

dx = [1, 0, 0, -1]    # これらは移動を表すリスト
dy = [0, 1, -1, 0]    # 順番に、下・右・左・上となっている

for i in range(H):
    for j in range(W):
        if s[i][j] == ".":      # "#"が隣接しているかどうかが知りたいので、"."の周りに何があってもどうでもいい
            ans = "Yes"
            continue            # つまり注目しているマスが"#"のときだけ以下の処理をする
        ans = "No"      # この文を入れる場所は要注意
        for d in range(4):      # s[i][j]に対して、隣接する8マスについて"#"があるかを判定する
            di = i + dx[d]
            dj = j + dy[d]
            if di<0 or dj<0 or H-1<di or W-1<dj:    # 注目した隣接マスが「ない」ときは処理をしない
                continue
            if s[di][dj] == "#":
                ans = "Yes"
print(ans)

Submission status: Runtime Error

Solution code:
H, W = map(int, input().split())
s = [0 for _ in range(H)]
for i in range(H):
    s[i] = input()      # intをかけずにinputすると文字列として扱われる
# ここまでが入力

dx = [1, 0, 0, -1]    # これらは移動を表すリスト
dy = [0, 1, -1, 0]    # 順番に、下・右・左・上となっている

ans = "Yes"
for i in range(H):
    for j in range(W):
        if s[i][j] == ".":      # "#"が隣接しているかどうかが知りたいので、"."の周りに何があってもどうでもいい
            continue            # つまり注目しているマスが"#"のときだけ以下の処理をする
        ans = "No"      # この文を入れる場所は要注意
        for d in range(4):      # s[i][j]に対して、隣接する8マスについて"#"があるかを判定する
            di = i + dx[d]
            dj = j + dy[d]
            if di<0 or dj<0 or H-1<di or W-1<dj:    # 注目した隣接マスが「ない」ときは処理をしない
                continue
            if s[di][dj] == "#":
                ans = "Yes"
print(ans)

Submission status: Runtime Error

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

H, W = map(int, input().split())
s = [None]*H
for i in range(H):
    s[i] = input()
d = deque()
d.append((0, 0))
while(len(d) != 0):
    g, r = d.popleft()
    if s[g][r] == '#':
        if g != 0 and s[g-1][r] == '#':
            d.append((g-1, r))
        else:
            print('No')
            break
        if g != H-1 and s[g+1][r] == '#':
            d.append((g+1, r))
        else:
            print('No')
            break
        if r != 0 and s[g][r-1] == '#':
            d.append((g, r-1))
        else:
            print('No')
            break
        if r != W-1 and s[g][r+1] == '#':
            d.append((g, r+1))
        else:
            print('No')
            break
    print('Yes')

Submission status: Runtime Error

Solution code:
a,b,x=map(int,input().split())
x=0
for i in range(a):
    for j in range(b):
        if i==j:
            x += 1
print(x)

Submission status: Runtime Error

Solution code:
a,b=mac(int,input().split())
if a<=b:print(a)
else: print(a-1)

Submission status: Runtime Error

Solution code:
a,b = map(int,input(),split())
 
if b >= a:
	print(a)
else:
	print(a - 1)

Submission status: Runtime Error

Solution code:
a,b = map(int,input(),split())

if b >= a:
	print(a)
else
	print(a - 1)

Submission status: Runtime Error

Solution code:
a, b = min(map(int, input().split()))
print(a) if a <= b else print(a-1)

Submission status: Runtime Error

Solution code:

# import
import numpy as np
import sys
sys.setrecursionlimit(10**6)

# input
H, W = map(int, input().split())

Mtmp = []
for _ in range(H):
    tmp = list(input())
    Mtmp.append(tmp)

M = np.array(Mtmp)
S = np.array([[0]*W]*H)

#print(M)

digtmp = np.array([[0, 1], [1, 0], [0, -1], [-1, 0]])

def dfs(i, j):
    global ngflag
    global searchflag
    if S[i, j] == 1:
        return
    S[i, j] = 1
    if M[i, j] == '.':
        return
    #print("i:{}, j:{}".format(i, j))
    searchflag = 1
    dig = digtmp + np.array([i, j])
    for d in dig:
        if 0 <= d[0] < H and 0 <= d[1] < W:
            if M[d[0], d[1]] == '#':
                ngflag = 0
                dfs(d[0], d[1])

searchflag = 0
ngflag = 1

while True:
    if 0 not in S:
        if M[target[0], target[1]] == '.':
            ngflag = 0
        break
    target = list(zip(*np.where(S == 0)))[0]
    #print("sf:{}, ng:{}".format(searchflag, ngflag))
    if M[target[0], target[1]] == '#':
        ngflag = 1
    dfs(target[0], target[1])
    if M[target[0], target[1]] == '#' and searchflag == 1 and ngflag == 1:
        break


#print("sf:{}, ng:{}".format(searchflag, ngflag))

if searchflag == 1 and ngflag == 0:
    ans = 'Yes'
elif searchflag == 1 and ngflag == 1:
    ans = 'No'
else:
    ans = 'Yes'

print(ans)

Submission status: Runtime Error

Solution code:

# import
import numpy as np
import sys
sys.setrecursionlimit(10**6)

# input
H, W = map(int, input().split())

Mtmp = []
for _ in range(H):
    tmp = list(input())
    Mtmp.append(tmp)

M = np.array(Mtmp)
S = np.array([[0]*W]*H)

print(M)

digtmp = np.array([[0, 1], [1, 0], [0, -1], [-1, 0]])

def dfs(i, j):
    global ngflag
    global searchflag
    if S[i, j] == 1:
        return
    S[i, j] = 1
    if M[i, j] == '.':
        return
    print("i:{}, j:{}".format(i, j))
    searchflag = 1
    dig = digtmp + np.array([i, j])
    for d in dig:
        if 0 <= d[0] < H and 0 <= d[1] < W:
            if M[d[0], d[1]] == '#':
                ngflag = 0
                dfs(d[0], d[1])

searchflag = 0
ngflag = 1

while True:
    if 0 not in S:
        if M[target[0], target[1]] == '.':
            ngflag = 0
        break
    target = list(zip(*np.where(S == 0)))[0]
    print("sf:{}, ng:{}".format(searchflag, ngflag))
    if M[target[0], target[1]] == '#':
        ngflag = 1
    dfs(target[0], target[1])
    if M[target[0], target[1]] == '#' and searchflag == 1 and ngflag == 1:
        break


print("sf:{}, ng:{}".format(searchflag, ngflag))

if searchflag == 1 and ngflag == 0:
    ans = 'Yes'
elif searchflag == 1 and ngflag == 1:
    ans = 'No'
else:
    ans = 'Yes'

print(ans)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
s=0
for i in range(1,12):
  for j in range(1,31):
    if int(a[i]==b[j]):
      s+=1
    print(s)

Submission status: Runtime Error

Solution code:
n,w=map(int,input().split())
st=[]
for i in range(n):
    st.append(list(input())) #0~n-1までの列ができる
if n==w==1:
    print("Yes")
    exit()

for i in range(1,n-1):
    for j in range(1,w-1): #i,jに1足しても引いても範囲内だから安心！
        if st[i][j]=="#":
            if st[i+1][j]=="." and st[i][j-1]=="." and st[i][j+1]=="." and st[i+1][j]==".":
                print("No")
                exit()
        if st[0][j]=="#" and st[1][j]=="." and st[0][j+1]=="." and st[0][j-1]==".": #上辺
            print("No")
            exit()
        if st[i][0]=="#" and st[i][1]=="." and st[i-1][0]=="." and st[i+1][0]==".": #左辺
            print("No")
            exit()
        if st[i][w-1]=="#" and st[i][w-2]=="." and st[i-1][w-1]=="." and st[i+1][w-1]==".": #右辺
            print("No")
            exit()
        if st[n-1][j]=="#" and st[n-2][j]=="." and st[n-1][j+1]=="." and st[n-1][j-1]==".": #下辺
            print("No")
            exit()
if st[0][0]=="#" and st[0][1]=="." and st[1][0]==".": #左上
    print("No")
    exit()
if st[0][w-1]=="#" and st[0][w-2]=="." and st[1][w-1]==".": #右上
    print("No")
    exit()
if st[n-1][0]=="#" and st[n-1][1]=="." and st[n-2][0]==".": #左下
    print("No")
    exit()
if st[n-1][w-1]=="#" and st[n-1][w-2]=="." and st[n-2][w-1]==".": #右下
    print("No")
    exit()
print("Yes")

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))
l2 = set(l)
print(l2[0])

Submission status: Runtime Error

Solution code:
#N,Wを入力
H,W = map(int, input().split())

trout = []

for i in range(H):
    trout.append(list(input()))

# 配列の比較用の変数
h = H-1
w = W-1

reslut = "Yes"
for i in range(H):
    for j in range(W):
        
        # "."だったらスルー
        if trout[i][j] == ".":
            pass
        
        else:
             # 真上
            if i>=1 and trout[i-1][j] == "#":
                pass
             # 左
            if j>=1 and trout[i][j-1] == "#":
                pass
            # 右
            if j<w and trout[i][j+1] == "#":
                pass
            # 真下
            if i<h and trout[i+1][j] == "#":
                pass
            
            else:
                reslut = "No"
                break
    else:
        continue
    break
    
print(reslut)

Submission status: Runtime Error

Solution code:
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		System.out.println(Math.min(a,b));
      
    }
}

Submission status: Runtime Error

Solution code:

n=int(input())
a=[]
a.append(2)
k=2
for i in range(55):
    while k < 55555 :
        k += 1
        b=k
        for j in a:
            if k%j==0:
                b=0
    
        if b==k:
            a.append(k)
            break
 
ans=[]
for j in range(len(a)):
    if len(ans) < n:
        if a[j] % 5 == 1:
            ans.append(a[j])
            
            
print(*ans)

Submission status: Runtime Error

Solution code:

a,b=map(int,input().split())
x=[0,0,-1,1]
y=[-1,1,0,0]
d=[[0]*a for x in range(b)]
for i in range(b):
    d[i]=list(input())
    
result="Yes"

for i in range(b):
    for j in range(a):
        if d[i][j] == '#':
            check=0
            for xv,yv in zip(x,y):
                if 0 <= xv + j < a  and 0 <= yv + i < b:
                    if d[i+yv][j+xv] == '#':
                        check=1
                        #break
        
            if check==0:
                result="No"
                #break
            
                        
print(result)

Submission status: Runtime Error

Solution code:
month, day = map(int, input().split())

ans = month-1 if month > day else month

if month < day:
  

print(ans)

Submission status: Runtime Error

Solution code:
a,b=int(input())
if a < b:
	print(a)
else:
	print(a-1)

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
k = int(input())

m = max(a,b,c)
print(m * 2 * k + a + b + c - max(a,b,c))

Submission status: Runtime Error

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

if a <= b:
  print(a)
else:
  print(b%a)

Submission status: Runtime Error

Solution code:
m,d=map(int,input())
if d>=m:
  print(m)
else:
  print(m-1)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(3000)
h, w = map(int, raw_input().split())
s = [[c for c in raw_input()] for i in range(h)]
def isValid(i, j):
    if i < 0 or i >= h or j < 0 or j >= w:
        return False
    return True
    
def dfs(s, i, j):
    if not isValid(i, j) or s[i][j] == "0" or s[i][j] == ".":
        return 0
    if s[i][j] == "#":
        s[i][j] = "0"
        a = dfs(s, i+1, j)
        b = dfs(s, i-1, j)
        c = dfs(s, i, j+1)
        d = dfs(s, i, j-1)
        return 1 + a + b + c + d

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            ccs = dfs(s, i, j)
            #print ccs
            if ccs == 1:
                print "No"
                exit()
print "Yes"

Submission status: Runtime Error

Solution code:
M, D=map(int,input().split())
if D>=M:
  print(M)
elif:
  print(M-1)

Submission status: Runtime Error

Solution code:
M, D=map(int,input()>split())
if D>=M:
  print(M)
elif:
  print(M-1)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a <= b:
    print(a)
else:
    ptiny(a-1)

Submission status: Runtime Error

Solution code:
ABC = list(map(int, input().split()))
K = int(input())

ABC_1 = sorted(ABC)
ABC_2 = ABC_1[:-1]

ABC_MAX = ((max(ABC))*2)**K

ABC_3 = sum(ABC_2)



print((ABC_MAX) + (ABC_3))

Submission status: Runtime Error

Solution code:
x=list(map(int,input().split()))
a=x[0]
b=x[1]
if a<=b:
  print(a)
else:
  priint(a-1)

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
K = int(input())

max_n = max(A, B, C)
print(sum([A, B, C]) + (2 ** K - 1) * max_n)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if (a <= b):
    print(a)
else:
    print(a-1

Submission status: Runtime Error

Solution code:
a, b = input().split()
if (a <= b):
    print(a)
else:
    print(a-1)

Submission status: Runtime Error

Solution code:
a, b = (map(int, input().split()))
if (a <= b):
    print(a)
else:
    print(a-1

Submission status: Runtime Error

Solution code:
a, b = map(int, input())

if a >= b:
    print(a)

else:
    print(a - 1)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
num = 55555
input_list = [False if i%2 == 0 or i%3 == 0 or i%5==0 else True for i in range(num)]
input_list[0] = input_list[1] = False
input_list[2] = input_list[3] = input_list[5] = True
sqrt = math.sqrt(num)

for serial in range(3, num, 2):
    if serial >= sqrt:
        break
    for s in range(serial ** 2, num, serial):
        input_list[s] = False

ans = []
count = 0
for i in range(11111):
    if input_list[5*i-1]:
        ans.append(5*i-1)
    if len(ans) == N:
        break

ans2 = ""
for i in range(len(ans)):
    ans2 += str(ans[i])
    if i != len(ans)-1:
        ans2 += " "

print(ans2)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split)
if a <= b:
    print(a)
else:
    print(a-1)

Submission status: Runtime Error

Solution code:
a, b = map(int, input())

if(a>b):
  print(a-1)
else:
  print(a)

Submission status: Runtime Error

Solution code:
H, W = map(int, input().split())

S = [list(input()) for _ in range(H)]

# #の座標(i,j)を与え、隣接している#があるならばTrue、そうでなければNoを出力して終了する
def exist_neighbor_black_cell(i,j):
    if "#" in [S[max(0,i-1)][j], S[min(H-1,i+1)][j], S[i][max(0,j-1)], S[i][min(W-1,j+1)]]:
        return True
    else:
        print("No")
        exit()

# どの#にも隣接していない#マスがあれば不可。そうでなければ可
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            exist_neighbor_black_cell(i, j)

print("Yes")

Submission status: Runtime Error

Solution code:
    a,b = [int(x) for x in input().split()]     
    if a <= b:
        print(a)
    if a > b:
        print(a-1)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())

if a =< b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())

if b => a:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b;
    cin>>a>>b;
    if (a<=b){
        cout<<a<<endl;
    }else{
        cout<<a-1<<endl;
    }
}

Submission status: Runtime Error

Solution code:
def main(a, b):
    days = a * 30 + b

    count = 0
    for i in range(1, min(a, b) + 1):
        if isinstance(int, (days // i * 30 + b)):
            count += 1

    return count

if __name__ == '__main__':
    print(main(map(int, input().split(' '))))

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
if a >= b:
  print(a)
else:
  print(b)

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
if a == b or a > b:
  print(a)
else:
  print(b)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  a, b = map(int, input().split())
  if a >= b:
    print(a)
  elif a < b:
	print(a-1)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  a, b = map(int, input())
  if a >= b:
    print(a)
  elif a < b:
    print(b)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if a=>b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a,b = map(int, iput().split())
print(a if a<=b else a-1)

Submission status: Runtime Error

Solution code:
#14:23
a,b = map(int,input())
if b >= a:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
A,B = map(int,input())

res = 0
if A>B:
    res = A-1
else:
    res = A
print(res)

Submission status: Runtime Error

Solution code:
a=list(mao(int,input().split()))
if a[1]>=a[0]:
    print(a[0])
else:
    print(a[0]-1)

Submission status: Runtime Error

Solution code:


endday = [31] * 12
endday[2] = 28
for i in [4,6,9,11]:
    endday[i] = 30

a, b = map(int, input().split())

res = 0
done = False
for m in range(1, 13):
    if done:
        break
    for d in range(1, endday[m] + 1):
        if m == d:
            res += 1
        if m == a and d == b:
            done = True
            break

print(res)

Submission status: Runtime Error

Solution code:
A,B = (int(_) for _ in input().split())

if a>=b:
    print(a-1)
else:
    print(b)

Submission status: Runtime Error

Solution code:
a,b=input().split();print(a if a=>b else int(a)-1)

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
K = int(input())
X = max(A, B, C)
print(A + B + C -X + X*2**K)

Submission status: Runtime Error

Solution code:
H,W=map(int,input().split())
S=[input()+'.'for _ in range(H)]+['.'*(W+2)]
print(('Yes','No')[any(S[y-1][x]==S[y+1][x]==S[y][x-1]==S[y][x+1]=='.'for y in range(H)for x in range(W)if S[y][x]=='#')])

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
print(a if b >= a else a-1)

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
print(a if b>=a else b)

Submission status: Runtime Error

Solution code:
a, b = list(input().split())
if a <= b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
x,y=map(int,input.split())
print(x if x>=y else x-1)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a > b:
  print(a -1)
elif:
  print(a)

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
if a<b:
    print(a-1)
else:
    print(a)

Submission status: Runtime Error

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

day = int(a)-1
if b >= a:
	day += 1
print(day)

Submission status: Runtime Error

Solution code:
if __name__=='__main__':
    a = input()
    b = input()

    day = int(a)-1
    if b >= a:
        day += 1
    print(day)

Submission status: Runtime Error

Solution code:
a, b = int(input().split())
print(a if a <= b else a - 1)

Submission status: Runtime Error

Solution code:
a, b = mao(int,input().split())
if a <= b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a, b = mao(int,input().split())
if a < b:
  print(a-1)
else:
  print(a)

Submission status: Runtime Error

Solution code:
a,b=map(int,inout().split())
if a <= b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
takahashi=[[1,1],[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10],[11,11],[12,12]]
ab = map(int,input().split())
for i in range(12):
  if takahashi[i][0] > ab[0] || (takahashi[i][0] = ab[0] && takahashi[i][1] > ab[1]):
    break
print(i-1)

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
K = int(input())

ans = A + B + C - max(A, B, C) * (K - 1) *2
  
print(int(ans))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
grid=[["."]*(a+2)]+[list("."+input()+".")for i in range(b)]+[["."]*(a+2)]
for s in range(1,1+a):
    for t in range(1,1+b):
        if grid[s][t]=="#" and all([grid[s+x][t+y]=="."for x,y in ([0,-1],[0,1],[1,0],[-1,0])]):
            print("No")
            exit()
print("Yes")

Submission status: Runtime Error

Solution code:
h, w = map(int, input().split())
S = [input() for i in range(h)]


picture = []
diff = [-1, 1]

for i_h in range(h):
    row = '...'
    for i_w in range(w):
        if S[i_h][i_w] == '.':continue
        else:
            for dh in diff:
                if (i_h+dh<0) or (i_h+dh>h-1):continue
                if S[i_h+dh][i_w] == '#':
                    row[i_w] = '#'
            for dw in diff:
                if (i_w+dw<0) or (i_w+dw<w-1):continue
                if S[i_h][i_w+dw] == '#':
                    row[i_w] = '#'
    picture.append(row)
    
if picture == S:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
a, b = map(int, input())

if a < b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
if (a <= b):
  print(a)
else:
  print(a - 1)

Submission status: Runtime Error

Solution code:
a, b = input().split()
print(a if a <= b elif a > b a - 1)

Submission status: Runtime Error

Solution code:
a, b = input().split()
if a <= b:
    print(a)
else:
    print(a-1)

Submission status: Runtime Error

Solution code:
cnt = 0
a, b = input().split()
d = int(a+b)
for i in l:
    if i <= d:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
a,b=map(int,input())
print(a) if b>=a else print(a-1)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())

print(a if a<=b else: a-1)

Submission status: Runtime Error

Solution code:
h,w=list(map(int,input().split()))
rows = [input() for i in range(h)]
grid = [list(row) for row in rows]

expanded_grid = []
expanded_grid.append(list('&'*(w+2)))
for row in rows:
    expanded_grid.append(list('&'+row+'&'))
expanded_grid.append(list('&'*(w+2)))

judge = True

for i in range(h):
    for j in range(w):
        if (grid[i])[j] == '#':
            nearby = [
                
                (expanded_grid[i])[j+1],
                

                (expanded_grid[i+1])[j],
                (expanded_grid[i+1])[j+2],

                
                (expanded_grid[i+2])[j+1]
                
            ]   

            if nearby.count('#') == 0:
                judge = False


if judge:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
a,b = input().split()
if b<a:
    print(a)
else:
    print(a-1)

Submission status: Runtime Error

Solution code:
a, b = map(int, input())

if a < b:
    print(a)
else:
    print(a-1)

Submission status: Runtime Error

Solution code:
l=sorted(list(map(int,input().split())))
k=int(input())
#print(l,k)
l[2]=(2**k)*l[2]
print(sum(l))

Submission status: Runtime Error

Solution code:
N = int(input()) 
prime = [] 
def isprime(n):
    flag = 0
    for i in range(2,int(n**(1/2))+1):
        if n % i == 0:
            flag = 1
            break
    if n == 2:
        flag = 0
    if flag == 0:
        return True
    else:
        return False 
for i in range(1,55556):
    if isprime(i) and i%5==1:
        prime.append(i) 
ans = str(prime[1] )
for i in range(2,N+1):
    ans += " "+str(prime[i] )
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
prime = []

def isprime(n):
    flag = 0
    for i in range(2,int(n**(1/2))+1):
        if n % i == 0:
            flag = 1
            break
    if n == 2:
        flag = 0
    if flag == 0:
        return True
    else:
        return False
for i in range(1,55556):
    if isprime(i) and i%5==1:
        prime.append(i)
ans = ""
for i in range(1,N+1):
  ans += prime[i]
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

a = []

def is_prime(n):
    if (n % 2 == 0):
        return False

    for i in range(n - 2,1,-2):
        if (n % i == 0):
            return False

    return True

start = 5
for n in range(N):
    for i in range(start,555555,5):
        if (is_prime(i + 1)):
            a.append(i + 1)
            start = i + 5
            break

print(a)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split()))
print(a if a<=b else a-1)

Submission status: Runtime Error

Solution code:
a,b=map(int,input())
print(min(a,b))

Submission status: Runtime Error

Solution code:
a,b=map(int(input()).split());print([a-1,a][b>=a])

Submission status: Runtime Error

Solution code:
a,b=map(int(input()));print([a-1,a][b>=a])

Submission status: Runtime Error

Solution code:
a,b=map(int(input()));print(min(a,b)-1)

Submission status: Runtime Error

Solution code:
a, b, c = sorted(map(int, input().split()), reverse=True)
k = int(intput())
print(a*2**k + b + c)

Submission status: Runtime Error

Solution code:
h, w = (list)(map(int, input().split()))
l = [[lin for lin in input()] for _ in range(h)]

gri = [[0 for i in range(w+2)] for _ in range(h+2)]
for i in range(h+2):
    for j in range(w+2):
        if i == 0 or i == h+1 or j == 0 or j == w+1:
            gri[i][j] = '.'
        else:
            gri[i][j] = l[i-1][j-1]


for i in range(1, h+1):
    for j in range(1, w+1):
        if gri[i][j] == '#':
            if gri[i-1][j] == '.' and gri[i+1][j] == '.' and gri[i][j-1] == '.' and gri[i][j+1] == '.':
                print("No")
                exit(1)

print("Yes")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split(" "))
if a <= b:
  pritn(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if b < a:
  print(a-1)
else:
  pringt(a)

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
print(a if a <= b else a-1)

Submission status: Runtime Error

Solution code:
a, b =map(int,input().split())

if a < b-1:
print(a)

else:
print(a-1)

Submission status: Runtime Error

Solution code:
a,b =map(int,input().split())

if a<b-1:
print(a)

else:
print(a-1)

Submission status: Runtime Error

Solution code:
a, b =map(int,input().split())

if a<b-1:
print(a)

else:
print(a-1)

Submission status: Runtime Error

Solution code:
h,w = map(int,input().split())
ss = []
for i in range(h):
    ss.append(list(input()))

def search(i,j):
    c = 0

    if i != 0:
        if ss[i-1][j] == "#":
            c += 1
    if i != h-1:
        if ss[i+1][j] == "#":
            c += 1
    if j != 0:
        if ss[i][j-1] == "#":
            c += 1
    if j != w-1:
        if ss[i][j+1] == "#":
            c += 1

    if c > 0:
        return False
    else:
        return True
    

ans = "Yes" 
for i in range(h):
    for j in range(w):
        if ss[i][j] == "#":
            if search(i,j):
                ans = "No"
                break

print(ans)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split)
if a>b:
  print(a-1)
else:
  print(a)

Submission status: Runtime Error

Solution code:
a, b = map(int, input())

ans = a - 1 + (a == b)

Submission status: Runtime Error

Solution code:
ABC = list(map(int,input().split()))
K = int(input())
print(max(ABC) * 2**K + sum(ABC) - max(ABC))

Submission status: Runtime Error

Solution code:
a,b = [int(x) for x in input().split()]

if b =>a:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
import std.stdio, std.conv, std.string, std.algorithm;

void main()
{
auto ip = readln.split.to!(int[]);
auto x = 0;
if(ip[0] <= ip[1]){
  x += ip[0];
} else {
  x += ip[0] - 1;
}
  writeln(x);
}

Submission status: Runtime Error

Solution code:
N=int(input())
L=[11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,431,461,491,521,541,571,601,631,641,661,691,701,751,761,811,821,
  881,911,941,991,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451]

print(str(L[:N]))

Submission status: Runtime Error

Solution code:
H, W = map(int, input().split())
s_list = [input() for _ in range(H)]
ans = 'Yes'
for i in range(1, H - 1):
	for j in range(1, W - 1):
		if s_list[i][j] == '#' and s_list[i-1][j] == s_list[i+1][j] == s_list[i][j-1] == s_list[i][j+1] == '.':
			ans = 'No'
			break
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
list=[str(i) for i in [11, 31, 41, 61, 71, 101, 131, 151, 181, 191, 211, 241, 251, 271, 281, 311, 331, 401, 421, 431, 461, 491, 521, 541, 571, 601, 631, 641, 661, 691, 701, 751, 761, 811, 821, 881, 911, 941, 971, 991, 1021, 1031, 1051, 1061, 1091, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381]]
print(" ".join(list[:N]))

Submission status: Runtime Error

Solution code:
h,w = map(int, input().split())
# print(h,w)
row = []
for x in range(h):
    col = list(input())
    row.append(col)

out = "YES"

for x in range(h):
    for y in range (w):
        if row[x][y] == "#":
           #print(x,y)
            if  x > 0 and row[x-1][y] == "#":
                pass
            elif x < h-1 and row[x+1][y] == "#":
                pass
            elif y > 0 and row[x][y-1] == "#" :
                pass
            elif y < w-1  and row [x][y+1] == "#" :
                pass
            else:
                out = "NO"
                break
        pass

print(out)

Submission status: Runtime Error

Solution code:
a,b = list(map(int,input().split()))
 if a<=b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a,b = input().split()

int(a)
int(b)

if a<=b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a,b = input().split()

int a
int b

if a<=b:
  print(a)
else:
  print(a-1)

Submission status: Runtime Error

Solution code:
a,b=list(map(int, input().aplit()))
if a<=b:
    print(a)
else:
    print(a-1)