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

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

R = iIn()
G = iIn()

ans = 2 * G - R
print(ans)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

print(2*g-r)

Submission status: Accepted

Solution code:

def main():
    r = int(input())    
    g = int(input())    
    print(g - r + g)


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*2-r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    R=ii()
    G=ii()

    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 - r) * 2) + r)

Submission status: Accepted

Solution code:
print -int(raw_input()) + (int(raw_input()) << 1)

Submission status: Accepted

Solution code:
a,av =  int(raw_input()), int(raw_input())
print 2*av - a

Submission status: Accepted

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

print(2*G - R)

Submission status: Accepted

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

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=int(input())
g=int(input())
print(2*g-r)

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(2)]
my_result = 2 * a[1] - a[0]
print(my_result)

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:
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:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

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

R = INT()
G = INT()
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(int(g * 2 - r))

Submission status: Accepted

Solution code:
r, g = list(map(int, [input() for _ in range(2)]))
print(g*2 - r)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    R, G = map(int, read().split())

    print(2 * G - R)

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
r = int(input())
g = int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
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())

t = g-r

print(g+t)

Submission status: Accepted

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

print(-I()+2*I())

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

print((2*G)-R)

Submission status: Accepted

Solution code:
# coding: utf-8
import math
#a, b, c = map(int,input().split())
N = int(input())
K = int(input())
#S = input()
ans = 1
#l = list(map(int,input().split()))
print(2*K-N)

Submission status: Accepted

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

def main():
    r = int(input())
    g = int(input())
    print(2 * g - r)


if __name__ == "__main__":
    main()

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:
a=int(input())
b=int(input())

print(2*b-a)

Submission status: Accepted

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

print(g*2-r)

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(2*b - a)

Submission status: Accepted

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

Submission status: Accepted

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

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:
r = int(input())
g = int(input())

print(-r+2*g)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    s = int(input())
    #s = (n+res)/2 -> 2s = n+res

    print(2*s-n) 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(g*2 -r)

Submission status: Accepted

Solution code:
R, G = [int(input()) for i in range(2)]
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,g = [int(input()) for i in range(2)]

print(2*g-r)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
current = int(input())
nextt = int(input())

ans = nextt * 2 - current

print(ans)

Submission status: Accepted

Solution code:
#g = (r+p)/2
#2g = r+p
#2g - r = p
r = int(input())
g = int(input())

print(2*g - r)

Submission status: Accepted

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

    ans = g + g-r
    print(ans)
resolve()

Submission status: Accepted

Solution code:
R=int(input())
G=int(input())
a=abs(R-G)
if G>R:
    print(max(R,G)+a)
else:
    print(min(R,G)-a)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
R = I()
G = I()
x = G - R
print(G + x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((2*b)-a)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = ri(), ri()
print(a + (b-a)*2)

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    r = i_input()
    g = i_input()

    print(g+g-r)
 
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=int(input())
print((a-n)+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(g * 2 - 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())

ans = 2*G-R
print(ans)

Submission status: Accepted

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

print(g * 2 - r)

Submission status: Accepted

Solution code:
r,g = [int(input()) for i in range(2)]
print(2*g-r)

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

Submission status: Accepted

Solution code:
import sys
R = int(input())
G = int(input())
if not (0 <= R <= 4500 and 0 <= G <= 4500):
    sys.exit()

print ( G * 2 - R )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

Submission status: Accepted

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

Submission status: Accepted

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

print(x)

Submission status: Accepted

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

print(2*g-r)

Submission status: Accepted

Solution code:
r,g=map(int,open(0))
print(g+g-r)

Submission status: Accepted

Solution code:
r,g=map(int,open(0).read().split());print((g*2)-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())
diff = g-r
print(g+diff)

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

b = 2*G - R

print(b)

Submission status: Accepted

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

answer = 2 * g - a
print(answer)

Submission status: Accepted

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

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

print((2 * g) - r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    print(2 * G - R)

if __name__ == '__main__':
    main()

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

sa = G-R
print(G+sa)

Submission status: Accepted

Solution code:
def main():
    r = int(input())
    target = int(input())
    diffs = target - r
    print(r+diffs*2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
r, g = map(int, open(0).read().split())
print(2 * g - r)

Submission status: Accepted

Solution code:
def actual(R, G):
    return (G - R) + G


R = int(input())
G = int(input())
print(actual(R, G))

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())
print (2*g-r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
R,G=int(input()),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 math

a=int(input())
b=int(input())
ans=2*b-a
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
r,g=map(int,open(0).read().split());print(g*2-r)

Submission status: Accepted

Solution code:
A = int(input())
B = int(input())
print(B*2-A)

Submission status: Accepted

Solution code:
R = int(input())
G = int(input())
print((G - R) * 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())
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())


N = 2*G -R

print(N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(g * 2 - r)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    N = int(input())
    M = int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

    print(2*M-N)




if __name__ == "__main__":
    main()

Submission status: Accepted

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

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    r = ii()
    g = ii()
    print(g*2 - r)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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 - r) + g)

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(2*g-r)

Submission status: Accepted

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

print(-R+2*G)

Submission status: Accepted

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))

def main():
    r = II()
    g = II()
    print(2*g-r)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


def solve(R: int, G: int):
    print(G*2-R)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    solve(R, G)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

r, g = [int(readline()) for _ in range(2)]
ans = r + (g - r) * 2
print(ans)

Submission status: Accepted

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

print((G-R)+G)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(r + (g - r) * 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
R, G = map(int, open(0))  # n行
print(G + (G - R))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 01:33:53 2020

@author: shinba
"""

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(R+(G-R)*2)

Submission status: Accepted

Solution code:
S = int(input())
T = int(input())

print(2*T - S)

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:
print(-int(input())+ 2*int(input()))

Submission status: Accepted

Solution code:
A=int(input())
B=int(input())
print(B+B-A)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    R = int(input())
    G = int(input())

    # (R + x) / 2 = G
    # x = 2G - R
    ans = 2 * G - R

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
R,G=int(input()),int(input())
for i in range(-4500,4501):
    if int(R+i)==G:
        print(i+G)
        break

Submission status: Accepted

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

    ans = 2*g - r
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':

    ABC_76_A()

Submission status: Accepted

Solution code:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
R = ri()
G = ri()
print(G+(G-R))

Submission status: Accepted

Solution code:
def main():
    r,g = (int(input()) for _ in range(2))
    print(2*g - r)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def resolve():
	r, g = [int(input()) for _ in range(2)]
	print(2*g - r)
resolve()

Submission status: Accepted

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

def main():
  R = int(input())
  G = int(input())
  
  print(2 * G - R)


if __name__ == '__main__':
  main()

Submission status: Accepted

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

print(r + (g - r) * 2)

Submission status: Accepted

Solution code:
now_rate = int(input())
to_rate = int(input())

print(to_rate * 2 - now_rate)

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:
print(-1*(int(input())-int(input())*2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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