Problem:


Score : 100 points

Problem Statement

We have A balls with the string S written on each of them and B balls with the string T written on each of them.

From these balls, Takahashi chooses one with the string U written on it and throws it away.

Find the number of balls with the string S and balls with the string T that we have now.

Constraints

S, T, and U are strings consisting of lowercase English letters.

The lengths of S and T are each between 1 and 10 (inclusive).

S \not= T

S=U or T=U.

1 \leq A,B \leq 10

A and B are integers.

Input

Input is given from Standard Input in the following format:

S T
A B
U

Output

Print the answer, with space in between.

Sample Input 1

red blue
3 4
red

Sample Output 1

2 4

Takahashi chose a ball with red written on it and threw it away.
Now we have two balls with the string S and four balls with the string T.

Sample Input 2

red blue
5 5
blue

Sample Output 2

5 4

Takahashi chose a ball with blue written on it and threw it away.
Now we have five balls with the string S and four balls with the string T.



Sample input:
red blue
3 4
red


Sample output:
2 4

Submission status: Runtime Error

Solution code:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if U = S: A-=1
else: B-=1
print(A,B)

Submission status: Runtime Error

Solution code:
S,T = map(str, input().split())
A,B = map(int, input().split())
U = input()

if U = S:
    print({}""{},(A-1)+B)
else:
    print({}""{},A+(B-1))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
print("YES") if len(A) == len(list(set(A))) else print("NO")

Submission status: Runtime Error

Solution code:
str_list = input().split()
str_dic = {str_list[0]:int(input()),str_list[1]:int(input())}

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * (n + 1)
ans = []
for i in range(n):
    l[i + 1] = l[i] + (p[i] + 1) / 2
for i in range(n - k + 1):
    ans.append(l[i + k] - l[i])
print(max(ans))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * n
ans = []
l[0] = (p[0] + 1) / 2
for i in range(1, n):
    l[i] = l[i - 1] + (p[i] + 1) / 2
for i in range(n - k):
    ans.append(l[i + k] - l[i])
print(max(ans))

Submission status: Runtime Error

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

if s==u:
	print((a-1)+' '+b)
elif t==u:
	print(a+' '+(b-1))

Submission status: Runtime Error

Solution code:
S = input()
S.replace()

ans = []

for i in range(1,len(s)):
    ans.append("x")

print("".join(ans))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N, K = map(int, input().split())
p = list(map(int, input().split()))
Exp = [0]*(N-K+1)
for i in range(N-K+1):
    x = 0
    for j in range(i, i+K):
        x += (sum(range(1, p[j]+1)))/p[j]
    Exp[i] = x
print(max(Exp))

Submission status: Runtime Error

Solution code:
S,T = map(input().split())
A,B = map(int,input().split())
U = input()
if(S==U):
  print(A-1,B)
else:
  print(A,B-1)

Submission status: Runtime Error

Solution code:
as. bs = map(str,input().split())
ci, di = map(int,input().split())
es = str(input())

if es == as:
  ca = ci - 1
  print(ca)
elif es == bs:
  da = di -1
  print(da)

Submission status: Runtime Error

Solution code:
#https://atcoder.jp/contests/abc154/tasks/abc154_c

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

for i in range(n-1):
    if a[i]==a[i+1]:
        print("NO")
        exit()

print("YES")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if len(set(A)) == N:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
S,T=map(lambda x: x, input().split())
A,B=int(input().split())
U=input()
L=[(S,A),(T,B)]
for l in L:
  x,y=l
  if x==U:
    print(y-1, end=" ")
  else:
    print(y, end=" ")

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    s,t = input().split()
    a,b = LI()
    d = {}
    d[s] = a
    d[t] = b
    u = input()
    d[u] -= 1
    print(d[s],d[t])
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
S, T = map(input().split())
A, B = map(int, input().split())
U = input()

print("A-1 B" if U == S else "A B-1")

Submission status: Runtime Error

Solution code:
S, T = map(input().split())
A, B = map(int, input().split())
U = input()

print(A-1 B if U == S else A B-1)

Submission status: Runtime Error

Solution code:
S, T = map(input().split())
A, B = map(int, input().split())
U = input()

print("A-1 B" if U == S else "A B")

Submission status: Runtime Error

Solution code:
S, T = map(input().split())
A, B = map(int, input().split())
U = input()

print(A-1 B if U == S else A B)

Submission status: Runtime Error

Solution code:
S, T = map(input().split())
A, B = map(int, input().split())
U = input()

print("S-1 T" if U == S else "S T-1")

Submission status: Runtime Error

Solution code:
S, T = map(input().split())
A, B = map(int, input().split())
U = input()

print(S-1 T if U == S else S T-1)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  string s, t, u;
  int a, b;
  cin >> s;
  cin >> t;
  cin >> a;
  cin >> b;
  cin >> u;

  if (u == s){
    cout << a - 1 << " " << b;
  }
  if (u == t){
    cout << a << " " << b - 1;
  }

}

Submission status: Runtime Error

Solution code:
S = str( input() )
T = str( input() )
A = int( input() )
B = int( input() )
U = str( input() )

if( S==U ):
    A-=1
if( T==U ):
    B-=1

print( str(A)+" "+str(B) )

Submission status: Runtime Error

Solution code:
def exp(x):
    exp=1/2*(x+1)
    return exp

n,k=map(int,input().split())
p=list(map(int, input().split()))
sum_list=[]
syokiti=0
for i in range(k):
    syokiti+=exp(p[i])
for i in range(1,n-k+1):
    syokiti=syokiti-exp(p[i])+exp(p[i+k])
    sum_list.append(syokiti)

print(max(sum_list))

Submission status: Runtime Error

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

if s==u:
  print( a-1,b)
else:
  print( a,b-1)

Submission status: Runtime Error

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

if s==u:
  print( str(a-1) +" "+ str(b) )
else:
  print( str(a) +" "+ str(b-1) )

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
  a[i]=(1+a[i])/2
x=[0]*(n+k-1)
for i in range(n):
  for j in range(i,i+k):
    x[j]+=a[i]
print('{:.10f}'.format(max(x)))

Submission status: Runtime Error

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


a = 123
b = 'abc'

print(f'{a} and {b}')
# print(f'{s} {t}')

# if s == u:
#     a-=1
#     print(f'{a} {b}')
# else:
#     b-=1
#     print(f'{a} {b}')

Submission status: Runtime Error

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

print(f'{s} {t}')

# if s == u:
#     a-=1
#     print(f'{a} {b}')
# else:
#     b-=1
#     print(f'{a} {b}')

Submission status: Runtime Error

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

print(f'{a} {b}')

# if s == u:
#     a-=1
#     print(f'{a} {b}')
# else:
#     b-=1
#     print(f'{a} {b}')

Submission status: Runtime Error

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

if s == u:
    a-=1
    print(f'{a} {b}')
else:
    b-=1
    print(f'{a} {b}')

Submission status: Runtime Error

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

if s == u:
    print(f'{a-1} {b}')
else:
    print(f'{a} {b-1}')

Submission status: Runtime Error

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

if s == u:
    print(f'{a-1} {b}')
else:
    print(f'{a} {b-1}')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = map(int, input().split())
U = int(input())

if S == U:
  print (str(A-1)+" "+str(B))
else:
  print (str(A)+" "+str(B-1))

Submission status: Runtime Error

Solution code:
S,T=map(str,input().split())
A,B=map(int,input().split())
U=input()
if U==S:
    A-=1
else:
    B-=1
print(f"{A} {B}")

Submission status: Runtime Error

Solution code:
n, k = list(map(int, input().split()))
p = list(map(int, input().split()))
exp = [sum([(pi + 1) / 2 for pi in p[i:i+k]]) for i in range(n-k+1)]
print(max(exp))

Submission status: Runtime Error

Solution code:
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k:
  print(x-1,y)
else:
  print(x,y-1)

Submission status: Runtime Error

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

if a == k:
  print(x-1,y)
else:
  print(x,y-1)

Submission status: Runtime Error

Solution code:
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k :
  print(x-1,y)
else
  print(x,y-1)

Submission status: Runtime Error

Solution code:
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k :
  print(x-1,y)
elif b == k :
  print(x,y-1)
else:
  print(x,y)

Submission status: Runtime Error

Solution code:
a,b = str(input().split())
x,y = int(input().split())
k = str(input())

if "a" == "k" :
  print(x-1,y)
elif "b" == "k" :
  print(x,y-1)
else:
  print(x,y)

Submission status: Runtime Error

Solution code:
a,b = str(input().split())
x,y = int(input().split())
k = str(input())

if a == k :
  print(x-1,y)
elif b == k :
  print(x,y-1)
else:
  print(x,y)

Submission status: Runtime Error

Solution code:
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N+1):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0
for i in range(n-k+1):
    e = 0
    for j in range(0,k):
        e += (0.5*(p[i+j]+1))
    ans = max(ans,e)
print(ans)

Submission status: Runtime Error

Solution code:
inputted = input().split()
S = inputted[0]
T = inputted[1]
inputted = list(map(int, input().split()))
A = inputted[0]
B = inputted[1]
U = input()

A2 = A - 1 if U == S else A
B2 = B - 1 if U == T else B

output = A2 + ' ' + B2

print(output)

Submission status: Runtime Error

Solution code:
s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())
if u == s:
  print(int(a-1) int(b))
else:
  print(int(a) int(b-1))

Submission status: Runtime Error

Solution code:
S,T = input().split()
A,B = map(int,input().split())
U = input()

if S == U:
  print({},{}).format(A-1,B)
else:
  print({},{}).format(A,B-1)

Submission status: Runtime Error

Solution code:
S,T = input().split()
A,B = map(int,input().split())
U = input()

if S == U :
    print(f"{A-1} {B}")
else :
    print(f"{A} {B-1}")

Submission status: Runtime Error

Solution code:
from sys import stdin

def slove():
    S, T = stdin.readline().rstrip().split()
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    U = input()

    if S == U:
        print(A-1, B)
    else T == U:
        print(A, B-1)
    else:
        print(A, B)


slove()

Submission status: Runtime Error

Solution code:
mod = 10**9 + 7
from collections import deque

def main():
    N = iip(False)
    K = iip(False)
    ret = solve(N, K)
    print(ret)

def solve(N, K):

    strn = str(N)

    A = []
    B = []

    for i in range(len(strn), 0, -1):
        if strn[len(strn)-i] != "0":
            A.append(int(strn[len(strn)-i]))
            B.append(i)


    if K == 1:
        return 9*(B[0]-1) + A[0]


    if K == 2:
        if len(strn) < 2:
            return 0
        ret = 0
        ret += (B[0]-1) * (B[0]-2) // 2 * (9**2) #桁数がmaxじゃない場合
        ret += (A[0]-1) * 9 * (B[0]-1) #桁数がmaxで先頭桁がmax以外の場合
        if len(B) >= 2 and len(A) >= 2:
            ret += (B[1]-1) * 9 + A[1] #先頭桁がmaxの場合
        return ret

    ret = 0
    ret += (B[0] - 1) * (B[0] - 2) * (B[0] - 3) // 6 * 9**3 #桁数がmaxじゃない場合
    ret += (A[0] - 1) * (B[0] - 1) * (B[0] - 2) // 2 * 9**2 #桁数がmaxで先頭桁がmaxじゃない場合

    #以下、桁数はmaxで先頭桁はmaxとする
    if len(strn) < 3:
        return 0
    if len(B) >= 2:
        ret += (B[1]-1) * (B[1]-2) // 2 * 9**2 #有効2桁目の桁数がmaxじゃない場合
    if len(B) >= 2 and len(A) >= 2:
        ret += (A[1] - 1) * (B[1]-1) * 9 #有効2桁目の桁数がmaxで数字がmaxじゃない場合
    if len(B) >= 3 and len(A) >= 3:
    ret += (B[2] - 1) * 9 + A[2] #有効2桁目,3桁目がmaxの場合
    return ret


#####################################################ライブラリ集ここから

def split_print_space(s):
    print(" ".join([str(i) for i in s]))

def split_print_enter(s):
    print("\n".join([str(i) for i in s]))


def searchsorted(sorted_list, n, side):
    if side not in ["right", "left"]:
        raise Exception("sideはrightかleftで指定してください")

    l = 0
    r = len(sorted_list)

    if n > sorted_list[-1]:
        #print(sorted_list)
        return len(sorted_list)
    if n < sorted_list[0]:
        return 0

    while r-l > 1:
        x = (l+r)//2
        if sorted_list[x] > n:
            r = x
        elif sorted_list[x] < n:
            l = x
        else:
            if side == "left":
                r = x
            elif side == "right":
                l = x

    if side == "left":
        if sorted_list[l] == n:
            return r - 1
        else:
            return r

    if side == "right":
        if sorted_list[l] == n:
            return l + 1
        else:
            return l


def iip(listed):
    ret = [int(i) for i in input().split()]
    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def soinsuu_bunkai(n):
    ret = []
    for i in range(2, int(n**0.5)+1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):
    if n <=0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n-r+1, n+1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r+1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        #print(f"{n}C{r} = {ret}")
        pass
    return ret


def inv(n, mod):
    return power(n, mod-2)

def power(n, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p//2) ** 2) % mod
    if p % 2 == 1:
        return (n * power(n, p-1)) % mod


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
S, T = input().split()
a, b = map(int, input().split())
U = input().strip()
print(a - S == U, b - S == T)

Submission status: Runtime Error

Solution code:
S, T = map(int, input().split())
A, B = map(int, input().split())
if input() == S:
  print(A-1, B)
else:
  print(A, B-1)

Submission status: Runtime Error

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

if s == u:
    print(a-1,end="")
    print(b)
else:
    print(a,end="")
    print(b-1)

Submission status: Runtime Error

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

if s == u:
    print(a-1, b, end="")
else:
    print(a, b-1, end="")

Submission status: Runtime Error

Solution code:
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
 
N,K = Line[0],Line[1]
 
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
 
max_dice = 0
 
for i in range(N+1-K):
    # dices = sum(Line[i:i+K])
    dices = 0
    for z in range(K):
        dices += Line[z+i]
    # print(dices)
    if dices > max_dice:
        max_dice = dices
  
max_dice += K
 
print(max_dice/2)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = 0
for i in range(n-k):
    if i == 0:
        for j in range(k):
            candidate += (num_list[j]+1)/2
        tmp = candidate
    else:
        tmp += -(num_list[i-1]+1)/2 + (num_list[i+k]+1)/2
        if tmp > candidate:
            candidate = tmp
        
print(candidate)

Submission status: Runtime Error

Solution code:
s,t=map(input().split())
a,b=map(int,input().split())
sum=a+b
u=input()
sum=sum-1
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if s, t == u:
  print(a + b - 1)
else:
  print(a + b)

Submission status: Runtime Error

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
s,t=iim()
a,b=iim()
u=ii()

if u == s:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Runtime Error

Solution code:
S, T = list(input().split())
A, B = list(map(int, input().split()))
U = input()
dict = {}
dict[S] = A
dict[T] = B
dict[U] -= 1
print(f"{dict[S]} {dict[T]}")

Submission status: Runtime Error

Solution code:
s, t = [input().split()]
red_balls, blue_balls = [int(x) for x in input().split()]
thrown_ball = input()
  
if thrown_ball == "red":
  red_balls -= 1
elif thrown_ball == "blue":
  blue_balls -= 1
else:
  print("Wrong!")
  
print(red_balls + " " + blue_balls)

Submission status: Runtime Error

Solution code:
s, t = [input().split()]
red_balls, blue_balls = [int(x) for x in input().split()]
thrown_ball = input()

if thrown_ball == "red":
  red_balls -= 1
elif thrown_ball = "blue":
  blue_balls -= 1
else:
  print("Wrong!")
 
print(red_balls + " " + blue_balls)

Submission status: Runtime Error

Solution code:
(s,t),(a,b),u=input().split(),map(int,input().split()),input();print(a-(s==u),b-(t--u))

Submission status: Runtime Error

Solution code:
(s,t)=input().split()
a=input()
(n,m)=list(map(int,a))
u=input()
if u==s:
  print(n-1,m)
elif u==t:
  print(n,m-1)

Submission status: Runtime Error

Solution code:
_S, _T = input().split()
A, B = list(map(lambda x:int(x)), input().split())
U = input()


if U == A:
    is_type_A = True
else:
    is_type_A = False

if is_type_A:
    print(A - 1, B)
else:
    print(A, B-1)

Submission status: Runtime Error

Solution code:
S,T=map(int,input().split())
A,B=map(int,input().split())
U=input()
if U=S:
  print("{} {}".format(A-1,B))
if U=T:
  print("{} {}".format(A,B-1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
N = int(input())
A = input().split(' ')

c = max(collections.Counter(A).values())
if c == 1:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

Solution code:
N, K = map( int, input().split() )
ps = list( map( int, input().split() ) ) 
s=sum(ps[0:K])
ans=s
for i in range( 1, N-K+1 ) :
  s = s + ps[i-1+K] - ps[i-1]
  if s > ans:
    ans=s
print( (ans+K)/2 )

Submission status: Runtime Error

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

if S == u:
  print(a-1, b)
else:
  print(a, b-1)

Submission status: Runtime Error

Solution code:
import math
import sys

comb=[0,0,0,1,3,6,10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431, 1485, 1540, 1596, 1653, 1711, 1770, 1830, 1891, 1953, 2016, 2080, 2145, 2211, 2278, 2346, 2415, 2485, 2556, 2628, 2701, 2775, 2850, 2926, 3003, 3081, 3160, 3240, 3321, 3403, 3486, 3570, 3655, 3741, 3828, 3916, 4005, 4095, 4186, 4278, 4371, 4465, 4560, 4656, 4753, 4851, 4950]
n=int(input())
k=int(input())
s=str(n)
L=len(s)

ans=0
if n<k:
    ans=0

elif k==1:
    for i in range(L):
        for a in range(1,10):
            if a*(10**i)<=n:
                ans+=1

elif k==2:
    for i in range(1,L):
        for j in range(i):
            for a in range(1,10):
                for b in range(1,10):
                    if a*(10**i)+b*(10**j)<=n: ans+=1


elif k==3 and L<4:
    for a in range(1,10):
        for b in range(1,10):
            for c in range(1,10):
                if a*100+b*10+c<=n: ans+=1

elif k==3 and L>=4:
    for i in range(L):
        ans+=comb[i]
    ans*=9**3
    ans+=comb[L]* 81 * (int(s[0])-1) #1桁目 1-int(s[0])-1
    if int(s[1])>0:
        ans+=comb[L-1]*81
        ans+=(L-2)*9*(int(s[1])-1)


    m=int(s[2:])

    for i in range(L-1):
        for a in range(1,10):
            if a*(10**i)<=m: ans+=1
                

print(ans)

Submission status: Runtime Error

Solution code:
import math
import sys

comb=[0,0,0,1,3,6,10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431, 1485, 1540, 1596, 1653, 1711, 1770, 1830, 1891, 1953, 2016, 2080, 2145, 2211, 2278, 2346, 2415, 2485, 2556, 2628, 2701, 2775, 2850, 2926, 3003, 3081, 3160, 3240, 3321, 3403, 3486, 3570, 3655, 3741, 3828, 3916, 4005, 4095, 4186, 4278, 4371, 4465, 4560, 4656, 4753, 4851, 4950]
n=int(input())
k=int(input())
s=str(n)
L=len(s)

ans=0
if n<k:
    ans=0

elif k==1:
    for i in range(L):
        for a in range(1,10):
            if a*(10**i)<=n:
                ans+=1

elif k==2:
    for i in range(1,L):
        for j in range(i):
            for a in range(1,10):
                for b in range(1,10):
                    if a*(10**i)+b*(10**j)<=n: ans+=1


elif k==3 and L<4:
    for a in range(10):
        for b in range(10):
            for c in range(10):
                if a*100+b*10+c<=n: ans+=1

elif k==3 and L>=4:
    a=0
    while True:
        a+=1

    for i in range(L):
        ans+=comb[i]
    ans*=9**3
    ans+=comb[L]* 81 * (int(s[0])-1) #1桁目 1-int(s[0])-1
    if int(s[1])>0:
        ans+=comb[L-1]*81
        ans+=(L-2)*9*(int(s[1])-1)


    m=int(s[2:])

    for i in range(L-1):
        for a in range(1,10):
            if a*(10**i)<=m: ans+=1
                

print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, a, b;
    cin >> n >> a >> b;
    int m = 1 << n;
    int d = a ^ b;
    if (__buitin_popcount(d) % 2 == 1) {
        cout << "NO" << endl;
        return 0;
    }
    cout << "YES" << endl;
    vector<int> res(m);

    for (int i = 0; i < m; i++) {
        cout << res[i] ^ a << " ";
    }
    cout << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
main = do
  [s, t] <- words <$> getLine
  [a, b] <- map read . words <$> getLine
  u <- getLine
  print $ f s a b u
  
f s a b u =
  if s == u
  then a - 1
  else b - 1

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

import numpy as np
def main():
    S,T = input().split()
    A,B = MAP()
    U = INT()

    if S == U:
        print(A-1,B)
    else:
        print(A,B-1)

    return

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

# a,b,c = map(int, input().split())
# n = int(input())
# a = list(map(int,input().split()))
s,t = input().split()
a,b = map(int, input().split())
u = int(input())
if u == s: print(a-1,b)
else: print(a,b-1)

Submission status: Runtime Error

Solution code:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

# a,b,c = map(int, input().split())
# n = int(input())
# a = list(map(int,input().split()))
s,t = input().split()
a,b = map(int, input().split())
u = int(input())
if u == s: print(a-1,b)
else: print(a,b-1)
print(ans)

Submission status: Runtime Error

Solution code:
S, T = input().split()
a, b = int(input.split())
U = input()
if str(S) == str(U):
  print(a-1)
else:
  print(b-1)

Submission status: Runtime Error

Solution code:
S, T = input().split()
a, b = int(input.split())
U = input()
if list(S) == list(U):
  print(a-1)
else:
  print(b-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

s = input()
t = input()

a = int(input())
b = int(input())

u = input()
if u == s:
    a -= 1
elif u == t:
    b -= 1
print(str(a) + ' ' + str(b))

Submission status: Runtime Error

Solution code:
s = input()
t = input()

a = int(input())
b = int(input())

u = input()
if u == s:
    a -= 1
elif u == t:
    b -= 1
print(a +" " + b)

Submission status: Runtime Error

Solution code:
import sys
A = list(map(int, input().split()))
N = int(input())

if len(A) == len(set(A)):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
s=input()
array=[]
array+=(int(x) for x in input().split())
array.sort()
def judge(array,s):
  for i in range(int(s)-1):
    if array[i] == array[i+1]:
        return "NO"
  return "YES"

print(judge(array,s))

Submission status: Runtime Error

Solution code:
s=input()
array=[]
array+=(int(x) for x in input().split())
array.sort()
def judge(array,s):
  for i in range(int(s)-1):
    if array[i] == array[i+1]:
        return "NO"
  return "YES"

print(judge(array,s))

Submission status: Runtime Error

Solution code:
s=input()
array=[]
array+=(int(x) for x in input().split())

def judge(array,s):
  for i in range(int(s)-1):
    if array[i] == array[i+1]:
        return True
  else:
    return False

print(judge(array,s))

Submission status: Runtime Error

Solution code:
s=input()
array=[]
array+=(int(x) for x in input().split())

def judge(array,s):
  for i in range(int(s)-1):
    if array[i] == array[i+1]:
        return True
  else:
    return False

print(judge(array,s))

Submission status: Runtime Error

Solution code:
s=input()
array=[]
array+=(int(x) for x in input().split())

def judge(array,s):
  for i in range(int(s)-1):
    print(array[i],array[i+1])
    if array[i] == array[i+1]:
        return True
  else:
    return False

print(judge(array,s))

Submission status: Runtime Error

Solution code:
name_a,name_b=(x for x in input().split())
a_count,b_count=(int(x) for x in input().split())
fetch_color=input()
 
if fetch_color==name_a:
  a_coount = a_count-1
elif:
  fetch_color==name_b
  b_count = b_count-1
print(a_count,b_count)

Submission status: Runtime Error

Solution code:
name_a,name_b=(x for x in input().split())
a_count,b_count=(int(x) for x in input().split())
fetch_color=input()

if fetch_color=name_a:
  a_coount = a_count-1
elif:
  fetch_color=name_b
  b_count = b_count-1
print(a_count,b_count)

Submission status: Runtime Error

Solution code:
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print('{0} {1}'.format(a,b))

Submission status: Runtime Error

Solution code:
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1

Submission status: Runtime Error

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

If a = e;
		print(c-1,d)
		
else;
		print(c,d-1)

Submission status: Runtime Error

Solution code:
S, T = input().split()
r, b = map(int, input().split())
N = input()

if S == N:
  r -= 1
elif T == N:
  b -= 1
  
 print(r, b)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
S,T=map(str,input().split())
U=input()
if S==U:
  print(A-1,B)
else:
  print(A,B-1)

Submission status: Runtime Error

Solution code:
S,T=map(str,input().split())
A,B=map(int,input().split())
U=input()

if S==U:
  print(A-1,B)
else:
  T==U:
    print(A,B-1)

Submission status: Runtime Error

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

pp=[0]*N
for i in range(N):
    pp[i]=(p[i]+1)/2
sum=0
for i in range(0,K):
    sum+=pp[i]
for i in range(0,N-K):
    sum=max(sum,sum-pp[i]+pp[i+K])
print(sum)

Submission status: Runtime Error

Solution code:
s,t=map(input().split())
a,b=map(input().split())
u=input()
if s==u:
    a-=1
else:
    b-=1
print(a+b)

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = map(int,input().split)
U = input()
 
if U == S:
    print(A-1 , B)
else:
    print(A , B-1)

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = map(int, input().split)
U = input()
 
if S == U:
    print(A-1 , B)
else:
    print(A , B-1)

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = map(int,input().split)
U = input()
 
if S == U:
    print(A-1 , B)
else:
    print(A , B-1)

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = map(int,input().split)
U = input()

if S == U:
    print(A-1 " " B)
else:
    print(A " " B-1)

Submission status: Runtime Error

Solution code:
S, T = map(input().split())
A, B = map(int,input().split)
U = input()

if S == U:
    print(A-1 " " B)
else:
    print(A " " B-1)

Submission status: Runtime Error

Solution code:
S, T, U = map(input().split())
A, B = map(int,input().split)

if S == U:
    print(S-1 " " T)
else:
    print(S " " T-1)