Problem:


Score : 100 points

Problem Statement

Takahashi is a user of a site that hosts programming contests.

When a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:  

Let the current rating of the user be a.

Suppose that the performance of the user in the contest is b.

Then, the new rating of the user will be the avarage of a and b.

For example, if a user with rating 1 competes in a contest and gives performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.

Takahashi's current rating is R, and he wants his rating to be exactly G after the next contest.

Find the performance required to achieve it.  

Constraints

0 \leq R, G \leq 4500

All input values are integers.

Input

Input is given from Standard Input in the following format:

R
G

Output

Print the performance required to achieve the objective.

Sample Input 1

2002
2017

Sample Output 1

2032

Takahashi's current rating is 2002.

If his performance in the contest is 2032, his rating will be the average of 2002 and 2032, which is equal to the desired rating, 2017.

Sample Input 2

4500
0

Sample Output 2

-4500

Although the current and desired ratings are between 0 and 4500, the performance of a user can be below 0.



Sample input:
2002
2017


Sample output:
2032

Submission status: Wrong Answer

Solution code:
import sys


def main():

    # Get Args
    args = _input_args()  # get arguments as an array from console/script parameters.

    # Call main Logic
    result = _main(args)

    # Output a result in a correct way.
    _output_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    # Extract arguments.
    Sd = args[0]
    T = args[1]

    # Write main logic here.
    result = _fit_partial_strings(Sd, T)

    # Return something.
    return result


def _fit_partial_strings(Sd, T):

    for i in range(len(Sd)):
        for j in range(len(T)):
            if Sd[i] == T[j]:
                if len(Sd) - i >= len(T) - j: # enough space available?
                    offset = i - j
                    Sd_list = list(Sd)  # convert str to list for operation
                    for k in range(len(T)):
                        Sd_list[k + offset] = T[k]  # patch T to Sd
                    Sd = "".join(Sd_list) # convert list to str
                else:
                    return 'UNRESTORABLE'

    if Sd.count('?') == 1:
        Sd = Sd.replace('?', 'a')
        return Sd

    return 'UNRESTORABLE'


def _input_args():
    # Comment-out appropriate pattern depends on subject.

    # arguments = sys.argv[1:]  # ptn1: get args from script parameters.
    # arguments = _input().split()  # ptn2: get args from 1 line console prompt with space separated.

    # for multi-line console input, use this.
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2)

    # Cast elements If you need.
    # arguments = list(map(int, arguments))  # cast elements to int for example.

    return arguments  # This will be array.


def _input():
    # If Subject requires interactive input, use this and patch mock in unittest.
    return input()  # Change if necessary.


def _get_args_from_multiple_lines(end_of_lines_char=[''], limit=2):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :param limit: If a number of the input line are certain, you can use this param to close prompt immediately.
    :type limit: int
    :return: args
    :rtype list of str
    """
    args = []
    for i in range(limit):
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  # Supports EOF Style. (Very Rare case)
            break
    return args


def _output_result(result):
    # Comment-out appropriate output pattern depends on subject.

    # sys.stdout.write(result)  # No Line Feed, and an result must be string (not useful). for single value output.
    # print(result)  # The result will cast to strings. Line feed will be appended to the end. for single value output.
    # print(result, end='')  # Same as above except Line Feed won't be appended. for single value output.
    # print(','.join(map(str, result)))  # Print array elements as comma separated strings. for multi-value.
    print('{}'.format(str(result)))  # Same as above, but more versatile.


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
R = float(input())
G = float(input())

x = 2*G -R
print(x)

Submission status: Wrong Answer

Solution code:
m = input()
n = input()

print (n + m) / 2.0

Submission status: Wrong Answer

Solution code:
m = input();
n = input();

print (n + m) / 2.0

Submission status: Wrong Answer

Solution code:
R = float(input())
G = float(input())

print(2*G-R)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
a = 1
for i in range(n):
    if 2*a>=a+k:
        a = a+k
    else:
        a = 2*a
print(a)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# coding: UTF-8

import math
import random

def main():
    print("現在のレート")
    R = int(input('The integer is '))
    if(R>4500)or(R<0):
        print ("ダメ")
        R = int(input('The integer is  '))
    
    print("次のコンテストを含めたレーティング")
    G = int(input('The integer is  '))
    if(G>4500)or(G<0):
        print ("ダメ")
        G = int(input('The integer is  '))

    x = 2*G - R
    
    print('取るべきパフォーマンスは、{}'.format(x))

main()

Submission status: Wrong Answer

Solution code:
n = input()
k = input()
z = 1
for i in range(n):
	z = min(2 * z, z + k)
print z

Submission status: Wrong Answer

Solution code:
S2 = list(input())
T = list(input())
S = []
Temp = 0

for _ in range(len(S2)-len(T)+1):
    for j in range(len(T)):
        if T[j] == S2[Temp + j] or S2[Temp + j] == "?":
            if j == len(T) - 1:
                S.append([S2[x] for x in range(Temp)] + [T[x] for x in range(len(T))] + [S2[x] for x in range(Temp + len(T), len(S2))])
                Temp += 1
                break
            else:
                continue
        else:
            Temp += 1
            break

#print(S2)
#print(S)
for i in range(len(S)):
    for j in range(len(S2)):
        if S[i][j] == '?':
            S[i][j] = 'a'
    S[i] = ''.join(S[i])
if S != []:
    print(sorted(S)[0])
else: print('UNRESTORABLE')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
ind = 0
sd = input()
t = input()
len_t = len(t)

while ind < len(sd):
    # S'からTと同じ長さの文字列を切り出す
    partOfSd = sd[ind:ind + len_t]
    # 切り出した文字列PoSdに対して１文字ずつループしてTと比較する
    if len(partOfSd) < len_t:
        matched = False
        break
    else:
        ind_posd = 0
        matched = True
    
    while ind_posd < len_t:
        if partOfSd[ind_posd] == t[ind_posd] or partOfSd[ind_posd] == '?':
            # match
            ind_posd += 1
        else:
            matched = False
            break
    if matched:
        # 全部一致した場合
        # PoSdをTで置き換えて、残りの？をaに置き換える
        slist = list(sd)
        ind_t = 0
        while ind_t < len_t:
            slist[ind] = t[ind_t]
            ind += 1
            ind_t += 1
        sd = "".join(slist)
        print (sd.replace('?', 'a'))
        break
    else:
        ind += 1
        
if not matched:
    print ('UNRESTORABLE')

# 一致しなかった場合、Sdを一文字ずらして繰り返す

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())

x = 1

for i in range(N):
	if x < K:
		x *= 2
	else:
		x += K

print(x)

Submission status: Wrong Answer

Solution code:
import itertools


def operationA(num):
    number = num * 2
    return number


def operationB(num, k):
    number = num + k
    return number


def what_do(start, n, k):
    for i in range(n):
        if start * 2 > start + k:
            start = operationB(start, k)

        else:
            start = operationA(start)

    return start


n = int(input())
k = int(input())


print(what_do(1, n, k))

Submission status: Wrong Answer

Solution code:
import sys

S = sys.stdin.readline().rstrip()
T = sys.stdin.readline().rstrip()

def checkValid(S, i, T):
    try:
        if S[i] == T[0]:
            for j in range(0, len(T)):
                if S[i+j] == T[j] or S[i+j] == '?':
                    pass
                else:
                    return False
        else:
            return False
        return True
    except Exception as e:
        return False

def checkValid2(S, i, T):
    try:
        for j in range(0, len(T)):
            if S[i+j] == T[j] or S[i+j] == '?':
                pass
            else:
                return False
        return True
    except Exception as e:
        return False
def getResult(S, i, T):
    res = ""
    for k in range(0, len(S)):
        if k < i:
            res = res + S[k]
        elif k >= i and k < i+len(T):
            res = res + T[k-i]
        else:
            res = res + S[k]
    S = res.replace('?', 'a')
    return S

res_list = []

res = False
for i in range(0, len(S)):
    if S[i] != '?':
        if checkValid(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True
    else:
        if checkValid2(S, i, T) == True:
            res_list.append(getResult(S, i, T))
            res = True

if res == False:
    print("UNRESTORABLE")
else:
    print (len(res_list))
    smallest = res_list[0]
    for i in range(0, len(res_list)):
        if smallest > res_list[i]:
            smallest = res_list[i]

Submission status: Wrong Answer

Solution code:
i,p=int,input
print(2*(i(p())-i(p())))

Submission status: Wrong Answer

Solution code:
R=float(raw_input())
G=float(raw_input())
x=0.0
if 0.0<=R<=4500.0 and 0.0<=G<=4500.0:
    x+=2*G-R
    print x

Submission status: Wrong Answer

Solution code:
R=float(raw_input())
G=float(raw_input())
x=0.0
if 0.0<=R<=4500.0 and 0.0<=G<=4500.0:
    x+=2*G-R
    print(x)

Submission status: Wrong Answer

Solution code:
R=float,raw_input()
G=float,raw_input()
x=0.0
if 0.0<=R<=4500.0 and 0.0<=G<=4500.0:
    x+=2*G-R
    print x

Submission status: Wrong Answer

Solution code:
# -*- coding utf-8 -*-
 
r = int(input())
g = int(input())

a=g-2*r

print(int(a/2))

Submission status: Wrong Answer

Solution code:
ans = 1
n = int(input())
k = int(input())
cnt = 0
while ans * 2 < ans + k:
    if cnt > n:
        break
    ans *= 2
    cnt +=1
for i in range(cnt,n):
    ans += k
    
print(ans)

Submission status: Wrong Answer

Solution code:
R=input()
G=input()
if R<G:
  print(2*G+R)
elif G>R:
  print(-1*(2*G+R))

Submission status: Wrong Answer

Solution code:
R=input()
G=input()
if G<R:
  print(2*G+R)
elif G>R:
  print(-1*(2*G+R))

Submission status: Wrong Answer

Solution code:
R=input()
G=input()
print(2*G+R)

Submission status: Wrong Answer

Solution code:
x = input()
y = input()
print( ( int(x) + int(y) ) / 2 )

Submission status: Wrong Answer

Solution code:
# coding: utf-8

R=int(input())
G=int(input())

print((R+G)/2)

Submission status: Wrong Answer

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

def eq(s, t):
    for i in range(len(s)):
        if s[i] != t[i] and s[i] != '?':
            return False
    return True

for i in reversed(range(len(s) - len(t)+1)):
    if eq(s[i:i+len(t)], t[:]):
        s[i:i + len(t)] = t[:]
        ans = ''.join(s)
        print(ans.replace('?', 'b'))
        quit()
print('UNRESTORABLE')

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    n = int(input())
    k = int(input())

    result=1
    while(n==0):
        if (result+k > result*2):
            result=result*2
        else:
            result=result+k
        n=n-1
    print(result)

Submission status: Wrong Answer

Solution code:
import sys

N = int(sys.stdin.readline())
K = int(sys.stdin.readline())

curVal = 1
for i in range(0, N):
    if curVal < K:
        curVal = curVal + curVal
    else:
        curVal = curVal + K
print(curVal)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
A = N-K
B = K-1
C = N*K
i =1
p=0
while p<B:
 i=i*2
 p=p+1
 print(i)
print(i+C-K*K+K)

Submission status: Wrong Answer

Solution code:
# -*- coding utf-8 -*-
 
r = int(input())
g = int(input())

a=(g/2)-r

print(int(a))

Submission status: Wrong Answer

Solution code:
R = int(input())
G = float(input())
b = 2*G + R
print(b)

Submission status: Wrong Answer

Solution code:
# -*- coding utf-8 -*-
 
r = int(input())
g = int(input())
 

print(int((g/2)-r))

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
 
A = 1 + ( N * K )
B = 1 * 2 +(N-1)*K
C = 1 * 2*2 +((N-2)*K)
D = 1 * 2*2*2 +(N-3)*K
E = 1 * 2*2*2*2+(N-4)*K
if 0<A<B:
    print(A)
elif 0<B<C:
    print(B)
elif 0<C<D:
    print(C)
elif 0<D<E:
    print(D)
elif 0<D:
    print(E)
else:
    print(A)

Submission status: Wrong Answer

Solution code:
import sys

def make_pattern(s):
    res = []
    for i in range(2**len(s)):
        origin = s
        for j in range(len(s)):
            if ((i & 1) == 1) and (j != 0) and (j != (len(s) - 1)):
                origin = origin[:j] + "?" + origin[(j+1):]
            elif ((i & 1) == 1) and (j == 0):
                origin = "?" + origin[1:]
            elif ((i & 1) == 1) and (j == (len(s) - 1)):
                origin = origin[:len(s) - 1] + "?"
            i = i >> 1
        res.append(origin)
    return res

S = sys.stdin.readline().strip()
T = sys.stdin.readline().strip()

if S.find(T) > -1:
    ans = S.replace("?", "a")
    print(ans)
else:
    pattern_list = make_pattern(T)
    index_list = []
    for pattern in pattern_list:
        index = S.rfind(pattern)
        if index != -1:
            index_list.append(index)
    if len(index_list) == 0:
        print ("UNRESTORABLE")
        sys.exit()
    replace_index = max(index_list)
    ans = S[:(replace_index)] + T + S[(replace_index + len(T)):]
    ans = ans.replace("?", "a")
    print(ans)

Submission status: Wrong Answer

Solution code:
R = int(input())
G = int(input())
b = 2*G + R
print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
 
A = 1 + ( N * K )
B = 1 * 2 +(N-1)*K
C = 1 * 2*2 +((N-2)*K)
D = 1 * 2*2*2 +(N-3)*K
E = 1 * 2*2*2*2+(N-4)*K
if 0<A<B:
    print(A)
elif 0<B<C:
    print(B)
elif 0<C<D:
    print(C)
elif 0<D<E:
    print(D)
elif 0<D:
    print(E)
else:
   print(A)

Submission status: Wrong Answer

Solution code:
# -*- coding utf-8 -*-
 
r = int(input())
g = int(input())
 
for x in range(4501):
    for y in range(4501):
        if g == (r+x-y)/2:
              print(x-y)
              break

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())

S = 1
for i in range(N):
    if S < K:
        S = S*2
    else:
        S = S + K

print(S)

Submission status: Wrong Answer

Solution code:
R = float(input())
G = float(input())
ans = (2 * G) -R
print("{0:.1f}".format(ans))

Submission status: Wrong Answer

Solution code:
R=float(raw_input())
G=float(raw_input())
x=2*R-G
print(x)

Submission status: Wrong Answer

Solution code:

G=float(raw_input())
R=float(raw_input())
x=2*R-G
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())

A = 1 + ( N * K )
B = 1 * 2 +(N-1)*K
C = 1 * 2*2 +((N-2)*K)
D = 1 * 2*2*2 +(N-3)*K
E = 1 * 2*2*2*2+(N-4)*K
if A<B:
    print(A)
elif B<C:
    print(B)
elif C<D:
    print(C)
elif D<E:
    print(D)
else:
    print(E)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())

A = 1 + ( N * K )
B = 1 * 2 +(N-1)*K
C = 1 * 2^2 +(N-2)*K
D = 1 * 2^3 +(N-3)*K
if A<B:
    print(A)
elif B<C:
    print(B)
elif C<D:
    print(C)
else:
    print(D)

Submission status: Wrong Answer

Solution code:
a =  float(raw_input())
c = float(raw_input())
print (2*c-a)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())

num = 1000000000000000000000

for i in range(n):
  cost = 1
  for j in range(i):
    cost = cost*2
  for j in range(n-i):
    cost = cost + k

  num = min(cost, num)

print(num)

Submission status: Wrong Answer

Solution code:
if "__name__"=="__main__":
  r = int(raw_input())
  g = int(raw_input())
  k = 2*g - r
  print k

Submission status: Wrong Answer

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

r = int(input())
g = int(input())

for x in range(4500):
	if g == (r+x)/2:
		a = x
		break

print(x)

Submission status: Wrong Answer

Solution code:
r = float(input())
g = float(input())

if r > g:
    print(int(g - r))
else:
    print(int(g - r + g))

Submission status: Wrong Answer

Solution code:
import sys

num = 1
n = int(sys.stdin.readline().strip())
k = int(sys.stdin.readline().strip())

for i in range(n):
    num = min(num + k, 2 * num)

print(num)

Submission status: Wrong Answer

Solution code:
n = int(input())
k = int(input())
v = 1
for i in range(n):
  if 2*v < v + k:
    v = 2*v
  else:
    v = v+k
print(v)

Submission status: Wrong Answer

Solution code:
if "__name__"=="__main__":
  r = raw_input()
  g = raw_input()
  k = 2*g - r
  print k

Submission status: Wrong Answer

Solution code:
R = float(input())
G = float(input())
ans = 2 * G -R
print(ans)

Submission status: Wrong Answer

Solution code:
R = float(input())
G = float(input())
print(2*G-R)

Submission status: Accepted

Solution code:
r=int(input())
g=int(input())
print(2*g-r)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(2*G - R)

Submission status: Accepted

Solution code:
R=int(input())
G=int(input())
print(2*G-R)

Submission status: Accepted

Solution code:
print(-int(input()) + 2 * int(input()))

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())

print(2*g - r)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())

print(2*b-a)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    #1 line 1 int
     return int(sys.stdin.readline().rstrip())
def LI():
    #1 line n int
     return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    #1 line 1 string
     return sys.stdin.readline().rstrip()
def LS():
    #1 line n strings
     return list(sys.stdin.readline().rstrip().split())

R=I()
G=I()

x=2*G-R
print(x)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I():
    # 1 line 1 int
    return int(sys.stdin.readline().rstrip())
def LI():
    # 1 line n ints
    return list(map(int,sys.stdin.readline().rstrip().split()))
def S():
    # 1 line 1 string
    return sys.stdin.readline().rstrip()
def LS():
    # 1 line n strings
    return list(sys.stdin.readline().rstrip().split())

R = I()
G = I()

x = 2*G-R
print(x)

Submission status: Accepted

Solution code:
r=int(input())
g=int(input())

print(2*g-r)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print(2 * G - R)

Submission status: Accepted

Solution code:
print((-1) * int(input()) + 2 * int(input()))

Submission status: Accepted

Solution code:
R=int(input())
G=int(input())
print(G*2-R)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    R = I()
    G = I()

    ans = 2 * G - R
    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print((2 * G) - R)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
print(2*b-a)

Submission status: Accepted

Solution code:
# 076_a
R=int(input())
G=int(input())
if (0<=R and R<=4500) and (0<=G and G<=4500):
    print(2*G-R)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(2*g-r)

Submission status: Accepted

Solution code:
a,b=[int(input()) for i in range(2)]

print(2*b-a)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(2*G-R)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(r+2*(g-r))

Submission status: Accepted

Solution code:
with open(0) as f:
    R, G = map(int, f.read().split())
print(2*G-R)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
print(a+(b-a)*2)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

# (answer + R)/ 2 = G

answer = 2 * G -R
print(answer)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())

print(2 * g - r)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(2* G - R)

Submission status: Accepted

Solution code:
R=int(input())
G=int(input())
print(2*G-R)

Submission status: Accepted

Solution code:
#76
r=int(input())
g=int(input())
print(2*g-r)

Submission status: Accepted

Solution code:
r=int(input())
g=int(input())
ans=(g*2)-r
print(int(ans))

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
print(b + (b - a))

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(2 * G - R)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())

print(a+(b-a)*2)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print(2 * G - R)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print(2*G-R)

Submission status: Accepted

Solution code:
r,g=int(input()),int(input())
print(2*g-r)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(2*g - r)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(g * 2 - r)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(2 * g - r)

Submission status: Accepted

Solution code:
def main():
    r, g = int(input()), int(input())

    print(2 * g - r)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())

print(2*g-r)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print(G + (G - R))

Submission status: Accepted

Solution code:
r=int(input())
c=int(input())
print(2*c-r)

Submission status: Accepted

Solution code:
# A - Rating Goal
# https://atcoder.jp/contests/abc076/tasks/abc076_a

R = int(input())
G = int(input())

print(G * 2 - R)

Submission status: Accepted

Solution code:
r=int(input())
g=int(input())
n=r+2*(g-r)
print(n)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(g*2 - r)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(2 * g - r)

Submission status: Accepted

Solution code:
import sys

R = int(input())
G = int(input())

print(2*G-R)

Submission status: Accepted

Solution code:
r = int(input())
n = int(input())
print(n * 2 - r)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print(G+(G-R))

Submission status: Accepted

Solution code:
R=int(input())
G=int(input())
print(G*2-R)

Submission status: Accepted

Solution code:
r=int(input())
g=int(input())
ans=2*g-r
print(ans)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(G * 2 - R)

Submission status: Accepted

Solution code:
x=int(input())
y=int(input())
print(y+(y-x))

Submission status: Accepted

Solution code:
# A - Rating Goal

# 現在のレートをa, コンテストのパフォーマンスをbとすると、レートはaとbの平均まで変化する
# 現在のレートをR, 次のコンテストでの目標レートをGとした場合、取るべきパフォーマンスを出力する


R = int(input())
G = int(input())

print((G * 2) - R)

Submission status: Accepted

Solution code:
# 現在のレーティングが R で, 次のコンテストでレーティングをちょうど G にしたい
# レーティングは現在のレーティングと次のパフォーマンスの平均

R = int(input())
G = int(input())

b = 2*G - R
print(b)

Submission status: Accepted

Solution code:
# 高橋君はあるプログラミングコンテストが行われているサイトに参加しています。
# ここでは, コンテストに出場した時にこの順位に応じて「パフォーマンス」というものがつき、
# それによってレーティング (整数とは限らない) が次のように変化します。
#
# 現在のレーティングを a とする。
# 次のコンテストで, パフォーマンス bを取ったとする。
# そのとき, レーティングは a と b の平均まで変化する。
# 例えば, レーティングが 1 の人が
# 次のコンテストでパフォーマンス 1000を取ったら,
# レーティングは 1 と 1000 の平均である 500.5 になります。
#
# 高橋君は, 現在のレーティングが R で,
# 次のコンテストでレーティングをちょうど Gにしたいと思っています。
# そのとき, 高橋君が取るべきパフォーマンスを求めなさい。

# 制約
# 0 ≦ R, G ≦ 4500
# 入力はすべて整数

# 標準入力から R, G の値を取得する
r = int(input())
g = int(input())

# 高橋君が取りべきパフォーマンスを計算し、出力する
# (r + x) / 2 = G
result = g * 2  - r

print(result)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())

print(int(2 * g - r))

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(G*2-R)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())

x = 2 * g - r

print(x)

Submission status: Accepted

Solution code:
# 入力
R = int(input())
G = int(input())

# (R+G)/2=X X=2G-R
performance = G * 2 - R

# 出力
print(performance)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(2 * G - R)

# 高橋君が取るべきレーティングをXと置くと　(R + X) / 2 = G となる。
# 式を変形すると　X = 2 * G - R となる。これが高橋君が取るべきレーティング。

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

print(G * 2 - R)

Submission status: Accepted

Solution code:
#   AtCoder abc076 a
#   ストレッチ課題

#   入力
#   ミス　r, g = map(int, input().split())
r = int(input())
g = int(input())

#   処理
#   G = (R + answer) / 2 -> answer = 2G - R
answer = 2 * g - r

#   出力
print(answer)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

rating = G * 2 - R
print(rating)

Submission status: Accepted

Solution code:
# 入力
R = int(input())
G = int(input())

# 処理
answer = 2 * G - R

# 出力
print(answer)

Submission status: Accepted

Solution code:
current_rating = int(input())
final_rating = int(input())
performance = final_rating * 2 - current_rating
print(performance)

Submission status: Accepted

Solution code:
print(-int(input()) + int(input()) * 2)

Submission status: Accepted

Solution code:
R, G = (int(input()) for i in range(2))
print(G * 2 - R)

Submission status: Accepted

Solution code:
# 入力
R = int(input())
G = int(input())

# 出力

if 0 <= R and G <= 4500:
    print(G * 2 - R)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
ans = 2*G - R
print(ans)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
performance = 2 * g - r
print(performance)

Submission status: Accepted

Solution code:
R = int(input())  # 現在のレーティング
G = int(input())  # 次のコンテストでとりたいと思ってるレーティング

# 高橋君が取るべきパフォーマンスを出力
print(G*2 - R)

Submission status: Accepted

Solution code:
print(-int(input()) + int(input()) * 2)

Submission status: Accepted

Solution code:
R, G = (int(input()) for i in range(2))

R += (G - R) * 2

print(R)

Submission status: Accepted

Solution code:
# 076a

R = int(input())
G = int(input())

B = G * 2 - R
print(B)

Submission status: Accepted

Solution code:
def main():
  my_rate = int(input())
  avarage_rate = int(input())
  
  target_rate = (avarage_rate * 2) - my_rate
  
  print(target_rate)

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
# 現在と目標のレーティングを取得
R = int(input())
G = int(input())

# 目標のレーティングになるためのパフォーマンスの数値を計算
Target = (G * 2) - R

# 計算結果を出力
print(Target)

Submission status: Accepted

Solution code:
print(-int(input()) + 2*int(input()))

Submission status: Accepted

Solution code:
# 現在のレートRとコンテスト後の目指したいレートGを入力
R = int(input())
G = int(input())
# Gの2倍から現在のレートRを引いて、次のコンテストのレートを出力
print(G * 2 - R)

Submission status: Accepted

Solution code:
S_list = [int(input()) for i in range(2)]

mokuhyou = 2 * S_list[1] - S_list[0]
print(mokuhyou)

Submission status: Accepted

Solution code:
a=int(input())
b= int(input())
print(b*2-a)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
print(b*2-a)

Submission status: Accepted

Solution code:
# 現在のレーティングを a とする。
# 次のコンテストで, パフォーマンス b を取ったとする。
#そのとき, レーティングは a と b の平均まで変化する。

# 現在のレーティング R と　目指したいレーティング G を入力
R = int(input())
G = int(input())
# print(R, G)

# とるべきパフォーマンス を x とすると、
# 目指したいレーティング　G = (R+x)/2　
# 以下式変換
# 2G = R + x
# x = 2G - R

x = (2 * G) - R
# print(x)

# 答えを代入
answer = x
print(answer)

Submission status: Accepted

Solution code:
r = int(input())
g= int(input())
print(r+2*(g-r))

Submission status: Accepted

Solution code:
# 入力
r = int(input())
g = int(input())

# 処理
answer = 2 * g - r

print(answer)

Submission status: Accepted

Solution code:
rrate = int(input())
nrate = int(input())

print(nrate * 2 - rrate)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print(G * 2 - R)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())

# (a + b) / 2 = G
# R = a
# answer = b
answer = 2 * G - R
print(answer)

Submission status: Accepted

Solution code:
last_rating = int(input())
average_rating = int(input())

this_time_rating = 2 * average_rating - last_rating

print(this_time_rating)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
a = R

b = G * 2 - a

print(b)

Submission status: Accepted

Solution code:
R=int(input())
G=int(input())

print(R+(G-R)*2)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
print(2 * b - a)

Submission status: Accepted

Solution code:
print(-(int(input())-int(input())*2))

Submission status: Accepted

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

R = int(input())
G = int(input())

print(2 * G - R)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(g*2 - r)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(g*2-r)

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
print(g * 2 - r)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    R = int(readline())
    G = int(readline())
    ans = 2*(G-R)+R
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
r=int(input())
g=int(input())
x = int((g*2)-r)
print(x)

Submission status: Accepted

Solution code:
print(-int(input())+2*int(input()))

Submission status: Accepted

Solution code:
R,G = (int(input()) for T in range(0,2))
print(2*G-R)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

def main():
    r = int(input())
    g = int(input())

    print(g*2-r)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
print(2*b-a)