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:
S = input()
for _ in range(int(input())):
    l = input().split()
    if len(l) == 1:
        S = S[::-1]
    else:
        if l[1] == "1":
            S = l[2] + S
        else:
            S = S + l[2]
print(S)

Submission status: Runtime Error

Solution code:
from sortedcontainers import SortedList, SortedDict

s = input()

print('YES' if len(set(s)) == 2 else 'NO')

Submission status: Runtime Error

Solution code:
a,b,c = input()
if a == b && b == c:
  print(No)
else:
  print(Yes)

Submission status: Runtime Error

Solution code:
stations = input()
s = stations.split()

if (s[0] == s[1] == s[2]):
    print('No')
elif (s[0] != s[1] != s[2]):
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
a=int(input())
if a in ["AAA","BBB"]:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = 0

N, A, B = [int(i) for i in input().split()]

n += int(N/(A+B)) * A

amari = N % (A+B)
n += min(amari, A)

print(n)

Submission status: Runtime Error

Solution code:
n = 0

N, A, B = [int(i) for i in input().split()]

n += int(N/(A+B)) * A

amari = N % (A+B)
n += min(amari, A)

print(n)

Submission status: Runtime Error

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

if A<0 or B<0:
    print("-1")
    exit()

minA = int(A/0.08)
maxA = int((A+1)/0.08)
minB = int(B/0.1)
maxB = int((B+1)/0.1)

for i in range(minA, maxA):
    if i >= minB and i < maxB:
        print(i)
        exit()

print("-1")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,a, b = map(int, input().split())
l = []
for i in range(10 ^100):
    l.extend([1]*a)
    l.extend([0]*b)

print(sum(l[:n]))

Submission status: Runtime Error

Solution code:
s = input().split()
n = int(s[0])
p = int(s[1])
ls = input()
ans = 0
for i in range(n):
  v = 0
  m = 0
  for j in range(n-i):
    v = m * 10 + int( ls[i+j] )
    m = v % p
    if m == 0 :
      ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
s = input().split()
n = int(s[0])
p = int(s[1])
 
ls = input()
 
ans = 0
for i in range(n):
  v = 0
  for j in range(n-i):
    k1 = ls[i+j]
    v = v*10 + int(k1)
    m = v % p
    if m == 0 :
      ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
s = input().split()
n = int(s[0])
p = int(s[1])
 
ls = input()
 
ans = 0
for i in range(n):
  v = 0
  for j in range(n-i):
    k1 = ls[i+j]
    v = v*10 + int(k1)
    m = v % p
    if m == 0 :
      ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
s = input().split()
n = int(s[0])
p = int(s[1])
 
ls = input()
 
ans = 0
for i in range(n):
  v = 0
  for j in range(n-i):
    k1 = ls[i+j]
    v = v*10 + int(k1)
    m = v % p
    if m == 0 :
      ans += 1
    v = m
    
print(ans)

Submission status: Runtime Error

Solution code:
s = input().split()
n = int(s[0])
p = int(s[1])
 
ls = input()
 
ans = 0
for i in range(n):
  v = 0
  for j in range(n-i):
    k1 = ls[i+j]
    v = v*10 + int(k1)
    m = v % p
    if m == 0 :
      ans += 1
    v = m
    
print(ans)

Submission status: Runtime Error

Solution code:
s = input().split()
n = int(s[0])
p = int(s[1])

ls = input()

ans = 0
for i in range(n):
  v = 0
  for j in range(n-i):
    #k1 = ls[i+j]
    #v = v*10 + int(k1)
    v = v*10 + int(ls[i+j])
    m = v % p
    #v = v % p
    if m == 0 :
    #if v == 0 :
      ans += 1
    v = m
    
print(ans)

Submission status: Runtime Error

Solution code:
#from collections import deque
#
#def ifcnt( an, ap ):
#  if an % ap == 0 :
#    return 1
#  else:
#    return 0
#  
s = input().split()
n = int(s[0])
p = int(s[1])

ls = input()

ans = 0
for i in range(n):
  v = 0
  for j in range(n-i):
    #k1 = ls[i+j]
    #v = v*10 + int(k1)
    v = v*10 + int(ls[i+j])
    #m = v % p
    v = v % p
    #if m == 0 :
    if v == 0 :
      ans += 1
    #v = m
    
print(ans)

Submission status: Runtime Error

Solution code:
from collections import deque

def ifcnt( an, ap ):
  if an % ap == 0 :
    return 1
  else:
    return 0
  
s = input().split()
n = int(s[0])
p = int(s[1])

ls = input()

ans = 0
for i in range(n):
  v = 0
  for j in range(n-i):
    k1 = ls[i+j]
    v = v*10 + int(k1)
    m = v % p
    if m == 0 :
      ans += 1
    v = m
    #dic_add(v)
    #ans += ifcnt( v , p )
    #
#print('-----')
#for e in dic:
#  ans = ans + dic[e]
  
print(ans)

Submission status: Runtime Error

Solution code:
#文字列の入力
S = input()

#listを一文字ずつのlistに
list_S = list(S)

AorB = S_list[0]
counter = 0
for i in range(len(S_list)):
  if(AorB == S_list[i]):
    counter =+ 1

if(counter == len(S_list)):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=inputs()
if S[0]!=S[1] or S[1]!=S[2]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem,A)
print(ans)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
j = -1
for t in range(1009):
    if int(t*0.08) == a and int(t*0.1) == b:
        j = t
        break

print(j)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
    
l = ""
flag = True
count = 0
while True:
    if flag == True:
        for x in range(a):
            l += "b"
        flag = False
    else:
        for y in range(b):
            l += "r"
        flag = True

    if len(l) >= n:
        break
         
for c in l:
    if c == "b":
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
    
l = ""
flag = True
count = 0
while True:
    if flag == True:
        for x in range(a):
            l += "b"
            if len(l) == n:
                break
        flag = False
    else:
        for y in range(b):
            l += "r"
            if len(l) == n:
                break
        flag = True

    if len(l) >= n:
        break
         
for c in l:
    if c == "b":
        count += 1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
S=set(range(25*A//2,25*(A+1)//2))&set(range(10*B,10*(B+1)))
print(S.pop() if len(S)>0 else -1)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string.h>
using namespace std;

int main()
{
    char    s[4];

    cin >> s;

    if (strcmp(s, "AAA") == 0 || strcmp(s, "BBB") == 0){
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }
    return 0;
}

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 = map(input().upper())
if s=='AAA' or 'BBB':
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(void){
  char S[5];
  scanf("%s", S);

  if(S[0] == S[1] && S[1] == S[2])
    puts("Yes");
  else
    puts("No");

  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
if a == "AAA":
  print("No")
if b == "BBB":
  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 = input()
if s == "AAA" or s === "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[0] == S[1] == S[2] == :
    print("no")
else:
    print("yes")

Submission status: Runtime Error

Solution code:
S = input()
if S[0] == S[1] == S[2] == S[3]:
    print("no")
else:
    print("yes")

Submission status: Runtime Error

Solution code:
// inputに入力データ全体が入る
function Main(input) {
	input = input.split("");
	chars = new Set(input);
    // console.log(chars.size);
	if(chars.size == 1){
      console.log('No');
    }else{
      console.log('Yes');
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Submission status: Runtime Error

Solution code:
s = input()
q = int(input())
a = [s]

for i in range(q):
    so = input()
    if so == '1':
        a[0], a[-1] = a[-1], a[0]
    else:
        d, f, c = so.split()
        if f == '1':
            a.insert(0, c)
        else:
            a.append(c)


print(''.join(a))

Submission status: Runtime Error

Solution code:
def yesno(S)

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

Submission status: Runtime Error

Solution code:
def yesno(S):

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

Submission status: Runtime Error

Solution code:
def yesno(S)

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

Submission status: Runtime Error

Solution code:
def yesno(S)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
A,B=map(str,input().split())
list=[0,1,2]

if list[0]==A and list[1]==A and list[2]==A or list[0]==B and list[1]==B and list[2]==B:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
import numpy as np
S = input()

Q = int(input())

A = np.array([S])

for i in range(Q):
    s = input().split()
    if len(s) == 1:
        A = np.flip(A)
    else:
        if s[1] == '1':
            A = np.insert(A,0,np.array([s[2]]))
        else:
            A = np.append(A,np.array([s[2]]))

print('%s' % ''.join(A))

Submission status: Runtime Error

Solution code:
S =input()

input_line = int(input())

flag0 = ""
flag1 = ""
flag = 0


for i in range(input_line):
    action = list(input())
    # print(flag0,flag1)
    # print(action)
    if action[0]=="1":
        if flag == 0:
            flag = 1
        else:
            flag = 0
    else:
        # print("check")
        if action[2] == "2":
            
            if flag == 0:
                flag0 = flag0 + action[4]
            elif flag ==1:
                flag1 = action[4] + flag1
        else:
            if flag == 0:
                flag0 = action[4] + flag0
            
            elif flag == 1:
                flag1 += action[4]
                
S = flag0 + S + flag1
if flag == 1:
    S = S[::-1]
    
print(S)

Submission status: Runtime Error

Solution code:
n, a, b = map(int,input().split())
count = 0
if 1 <= (n/(a+b)):
    if a < n%(a+b):
        print ((n/(a+b)*a) +a)
    else:
        print (int(n/(a+b)*a) + int(n%(a+b)))
else:
    if a < n%(a+b):
        print (a)
    else:
        print (n%(a+b))

Submission status: Runtime Error

Solution code:
from collections import deque
S=deque(input())
Q=int(input())
for i in range(Q):
  N=list(input().split())
  if N[0]=="1":
    S.reverse()
  elif N[1]=="1":#先頭にC1
    S.appendleft(N[2])
  else:#末尾にC1
    S.append(N[2])
S="".join(S)
print(S)

Submission status: Runtime Error

Solution code:
S = input()
N,A,B = S.split(' ')
N = int(N)
A = int(A)
B = int(B)
ans = N //(A+B) * A
left = N % (A+B)
if left > A:
    ans += A
else:
    ans += left
print(ans)

Submission status: Runtime Error

Solution code:
S = str(Input())
if S.count('AB') is 0 and S.count('BA') is 0:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
S = Input()
if S.count('AB') is 0 and S.count('BA') is 0:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s= list(input())
r=False
x=''
Q=int(input())
for i in range(Q):
	l= list(input().split())
	#print(l)
	if int(l[0])==1:
		r=not(r)
	else:
		if(int(l[1])==1):
			if r:
				s.append(l[2])
			else:
				s.insert(0,l[2])
		else:
			if r:
				s.insert(0,l[2])
			else:
				s.append(l[2])
if r:
    s=s[::-1]
    for i in s:
        print(i,end='')
else:
    for i in s:
        print(i,end='')

Submission status: Runtime Error

Solution code:
s= list(input())
r=False
x=''
Q=int(input())
for i in range(Q):
	q,*l= input().split()
	#print(l)
	if int(q)==1:
		r=not(r)
	else:
		if(int(l[0])==1):
			if r:
				s.append(l[1])
			else:
				s.insert(0,l[1])
		else:
			if r:
				s.insert(0,l[1])
			else:
				s.append(l[1])
if r:
	s=s[::-1]
    for i in s:
      print(i,end='')
else:
	for i in s:
      print(i,end='')

Submission status: Runtime Error

Solution code:
from math import ceil,floor
def without_tax(a,b):
    w_a = ceil(a/0.08)
    m_w_a = ceil((a+1)/0.08) -1
    w_b = ceil(b/0.1)
    m_w_b = ceil((b+1)/0.1) -1
    result = max(w_a,w_b)
    if result > min(m_w_a,m_w_b): 
        return -1
    return result
a,b = [int(e) for e in input().split()]
print(without_tax(a,b))

Submission status: Runtime Error

Solution code:
s= list(input())
x=''
Q=int(input())
for i in range(Q):
	q,*l= input().split()
	#print(l)
	if int(q)==1:
		s=s[::-1]
	else:
		if(int(l[0])==1):
			s.insert(0,l[1])
		else:
			s.append(l[1])
x=''.join(s)
print(x)

Submission status: Runtime Error

Solution code:
cuts = []
for i in range(2000):
  cuts+= [[int(i*0.08), int(i*0.10)]]
  
A, B = map(int,input().split())

for i in range(1,2000):
  if [A, B] == cuts[i]:
    print(i)
    break
else:
  print(0)

Submission status: Runtime Error

Solution code:
S1=int(input())
S2=int(input())
S3=int(input())

if(S1 == S2 == S3):
  print("No");
else:
  print("Yes");

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
r=-1
for i in range(1001):
    if i*8//100==a and i*10//100==b:
        r=i
        break
print(r)

Submission status: Runtime Error

Solution code:
buses = input()
first = buses[0]
count = 0
for i in buses:
	if i == first:
      count += 1
if count == len(buses):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
x=a*100//8
y=b*10
i=1
f=False
while(i<=1250):
  if i*8//100 == x and i//10 == y:
    print(i)
    f=True
    break
  i+=1
if not f:
  print(-1)

Submission status: Runtime Error

Solution code:
n, a, b=map(int,input().split())
if n==a+b:
  print(a)
else:
  if a==0:
    print(0)
  else:
    print((n//(a+b))*a + min(n%(a+b), a))

Submission status: Runtime Error

Solution code:
s = input()
vis_a = 0
vis_b = 0

for i in s:
  if i == 'A':
    vis_a = 1
  if i == 'B':
    vis_b = 1

if vis_a and vis_b:
  print("Yes")
else
  print("No")

Submission status: Runtime Error

Solution code:
s = input()
vis_a = 0
vis_b = 0

for i in s:
  if s == 'A':
    vis_a = 1
  if s == 'B':
    vis_b = 1

if vis_a and vis_b:
  print("Yes")
else
  print("No")

Submission status: Runtime Error

Solution code:
S=input()
count=0
for i in range(2):
  S[i]==S[i+1]
  count+=1
  bleak
if count==2:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S=input()
count=0
for i in range(3):
  S[i]==S[i+1]
  count+=1
if count==2:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

string S[3];
int N;

for(i=0; i<N; i++) cin >> S[i];
if(S[0] == S[1] == S[2]);
  print("Yes")
else;
  print("No)

Submission status: Runtime Error

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

for i in range(10000):
  if i * 0.08 == a and i * 0.1 == b:
    print(i)
    exit(0)
else:
  print(-1)

Submission status: Runtime Error

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

for i in range(10000):
  if i == a * 0.08 and i ==  b * 0.1:
    print(i)
    exit(0)
print('-1')

Submission status: Runtime Error

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

for i in range(10000):
  if i == a * 0.08 and i ==  b * 0.1:
    print(i)
    exit(0)
  else:
    print('-1')

Submission status: Runtime Error

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

for i in range(10000):
  if i == a * 0.08 and i ==  b * 0.1:
    print(i)
  else:
    print('-1')

Submission status: Runtime Error

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

for i in range(10000):
  if a * 0.08 == b * 0.1:
    print(a)
    exit(0)
  else:
    print('-1')

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split(" "))
list_a = [i for i in range(round(a/0.08+0.5)-1, round((a+1)/0.08 +0.5))]
list_b = [i for i in range(round(b/0.1 +0.5)-1,round((b+1)/0.1 +0.5))]
list_and = list(set(list_a) & set(list_b))
if list_and == []:
    print("-1")
else:
    print(min(list_and))

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:
N,P=map(int,input().split())
S=str(input())
S=S[::-1]
Si=[]
count=0
sum=0
if P==2:
    for i in range(N):
        if int(S[i])%2==0:
            count+=N-i
elif P==5:
    for i in range(N):
        if S[i]=="0" or S[i]=="5":
            count+=N-i
else:
    listS=[int(i) for i in S]
    mod=[(k*10**j)%P for j,k in enumerate(listS)]
    for m in mod:
        sum+=m
        Si.append(sum%P)
        
    for start in range(N):
        if Si[start]==0:
            count+=1            
        for end in range(start+1,N):
            if Si[start]==Si[end]:
                count+=1
print(count)

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 = input()
if(s[0]==s[1] and s[1]==s[2]):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
n, p = map(int,input().split())
D = input()
count = [0] * p
out = 0

if 10 % p == 0:
    for i in range(n):
        if int(D[i]) % p == 0:
            out += i + 1
else:
    ten = 1
    count[0] = 1
    for i in range(n):
        mod = (mod + int(D[n-i-1]) * ten) % p
        count[mod] += 1
        ten *= 10
    for c in count:
        out += (c * (c - 1)) // 2
print(out)

Submission status: Runtime Error

Solution code:
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08)
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1)

if a_max < b_min or b_max < a_min:
  print(-1)
else:
  result = b_min if a_min < b_min else a_min
  print(result)

Submission status: Runtime Error

Solution code:
import math
a,b = map(int,input().split())
a_min = math.ceil(a / 0.08)
a_max = math.floor((a + 1) / 0.08)
b_min = math.ceil(b / 0.1)
b_max = math.floor((b + 1) / 0.1)

if a_max < b_min or b_max < a_min:
  print(-1)
else:
  result = b_min if a_min <= b_min else a_min
  print(result)

Submission status: Runtime Error

Solution code:
s = list(input())

if len(list(set(s)):
       print('Yes')
else:
       print('No')

Submission status: Runtime Error

Solution code:
a,b=(int(x) for x in input().split())
 
import math 
 
i=0
while i<10001:
  i++
  if math.float(i)==a and math.float(i)==b:
    print(i)
    break
else:
  print(-1)

Submission status: Runtime Error

Solution code:
a,b=(int(x) for x in input().split())
 
for i in range(10000):
  if i//100*8==a and i//100*10==b:
    print(i)
  else:
    print(-1)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3 ## -*- python -*-

s = input()
q = int(input())

for i in range(q):
    d = input()
    if d[:1] == "1":
        if not s[:1] == s[-1:1]:
            s = s[::-1]
    else: # 2
        dd = d.split()
        f = int(dd[1])
        c = dd[2]
        if f == 1:
            s = c + s
        else: # f == 2
            s = s + c

print(s)

Submission status: Runtime Error

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

c=int(n/(a+b))*a+min(a,n%int(a+b))

print(c)

Submission status: Runtime Error

Solution code:
S=input()
if S[1]==S[2] and 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:
intxt = input()
p = ""
ok = 0
for i in range(0,3):
  if intxt[i] != p:
    ok += 1
  p = intxt[i]
if ok == 1:
  print("Yes")
else:
  print("No)

Submission status: Runtime Error

Solution code:
intxt = input()
p = ""
ok = 0
for i in intxt:
  if i != p:
    ok += 1
  p = i
if ok == 2:
  print("Yes")
else:
  print("No)

Submission status: Runtime Error

Solution code:
intxt = input()
p = ""
ok = 0
for i in intxt:
  if i != p:
    ok += 1
  p = i
if ok == 1:
  print("Yes")
else:
  print("No)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
A,B = list(map(int,input().split()))
def problem_gksn(A, B):
  x_min = math.ceil(A / (0.08))
  x_max = math.floor((A+1)/0.08)
  y_min = math.ceil(B / (0.10))
  y_max = math.floor((B+1) / (0.10))
  if max(x_min, y_min) <= min(x_max, y_max):
    return max(x_min, y_min)
  else:
    return -1
print(problem_gksn(A,B))

Submission status: Runtime Error

Solution code:
import math
S = input()
Q = int(input())

lr = 'left'

def reverse_list(lr):
    if lr == 'right':
        return 'left'
    else:
        return 'right'

def moji_tuika(S, f, c, lr):
    if f == 1 and lr == 'left':
        S.insert(0,c)
    elif f == 1 and lr == 'right':
        S.append(c)
    elif f == 2 and lr == 'left':
        S.append(c)
    else:
        S.insert(0,c)
    return S

q = []
for i in range(Q):
    temp = input().split()
    if len(temp) == 1:
        q.append(1)
    else:
        q.append(temp)

S = list(S)
print(S)
for i in q:

    if type(i) == int:
        lr = reverse_list(lr)
    elif int(i[0]) == 2:
        #print(i[2])
        #print(S)
        S = moji_tuika(S,int(i[1]),i[2],lr)
    #print(S)
if lr == 'right':
    S.reverse()

S = ''.join(S)
print(S)

Submission status: Runtime Error

Solution code:
import math
S = input()
Q = int(input())

lr = 'left'

def reverse_list(lr):
    if lr == 'right':
        return 'left'
    else:
    	return 'right'

def moji_tuika(S, f, c, lr):
    if f == 1 and lr == 'left':
        return c + S
    elif f == 1 and lr == 'right':
        return S + c
    elif f == 2 and lr == 'left':
        return S + c
    else:
        return c + S
q = []
for i in range(Q):
    temp = input().split()
    if len(temp) == 1:
        q.append(1)
    else:
        q.append(temp)

for i in q:
    if type(i) == int:
        lr = reverse_list(lr)
    elif int(i[0]) == 2:
        S = moji_tuika(S,int(i[1]),i[2],lr)

if lr == 'right':
    S = list(S)
    S.reverse()
    S = ''.join(S)


print(S)

Submission status: Runtime Error

Solution code:
import math
S = input()
Q = int(input())

def reverse_list(S):
    S = S.split("")
    S.reverse()
    return ''.join(S)

def moji_tuika(S, f, c):
    if f == 1:
        return c + S
    else:
        return S + c

q = []
for i in range(Q):
    temp = input().split()
    if len(temp) == 1:
        q.append(1)
    else:
        t = int(temp[0])
        f = int(temp[1])
        c = temp[2]
        q.append((t,f,c))

for i in q:
    if type(i) == int:
        S = reverse_list(S)
    elif i[0] == 2:
        S = moji_tuika(S,i[1],i[2])

print(S)

Submission status: Runtime Error

Solution code:
import math
S = input()
Q = int(input())

def reverse_list(S):
    if len(S) == 1:
        return S
    else:
        return S[::-1]

def moji_tuika(S, f, c):
    if f == 1:
        return c + S
    else:
        return S + c

q = []
for i in range(Q):
    temp = input().split()
    if len(temp) == 1:
        q.append(1)
    else:
        t = int(temp[0])
        f = int(temp[1])
        c = temp[2]
        q.append((t,f,c))

for i in q:
    if type(i) == int:
        S = reverse_list(S)
    elif i[0] == 2:
        S = moji_tuika(S,i[1],i[2])

print(S)

Submission status: Runtime Error

Solution code:
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "S = input()\n",
    "if S ==\"AAA\" or S ==\"BBB\":\n",
    "    print(\"No\")\n",
    "else:\n",
    "    print(\"Yes\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}

Submission status: Runtime Error

Solution code:
import math

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

A_min = int(math.ceil(A/0.08))
A_max = int(math.floor((A+1)/0.08)

B_min = int(math.ceil(B/0.1))
B_max = int(math.floor((B+1)/0.1)


A_list = list(range(A_min,A_max+1))
B_list = list(range(B_min,B_max+1))

ans_list = list(set(A_list) & set(B_list))

if len(ans_list) > 1:
  print(min(ans_list))
elif len(ans_list) == 0:
  print(-1)
else:
  print(min(ans_list))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
for i in range(1,1009):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(int(i))
print("-1")

Submission status: Runtime Error

Solution code:
n, b_n, r_n = input().split()
b= "b" * int(b_n)
r = "r" * int(r_n)

total = (b + r) * int(n)
total = total[:int(n)]

b_n2 = 0
for _ in total:
  if _ == "b":
    b_n2 += 1
  
print(str(b_n2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
inp=list(map(int,input().split()))
S=inp[0]
B=inp[1]
R=inp[2]
x=S//(B+R)#brグループが何回
y=S%(B+R)

print(B*x+min(y,B))

Submission status: Runtime Error

Solution code:
inp=list(map(int,input().split()))
S=inp[0]
B=inp[1]
R=inp[2]
x=S//(B+R)#brグループが何回
y=S%(B+R)
print(B*x+y)

Submission status: Runtime Error

Solution code:
inp=list(map(int,input().split()))
S=inp[0]
B=inp[1]
R=inp[2]
x=S//(B+R)#brグループが何回
y=S//(B+R)
print(B*x+y)

Submission status: Runtime Error

Solution code:
inp=list(map(int,input().split()))
S=inp[0]
B=inp[1]
R=inp[2]
if B==0:
  print(0)
else:
  ans=B+(S-B-R)
  print(ans)

Submission status: Runtime Error

Solution code:
print("YNeos"[len(set(input())>1)::2])

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:
tax = [int(n) for n in input().split()]

max_8tax = (tax[0]+1) / .08
min_8tax = int((tax[0]) / .08)
max_10tax = int((tax[1]+1) / .1) - 1
min_10tax = int((tax[1]) / .1)

r = -1

#print(max_8tax, min_8tax)
#print(max_10tax, min_10tax)

for i in range(min_10tax, max_10tax):
    if min_8tax <= i and i <= max_8tax:
        r = i
        break

print(r)

Submission status: Runtime Error

Solution code:
s=input()
q= int(input())
 
for iq in range(1,q+1):
	t=input().split()
	if t[0]=='1':
		s=s[::-1]
	else:
		if t[1]=='1':
#			s=t[2]+s
#			s=f"{t[2]}{s}"
			list1=[t[2],s]
			s="".join(list1)
		else:
#			s=s+t[2]
#			s=f"{s}{t[2]}"   
			list2=[s,t[2]]
			s="".join(list2)
 
print (s)

Submission status: Runtime Error

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

am=int(100/8*a)
al=int(100/8*(a+1))
if ((a+1)%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al):
       for ib in range(bm,bl):
       		if ia==ib:
       			print (ia)
       			exit()
else:
  print(-1)

Submission status: Runtime Error

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

am=int(100/8*a)
al=int(100/8*(a+1))
if (a%4)==0:
       al=al-1

bm=int(10*b)
bl=int(10*(b+1))-1

#print (am,al)
#print (bm,bl)
for ia in range(am,al+1):
       for ib in range(bm,bl+1):
       		if ia==ib:
       			print (ia)
       			exit()
      
print -1

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:
a, b, k = map(int, input().split())

count = 0

l = []

for i in range(1,100):
    if a % i == 0 and b % i == 0:
        l.append(i)
        
l.sort()
l.reverse()
k-=1
print(l[k])

Submission status: Runtime Error

Solution code:
    #n,m = list(map(int,input().split()))
    s = input()
     
    if s[0] == s[1] == s[2]:
      print('No')
    else:
      print('Yes')

Submission status: Runtime Error

Solution code:
import math

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

for i in range(10000):
    if math.floor(i * 0.08) == a and math.floor(i* 0.1) == b:
        print(i)
        break

print(-1)