Problem:


Score : 100 points

Problem Statement

Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.

Constraints

1\leq N,K\leq 100

N and K are integers.

Input

Input is given from Standard Input in the following format:

N K

Output

If we can choose K integers as above, print YES; otherwise, print NO.

Sample Input 1

3 2

Sample Output 1

YES

We can choose 1 and 3.

Sample Input 2

5 5

Sample Output 2

NO

Sample Input 3

31 10

Sample Output 3

YES

Sample Input 4

10 90

Sample Output 4

NO



Sample input:
3 2


Sample output:
YES

Submission status: Runtime Error

Solution code:
N, K = map(int(input().split()))
if N >= k * 2 - 1:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
if (n+1)/2>=k:
  print('YES')
else:
  print('')NO

Submission status: Runtime Error

Solution code:
N,K = map(int,list(input().replace(" ","")))
if K > N//2:
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

Solution code:
N,K=int(input().split())
if K>=K*2-1:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
n = 3
num_list = [list(map(int, input().split())) for _ in range(n)]
N = (sum(num_list, []))
N1 = N.count(1)
N2 = N.count(2)
N3 = N.count(3)
N4= N.count(4)
if N1 > 2 or N2 > 2 or N3 > 2 or N3 > 2 or N4 > 2:
    print('NO')
else:
    print('YES')

Submission status: Runtime Error

Solution code:
n,k=map(int,input())
if (n+1)//2>=k:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    N=[]
    for _ in range(3):
        a,b=map(int,input().split())
        N.append(a)
        N.append(b)
    N=Counter(N)
    NN=N.most_common(1)
    if NN[0][1]==3:
        print("NO")
    else:
        print("YES")


if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
if(N>=(2*(K-1)))
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

if int((n+1)/2)=>k:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,k = int(split(input()))
cnt=0
for i in range(1,n+1,2):
  cnt++

if k <= cnt:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,k = int(split(input()))
cnt=0
for i in range(1,n+1,2):
  cnt++

if (k<=cnt):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
if N>=2*K-1:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
if N>=2K-1:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
b = [0]*n
for i in range(n):
  if a[i]%2:
    b[i] = 1
  elif a[i]:
    b[i] = 2
DP = [[0 for i in range(5)] for j in range(n+1)]
for i in range(1,n+1):
  for j in range(5):
    for k in range(j,5):
      if k == 0 or k == 4:
        DP[i][k] = DP[i-1][j]+a[i-1]
      elif k == 1 or k == 3:
        DP[i][k] = DP[i-1][j]+abs(b[i-1]-2)
      else:
        DP[i][k] = DP[i-1][j]+abs(b[i-1]-1)
print(min(DP[n]))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
b = [0]*n
for i in range(n):
  if a[i]%2:
    b[i] = 1
  elif a[i]:
    b[i] = 2
DP = [[10**18 for i in range(5)] for j in range(n+1)]
for i in range(5):
    DP[0][i] = 0
for i in range(1,n+1):
  for j in range(5):
    for k in range(j,5):
      if k == 0 or k == 4:
        DP[i][k] = min(DP[i][k],DP[i-1][j]+a[i-1])
      elif k == 1 or k == 3:
        DP[i][k] = min(DP[i][k],DP[i-1][j]+abs(b[i-1]-2))
      else:
        DP[i][k] = min(DP[i][k],DP[i-1][j]+abs(b[i-1]-1))
print(min(DP[n]))

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
if n-k>=1:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
X=[0]*4
for i in range(3):
  A,B=map(int,input().split())
  X[A-1]+=1
  X[B-1]+=1
X.sort()
if(X[0]==1 and X[1]==1 and X[2]==2):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
#C when i hit my pocket
k,a,b=map(int,input().split( ))
if a>=(b-2):
    print(int(1+k))
else:
    if (k-a+1)%2==0:
        print(int(a+(b-a)*(k-a+1)/2))
    else:
        print(int(a+(b-a)*(k-a)/2+1))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(N: int, K: int):
 	from math import ceil
    if(ceil(N/2) >= K):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.5.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main(N, K):
    if N - 1 >= K:
        return 'YES'
    else:
        return 'NO'


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

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
print('YES' if n=>2*(k-1) else 'NO')

Submission status: Runtime Error

Solution code:
print("YNEOS"[::2])print("YNEOS"[eval(input().replace(" ","<")+"*2-1")::2])

Submission status: Runtime Error

Solution code:
n,k=map(int,input())
ans='NO'
if k<=(n+1)//2:
  ans='YES'
print(ans)

Submission status: Runtime Error

Solution code:
a,b = list(map(int, input().split()))
if a % 2 == 0:
  if a / 2 >= b:
    print("YES")
  else:
    print("NO")
else:
  if (a + 1) / 2 >= b:
    print("YES")
  else:
	print("NO")

Submission status: Runtime Error

Solution code:
print('YES' if (int(input()) + 1) // 2 > int(input()) else 'NO')

Submission status: Runtime Error

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

if n%2==0:
  if k>==n/2:
    print("YES")
  else:
    print("NO")
else:
  if K>=(n//2)+1:
    print("YES")
  else:
    print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())+1
a = int(input())
b = int(input())
print((n-a)*(n-b))

Submission status: Runtime Error

Solution code:
import(math)

a,b=map(int,input().split())
if math.ceil(a/2)>=b:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
k,a,b = map(int,input().split())
if b-a <= 2:
  print(k+1)
elif  a+1 >= k:
  print(k+1)
else:
  print(a+int((k+1-a)/2)*max(2,(b-a))+(k+1-a)%2)

Submission status: Runtime Error

Solution code:
def solution(edges):
    num_of_neighbor = {}
    for e in edges:
        if e[0] in num_of_neighbor:
            num_of_neighbor[e[0]] += 1
        else:
            num_of_neighbor[e[0]] = 1
        if e[1] in num_of_neighbor:
            num_of_neighbor[e[1]] += 1
        else:
            num_of_neighbor[e[1]] = 1
    n_2 = 0
    n_1 = 0
    for n in num_of_neighbor:
        if num_of_neighbor[n] == 2:
            n_2 += 1
        elif num_of_neighbor[n] == 1:
            n_1 += 1

        if n_2 == 2 and n_1 == 2:
            return 'YES'
        else:
            return 'NO'

e1 = [int(s) for s in input().split(' ')]
e2 = [int(s) for s in input().split(' ')]
e3 = [int(s) for s in input().split(' ')]
edges = [e1, e2, e3]
print(solution(edges))

Submission status: Runtime Error

Solution code:
def solution(N, K):
	x = 0
	if N%2:
      x = N/2
	else:
      x = (N-1) / 2
    return K<=x
N, K = [int(s) for s in input().split(' ')]
print(solution(N, K))

Submission status: Runtime Error

Solution code:
N, K = list(map(int, input().split()))
x = 0
if N%2:
  x = N/2
else:
  x = (N-1) / 2
return K<=x

Submission status: Runtime Error

Solution code:
N, K = list(map(int, input().split()))
  x = 0
  if N%2:
    x = N/2
  else:
    x = (N-1) / 2
   
  return K<=x

Submission status: Runtime Error

Solution code:
int main():
  x = 0
  if N%2:
    x = N/2
  else:
    x = (N-1) / 2
   
  return K<=x

Submission status: Runtime Error

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

IF (int(N/2)+1>K):
  print("YES")
ELSE:
  print("NO")

Submission status: Runtime Error

Solution code:
a,b=map(int, input().split())
from scipy.special import comb
print(comb(10**4, 100, exact=True)%(10**9+7))

Submission status: Runtime Error

Solution code:
input_string = input().split()

K = int(input_string[0])
A = int(input_string[1])
B = int(input_string[2])

if (A > B):
    print(K+1)
    
# y = -Ax + B(K-x)
# y = -Ax + BK - Bx
# y = -(A + B)x + BK

y = -(A + B)*0 + B*K + 1

print(y)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def error_mat_print(m):
    for r in m:
        print(r, file=sys.stderr)

def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(L, A):

    dp = [[sys.maxsize] * (L+1) for _ in range(5)]
    dp[0][0] = 0

    for i, a in enumerate(A):
        t = dp[0][i]
        dp[0][i+1] = t + a
        t = min(t, dp[1][i])
        dp[1][i+1] = t+ ((a%2) if a != 0 else 2)
        t = min(t, dp[2][i])
        dp[2][i+1] = t + ((a+1)%2)
        t = min(t, dp[3][i])
        dp[3][i+1] =t + ((a%2) if a != 0 else 2)
        t = min(t, dp[4][i])
        dp[4][i+1] = t + a


    return min([dp[i][L] for i in range(5)])

def main():
    L = read_int()
    A = [read_int() for _ in range(L)]
    print(slv(L, A))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N,K = map(int,input.split())
if N <= K :
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
#https://atcoder.jp/contests/yahoo-procon2019-qual/tasks/yahoo_procon2019_qual_d
#2019-02-11

#DP
L = int(input())
DP = [0 for i in range(5)]

def cost(a):
    if a:
        return [a, a%2, (a+1)%2, a%2, a]
    else:
        return [0, 2, 1, 2, 0]

for i in range(L):
    n = [min(DP[:i+1]) for i in range(5)]
    cos = cost(int(input()))
    DP[4] = n[4] + cos[4]
    DP[3] = n[3] + cos[3]
    DP[2] = n[2] + cos[2]
    DP[1] = n[1] + cos[1]
    DP[0] = n[0] + cos[0]

print(min(DP))

Submission status: Runtime Error

Solution code:

#DP
import numpy as np
L = int(input())
A = [int(input()) for i in range(L)]

DP = np.zeros(5, dtype = int)

def cost(a:int) -> np.array:
    if a:
        return np.array([a,a%2,(a+1)%2,a%2,a])
    else:
        return np.array([0,2,1,2,0])

for i in range(L):
    n  = np.array([np.min(DP[:i+1]) for i in range(5)])
    DP = n + cost(A[i])

print(np.min(DP))

Submission status: Runtime Error

Solution code:
#https://atcoder.jp/contests/yahoo-procon2019-qual/tasks/yahoo_procon2019_qual_d
#2019-02-10

#DP

L = int(input())
A = [int(input()) for i in range(L)]

DP = [[0 for i in range(5)] for j in range(L+1)]

def cost(s, a):
    if s == 0 or s == 4:
        return a
    elif s == 1 or s == 3:
        if a > 0:
            return a%2
        else:
            return 2
    else:
        return (a+1)%2

for i in range(L):
    a = A[i]
    DP[i+1][0] = min(DP[i][:1]) + cost(0, a)
    DP[i+1][1] = min(DP[i][:2]) + cost(1, a)
    DP[i+1][2] = min(DP[i][:3]) + cost(2, a)
    DP[i+1][3] = min(DP[i][:4]) + cost(3, a)
    DP[i+1][4] = min(DP[i][:5]) + cost(4, a)



print(min(DP[L]))

Submission status: Runtime Error

Solution code:
#https://atcoder.jp/contests/yahoo-procon2019-qual/tasks/yahoo_procon2019_qual_d
#2019-02-10

#DP

L = int(input())
A = [int(input()) for i in range(L)]

DP = [[0 for i in range(5)] for j in range(L+1)]

def cost(s, i, A):
    if s == 0 or s == 4:
        return A[i]
    elif s == 1 or s == 3:
        if A[i] > 0:
            if A[i]%2 == 0:
                return 0
            else:
                return 1
        else:
            return 2
    else:
        if A[i]%2 == 1:
            return 0
        else:
            return 1

for i in range(L):
    DP[i+1][0] = DP[i][0] + cost(0, i, A)
    DP[i+1][1] = min(DP[i][:2]) + cost(1, i, A)
    DP[i+1][2] = min(DP[i][:3]) + cost(2, i, A)
    DP[i+1][3] = min(DP[i][:4]) + cost(3, i, A)
    DP[i+1][4] = min(DP[i][:5]) + cost(4, i, A)



print(min(DP[L]))

Submission status: Runtime Error

Solution code:
N, K=input().split()

if (N+2)//3 >= K:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
l=[]
count=0
flg=0
n,k=map(int,input().split())
for i in range(1,n+1):
    l.append(i)
for i in range(1,len(l)):
    for j in range(i+1,len(l)+1):
        if j-i<=1:
            del l[j]
if k<=len(l):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
n,k = map(int,input().strip().split(' '))
c = 0
for i in range(n):
  if(!(i&1)):
    c+=1
if(c>=k):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
K,A,B = list(map(int,input().split()))
if A>=B-2:
    answer = K+1
elif A+1>K:
    answer=K+1
else:
  # gutyoku
    first = A
    rest = K - (A-1) - 2
    if rest%2==0:
        answer = (rest/2+1)*B - (rest/2)*A
    else:
        #print('else')
        answer = ((rest-1)/2+1)*B - ((rest-1)/2)*A+1
    
print(int(answer))

Submission status: Runtime Error

Solution code:
K,A,B = list(map(int,input().split()))
if A>=B-2:
    answer = K+1
else:
  # gutyoku
    first = A
    rest = K - A -1
    if rest%2==0:
        answer = (rest/2+1)*B - (rest/2)*A
    else:
        #print('else')
        answer = ((rest-1)/2+1)*B - ((rest-1)/2)*A+1
    
print(int(answer))

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split(" "))
b = b -1
if b==0:
  print("YES")
if (a-1)//b >=2:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n,k=map(int,input(),split())
if n%2==0:
    if n/2>=k:
        print('YES')
    else:
        print('NO')
else:
    if (n//2)+1>=k:
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

Solution code:
#coding:utf-8

I=raw_input()
n,k=map(int, I.split(" "))

def f(n):
    if n==3:return 2
    if n%2==0:return f(n-1)
    return f(n-1)+1

if f(n)>=k:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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


ans=1+K
count=0
count=(K-(A))//2
ANS=1+(K-2*count)+abs(A-B)*count

print(max(ANS,ans))

Submission status: Runtime Error

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


ans=1+K
count=0
count=(K-(A-1))//2
ANS=(K-2*count)+abs(A-B)*count

print(max(ANS,ans))

Submission status: Runtime Error

Solution code:
print('YES' if sum(divmod(int(input()), 2)) >= int(inpu()) else 'NO')

Submission status: Runtime Error

Solution code:
if n>=2*k-1:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
n = int(input())
target = [int(input()) for _ in range(n)]

zero = target.count(0)

if zero == 0:
    print(0)
elif zero == 1:
    if len(target[:target.index(0)]) > len(target[target.index(0)+1:]):
        print(sum(target[target.index(0)+1:]))
    else:
        print(sum(target[:target.index(0)]))

Submission status: Runtime Error

Solution code:
L = int(input())
A =[]
for i in range(L):
    A.append(int(input()))
def reader(x):
    s = 0
    for i in x:
        if i ==0:
            s = s -1
        else:
            s = s + i
    return s
j = 0
flag = 0
startpoint = []
endpoint = []
for i in A:
    j = j+1
    if i == 0:
        if flag ==1:
            endpoint.append(j-2)
            flag = 0
    else:
        if flag == 0:
            startpoint.append(j-1)
            flag = 1
menseki = []
for s in startpoint:
    for e in endpoint:
        menseki.append(reader(A[s:(e+1)]))
m = max(menseki)
real = reader(A)
print(real-m)

Submission status: Runtime Error

Solution code:
n, k= [int(i) for i in input().split()]
 
ls = list(range(1,n+1))
ls_l = []
j = 0

while j <= len(ls):
  ls_l.append(ls[j])
  j += 2
  
if len(ls_l) == k:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K >= 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco)

Submission status: Runtime Error

Solution code:
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K > 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco+1)

Submission status: Runtime Error

Solution code:
k,a,b = map(int,input().split())
bis = 1
if ((k <= 1) or (b <= a + 2)):
    print(1+k)
    exit()
else:
    bis = b
    k = k - (a + 1)
    if not k == 0:
        bis += int(k/2)+(b-a)+k%2
print(bis)

Submission status: Runtime Error

Solution code:
#!/usr/bin/python3

N, K = list(map(int, input().split()))
if N % K == 1:
    print("YES")
else:
    pritn("NO")

Submission status: Runtime Error

Solution code:
k,a,b = map(int,input().split())
bis = 1
if k<= 1 or b <= a + 2:
    print(1+k)
    exit()
else:
    bis = b
    k = k - (a + 1)
    if not k == 0:
        bis += int(k/2)+(b-a)+k%2
print(bis)

Submission status: Runtime Error

Solution code:
import math
K,A,B = map(int, input().split())
cookie = 0

if K < A + 1 or B - A <  A + 1 or B - A < 2:
    print(K + 1)

else:
    cookie = B
    K = K-A-1

    if K%2==0:
        cookie += (B-A)* math.floor(K/2)
        print(cookie)
    else:
        cookie += (B-A)*math.floor((K-1)/2)
        print(cookie + 1)

Submission status: Runtime Error

Solution code:
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K > 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
k,a,b = map(int, input().split())

if a >= b:
  print(k+1)
elif k==1:
  print(b)
elif k==2:
  print(b)
elif k<=a:
  print(k+1)
else:
  t=((k+1)//(a+2))
  r=(k+1)-t*(a+2)
  if a < (b-a):
    nn = (k+1)-a
    print(nn//2*(b-a)+a+((k+1)-a)%2) 
  else:
    print(max(t*b+r,k+1))

Submission status: Runtime Error

Solution code:
# C When I hit my pocket
k,a,b = map(int,input().split())

bis = 1

if k <= 1 or b <= a + 2:
    print(1 + k)
    exit()
else:
    bis = b
    k = k - ( a + 1)
    if not k == 0:
        bis += int(k / 2) * (b - a) + k % 2

print(bis)

Submission status: Runtime Error

Solution code:
K, A, B = map(int, input().split())
bis = 0
C = int(B/A)
D = int(K/A)
if C >= 2 and K>A:
  if K >= A*D+D:
    K -= A*D+D
    print(K+B*D)
  else:
    K -= A*(D-1)+D-1
    print(K+B*(D-1))
else:
  print(K+1)

Submission status: Runtime Error

Solution code:
# C When I hit my pocket
k,a,b = map(int,input().split())

bis = 1

if k <= 1 or b <= a + 2 or k - (a + 1) < 0:
    print(1 + k)
    exit()
else:
    bis = b
    k = k - ( a + 1)
    if not k == 0:
        bis += int(k / 2) * (b - a) + k % 2

print(bis)

Submission status: Runtime Error

Solution code:
K, A, B = map(int, input().split())
C = int(B/A)
D = int(K/A)
if C >= 2:
  if K >= A*D+D:
    K -= A*D+D
    print(K+B*D)
  else:
    K -= A*(D-1)+D-1
    print(K+B*(D-1))
else:
  print(K+1)

Submission status: Runtime Error

Solution code:
#!/usr/bin/python3

N, K = list(map(int, input().split()))
if N % K = 1:
    print("YES")
else:
    pritn("NO")

Submission status: Runtime Error

Solution code:
# C When I hit my pocket
k,a,b = map(int,input().split())

bis = 1

#print(k - (a + 1))
if k <= 1 or b <= a + 2 or k - (a + 1) < 0:
    print(1 + k)
    #print('true')
    exit()
else:
    bis = b
    k = k - ( a + 1)
    if not k == 0:
        bis += int(k / 2) * (b - a) + k % 2

print(bis)

Submission status: Runtime Error

Solution code:
K, A, B = map(int, input().split())
bis = 0
C = int(B/A)
D = int(K/A)
if C >= 2:
  if K >= A*D+D:
    K -= A*D+D
    print(K+B*D)
  else:
    K -= A*(D-1)+D-1
    print(K+B*(D-1))
else:
  print(K+1)

Submission status: Runtime Error

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

need_turns = A + 1 + 1  # 交換に必要なターン
first_need_turns = need_turns - 1

if A + 2 > B or K < first_need_turns:  # 交換せずにビスケットを叩き続ける方が得
    print(1 + K)
    exit()

ans = B  # 一度交換した
K -= (need_turns - 1)

# print("{}, {}".format(K, ans))

while K >= 0:
    if ans >= A and K >= 2:
        ans += (B - A) * K / 2
        K = 0
    else:
        ans += 1
        K -= 1

print(ans)

Submission status: Runtime Error

Solution code:
K, A, B = map(int, input().split())
 
need_turns = A + 1 + 1  # 交換に必要なターン
first_need_turns = need_turns - 1
 
if A + 2 > B or K < first_need_turns:  # 交換せずにビスケットを叩き続ける方が得
    print(1 + K)
    exit()
 
ans = B  # 一度交換した
K -= (need_turns - 1)
 
# print("{}, {}".format(K, ans))
 
while K > 0:
    if ans >= A and K >= 2:
        ans += (B - A) * K / 2
        K = K % 2
    else:
        ans += 1
        K -= 1
 
print(ans)

Submission status: Runtime Error

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

need_turns = A + 1 + 1  # 交換に必要なターン
first_need_turns = need_turns - 1

if A + 2 > B or K < first_need_turns:  # 交換せずにビスケットを叩き続ける方が得
    print(1 + K)
    exit()

ans = B  # 一度交換した
K -= (need_turns - 1)

# print("{}, {}".format(K, ans))

while K > 0:
    if ans >= A and K >= 2:
        ans += (B - A) * K / 2
        K = K % 2
    else:
        ans += 1
        K -= 1

print(ans)

Submission status: Runtime Error

Solution code:
n, k= [int(i) for i in input().split()]
 
i = 1
ls = []
while j > n:
  ls.append(ls)
  j += 2
  
if len(ls) == k:
  print(YES)
else:
  print(NO)

Submission status: Runtime Error

Solution code:
n, k= [int i for i in input().split()]
 
i = 1
ls = []
while j > n:
  ls.append(ls)
  j += 2
  
if len(ls) == k:
  print(YES)
else:
  print(NO)

Submission status: Runtime Error

Solution code:
# https://yahoo-procon2019-qual.contest.atcoder.jp/tasks/yahoo_procon2019_qual_c


K, A, B = map(int, input().split())

need_turns = A + 1 + 1  # 交換に必要なターン
first_need_turns = need_turns - 1

if A + 2 > B or K < first_need_turns:  # 交換せずにビスケットを叩き続ける方が得
    print(1 + K)
    exit()

ans = B  # 一度交換した
K -= (need_turns - 1)

# print("{}, {}".format(K, ans))

while K > 0:
    if ans >= A and K >= 2:
        ans += (B - A) * K / 2
        K = 0
    else:
        ans += 1
        K -= 1

print(ans)

Submission status: Runtime Error

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

i = 1
ls = []
while i > n:
  ls.append(ls)
  i += 2
  
if len(ls) == k:
  print(YES)
else:
  print(NO)

Submission status: Runtime Error

Solution code:
K, A, B = map(int, input().split())
if A + 2 > B:
    print(K+1)
    exit()


bis = 0
K = K - (A+1)
bis = B

if B - A >= 2:
    if K > 1:
        k = K//2
        bis += (B-A)*k

    if K % 2 == 1:
        bis += 1

print(bis)

Submission status: Runtime Error

Solution code:
k,a,b=[int(p) for p in input().split()]
if(a+2>=b or (k)/(a+2)<1 or 2*a+2==b):
    print(k+1)
elif(2*a+2>b):
    print(1+k+(int((1+k)/(2*a-b+2)))*(b-a-2))
else:
    print(1+k+(int((1+k-a)/2))*(b-a-2))

Submission status: Runtime Error

Solution code:
l=int(input())
a=[]
for k in range(l):
    a.append(int(input()))
ans=9999
for i in range(l):
    for j in range(l):
        if i<j:
            for k in range(j-i+1):
                k+=i
                n=0
                m=0
                for t in range(k-i):
                    t+=i
                    if a[t] % 2 == 0:
                        n+=1
                    else:
                        m+=1
                for t in range(j-k+1):
                    t+=k
                    if a[t] % 2 == 0:
                        m+=1
                    else:
                        n+=1
                if ans>m:
                    ans=m
                if ans>n:
                    ans=n
print(ans)

Submission status: Runtime Error

Solution code:
k,a,b=[int(p) for p in input().split()]
if(a+2>=b or k/(a+2)<1 or 2*a+2==b):
    print(k+1)
elif(2*a+2>b):
    print(1+k+(int((1+k)/(2*a-b+2)))*(b-a-2))
else:
    print(1+k+(int((1+k-a)/2))*(b-a-2))

Submission status: Runtime Error

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

sum = 0
if a >= b:
    # A >= Bの場合
    sum = 1 + (k - 2) + (b - a) 
else:
    # A < B の場合
    diff = b - a
    if diff == 1:
        # a,bに１施行ずつ使い、それ以外は叩く、という選択
        sum = 1 + (k - 2) + 1
    elif diff == 2:
        # a,bに１施行ずつ使い、それ以外は叩く、という選択(a,bで + 2 なのでall叩くと同じスコア)
        sum = 1 + k
    else:
        # a->bコンボが利潤を生み続けるパターン
        print("a")
        k = 1 + k - a
        if k % 2 == 0:
            sum = a + ((diff) * (k / 2))
        else:
            # 最後1回はコンボができないので、叩くパターン
            print("b")
            sum = a + ((diff) * ((k - 1) / 2)) + 1

print(sum)

Submission status: Runtime Error

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

sum = 0
if a >= b:
    # A >= Bの場合
    sum = k + 1
else:
    # A < B の場合
    diff = b - a
    if diff == 1:
        sum = k + 1
    elif diff == 2:
        sum = k + 1
    else:
        # a->bコンボが利潤を生み続けるパターン
        k = 1 + k - a
        if k % 2 == 0:
            sum = a + ((diff) * (k / 2))
        else:
            # 最後1回はコンボができないので、叩くパターン
            sum = a + ((diff) * ((k - 1) / 2)) + 1

print(sum)

Submission status: Runtime Error

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

sum = 0
if a >= b:
    # A >= Bの場合
    sum = k + 1
else:
    # A < B の場合
    diff = b - a
    if diff == 1:
        sum = k + 1
    elif diff == 2:
        sum = k + 1
    else:
        # a->bコンボが利潤を生み続けるパターン
        k = 1 + k - a
        if k % 2 == 0:
            sum = a + ((diff) * (k / 2))
        else:
            # 最後1回はコンボができないので、叩くパターン
            print("b")
            sum = a + ((diff) * ((k - 1) / 2)) + 1

print(sum)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
num =[]
ans =0
for i in range(3):
    x,y = map(int,input().split(" "))
    num.append(x)
    num.append(y)
for i in range(1,5):
    if num.count(i)==3:
        ans +=1
if ans>0:
    print("NO")
else:
    print("YES")

Submission status: Runtime Error

Solution code:
n,A,B=map(int,input().split())
if A+2>=B:
  ans=bis+n
else:

  print("A n",A,n)
  if (n+1)>=(A+2):
    en+=(n+1)//(A+2)
    n-=en*(A+2)-1
    print(bis,en,n)
    #交換
    bis=en*B
    en=0
    print("交換",bis,en,n)
  if n==0:
    ans=bis
  else:
    ans=bis+n
  
print(ans)

Submission status: Runtime Error

Solution code:
print("N")
N=int(input())
print("K")
K=int(input())
if 2*(K-1)<=N :
    print("YES")
else :
    print("NO")

Submission status: Runtime Error

Solution code:
from math import factorial
n,k=map(int,input().split())
print(["NO","YES"][factorial(n)/factorial(k)-(n-1)*factorial(n-2)/factorial(k-2)>1])

Submission status: Runtime Error

Solution code:
import math
import copy
import bisect








def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input().split())

def func():
    if n[2]-n[1]<2:
        return 1+n[0]
    if n[1]-1>=n[0]:
        return 1+n[0]

    result=n[1]
    ret=n[0]+1-n[1]
    if ret%2==0:
        return result+ret/2*(n[2]-n[1])
    return 1+result+(ret-1)/2*(n[2]-n[1])
    
print(int(func()))

Submission status: Runtime Error

Solution code:
n, k = input()
re = ""
if n - k > 0:
    re="YES"
else:
    re="NO"
print(re)

Submission status: Runtime Error

Solution code:
n = input("")
n = int(n)
k = input("")
k = int(k)
m = k-n+1:
if n>m
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
n = input("")
n = int(n)
k = input("")
k = int(k)
if n>k-n+1:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
n, k = input()
re = ""
if n - k > 0:
    re.jpin("YES")
else:
    re.jpin("NO")
print(re)

Submission status: Runtime Error

Solution code:
i = list(map(int, input().split()))
n = i[0]
k = i[1]

if n >= 1 and n <= 100 and k >= 1 and k <= 100:
  if n > 2:
    if n % 2 == 1:
      if n / k >= 1:
        print("YES")
      elif n % k == 1:
        print("YES")
      else:
        print("NO")
    else:
      if n / k >= 2:
        print("YES")
      elif n % k == 0:
        print("YES")
      else:
        print("NO")
  else:
    print("NO")
else:

Submission status: Runtime Error

Solution code:
def Test(n,k):
    if n > 2 * k:
        res = "YES"
    else:
        count = 0
        res = "NO"
        for i in range(1,n + 1,2):
            count += 1
            if count == k:
                res = "YES"
    print(res)
    
if __name__ == '__main__':
    _N = input()
    _K = input()
    try:
        N = int(_N)
        K = int(_K)
        Test(N,K)
    except:
        print("Error")

Submission status: Runtime Error

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

if (2 * K - 1 <= N):
    print("YES")
else: 
    print("NO")

Submission status: Runtime Error

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

nn = 1
count_n = 1
while nn < n:
    nn += 2
    count_n += 1
    
if n,k == 2,2:
    print("NO")
elif count_n >= k:
    print("YES")
elif count_n < k:
    print("NO")

Submission status: Runtime Error

Solution code:
#失恋してメンタル死んでるのでコードもシンデマス

dic = {}
key = []
item = []

for i in range(3):
    a,b = map(int,input().split())
    dic[a] = b
    key.append(a)
    item.append(b)

for i in key:
    flag = True
    tmp_key = key
    tmp_item = item
    
    a = i
    while flag:
        if a in key:
          a = dic[a]
            tmp_key.remove(a)
            tmp_item.remove(dic[a])
            
        else:
            flag = False
        
    if len(tmp_item) == 0 and len(tmp_key) == 0:
        res = "YES"
        res_flag = False
if res_flag:
  res = "NO"

print(res)

Submission status: Runtime Error

Solution code:
n,k =list(map(int,input().split())
if k*2-1 > n:
    print("NO")
else:
    print("YES")

Submission status: Runtime Error

Solution code:
i = list(map(int, input().split()))
n = i[0]
k = i[1]

if n >= 1 and n <= 100 and k >= 1 and k <= 100:
  if n > 2:
    if n > k - 2:
      if n % 2 == 1:
        if n / k >= 1:
          print("YES")
        elif n % k == 1:
          print("YES")
        else:
          print("NO")
      elif:
        if n / k >= 2:
          print("YES")
        elif n % k == 0:
          print("YES")
        else:
          print("NO")
      else:
        print("NO")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")