Problem:


Score : 100 points

Problem Statement

In AtCoder City, there are three stations numbered 1, 2, and 3.

Each of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.

To improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.

Determine if there is a pair of stations that will be connected by a bus service.

Constraints

Each character of S is A or B.

|S| = 3

Input

Input is given from Standard Input in the following format:

S

Output

If there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.

Sample Input 1

ABA

Sample Output 1

Yes

Company A operates Station 1 and 3, while Company B operates Station 2.

There will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.

Sample Input 2

BBA

Sample Output 2

Yes

Company B operates Station 1 and 2, while Company A operates Station 3.

There will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.

Sample Input 3

BBB

Sample Output 3

No

Company B operates all the stations. Thus, there will be no bus service, so print No.



Sample input:
ABA


Sample output:
Yes

Submission status: Runtime Error

Solution code:
N,B,R=map(int,input().split())
b=0
total=0

for i in range(10**100):
    total+=B
    b+=1
    if total>N:
        break
    total+=R
    if total>N:
        break
if B==0:
    print(0)

else:
    print(B*b-(total-N))

Submission status: Runtime Error

Solution code:
s = input()
if s=="AAA" | s=="BBB":
    print("No")
else: 
    print("Yes")

Submission status: Runtime Error

Solution code:
s = inputu()
if s[0] == s[1] and s[0] = s[2] and s[1] == s[2]:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
import math
A,B=map(int, input().split())
flag=False
for i in range(1250):
  A_X=math.floor(i*0.08)
  if(A_X==A):
    B_X=math.floor(i*0.10)
    if(B_X==B):
      print(i)
      flag=True
      break
if(flag==False):
  print(-1)

Submission status: Runtime Error

Solution code:
# import module
import sys
import math
import numpy as np

S = input()

if S.find(A) != -1 and S.find("B") != 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s=input()
print("No" if s="AAA" or s="BBB" else "Yes")

Submission status: Runtime Error

Solution code:
import math
A,B=map(int,input().split())
Amin=A/0.08
Amax=(A+1)/0.08
Bmin=B/0.1
Bmax=(B+1)/0.1

a=[]
b=[]
c=[]
"""
if int(Amin)==Amin:
    p=Amin
else:
    p=int(Amin)+1

if int(Bmin)==Bmin:
    q=Bmin
else:
    q=int(Bmin)+1
"""
p=int(Amin+1)
q=int(Bmin+1)
while p<=Amax:
    a.append(p)
    p+=1
while q<=Bmax:
    b.append(q)
    q+=1
for i in range(len(a)):
    if a[i] in b:
        c.append(a[i])
for i in range(len(b)):
    if b[i] in a:
        c.append(b[i])
if len(c)==0:
  print(-1)
else:
  print(min(c))

Submission status: Runtime Error

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

s=N//(A+B)
NA=N%(A+B)
if(A!=0):
  if(NA<A):
    sA=0
    sAG=NA
  else:
    sA=1
    sAG=0
else:
  sA=0
  sAG=0
print(s*A+sA*A+sAG)

Submission status: Runtime Error

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

s=N//(A+B)
NA=N-s*(A+B)
if(A!=0):
  if(NA//A>=1):
    sA=1
  else:
    sA=NA
else:
  sA=0
print(s*A+sA*A)

Submission status: Runtime Error

Solution code:
S=input()
if(len(Sset)==2):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
import bisect
import sys
mod=998244353
n=int(input())
if n==1: print(2);sys.exit()

l=[list(map(int,input().split())) for _ in range(n)]
l=sorted(l)
x=[l[i][0] for i in range(n)]
d=[l[i][1] for i in range(n)]
dp=[[0,0] for _ in range(n)]
dp[n-1]=[1,1]

for i in range(n-2,-1,-1):
    dp[i][0]=dp[i+1][0]+dp[i+1][1]
    if x[i]+d[i]<=x[i+1]: dp[i][1]=dp[i][0]
    elif x[i]+d[i]<=x[i+1]+d[i+1]: dp[i][1]=dp[i+1][1]
    else:
        p=bisect.bisect_right(x,x[i]+d[i])-1
        dp[i][1]=min(dp[p][1],dp[i+1][1])
    dp[i]=[x%mod for x in dp[i]]

print(sum(dp[0])%mod)

Submission status: Runtime Error

Solution code:
a=input()
if a=='AAA'or'BBB':
  print(No)
else:
  print(Yes)

Submission status: Runtime Error

Solution code:
def Main(S):
    return "Yes" if 'A' in S and 'B' in S else "No"
    
def main():
    S = str(input())
    print(Main(N))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
from collections import deque
s=deque(input())
q=int(input())
direction=1
for i in range(q):
  k=deque(input().split())
  if k[0]=='1':
    direction*=(-1)
  if k[0]=='2':
    if k[1]=='1':
      if direction==1:
        s.appendleft(k[2])
      else:
        s.append(k[2])
    if k[1]=='2':
      if direction==1:
        s.append(k[2])
      else:
        s.appendleft(k[2])
if direction==-1:
  s.reverse()
print("".join(list(s)))

Submission status: Runtime Error

Solution code:
x = str(input())

if x="AAA" or x="BBB":
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
a=input()
if a[1]==a[2]==a[3]:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
a=input()
if a[1]==a[2]==a[3]
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

if blue_count >= n:
  print(n)
elif blue_count + red_count > n:
  print(blue_count)
else:
  set_count = blue_count + red_count

  margin = 0
  if n % set_count == 0:
    c =  n // set_count
  else:
    c =  n // set_count
    margin = n % set_count

  # NOTE: あまり部分が 青 -> 赤 の途中である事を前提としてしまっているので変更が必要
  if margin > blue_count:
    margin = blue_count
    
  print(blue_count * c + margin )

Submission status: Runtime Error

Solution code:
import math

A, B = map(int, input().split())
ans = -1
a1 = math.ceil(A*12.5)
a2 = (A+1)*12.5

a = [i for i in range(a1, int(a2)) if i < a2]

b1 = B*10
b2 = (B+1)*10

b = list(range(b1, b2))

for i in a:
    if i in b:
        ans = i
        break

print(ans)

Submission status: Runtime Error

Solution code:
s = input()

if s = 'AAA' or 'BBB':
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
l = list(s)
for i in range(0,len(l)-1):
  if(l[i]!= l[i+1]):
    print("Yes")
    break()
  else:
    print("No")

Submission status: Runtime Error

Solution code:
s = input()
if s[1] == s[2] == s[3]:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

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

for i in range(1100):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        exit()
print(-1)

Submission status: Runtime Error

Solution code:
import math
#数値ひとつ
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき
#str = input()
#文字分割
A,B,C = input().split()

if A == B == C:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s = input()

if s == "AAA" or s -- "BBB":
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]

min_eight_ex_tax = float(A / 0.08)
max_eight_ex_tax = float((A + 1) / 0.08)
min_ten_ex_tax = int(B / 0.1)
max_ten_ex_tax = int((B + 1) / 0.1)

res = float(-1)
for x in range(min_ten_ex_tax, max_ten_ex_tax, 1):
    if min_eight_ex_tax <= x < max_eight_ex_tax:
        res = float(x)
        break
#print(min_eight_ex_tax, max_eight_ex_tax, min_ten_ex_tax, max_ten_ex_tax)
print(int(res))

Submission status: Runtime Error

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
  S = input()
  N = int(input())

  ans = ""
  for i in range(N):
    list = input().split()
    if list[0] == '1':
      S = S[::-1]
      continue
    if list[1] == '1':
      S = list[2] + S
      continue
    S += list[2]
  print(S)

if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
s=input()
dict1={}
for i in s:
	if i in dict1:
		dict1[i]+=1
	else:
		dict1[i]=0
if(dict1['A'] > 0 and dict1['B'] > 0):
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
x = input()
print(["Yes","No"][x == "AAA" | x == "BBB"])

Submission status: Runtime Error

Solution code:
import math
a,b=map(int,input().split())
flag=True
for i in range(10**6):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        flag=False
        exit()
if flag:
    print(-1)

Submission status: Runtime Error

Solution code:
A=input()
if A == AAA or A == BBB:
  print(No)
else:
  print(Yes)

Submission status: Runtime Error

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

if (a== b) and (a==c) and (b==C):
  ans = "No"
else:
  ans = "Yes"
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c = input().split()
print("No") if a == b and b == c and c == a else print("Yes")

Submission status: Runtime Error

Solution code:
S=input()
# Python3 program to Split string into characters 
def split(word): 
    return [char for char in word]  
def convert(s): 
  
    # initialization of string to "" 
    new = "" 
  
    # traverse in the string  
    for x in s: 
        new += x  
  
    # return string  
    return new 
      
      
# Driver code 
word = S
splits=split(S)
Q=int(input())
flipcounter=0
for i in range(0,Q):
  inputforround=input()
  if inputforround=='1':
    flipcounter=flipcounter+1
  else:
    T,F,C=map(str,inputforround.split())
    if (int(F)+flipcounter)%2==1:
      splits.insert(0,C)
    else:
      splits.append(C)
if flipcounter%2==1:
  splits.reverse()
ans=convert(splits)
print(ans)

Submission status: Runtime Error

Solution code:
N, A, B=map(int, input().split())
K=(N-N%(A+B))/(A+B)
ans=(K*A+min(A,N%(A+B))
print(int(round(ans)))

Submission status: Runtime Error

Solution code:
N, A, B=map(int, input().split())
ans=(N-N%(A+B))*A/(A+B)+min(A,N%(A+B))
print(int(round(ans)))

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
loop = N // (A + B)
amari = N % (A + B)
blue = A * loop + min(A, amari)
print(blue)

Submission status: Runtime Error

Solution code:
import sys
A,B = map(int,input().split())
if A<13:
  print(-1)
  sys.exit()
last = 2000

for i in range(last):
  mA = int(i*0.08)
  mB = int(i*0.10)
  print(mA,mB,i)

  
  if mA==A and mB==B:
    print("match")
    print(i)
    break
  if i==last-1:
    print("-1")

Submission status: Runtime Error

Solution code:
A,B = [int(i) for i in input().split()]

flag=0
for i in range(1,1050):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = i
        flag=1
        break

if flag==1:
    print(ans)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
j=0
for i in range(1,100001):
    if int(i*0.08) == A and int(i*0.1) == B:
        j =1
        ans = i
        break
if j == 1:
    print(ans)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
A,B = [int(i) for i in input().split()]

flag=0
for i in range(1,10000):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = i
        flag=1
        break

if flag==1:
    print(ans)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
A,B = [int(i) for i in input().split()]

flag=0
for i in range(1,10000):
    if int(i*0.08)==A and int(i*0.1)==B:
        ans = i
        flag=1
        break
if flag==1:
    print(ans)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
a = str(input())
q = int(input())
s = [input().split() for i in range(q)]
for i in range(q):
    if int(s[i][0]) == 1 and len(a)>1:
        a = a[::-1]
    elif int(s[i][0])== 2 and int(s[i][1])==1:
        a=s[i][2]+a
    else:
        a=a+s[i][2]
print(a)

Submission status: Runtime Error

Solution code:
s=int(input())
if s[0] == s[1] and s[1] == s[2] and s[0] == s[2]:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = list(input())
if S[0] == S[1] == S[2]:
  print("Yes)
else:
  print("No")

Submission status: Runtime Error

Solution code:
S = input()
c = S.count('A') 
if s == 3 or s == 0:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
if S==AAA or S==BBB:
	print("No")
else:
	print("Yes")

Submission status: Runtime Error

Solution code:
a = input()
 
if b(i == "A" for i in a) or b(i == "B" for i in a):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

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

que = []

for i in range(N//(A+B)+1):
    for j in range(A):
        que.append('b')
    for j in range(B):
        que.append('r')

count = 0
for i in range(N):
    if que[i] == 'b':
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
a=A+B
x=N//a
y=N%a
if y<=A:
    print(x*A+y)
else:
    print(x*(A+1))

Submission status: Runtime Error

Solution code:
S=str(input())

if S=='AAA' or S='BBB':
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s = str(input())

if s == "AAA" or S == "BBB":
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
ans = []

taxfree = A/0.08
while taxfree*0.08 < A+1:
    if B <= taxfree*0.1 < B+1:
        ans.append(int(taxfree))
        break
    taxfree += 1

taxfree = B/0.1
while taxfree*0.1 < B+1:
    if B <= taxfree*0.08 < A+1:
        ans.append(int(taxfree))
        break
    taxfree += 1

if len(ans) != 0:
    print(min(ans))
else:
    print(-1)

Submission status: Runtime Error

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


print( (n-1)*n/2+(m-1)*m/2)

Submission status: Runtime Error

Solution code:
S = input()
Q = int(input())
Q_list = [list(input().split()) for n in range(Q)]
front = [1, 0]

for _list in Q_list:
    if int(_list[0]) == 1:
        first = front[0]
        front[0] = front[1]
        front[1] = first
    else:
        if int(_list[1]) == 1:
            if front[0] == 1:
                S = _list[2] + S
            else:
                S = S + _list[2]
        else:
            if front[0] == 1:
                S = S + _list[2]
            else:
                S = _list[2] + S
if front[0] == 0:
    S = S[::-1]

print(S)

Submission status: Runtime Error

Solution code:
S = input()

if all(S == "A") or all(S == "B"):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
S=input()

if(S[1]==S[2]==S[3]):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
else:
  print('yes')

Submission status: Runtime Error

Solution code:
s=raw_input().split()
if s[0]==s[1] and s[0]!=s[2]:
  print "Yes"
elif s[0]==s[2] and s[0]!=s[1]:
  print "Yes"
elif s[1]==s[2] and s[1]!=s[0]:
  print "Yes"
elif s[1]==s[0] and s[1]!= s[2]:
  print "Yes"
elif s[2]==s[0] and s[2]!= s[1]:
  print "Yes"
elif s[2]==s[1] and s[2]!= s[0]:
  print "Yes"
else:
  print "No"

Submission status: Runtime Error

Solution code:
x,y= list(map(int, input().split()))
i = list(map(int, input().split()))
i.sort(reverse=True)
k=sum(i)
flag=0
for j in range(x):
    if i[j]<(k/(4*(j+1))):
        pass
    else:
        flag+=1
if flag!=y:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

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

if S[0] == S[1] and S[1] == S[2]:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
S = input()

if S[0] == S[1] = S[2]:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
(A,B)=map(int, input().split())
 
for x in range(10000):
    if (int(x*0.08)==A and int(x*0.1)==B):
        print(x)
        break
    else:
        print('-1')

Submission status: Runtime Error

Solution code:
S = input()

if S.count(A) >= 1 and S.count(B) >= 1 :
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
S = input()

if S.count(A) >= 1 and S.count(B) >= 0 :
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
import numpy as np
import sys
readline = sys.stdin.buffer.readline
N,A,B = map(int, readline().split())
R=A*(N//(A+B))+min(A,N%(A+B))
print(R)

Submission status: Runtime Error

Solution code:
S = input()

if len(set(list(S))) !BBA
= 1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
List=""
while len(List) < N:
    List=+="b"*A+"r"*B
if len(List) >= N:
  ans=List[:N]
  print(ans.count("b"))

Submission status: Runtime Error

Solution code:
S = input()
 
if S = "AAA":
    print("No")
elif S = "BBB":
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
S = input()

if S = "AAA":
  print("No")
elif S = "BBB":
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
if "A" ib S and "B" in S:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import math
A,B = map(int, input().split())
answerA = math.ceil(A/0.08)
answerAA = math.floor((A+1)/0.08)
answerB = math.ceil(B/0.1)
answerBB = math.floor((B+1)/0.1)
if answerA < answerB and answerAA >= answerB:
    print(answerB)
elif answerB < answerA and answerBB >= answerA:
    print(answerA)
elif answerB > answerAA:
    print("-1")
elif answerBB < answerA:
    print("-1")
elif answerA >= answerB and answerAA <= answerBB:
    print(answerA)
elif answerB >= answerA and answerBB <= answerAA:
    print(answerB)
else:
    print("-1")

Submission status: Runtime Error

Solution code:
√çS = str(input())
if S == 'AAA' or S=='BBB':
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
S=str(input())
if S==AAA or S==BBB:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define INF 1050000000
#define rep(i,n) for (int i = 0; i < (n); i++)
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    string s, flag="No";
    cin >> s;
    rep(i, ARRAY_LENGTH(s)-1){
        if (s[i]!=s[i+1]) flag = "Yes";
    }
    cout <<flag<< endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
S = list(input())
if S[0] == S[1] & S[1] == S[2]:
  print('No')
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
n = 0
m = 0
for i in range(N-1):
    n += N

for j in range(M-1):
    m += M
    
Nans = n//2
Mans = m//2
print(Nans + Mans)

Submission status: Runtime Error

Solution code:
n,a,b = map(int,input().split())
s = ''
length = len(s)
while len(s)<n:
  s += 'b'*a
  s += 'r'*b
  length = len(s)
print(s)
print(s.count('b'))

Submission status: Runtime Error

Solution code:
s = input()

if s.count("A") = 3 or s.count("B") = 3:
  print("No")
else :
  print("Yes")

Submission status: Runtime Error

Solution code:
s = input()

if s.count("A") = 0 or s.count("B") = 0:
  print("No")
else :
  print("Yes")

Submission status: Runtime Error

Solution code:
s = input()

if s.count("A") = 0 or s.count("B"):
  print("No")
else :
  print("Yes")

Submission status: Runtime Error

Solution code:
s = input()
if s[0] == n[1] and s[1] == s[2]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = input()
if S[0] == s[1] and s[1] == s[2]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = input()
if S == AAA or S == BBB:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
a = list(input().count("A"))
if a == 3:
  print("No")
elif a == 0:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
a = list(input().count("A"))
if a = 3:
  print("No")
elif a = 0:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
from Collections import Counter
s=input()
c=Counter(s)
if(len(c.keys())==1):
  print ("No")
else:
  print ("Yes")

Submission status: Runtime Error

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

ans = N // (A + B) * A
temp = N % (A + B)
if temp < A:
    ans += temp
else:
    ans += A
print(ans)

Submission status: Runtime Error

Solution code:
import math
tax1,tax2 = map(int,input().split())
tax_max1 = tax1+1 
if int(tax_max1%0.08) != 0:
    subtraction1 = int((tax_max1/0.08)) - math.ceil(tax1/0.08)
    store1 = []
    beggining1 = math.ceil(tax1/0.08)
    for num in range(subtraction1+1):
        price = beggining1 + num
        store1.append(price)
else:
    subtraction1 = int((tax_max1/0.08)-1) - math.ceil(tax1/0.08)
    store1 = []
    beggining1 = math.ceil(tax1/0.08)
    for num in range(subtraction1+1):
        price = beggining1 + num
        store1.append(price)
tax_max2 = tax2+1
subtraction2 = int((tax_max2/0.10)-1) - math.ceil(tax2/0.10)
store2 = []
beggining2 = math.ceil(tax2/0.10)
for num in range(subtraction2+1):
    price = beggining2 + num
    store2.append(price)
common = list(set(store1)&set(store2))
if len(common)>0:
    print(common[0])
else:
    print(-1)

Submission status: Runtime Error

Solution code:
S = input()
Q = int(input())
hanten = 1
front = []
back = []
for _ in range(Q):
    q = list(map(str, input().split()))
    if q[0]=='1':
        hanten *= -1
    else:
        if hanten==1:
            if q[1]=='1':
                front.append(q[2])
            else:
                back.append(q[2])
        else:
            if q[1]=='1':
                back.append(q[2])
            else:
                front.append(q[2])


if hanten==1:
    print(''.join(list(reversed(front)) + list(S) + back))
else:
    print(''.join(list(reversed(back+list(S)))+front))

Submission status: Runtime Error

Solution code:
# 未完成
import math
a = list(map(int, input().split()))

x = [a[0] / 0.08, (a[0] + 1) / 0.08]
y = [a[1] / 0.1, (a[1] + 1) / 0.1]
ans = [max([a[0] / 0.08, a[1] / 0.1]),
       min([(a[0] + 1) / 0.08, (a[1] + 1) / 0.1])]
if ((a[1] + 1) / 0.1 > (a[1] + 1) / 0.1) or (a[1] / 0.1 > (a[0] + 1) / 0.08):
    print(-1)
else:
    if math.ceil(ans[0]) > ans[1]:
        print(-1)
    else:
        print(math.ceil(ans[0]))

Submission status: Runtime Error

Solution code:
S = input()
Q = int(input())
for _ in range(Q):
    q = list(map(str, input().split()))
    if q[0]=='1':
        list(S).reverse()
        S = ''.join(S)
    else:
        if q[1]=='1':
            S = q[2] + S
        else:
            S = S + q[2]

print(S)

Submission status: Runtime Error

Solution code:
S = str(input())
print('Yes' if S[2]==S[3] and S[4]==S[5] else 'No')

Submission status: Runtime Error

Solution code:
=input()
if S=="BBB" or S=="AAA":
  print("No")
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
if S=+"BBB" or S=="AAA":
  print("No")
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = raw_input()
res = (S[0] == S[1] == S[2])
if res:
  print "No"
 else:
  print "Yes"

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
X = int((A/0.08)+0.5)
Y = int((B/0.1)+0.5)
min = 0

if X > Y:
    if int(X*0.1) == B:
        min = X
    else :
        min = -1
elif X < Y:
    if int(Y*0.08) == A:
        min = Y
    else :
        min = -1
else :
    min = X

print(min)

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
X = int((A/0.08)+0.5)
Y = int((B/0.1)+0.5)
min = 0
if X == Y:
    min = X
elif X > Y:
    if int(X*0.1) == B:
        min = X
    else :
        min = -1
elif X < Y:
    if int(Y*0.08) == A:
        min = Y
    else :
        min = -1
else :
    min = -1

print(min)

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
X = int((A/0.08)+0.5)
Y = int((B/0.1)+0.5)
min = 0
if X == Y:
    min = X
elif X > Y:
    if int(X*0.1) == B:
        min = X
    else :
        min = -1
elif X < Y:
    if int(Y*0.08) == A:
        min = Y
    else :
        min = -1

print(min)

Submission status: Runtime Error

Solution code:
a,b,c = map(input().split())
print("No" if a == b == c else "Yes")

Submission status: Runtime Error

Solution code:
S = input()

if S == "AAA" or S = "BBB":
  print(Yes)
else :
  print(No)

Submission status: Runtime Error

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

#int(ans*0.08) = A
#int(ans*0.10) = B

ans = 1
for b in range(10*B, 10*B+10):
    if int(b*0.08) == A:
        print(b)
        ans = 0
        break

if ans:
    print(-1)

Submission status: Runtime Error

Solution code:
S=input()
if S == AAA or BBB:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S=input()
if S = AAA or BBB:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
from math import floor

def dostuff():
    a, b = (int(x) for x in input().split(' '))

    x = b * 10
    # print(x)
    for i in range(x, x + 10):
        if floor(i * 0.08) == a:
            print(i)
            return
    print(-1)

dostuff()

Submission status: Runtime Error

Solution code:
from math import floor

def dostuff():
    a, b = (int(x) for x in input().split(' '))

    x = b * 10
    i = x
    for i in range(x, x + 10):
        if floor(i * 0.08) == a:
            print(i)
            return
    print(-1)

dostuff()

Submission status: Runtime Error

Solution code:
from math import floor

def dostuff():
    a, b = (int(x) for x in input().split(' '))

    x = b * 10
    # print(x)
    i = x
    for i in range(x, x + 10):
        if floor(i * 0.08) == a:
            print(i)
            return
    print(-1)

dostuff()

Submission status: Runtime Error

Solution code:
n = input()

if n == "AAA" or n "BBB":
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

Solution code:
def choose_2_from_n(n):
    return (n-1)*n/2
l1 = input().split()
[n,p] = [int(x) for x in l1]
s = input()
remainder_pre = [0 for i in range(p)]
for i in range(1,n+1):
    x = int(s[:i])
    a = x%p
    remainder_pre[a] = remainder_pre[a] + 1
out = remainder_pre[0]
for i in range(p):
    if remainder_pre[i] >= 2:
        out += choose_2_from_n(remainder_pre[i])
print(int(out))

Submission status: Runtime Error

Solution code:
def choose_2_from_n(n):
    return (n-1)*n/2
l1 = input().split()
[n,p] = [int(x) for x in l1]
s = input()
remainder_pre = [0 for i in range(p)]
for i in range(1,n+1):
    x = int(s[:i])
    remainder_pre[(x%p)] += 1
out = remainder_pre[0]
for i in range(p):
    if remainder_pre[i] >= 2:
        out += choose_2_from_n(remainder_pre[i])
print(int(out))

Submission status: Runtime Error

Solution code:
def choose_2_from_n(n):
    return (n-1)*n/2
l1 = input().split()
[n,p] = [int(x) for x in l1]
s = input()
remainder_pre = [0 for i in range(p)]
for i in range(1,n+1):
    x = int(s[:i])
    remainder_pre[x%p] += 1
out = remainder_pre[0]
for i in range(p):
    if remainder_pre[i] >= 2:
        out += choose_2_from_n(remainder_pre[i])
print(int(out))

Submission status: Runtime Error

Solution code:
import sys
s = sys.stdin.readline().rstrip()
q = int(sys.stdin.readline().rstrip())

for _ in range(q):
    t = sys.stdin.readline().rstrip()
    if t == '1':
        s = s[::-1]
    else:
        t, f, c = t.split()
        if f == '1':
            s = c + s
        else:
            s = s + c

print(s)

Submission status: Runtime Error

Solution code:
import math

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

pricemax_A = math.floor((A+1)/0.08)
pricemin_A = math.floor(A/0.08)

pricemax_B = math.floor((B+1)/0.1)
pricemin_B = math.floor(B/0.1)

if pricemin_A >= pricemax_B or pricemax_A =< pricemin_B:
    print(-1)
elif pricemin_A >= pricemin_B:
    print(pricemin_A)
elif pricemin_A < pricemin_B:
    print(pricemin_B)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
for x in range(10*B,10*B+10):
    if A*100/8<=x<A*100/8+100/8:
        print(x)
        exit()
print("-1")

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
for x in range(10*B,10*B+10):
    if A*100/8<=x<=A*100/8+100/8:
        print(x)
        exit()
print("-1")

Submission status: Runtime Error

Solution code:
s = input().split()
if s in 'A' and s in 'B':
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S=input()
if S[1]==S[2]==S[3]:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# /home/remina/PycharmProjects/atcoder/C-TaxIncrease.py
#
import math


def calc_notaxincluded_min_from_tax8(tax8: int) -> int:
    notaxincluded_min = int(tax8 / 0.08)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax8(tax8: int) -> int:
    notaxincluded_max = math.ceil((tax8 + 1) / 0.08)
    return notaxincluded_max


def calc_notaxincluded_min_from_tax10(tax10: int) -> int:
    notaxincluded_min = int(tax10 / 0.1)
    return notaxincluded_min


def calc_notaxincluded_max_from_tax10(tax10: int) -> int:
    notaxincluded_max = math.ceil((tax10 + 1) / 0.1)
    return notaxincluded_max


tax_8, tax_10 = map(int, input().split())
notax_min_from8 = calc_notaxincluded_min_from_tax8(tax_8)
notax_min_from10 = calc_notaxincluded_min_from_tax10(tax_10)
notax_max_from8 = calc_notaxincluded_max_from_tax8(tax_8)
notax_max_from10 = calc_notaxincluded_max_from_tax10(tax_10)

if (notax_min_from10 > notax_max_from8) or (notax_min_from8 > notax_min_from10):
    print(-1)
elif notax_min_from8 <= notax_min_from10:
    print(notax_min_from8)
else:
    print(notax_min_from10)

Submission status: Runtime Error

Solution code:
s=input()
if s[0]=s[1] and s[1]=s[2]:
  print("Yes"
else:
  print("No"

Submission status: Runtime Error

Solution code:
s = input()
if s = "AAA" or "BBB":
	print("No")
else:
	print("Yer")

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
count = n//(a+b)*a
add = min(n%(a+b),a)
sum = count + add
print(sum)

Submission status: Runtime Error

Solution code:
X = input()
Y = X.count("A")
Z = X.count("B")
if (Y == 3 or Z ==3):
  print("Yes")
else
  print("No")

Submission status: Runtime Error

Solution code:
X = input()
Y = X.count("A")
Z = X.count("B")
if (Y == 3 or X ==3):
  print("Yes")
else
  print("No")

Submission status: Runtime Error

Solution code:
X = input()
Y = len(X)
if (Y == 3):
  print("Yes")
else
  print("No")

Submission status: Runtime Error

Solution code:
X = input()
Y = len(X)
if (Y = 3):
  print("Yes")
else
  print("No")

Submission status: Runtime Error

Solution code:
if input() == 'AAA' or input() == 'BBB':
  print ("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
 S = input() 
 if S[0] == S[1] and S[1] == S[2]: 
 print('No') 
 else: 
 print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
if s=="AAA" or s="BBB":
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S=str(input())
if S=='AAA' or S='BBB':
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=str(input())
if S='AAA' or S='BBB':
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
A,B =map(int,input().split())
 
# 元の価格ｘ,8%  y、１０％
x = A/0.08
x_1 =(A+1)/0.08
y = B/0.1
y_1 = (B+1)/0.1

x_2 = {i for i in range(int(x),int(x_1) +1) }
y_2 = {i for i in range(int(y),int(y_1) +1) }
moto_nedan = x_2 & y_2
if len(moto_nedan) == 0:
    print("-1")
else:
    print(min(moto_nedan))
print(x_2)
print(y_2)
print(38*0.08)