Problem:


Score : 100 points

Problem Statement

A programming competition site AtCode regularly holds programming contests.

The next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.

The contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.

The contest after the ARC is called AGC, which is rated for all contestants.

Takahashi's rating on AtCode is R. What is the next contest rated for him?

Constraints

0 ≤ R ≤ 4208

R is an integer.

Input

Input is given from Standard Input in the following format:

R

Output

Print the name of the next contest rated for Takahashi (ABC, ARC or AGC).

Sample Input 1

1199

Sample Output 1

ABC

1199 is less than 1200, so ABC will be rated.

Sample Input 2

1200

Sample Output 2

ARC

1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.

Sample Input 3

4208

Sample Output 3

AGC



Sample input:
1199


Sample output:
ABC

Submission status: Runtime Error

Solution code:
import itertools
import numpy as np

D,G = map(int,input().split(" "))
p = []
c = []
score_list = []
for i in range(D):
    p_,c_ = map(int,input().split(" "))
    p.append(p_)
    c.append(c_)
    for n in range(p_):
        score_list.append((i+1)*100)

ans = sum(p)

if min(c) >= G:
    count = 0
    score = 0
    for j in range(D - 1, -1, -1):
        for k in range(p[j] - 1):
            score += (j + 1) * 100
            count += 1

            if score >= G:
                ans = min(ans, count)
                break
        if score >= G:
            break
else:
    # 何個の問題をコンプリートボーナス取得まで解くかのループ
    for i in range(1,len(score_list)):

        # コンプリートボーナスの組み合わせ
        comp_scores_pos = list(itertools.combinations(np.arange(len(c)),i))

        for cs in comp_scores_pos:        
            # 合計を計算（コンプリートボーナス）
            cs = list(cs)
            if len(cs) <= 1:
                score = c[cs[0]]
            else :
                score = sum(np.array(c)[cs])

            # 合計を計算（問題の得点）と問題数のカウント
            count = 0
            for n in cs:
                score += (n + 1) * 100 * p[n]
                count += p[n]

            # G以上か見て
            if score >= G:
                # 最小値を更新
                ans = min(ans, count)
    #             print("ans = ", ans, ", count = ", count, ", cs = ", cs)
            else:
#                 print("cs = ", cs, ", score = ", score, ", count = ", count)
                # 何個の問題を解けばGに届くか
                for j in range(D - 1, -1, -1):
                    for k in range(p[j] - 1):
                        if cs.count(j) > 0:
                            continue

                        score += (j + 1) * 100

#                         print("j = ", j, ", score = ", score)
                        count += 1

                        if score >= G:
                            ans = min(ans, count)
#                             print("ans = ", ans, ", count = ", count, ", cs = ", cs)
                            break
                    if score >= G:
                        break
#                 print()
    
print(ans)

Submission status: Runtime Error

Solution code:
r = int(input())
if a < 1200:
  print("ABC")
elif a < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
  print('ABC')
else if R < 2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
R=int(input())
if R<1200:
    print(ABC)
elif R<2800:
    print(ARC)
else:
    print(AGC)

Submission status: Runtime Error

Solution code:
r = int(input())
if r >= 2800 :
  print('AGC')
elif r >= 1200 :
  print('ARC'):
else:
  print('ABC')

Submission status: Runtime Error

Solution code:
def solve(levelNum, levelProblemNums, extraPoints, target):
	target = int(target / 100)
	dp = [[99999999] * (target+1) for _ in range(levelNum+1)]
	for i in range(levelNum+1):
		dp[i][0] = 0
	#print(dp)
	#print(target)
    # for each level
	for l in range(1, levelNum+1):
		#for each point
		#print( l)
		for point in range(1, target+1):
			dp[l][point] = dp[l-1][point]
			for p in range(1, levelProblemNums[l-1]+1):
				curPoint = p*l if p < levelProblemNums[l-1] else p*l + int(extraPoints[l-1]/100)
				subPoint = point - curPoint if point > curPoint else 0
				dp[l][point] = min(dp[l-1][subPoint]+p, dp[l][point])

	return dp[l][target]	

D, G = map(int, input().split())
P, C = [], []
for i in range(D):
    p, c = map(int, input().split())
    P.append(p)
    C.append(c)

#res = [D]
rt = solve(D, P, C, G)
print(rt)

Submission status: Runtime Error

Solution code:
def solve(levelNum, levelProblemNums, extraPoints, target):
	target = int(target / 100)
	dp = [[99999999] * (target+1) for _ in range(levelNum+1)]
	for i in range(levelNum+1):
		dp[i][0] = 0
	#print(dp)
	#print(target)
    # for each level
	for l in range(1, levelNum+1):
		#for each point
		for point in range(1, target+1):
			dp[l][point] = dp[l-1][point]
			for p in range(1, levelProblemNums[l-1]+1):
				curPoint = p*l if p < levelProblemNums[l-1] else p*l + int(extraPoints[l-1]/100)
				subPoint = point - curPoint if point > curPoint else 0
				dp[l][point] = min(dp[l-1][subPoint]+p, dp[l][point])

	return dp[l][target]	

D, G = map(int, input().split())
P, C = [], []
for i in range(D):
    p, c = map(int, input().split())
    P.append(p)
    C.append(c)

#res = [D]
rt = solve(D, P, C, G)
print(rt)

Submission status: Runtime Error

Solution code:
r=int(input())
print("ABC" if r<1200 else "AGC" if r<2800)

Submission status: Runtime Error

Solution code:
N = int(input())

if N< 1200:
  print ("ABC")
elsif N< 2800:
  print ("ARC")
else:
  print ("AGC")

Submission status: Runtime Error

Solution code:
r = input()
if r < 1200:
    print('ABC')
elif 1200 <= r < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
d,g=map(int,input().split())
ans=10000
p=[]
c=[]
for i in range(d):
    a,b=map(int,input().split())
    p.append(a)
    c.append(b)
for i in range(2**d):
    x=0
    cou=0
    l=[]
    for j in range(d):
        if ((i>>j)&1):
            x+=c[j]+p[j]*(j+1)*100
            cou+=p[j]
        else:
            l.append(j)
    l.sort(reverse=True)
    k=0
    while x<g:
        for _ in range(p[l[k]]):
            if x>=g:
                break
            cou+=1
            x+=(100*(l[k]+1))
        k+=1
        if k>=len(l):
            break
    ans=min(ans,cou)
print(ans)

Submission status: Runtime Error

Solution code:
d, g = map(int, input().split())

p = []
c = []
ans = []
cnt = 0
ss = 0
for _ in range(d):
    pp, cc = map(int, input().split())

    p.append(pp)
    c.append(cc)



for x in range(2**d):
    ss = 0
    cnt = 0
    for i in range(d):
        if (x>>i)&1:

            ss += (i+1)*100*p[i] + c[i]
            cnt += p[i]
    print("a",ss)
    if ss>=g:
        ans.append(cnt)

    else:
        print("c")
        for l in range(d)[::-1]:
            print(l)
            print(x>>l)
            if  ((x >> l) & 1):
                continue

            for _ in range(p[l]):
                ss += (l+1)*100
                print("b",ss)
                cnt += 1

                if ss>=g:
                    ans.append(cnt)
                    break

print(min(ans))

Submission status: Runtime Error

Solution code:
n = int(input())

if n<1200:
  print("ABC")
  
elif 1200=<n<2800:
  print("ARC")
  
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
r = int(input())
ans = ''
if r < 1200:
  print('ABC')
elfi r < 2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
n = int(inout())
if n < 1200:
  print('ABC')
elif n < 2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
解答例
R = int(input())

if R < 1200:
	print("ABC")
elif R < 2800:
	print("ARC")
else:
	print("AGC")

Submission status: Runtime Error

Solution code:
R = int(input())

if R < 1200:
	print(“ABC”)
elif R < 2800:
	print(“ARC”)
else:
	print(“AGC”)

Submission status: Runtime Error

Solution code:
S = input()
count = 0
answer = "WA"

if S[0] == 'A' and S[2:-1].count('C') == 1:
    C = S.index('C')
    exception = [0]
    exception.append(C)

if len(exception) == 2:
    for j in range(len(S)):
        if j not in exception and S[j].islower():
            count += 1

if count == len(S)-2:
    answer = "AC"
    

print(answer)

Submission status: Runtime Error

Solution code:
r = input()

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
def resolve():

    d, g = map(int, input().split())

    p = [0] * d
    c = [0] * d

    for i in range(d):
        p[i], c[i] = map(int, input().split())

    ans = 1010

    for i in range(d ** 2):

        sum = 0
        cnt = 0

        for j in range(d):

            if (i >> j) & 1:

                sum += (j + 1) * 100 * p[j]
                sum += c[j]

                cnt += p[j]

        if sum < g:

            for k in range(d)[::-1]:

                flag = 0

                if not (i >> k) & 1:

                    for _ in range(p[k] -1):

                        if sum >= g:
                            flag = 1
                            break

                        sum += (k+1) * 100
                        cnt += 1

                if flag:
                    break

        if sum >= g:
            ans = min(cnt, ans)

    print(ans)
    
resolve()

Submission status: Runtime Error

Solution code:
rate = int(input())

if rate >= 0 && rate <= 1199:
	print('ABC')
elif rate >= 1200 && rate <= 2799:
	print('ARC')
else:
	print('AGC')

Submission status: Runtime Error

Solution code:
a = int(input)

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
from math import ceil
D,G = map(int,input().split())
para = [[i for i in map(int,input().split())] for j in range(D)]
result = []
for i in  range(2**D):
    ans = 0
    cnt = 0
    num = format(i,"b").zfill(D)
    for j in range(D,0,-1):

        if num[j-1] == "1" :
            ans += para[j-1][0] *100*j + para[j-1][1]
            cnt += para[j-1][0]
            
        else : pass

    if ans >= G :
        result.append(cnt)
    else :
        for j in range(D,0,-1):
            if num[j-1] == "1" : pass
            else : 
                if G <= ans + (para[j-1][0]-1)*100*(j):
                    cnt += ceil((G-ans)/(100*(j)))
                    result.append(cnt) 
                
print(min(result))

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
    print('ABC')
elif:
    R < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
D,G = map(int,input().split(' '))
l = [list(map(int,input().split())) for i in range(D)]

ans = 10**8
for i in range(2**D):
    score = 0
    tmp = 0
    n_list = []
    for j in range(D):
        if (i >> j & 1):
            k = l[j]
            score += (j+1)*100*k[0]+k[1]
            tmp += k[0]
        else:
            n_list.append([j+1]+l[j])
    e_flag = False
    for ii in n_list[::-1]:#[1or2or..,times,bonus]
        for jj in range(ii[1]-1):
            if score<G:
                score += ii[0]*100
                tmp += 1
            else:
                e_flag = True
                break
        if e_flag:
            break
    if score<G:
        continue
    ans = min(ans,tmp)
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
if n<1200:
  print('ABC')
elif (n<2800)&&(n>=1200):
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
n=int(input())
if n<1200:
  print('ABC')
elif n<2800&&n>=1200:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
a = int(input())

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else
    print("AGC")

Submission status: Runtime Error

Solution code:
from math import ceil

class Score():
    def __init__(self, score, num, bonus):
        self.num = num
        self.score = score
        self.bonus = bonus

D, G = [int(c) for c in input().split(" ")]
min_times = 100000000000

def dfs(score_lists, masks: list, num: int, sum_score, sum_use_num):
    """completeするかしないかで2^Dを選んでいく
    """
    if (num == D):
        # print(sum_score)
        for i in range(D - 1, -1, -1):
            if (masks[i] == 1):
                continue
            else:
                global min_times
                if sum_score >= G:
                    min_times = min(min_times, sum_use_num)
                elif sum_score + (score_lists[i].num)* score_lists[i].score < G:
                    # break
                    continue
                else:
                    min_times = min(sum_use_num + ceil((G - sum_score) / score_lists[i].score), min_times)
                    # break
                    
    else:
        masks[num] = 0
        dfs(score_lists, masks, num + 1, sum_score, sum_use_num)

        masks[num] = 1
        dfs(score_lists, masks, num + 1, \
            sum_score + score_lists[num].num * score_lists[num].score + score_lists[num].bonus, \
            sum_use_num + score_lists[num].num)


score_lists = []
min_num = 0
for i in range(D):
    p, c = [int(c) for c in input().split(" ")]
    score = 100 * (i + 1)
    scores = Score(score, p, c)
    score_lists.append(scores)

masks = [0] * D
dfs(score_lists, masks, 0, 0, 0)

print(min_times)

Submission status: Runtime Error

Solution code:
R =input()
if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
a=int(input())
if a<1200:
  print(ABC)
elif 1199<a<2800:
  print(ARC)
else:
  print(AGC)

Submission status: Runtime Error

Solution code:
a=input()
if a<1200:
  print(ABC)
elif 1199<a<2800:
  print(ARC)

Submission status: Runtime Error

Solution code:
a=input()
if a<1200:
  print(ABC)
else:
  print(ARC)

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
    print('ABC')
elif <2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
a = input()

if a < 1200:
    print("ABC")
elif(a < 2800):
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
a = input()

if a < 1200:
    print("ABC")
elif(a < 2800)
    print("ARC")
else
    print("AGC")

Submission status: Runtime Error

Solution code:
a=int(input())
print(["ABC","ARC","AGC"][int(a/2800)+int(a/1200)])

Submission status: Runtime Error

Solution code:
# ABC104A - Rated for Me
r = list(map(int, input().rstrip().split()))
if r < 1200:
    print("ABC")
elif 1200 <= r < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
a = int(input())
if a < 1200 :
    prunt('ABC')
elif a >= 1200 and a < 2800 :
    print('ARC')
else :
    print('AGC')

Submission status: Runtime Error

Solution code:
r = int(input())
if r < 1200:
  print(ABC)
elif 1200 <= r < 2800:
  print(ARC)
else:
  print(AGC)

Submission status: Runtime Error

Solution code:
r = int(input())
if r < 1200:
  print(ABC)
if 1200 <= r < 2800:
  print(ARC)
else:
  print(AGC)

Submission status: Runtime Error

Solution code:
r = input()
if r < 1200:
  print(ABC)
if 1200 <= r < 2800:
  print(ARC)
else:
  print(AGC)

Submission status: Runtime Error

Solution code:
D, G = map(int, input().split())
pc = []
for i in range(D):
    pc.append(list(map(int, input().split())))


def convert(n):
    Bin = []
    while n != 0:
        a = n % 2
        n //= 2
        Bin.insert(0, a)
    if not Bin:
        Bin.append(0)
    return Bin


Min = 10**8
for i in range(0, 2**D-1):
    Bin = [str(s) for s in convert(i)]
    Bin = ''.join(Bin).zfill(D)
    idx = 0
    ct = 0
    score = 0
    for j in Bin:
        if j == '1':
            p, c = pc[idx]
            ct += p
            score += 100*(idx+1)*p+c
        if score >= G:
            Min = ct if ct < Min else Min
            break
        idx += 1
    if score < G:
        Bin = Bin[::-1]
        idx = 0
        for j in Bin:
            if j == '0':
                p, c = pc[idx]
                for k in range(p-1):
                    ct += 1
                    score += 100*(D-idx)
                    if score >= G:
                        Min = ct if ct < Min else Min
                        break
            if score >= G:
                break
            score -= 100*(D-idx)*(p-1)
            ct -= (p-1)
            idx += 1

print(Min)

Submission status: Runtime Error

Solution code:
a = input(int())
if a<1200:
    print("ABC")
elif a<2800:
    print("ARC")
else:print("AGC")

Submission status: Runtime Error

Solution code:
a = input(int())
if a<1200:
    print("ABC")
elif 1201<a<2800:
    print("ARC")
else:print("AGC")

Submission status: Runtime Error

Solution code:
a = map(int, input().split())
if a<1200:
    print("ABC")
elif 1201<a<2800:
    print("ARC")
else:print("AGC")

Submission status: Runtime Error

Solution code:
R = int(input())

if R >= 2800:
    print('AGC')
elif R < 1200:
    print('ABC')
else:a
    print('ARC')

Submission status: Runtime Error

Solution code:
a = input()
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
a = input()
if a < 1200:
 print("ABC")
elif a < 2800:
 print("ARC")
else:
 print("AGC")

Submission status: Runtime Error

Solution code:
a = input()
if a < 1200:
	print("ABC")
elif a < 2800:
	print("ARC")
else:
	print("AGC")

Submission status: Runtime Error

Solution code:
a = input()
if a < 1200:
    print("ABC")
else if a < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
a = input()
if a < 1200:
  print("ABC")
else if a < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
a = int(input())
if a < 1200:
  print("ABC")
else if a < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
r = int(input())
if r < 1200:
  print("ABC")
else r < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define ll long long

const ll mod = 1e9+7;

int main(){
	ll r;
	cin >> r;
	if (r<1200) cout << "ABC" << endl;
	else if (r<2800) cout << "ARC" << endl;
	else cout << "AGC" << endl;
}

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else
  print("AGC")

Submission status: Runtime Error

Solution code:
d, g = map(int, input().split())
pc=[list(map(int, input().split())) for i in range(d)]
def S(x):
    score=0
    cost=0
    no_use=0
    
    b=str(format(x, '010b'))
    for i in range(1, d+1):
        if b[-i]=='1':
            score+=100*i*pc[i-1][0]+pc[i-1][1]
            cost+=pc[i-1][0]
        else:
            no_use=i-1
    if score<g:
        tmp=(g-score)//((no_use+1)*100)
        if tmp<pc[no_use][0]:
            if (g-score)%(no_use+1)==0:
                cost+=tmp
            else:
                cost+=tmp+1
        else:
            cost=10**9
   
    return cost    
ans=10**9
for x in range(1, 2**d+1):
        s=S(x)
        ans=min(ans, s)
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
print("ABC")if a<1200
print("ARC")if a<2800
print("AGC")if a>2799

Submission status: Runtime Error

Solution code:
a=int(input())
print("ABC"if a<1200)
print("ARC"if a<2800)
print("AGC"if a>2799)

Submission status: Runtime Error

Solution code:
a=int(input());print("ABC"if a<1200"ARC"elif a<2800else"AGC")

Submission status: Runtime Error

Solution code:
R = int(input(R))
if R < 1200:
  print('ABC')
elif 1200 <= R < 2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
R = int(input())
r = 'AGC'
if R<2800:
    r[1]='R'
if R<1200:
    r[1]='B'
print(r)

Submission status: Runtime Error

Solution code:
a = int(input())
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else a 
    print("AGC")

Submission status: Runtime Error

Solution code:
a = int(input().split())
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
a = int, input().split()
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
from sys import stdin
n = int(stdin.readline.rstrip())
if n<1200:
  print('ABC')
elif n>=1200 and n<2800:
  print('ARC')
elif n>=2800:
  print('AGC')

Submission status: Runtime Error

Solution code:
import math

d, g = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(d)]

for k,i in enumerate(lst):
    i.append((k+1)*100)
    i.append(i[2]*i[0]+i[1])

def calcurate(pt, count, g, lst):
    lst1 = list()
    for i in lst:
        if i[3] > g - pt:
            lst1.append(i + [i[2]])
        else:
            lst1.append(i + [i[3]/i[0]])
    lst1 = sorted(lst1, key = lambda x: -x[-1])
    ps = lst1[0]
    if ps[3] > g - pt:
        count += math.ceil((g - pt) / ps[2])
        return print(count)
    elif ps[3] == g - pt:
        return print(count + ps[0])
    else:
        calcurate(pt+ps[3], count+ps[0], g, lst1[1:])

calcurate(0,0,g,lst)

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
    ptint("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
if n < 1200:
    print('ABC')
elif n < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
A=int(input())
ARC=1
if(A<1200):
  print("ABC")
  ARC=0

if(A>=2800):
  print("AGC")
  ARC=0
  
if(ARC=1):
  print("ARC")

Submission status: Runtime Error

Solution code:
r = int(input())
if 0 <= r and r < 1200:
    print('ABC')
elif 1200 <= r and r < 2800:
    print('ARC')
elif 2800 <= r and r < 4208:
    print('AGC')
else:
    raise ValueError

Submission status: Runtime Error

Solution code:
s = input()
mod = 10**9 + 7
abc = 0
bc = 0
c = 0
q = 0
for i in s[::-1]:
  elif i == "A":
    abc = (abc + bc) % mod
  elif i == "B":
    bc = (bc + c) % mod
  elif i == "C":
    c = (3**q+c) % mod
  elif i == "?":
    abc = (abc*3 + bc) % mod
    bc = (bc*3 + c) % mod 
    c = (3**q + c*3) % mod
    q += 1
print(abc)

Submission status: Runtime Error

Solution code:
d, g = (int(i) for i in input().split())
p = [[int(i) for i in input().split()] for i in range(n)]
ans = 1000

for i in range(1 << d): # 4
    score = 0
    num = 0
    rest = 0
    for j in range(d): # 2
        if ((i >> j) & 1) == 1: # 0 1  2=10
            score += p[j][0] * 100 * (j + 1) + p[j][1]
            num += p[j][0]
        else:
            rest = j
    if score < g:
        need = (g - score - 1) // (100*(rest+1))
        if need > p[rest][0] - 1: # 0だったところの中で一番大きいところの問題数-1よりも必要手数が多かったら初めに戻る
            continue
        else:
            num += need
    ans = min(ans, num)
print(ans)

Submission status: Runtime Error

Solution code:
import sys

def solve(R):
    if R < 1200 :
        return 'ABC'
    elif R < 2800 :
        return 'ARC'
    else :
        return 'AGC'

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    R = int(ws[0])
    return (R,)

def main():
    solve(*readQuestion())

Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else print("AGC")

Submission status: Runtime Error

Solution code:
R = input()
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else print("AGC")

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
  print(ABC)
elif R < 2800:
  print(ARC)
else:
  print(AGC)

Submission status: Runtime Error

Solution code:
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')

z=[name[0] if r < 1200 else name[1] if 1200 <= r < 2800 else name(2) if 2800 <= r else i for i in range(1)]
print(z[0])

Submission status: Runtime Error

Solution code:
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')
z=[name[0] if r < data[0] else name[1] if data[0] <= r < data[1] else name(2) if data[1] <= r else i for i in range(1)]
print(z[0])

Submission status: Runtime Error

Solution code:
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')
if r<data[1]:
  print(name[0])
elif data[1]<=r<data[2]:
  print(name[1])
else:
  print(name[2])

Submission status: Runtime Error

Solution code:
r=int(input())
data1=1200
dara2=2800
name=('ABC', 'ARC', 'AGC')
if r<data1:
  print(name[0])
elif data1<=r<data2:
  print(name[1])
else:
  print(name[2])

Submission status: Runtime Error

Solution code:
r = int(input())
if r < 1200:
  print('ABC')
else if r < 2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
from math import ceil
D,G=map(int,input().split())
p=[0]*D
c=[0]*D

for i in range(D):
    p[i],c[i]=map(int,input().split())
_min=101*D

flag=1
while(flag < 2**D):
    
    _G=G
    tmp=0
    max_ind=0
    for i in range(D):
        if(flag & 1<<i):
            _G-=p[i]*(i+1)*100 + c[i]
            tmp+=p[i]
        else:
            max_ind=i
    k=ceil(max([(_G),0])/(100*(max_ind+1)))  
    if(k < p[max_ind]):
        tmp+=k
        _min=min([tmp,_min])
    flag+=1
print(_min)

Submission status: Runtime Error

Solution code:
from math import ceil
D,G=map(int,input().split())
p=[0]*D
c=[0]*D

for i in range(D):
    p[i],c[i]=map(int,input().split())
_min=101*D

flag=1
while(flag < 2**D):
    
    _G=G
    tmp=0
    max_ind=0
    for i in range(D):
        if(flag & 1<<i):
            _G-=p[i]*(i+1)*100 + c[i]
            tmp+=p[i]
        else:
            max_ind=i
    k=ceil(max([(_G),0])//(100*(max_ind+1)))  
    if(k < p[max_ind]):
        tmp+=k
        _min=min([tmp,_min])
    flag+=1
print(_min)

Submission status: Runtime Error

Solution code:
r = int(input())
if n < 1200:
    print('ABC')
elif n < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
r = int(input())
if r >= 0 and r < 1200
  print("ABC")
if r >= 1200 and r < 2800
  print("ARC")
if r >= 2800
  print("AGC")

Submission status: Runtime Error

Solution code:
r = int(input())
if n < 1200:
    print("ABC")
elif n < 2800:
    print("AEC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
R = int(raw_input())

if R <1200:
	print('ABC')
elif 1200<=R<2800:
	print('ARC')
else :
	print('AGC')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int R;
  cin >> R;
  if(R<1200)  cout<<"ABC";
  else if(R<2800)  cout<<"ARC";
  else  cout<<"AGC";

}

Submission status: Runtime Error

Solution code:
r = input()
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
C = ["ABC", "ARC" , "AGC"]
A = int(input())
print(C[(A>1200)+(A>2800)]

Submission status: Runtime Error

Solution code:
s = input()
text = s[2:-1]
r = s.replace('A', '')
r = r.replace('C', '')

if s[0] != 'A' pr text.count('C') != 1 or r != r.lower():
	print('WA')
	exit()

print('AC')

Submission status: Runtime Error

Solution code:
s = input()
a = False
b = False
c = False
cnt = 0
k = 0

if s[0] == 'A':
	a = True

for c in range(s[2],s[-1]):
	if c == 'C':
		cnt += 1
if cnt == 1:
	b = True

for c in s:
	if c != 'A' or c != 'C':
		if c.islower() == True:
			k += 1

if k == len(s):
	c = True


if a == b == c == True:
	print("AC")
else:
	print("WC")

Submission status: Runtime Error

Solution code:
import itertools
D, G = map(int, input().split())
P = [list(map(int, input().split())) for i in range(D)]
min_num = 10**8

judge_list = list(itertools.product([0, 1, 2], repeat=D)) #0:中途半端に解く 1:一問も解かない 2: 全部解く

for judge in judge_list:
    score = 0
    num = 0
    flag = 0
    for i in range(1, len(judge) + 1):
        if score >= G:
            break
        
        if judge[-i] == 1:
            pass
        
        if judge[-i] == 2:
            score += P[-i][0] * (D - i + 1) * 100 + P[-i][1]
            num += P[-i][0]
            
        if (judge[-i] == 0) and (flag == 0):
            for j in range(P[-i][0]):
                if score >= G:
                    break
                score += 100 * (D - i + 1)
                num += 1
            flag = 1
                        
    if score >= G:
        min_num = min(num, min_num)

print(min_num)

Submission status: Runtime Error

Solution code:
r = int(input())
if r < 1200:
    print(ABC)
    if 1200 <= r <2800:
        print(ARC)
    else:
        print(AGC)

Submission status: Runtime Error

Solution code:
a = int(input())
print(["ABC","ARC","AGC"][a<1200, a<2800, a>=2800])

Submission status: Runtime Error

Solution code:
R = int(input())

if R<1200:
    print("ABC")
if R<2800 and R>1200:
    print("ARC")
if R>2800:
    print("AGC"

Submission status: Runtime Error

Solution code:
r = int.input()

if r < 1200:
    print("ABC")
else if r < 2800
    print("ARC")
else
    print("AGC")

Submission status: Runtime Error

Solution code:
R=input()
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C":
    rs=1
else:
    rs=0

if t[1].isupper()==True or t[-1].isupper()==True:
    rs -=1

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

if rs==1:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C":
    rs=1
else:
    rs=0

if t[1].isupper==True or t[-1].isupper==True:
    rs -=1

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

if rs==1:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C" and t[-1].islower==True and t[1].islower==True:
    rs=1
else:
    rs=0

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

if rs==1:
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
R=input()
if R<1200:print "ABC"
elif E<2800:print "ARC"
else:print "AGC"

Submission status: Runtime Error

Solution code:
n = int(input())
ans = ""
if n < 1200:
	ans = "ABC"
else if n < 2800:
	ans = "ARC"
else:
	ans = "AGC"

print(ans)

Submission status: Runtime Error

Solution code:
R=input()
0<=R and R<=4208
if R>=1 and R<1200
   print('ABC')
elif R>=1200 and R<2800
   print('ARC')
elif R>=2800 and R<=4208
   print('AGC')

Submission status: Runtime Error

Solution code:
R=input()
0<=R and R<=4208
if R>=1 and R<1200
print('ABC')
elif R>=1200 and R<2800
print('ARC')
elif R>=2800
print('AGC')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

rate = int(input("Enter your rate: "))

if rate < 1200:
    print("ABC")
elif rate >= 1200 and rate < 2800:
    print("ARC")
elif:
    print("AGC")

Submission status: Runtime Error

Solution code:
n=eval(input())
if n<1200:
	print("ABC")
elif n>=1200 and n<2800:
	print("ARC")
else:
    peint("AGC")