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: Accepted

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: Accepted

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: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S, T = input().split()
A, B = MAP()
U = input()

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

Submission status: Accepted

Solution code:
# ABC154a


def main():
    import sys
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S,T = input().split()
A,B = [int(i) for i in input().split()]
U = input()
if S == U:
    print(A-1,B)
else :
    print(A,B-1)

Submission status: Accepted

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

import sys
sys.setrecursionlimit(300000)


def solve(S: str, T: str, A: int, B: int, U: str):
    if S == U:
        A -= 1
    if T == U:
        B -= 1
    print(A, B)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    solve(S, T, A, B, U)

if __name__ == '__main__':
    main()

Submission status: Accepted

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: Accepted

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

Submission status: Runtime Error

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

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)
elif t == u:
    print(a, b - 1)

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 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 U=S:
  print(A-1,B)
else
  print(B,A-1)

Submission status: Runtime Error

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

flag = True
A = sorted(A)
for i in range(N-1):
  if A[i] == A[i+1]:
    flag = False
    break
if flag:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

for i in range(n-k+1):
  cnt = 0
  for j in range(i, i+k):
    cnt += (p[j] + 1)/2
    
  arr.append(cnt)
  
print(max(arr))

Submission status: Runtime Error

Solution code:
s, t = input().split()
a, b = map(int, input().split())
u = str(input())
 
if u = s:
  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 = str(input())

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

Submission status: Runtime Error

Solution code:
[H, A] = [int(i) for i in input().split()]
t = 0
if H/A != int(H/A):
    t = 1
print(int(H/A) + t)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
fn input_pair<T: std::str::FromStr + Copy> () -> (T, T) {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let arr: Vec<_> = s.trim().split_whitespace().flat_map(str::parse).collect();
    (arr[0], arr[1])
}

fn input_one<T: std::str::FromStr> () -> Result<T, T::Err> {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).unwrap();
    n.trim().parse()
}

fn main() {
    let st = input_one::<String>().unwrap();
    let st = st.split_ascii_whitespace().collect::<Vec<_>>();
    let (s, t) = (st[0].clone(), st[1].clone());
    let (a, b) = input_pair::<usize>();
    let u = input_one::<String>().unwrap();
    if u == s {
        println!("{} {}", a - 1, b);
    } else {
        println!("{} {}", 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(s-1 t)
else:
  print(s t-1)

Submission status: Runtime Error

Solution code:
s,t = map(str,input().split())
a,b = map(int,input().split())
u = int(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(str,input().split())
u = str(input())
if(u==s):
  print(a-1,b)
elif(u==t):
  print(a,b-1)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
P = [(int(x)+1)/2 for x in input().split()]

total=ans=sum(P[:K])
for n in range(K,N):
  total+=P[n]-P[n-K]
  ans=max(ans, total)

print(ans)

Submission status: Runtime Error

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

if S==U:
    A-=1
else:
    B-=1

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

Submission status: Runtime Error

Solution code:
S,T=map(input().split())
A,B=map(int,input().split())
U=input()
if U==S:
    A=A-1
else:
    B=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 U == S:
  print (A-1,B)
else:
  print (A,B-1)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
cc = list(map(int,input().split()))
dice_sum = sum(cc[:K])
max_dice = dice_sum
for i in range(N-K):
  dice_sum = dice_sum + cc[i+K] - cc[i]
  max_dice = max(max_dice,dice_sum)
print((max_dice+K)//2)

Submission status: Runtime Error

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

ind = S.index(U)

A[ind] -= 1

print("".join(A))

Submission status: Runtime Error

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

ind = S.index(U)

A[ind] -= 1

print("".join(A))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

# ABC154
#A Remaining balls
s, t = map(input().split())
a, b = map(int, input().split())
u = input()
if s == u:
    a = a - 1
else:
    b = b -1
print(a, b)

Submission status: Runtime Error

Solution code:
S,T = input().split()
A,B = int(input().split())
U = input()
if U == S:
  	print(A-1,B)
elif U == T:
    print(A,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,B)
elif T == U:
    print(A,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,B)
else:
    print(A,B-1)

Submission status: Runtime Error

Solution code:
x = [list(map(str, input().split())) for i in range(3)]
s = x[0][0]
t = x[0][1]
a = x[1][0]
b = x[1][1]
u = x[2][0]
if s == u:
  print(int(a)-1) print(int(b))
else:
  print(int(a)) print(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(A - 1)
elif T == U :
  print(B - 1)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if(U == S):
  print(A-1)
elif(T == U):
  print(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 s==u else print(a,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 s==i else print(a,b-1)

Submission status: Runtime Error

Solution code:
str = input().split(" ")
S = str[0]
T = str[1]
num = input().split(" ")
NS = int(num[0])
NT = int(num[1])
U = input()

if S == U:
  print(str(NS - 1) + " " + str(NT))
else:
  print(str(NS) + " " + str(NT - 1))

Submission status: Runtime Error

Solution code:
N,*a = map(int,open(0).read().split())
a.sort()
flag = True
for i in range(1,N):
  if a[i]==a[i-1]:
    print('NO')
    flag=False
    break
if flag ==True:
  print('YES')

Submission status: Runtime Error

Solution code:
p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)

Submission status: Runtime Error

Solution code:
p,q,r=map(int,input().split())
if p>=q and  p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(p+q)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S, T = 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:
while True:
    s,t = input().split()
    a,b = map(int, input().split())
    u = input()

    if u == s:
        a = a - 1
    if u == t:
        b = b - 1

    print(a,b)

Submission status: Runtime Error

Solution code:
s,t=input()
a,b=int(input())
u=input()
if s==u:
  print(s-1+' '+t)
else:
  print(s+' '+t-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if a == e:
  print("{} {}".format(c-1,d))
else:
  print("{} {}".format(c,d-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:
import sys
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = rl()
max_ = 0
for i in range(n-k+1):
  max_ = max(max_, sum(a[i:i+k]))
print((max_+k)/2)

Submission status: Runtime Error

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

if U == S:
  A -= 1
else:
  B -= 1

print(A, B)

Submission status: Runtime Error

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

for i in range(n - k):
  expected_value.append(expected_value[-1]-p[i]+p[i+k])
print((max(expected_value)+k)/2)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = [i in input().split()]
nums = [int(i) in input().split()]
thr = input()
if(thr == a[0]):
	nums[0] -= 1
else:
	nums[1] -= 1
print(nums[0],nums[1])

Submission status: Runtime Error

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

if U==S:
  print(A-1)
  print(B)
else:
  print(A)
  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)
else:
  print(a,b-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

flag = False
for i in range(1,N):
  if A[i] == A[i-1]:
    flag = True
    
if flag:
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

Solution code:
N=int(input())
A=sorted(list(map(int,input().split())))
flag = False
for i in range(1,N):
  if A[i] == A[i-1]:
    flag = True
if flag:
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
clr = input().split()
cnt = input().split()

d = {clr[i]: cnt[i] for i in range(0, len(clr))}

d[input()] -= 1

for key, val in d.items():
  print(val, end="")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if u == "red":
  print(int(s-1,t))
elif t == "blue":
  print(int(s, t-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:
S,T = input.split()
A,B = map(int, input().split())
U = input()

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

Submission status: Runtime Error

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

if u == w[0]:
  print(n[0]-1,n[1])
else:
  print(n[0],n[1]-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print((lambda x:((x[2]-1) if x[4] == x[0] else x[2]),((x[3]-1) if x[4] == x[1] else x[3]) )(input().split()+list(map(int,input().split()))+input()))

Submission status: Runtime Error

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

if u==s:
  print(a-1)
else:
  print(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 S ==U else A, B-1)

Submission status: Runtime Error

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

if s == u:
    a = a - 1
else:
    b = b - 1

print(a + ' ' + b)

Submission status: Runtime Error

Solution code:
S,T = input().split()
N,M = list(map(int, input().split()))
s = input()
print(f"{N-1} {M}" if s == S else f"{N} {M-1}")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S,T=map(input().split())
a,b=mao(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:
  prtin(a, b-1)

Submission status: Runtime Error

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

a = A - 1
b = B - 1

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

Submission status: Runtime Error

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

a = A - 1
b = B - 1

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

Submission status: Runtime Error

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

a = A - 1
b = B - 1

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

Submission status: Runtime Error

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

a = A - 1
b = B - 1

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

Submission status: Runtime Error

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

a = A - 1
b = B - 1

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

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=str(input(),split())
a,b=int(input(),split())
u=str(input())
if u==s:
  a-=1
else:
  b-=1
print(a,b)

Submission status: Runtime Error

Solution code:
s,t=input().split()
a,b=(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,t=map(str,input().split())
a,b=map(int,input().split())
ss=input()
if ss="s":
  a-=1
else:
  b-=1
print(a,b)

Submission status: Runtime Error

Solution code:
#! env/bin/local python3

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

balls = {
    s: a,
    t: b
}

balls[u] -= 1

print(f'{balls[s]} {balls[t]}')

Submission status: Runtime Error

Solution code:
#! env/bin/local python3

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

balls = {
    s: a,
    t: b
}

balls[u] -= 1

print(f'{balls[s]} {balls[t]}')

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 = input()
t = input()
a = int(input())
b = int(input())
u = input()
if s == a:
	print(a-1 b)
else:
  	print(a b-1)

Submission status: Runtime Error

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

print('YES' if len(set(a)==n) else 'NO')

Submission status: Runtime Error

Solution code:
from itertools import accumulate

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

p = list(accumulate(p))

ans = 0
for i in range(N - K):
    ans = max(ans, p[i + K]-p[i])

ans = (ans + K) / 2

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <stdio.h>
#include <string.h>

void readInt(int *x) {
	scanf("%d", x);
	return;
}
void readInts(int n, int arr[]) {
	int i;
	for (i=0;i<n;i++) {
		readInt(&arr[i]);
	}
}
void readChar(char *x) {
	scanf("%c", x);
	return;
}
void readChars(char x[]) {
	scanf("%s", x);
	return;
}
void printInts(int n, int *arr) {
	int i;
	for (i=0;i<n;i++) {
		printf("%d ", arr[i]);
	}
	printf("\n");
	return;
}

int main(int argc, char const *argv[])
{
	char s[11], t[11], u[11];
	int a, b;
	readChars(s);
	readChars(t);
	readInt(&a);
	readInt(&b);
	readChars(u);

	if (!strcmp(s,u)) {
		printf("%d %d\n", --a, b);
	}else{
		printf("%d %d\n", a, --b);
	}

	return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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)
else:
    print(B-1)

Submission status: Runtime Error

Solution code:
S, T = [i for i in input().split()]
A, B = map(int, input().split())
U = input()
if U == S:
    A -= 1
elif U == T:
    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 u == s:
	print(a-1,b)
elif u == t:
    print(a,b-1)
else:
    print(a,b)

Submission status: Runtime Error

Solution code:
s,t = map(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,K = map(int,input().split())
D = list(map(int,input().split()))
L = []
n = 0
l = 0
 
for p in range(N-K+1):
  for q in range(K):
    for r in range(D[p+q]+1):
      n = n + r
    f = n/D[p+q]
    l = l + f
    n = 0
  L.append(l)
  l = 0
 
print(max(L))

Submission status: Runtime Error

Solution code:
S, T = input().split()
A, B = (int(x) for x in input().split())
U = input()
print(A - int(S==U), B - int(T==U) if S == U or T == U)

Submission status: Runtime Error

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

for i in range(n):
    p[i] = (p[i]+1)/2

kset = 0
for j in range(k):
    kset += p[j] 

max = -10000
if n != k:
    for l in range(n-k):
        if kset >= max:
            max = kset
        kset = kset - p[l] + p[l+k]
else:
    max = kset
print(max)

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()
print(A-1, B if s==T else A, B-1)

Submission status: Runtime Error

Solution code:
#C++のコードを移植
def Expected_value(n):
    return n + 1

n,k = map(int, input().split())
a = input().split()
sm = 0
mx = 0
for i in range(n):
    if i <= k-1:
        sm += Expected_value(int(a[i]))
        mx = sm
    else:
        sm = sm + Expected_value(int(a[i])) - Expected_value(int(a[i-k]))
        mx = max(mx,sm)

print(mx/2)

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(s - 1 , t)
else:
    print(s, t - 1)

Submission status: Runtime Error

Solution code:
N,K=map(int, input().split())
A = list(map(int, input().split()))
B=0
for i in range(N-K+1):
    S = (sum(A[i:i+K])+K)/2
    if B<S:
        B=S
print(B)

Submission status: Runtime Error

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

s = 0

for j in range(K):
  s += p[j]
  
x = s

for k in range(N - K):
  t = s - p[k] + p[K + k]
  if s <= t:
    x = t
  else:
    pass
  s = t

print((x + K) / 2)

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()

dic = {s: a, t: b}
dic[u] -= 1
print(dic[s] + ' ' + dic[t])

Submission status: Runtime Error

Solution code:
import itertools
n,k = map(int,input().split())
p = list(map(int,input().split()))
acc =[0]+ list(itertools.accumulate([x for x in p]))
 
 
ans=max(acc[i]-acc[i-k] for i in range(k,n+1))
answer=ans/2+k/2
print(answer)

Submission status: Runtime Error

Solution code:
import itertools
n,k = map(int,input().split())
p = list(map(int,input().split()))
acc = list(itertools.accumulate([x for x in p]))
 

ans=max(acc[i]-acc[i-k] for i in range(k-1,n))
answer=ans/2+k/2
print(answer)

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
p = list(map(int, input().split()))
 
for i in range(n-2):
  sump0=0
  sump=p[i]+p[i+1]+p[i+2]
  if sump>smp0:
    sum0=sump
    
print(sum0/2+k/2)

Submission status: Runtime Error

Solution code:
k = map(int, input().split())
p = list(map(int, input().split()))
 
for i in range(n-2):
  sump0=0
  sump=p[i]+p[i+1]+p[i+2]
  if sump>smp0:
    sum0=sump
    
print(int(sum0/2)+int(k/2))

Submission status: Runtime Error

Solution code:

n = int(input())
a = list(map(int, input().split()))
seta = set(a)
if len(a)==len(seta):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    seta = set(a)
    ans = 'YES' if len(a) == len(seta) else 'NO'
    print(ans)    
main()

Submission status: Runtime Error

Solution code:
 n = int(input())
 a = list(map(int, input().split()))
 seta = set(a)
 ans = 'YES' if len(a) == len(seta) else 'NO'
 print(ans)

Submission status: Runtime Error

Solution code:
s,t=input().split();a,b=map(int,input().split());print(f"{a-1} {b}" if s==input()else f"{a} {b-1}")

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
p=list(map(int,input().split()))
p_=[0]*N
for a in range(N):
    p_[a]=(1+p[a])/2
A=[]          
for i in range(N-K+1):
            A.append(sum(p_[i:i+K]))
print(max(A))

Submission status: Runtime Error

Solution code:
S,T = input().split()
a,b = list(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())
X,Y = map(int,input().split())
Z = input()
if S==Z or T==Z:
    print(X+Y-1)
else:
    print(X+Y)

Submission status: Runtime Error

Solution code:
S,T = map(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:
# coding: utf-8
# Your code here!
#########行列読み込み ##############################################
"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""
##################################################################
#########入力系####################################################
"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""
##################################################################
import numpy as np
l ={}
N,K = map(int,input().split())
#P = list(map(int,input().split()))
P = np.asarray(list(map(int,input().split())))
#print(P)
P_ = []
#print(P_)

def kitai(num):
    x = 0
    for j in range(num):
        x += num-j
    return x/num
for i in P:
    P_.append(kitai(i))
#print(type(P_))


#print(P)
for i in range(0,N-K+1):
    #print(P[i:i+K])
    l[sum(P_[i:i+K])]=i
#print(l)
max = max(l.keys())
print(max)
import sys
def input():
    return sys.stdin.readline()[:-1]

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
p = list(map(int,input().split()))
u = sum(p[0:k])
maxsum = u
for i in range(1, n-k+1):
	u = u + p[i+k-1] - p[i-1]
	if u >= maxsum:
		maxsum = u
print((maxsum+k)/2)

Submission status: Runtime Error

Solution code:
a,b=map(str,input().split())
c.d=map(int,input().split())
e=str(input())
if a==e:
    print(c-1,d)
else:
    print(c,d-1)

Submission status: Runtime Error

Solution code:
a,b=map(str,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:
a,b=map(str,input().split())
c.d=map(int,input().split())
e=input()
if c==e:
  print(c-1,d)
else:
  print(c,d-1)