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: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
s = input().rstrip("\n")
t = input().rstrip("\n")
flg = False
#cnt = 0

if len(s)-len(t)+1<0:
	print("UNRESTOABLE")
    sys.exit(0)
 
for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        #print(s[i+j],t[j])
        if s[i+j] == t[j] or s[i+j] == '?':
            cnt+=1
        #print(cnt,len(t))
    if cnt == len(t):
        cnt=i
        flg = True
        #print(cnt)
        break
 
if not flg:
    print("UNRESTORABLE")
else:
    li = list(s.replace("?","a"))
    #print(li)
    for j in range(len(t)):
        #print(li[cnt+j], t[j])
        li[cnt+j] = t[j]
    print("".join(li))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
s = input().rstrip("\n")
t = input().rstrip("\n")
flg = False
#cnt = 0

if len(s)-len(t)+1<0:
	print("UNRESTOABLE")
    sys.exit()
 
for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        #print(s[i+j],t[j])
        if s[i+j] == t[j] or s[i+j] == '?':
            cnt+=1
        #print(cnt,len(t))
    if cnt == len(t):
        cnt=i
        flg = True
        #print(cnt)
        break
 
if not flg:
    print("UNRESTORABLE")
else:
    li = list(s.replace("?","a"))
    #print(li)
    for j in range(len(t)):
        #print(li[cnt+j], t[j])
        li[cnt+j] = t[j]
    print("".join(li))

Submission status: Runtime Error

Solution code:
R, G = map(int, input().split())
print(2*G-R)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
 
def func(a):
  ans = 1
  for n in range(a):
    ans = ans*2
  for n in range(N-a):
    ans = ans + K
  return ans
 
print(min([func(i) for i in range(N)]))

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
print(a+(b-a)*2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def newrating(r , g):

    return (r + g) / 2

def main():
    r , g = map(int , input().split())
    print(newrating(r , g))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,m=map(int,input().split())
print(2*m-a)

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B = read().decode('utf8').split()
print(2*B-A)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(2g-r)

Submission status: Runtime Error

Solution code:
N = int(input())
t = [0]+ list(map(int,input().split()))
v = [0] + list(map(int,input().split()))

T = sum(t) 

limit=[0]*(T+1)
sp_forward=[0]*(T+1)
sp_backward=[0]*(T+1)

j = 1
tmp = 0
for i in range(1,T+1):
    limit[i] = v[j]
    tmp += 1
    if tmp == t[j]:
        if j < N-1 and v[j+1] < v[j]:
            limit[i] = v[j+1]
        j+=1
        tmp = 0

    
for i in range(1,T+1):
    sp_forward[i] = min(sp_forward[i-1]+1, limit[i])

for i in reversed(range(0,T)):
    sp_backward[i] = min(sp_backward[i+1]+1, limit[i])

cnt = 0

for i in range(1,T+1):
    if sp_forward[i-1] == sp_backward[i] and (sp_forward[i-1] < sp_forward[i] or sp_backward[i-1] > sp_backward[i]):
        cnt += sp_backward[i] + 0.25
    elif sp_forward[i-1] == sp_backward[i]:
        cnt+=sp_backward[i]
    else:
        cnt += min(sp_forward[i-1], sp_backward[i]) + 0.5
    
    
print(cnt)

Submission status: Runtime Error

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

print(2g-r)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
R,G = map(int, input().split())

X = ((2*G)-R)

print(X)

Submission status: Runtime Error

Solution code:
#Rating Goal
R, G = map(int, input().split())
T = R + 2 * (G - R)
print(T)

Submission status: Runtime Error

Solution code:
#Rating Goal
R, G = map(int, input().split())
T = R + 2 * (G - R)
print (T)

Submission status: Runtime Error

Solution code:
#asfddddddd
n, m  = map(int, input().split())
print(m + m - n)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
prinp(b*2-a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s = g * 2 - r
print(s)

Submission status: Runtime Error

Solution code:
r, g = map(int, input().split())
x = g * 2 - r

print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
lst=list(map(int, input().split()))
r=lst[0]
g=lst[1]
print(2*g-r)

Submission status: Runtime Error

Solution code:
lst = map(int, input().split())
r = lst[0]
g = lst[1]
print(2*g-r)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
V

Submission status: Runtime Error

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

print(2G-R)

Submission status: Runtime Error

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

input(2G-R)

Submission status: Runtime Error

Solution code:
r, g = map(int, input().split())
print((r + g) / 2)

Submission status: Runtime Error

Solution code:
from itertools import accumulate as ac
n=int(input())+2
t=[0]+list(map(int,input().split()))+[0]
v=[0]+list(map(int,input().split()))+[0]
s=[0]+list(ac(t))
def f(i,x):
    if s[i]<=x<=s[i+1]:return v[i]
    elif x<s[i]:return v[i]+s[i]-x
    else:return v[i]+x-s[i+1]
c=float("INF")
for i in range(n):
    c=min(c,f(i,0))
e=0
for i in range(1,2*s[-1]+1):
    i=i/2
    d=float("INF")
    for j in range(n):
        d=min(d,f(j,i))
    e+=0.25*(c+d)
    c=d
print(e)

Submission status: Runtime Error

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

print(abs(g - r)*2 + mint(g,r))

Submission status: Runtime Error

Solution code:
(r, g) = (int(tok) for tok in input().split())
print(2 * g - r)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#18:09
r,g = map(int,input().split())
print ( 2 * g - r )

Submission status: Runtime Error

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

Submission status: Runtime Error

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

x = 2*average-now_Rating

prtint(x)

Submission status: Runtime Error

Solution code:
h, w = 2, 3
c = []

for _ in range(h):
    c.append(input())

if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int r = sc.nextInt();
        int g = sc.nextInt();
        int result = g * 2 - r;
        System.out.println(result);
        sc.close();
    }
}

Submission status: Runtime Error

Solution code:
r = int(input().split()[0])
g = int(input().split()[0])

next = g * 2 - r
print(next

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
R=input()
G=input()
answer=R-G

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = 0; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(-eval(open(0).replace("\n","-2*")))

Submission status: Runtime Error

Solution code:
print(eval(("2*" +input()).replace(" ","-"))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(int(2*b-a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)-1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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

print(2*G/R)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(r+2g)

Submission status: Runtime Error

Solution code:
r,g=list(map(int,input().split()))
print(2*g-r)

Submission status: Runtime Error

Solution code:
R, G= map(int,input().split())
print(2*G-R)

Submission status: Runtime Error

Solution code:
R,G= map(int,input().split())
print(2*G-R)

Submission status: Runtime Error

Solution code:
R, G=map(int,input().split())
print(2*G-R)

Submission status: Runtime Error

Solution code:
R,G=map(int,input().split())
  print(2*G-R)

Submission status: Runtime Error

Solution code:
  R,G=map(int,input().split())
  print(2*G-R)

Submission status: Runtime Error

Solution code:
R,G=map(int,input().split())
print((2*G)-R)

Submission status: Runtime Error

Solution code:
R,G=map(int,input().split())

print(2*G-R)

Submission status: Runtime Error

Solution code:
R,G=map(int,input().split())
print(2*G-R)

Submission status: Runtime Error

Solution code:
def main():
    n = int(input()) 
	t = [int(input()) for i in range(n)] 
    print(t[1]*2 - t[0])

Submission status: Runtime Error

Solution code:
def main:
  print(1000)

Submission status: Runtime Error

Solution code:
#区間ごとの面積を計算する
def calc_area(v_end, v_start, v_max, dt):
    kouten_v = (v_end + v_start + dt) / 2
    kouten_t = kouten_v - v_start
    if 0 < kouten_t < dt:
        area = (v_start + kouten_v) * kouten_t / 2 #左側
        area +=  (v_end + kouten_v) * (dt - kouten_t) / 2 #右側
        area -=  max(0, (kouten_v - v_max))** 2 #上の三角形
    else:
        area = (v_start + v_end) *  dt / 2
    return area

def main():
    #与えられた入力を受け取る
    n=int(input())
    t=[int(i) for i in input().split()]
    v=[int(i) for i in input().split()]

    #各区間の許容最大速度を計算する
    #（この段階では傾きが-1未満になる可能性がある）
    max_velocity = [0]
    for i in range(1, n):
        max_velocity_ = min(v[i-1], v[i], max_velocity[i-1] + t[i-1])
        max_velocity.append(max_velocity_)
    max_velocity.append(0)

    #後ろから走査して、傾きが-1以上を満たすように許容速度をfittingする
    for i in range(n-1):
        if  max_velocity[-(i+1)] - max_velocity[-(i+2)] < -t[-(i+1)]:
            max_velocity[-(i+2)] = max_velocity[-(i+1)] + t[-(i+1)]

    #各区間の面積を計算して足し合わせる
    ans = 0
    for i in range(n):
        ans += calc_area(max_velocity[i+1], max_velocity[i], v[i], t[i])
    print(ans)

main()

Submission status: Runtime Error

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

print(2G-R)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def aa(a,b):
    return (2*b-a) 
aa(a,b)

Submission status: Runtime Error

Solution code:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(R,G):
    return(G*2-R)
    
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

def solve(R,G):
    print(G*2-R)
    # Uncomment the following if you want to check the input.
    # print('R =', R)
    # print('G =', G)


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

def main():
    solve(readQuestion())

# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
print(k*2-n)

Submission status: Runtime Error

Solution code:
S=input()
T=input()
j=0
i=-1
flag = False
while i>=-1*len(S)-1+len(T):
    while j>=-1*len(T):
        if i==-1*len(S)-1+len(T):
            A="UNRESTORABLE"
            flag=True
            break
        elif j==-1*len(T):
            if i!=-1:
                P=S.replace(S[i-len(T)+1:i+1],T,1)
                A=P.replace("?","a")
                i=-1*len(S)-1+len(T)
                flag=True
                break
            else:
                P=S.replace(S[i-len(T)+1:],T,1)
                A=P.replace("?","a")
                flag=True
                break
        elif S[i+j]==T[j-1] or S[i+j]=="?":
            j=j-1
        else:
            j=0
            i=i-1
    if flag:
        break
print(A)

Submission status: Runtime Error

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


a=input()
b=input()

s=2*b-a

print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(2g-r)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
r,g = map(int, input().split())
print((g*2)/r)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
res = ''
end = -1
for i in range(len(S) - len(T) + 1):
    for j in range(len(T)):
        start = i
        
        if S[i+j] == T[j]:
            end = i + j
            flag == 1
        elif S[i+j] == '?':
            end = i + j
            flag == 0
        else:
            pass
            break
    if flag == 1:
        break
            
if end == -1:
    print('UNRESTORABLE')
    
else:
    j = 0
    for i in range(len(S)):
        if start <= i <= end:
            res += T[j]
            j += 1

        elif S[i] == '?':
            res += 'a'

        else:
            res += S[i]

    print(res)

Submission status: Runtime Error

Solution code:
s = input()
t = input()
for i in range(len(s)-len(t),-1,-1):
  for j in range(len(t)):
    if s[i+j] != '?' and s[i+j] != t[j]:
      break
  else:
    print('{}{}{}'.format(s[:i],t,s[i+u:]).replace('?','a'))
    break
else:
  print('UNRESTORABLE')

Submission status: Runtime Error

Solution code:
#coding:utf-8
n=[int(i) for i in input().split()]
n1=n[1]*2-n[0]
print(n1)

Submission status: Runtime Error

Solution code:
#include<stdio.h>

int main( void )
{
    int r, g;
    scanf("%d", &r);
    scanf("%d", &g);

    printf("%d\n", r + (g-r)*2);
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = []
for i in range(N):
    a.append(input()) 
R=int(a[0])
G=int(a[1])
print(2*G-R)

Submission status: Runtime Error

Solution code:
hoge=[]
for i in range(0,1):
  a=int(input())
  hoge.append(a)
R=hoge[0]
G=hoge[1]
print(2*G-R)

Submission status: Runtime Error

Solution code:
hoge=[]
for i in range(0,1):
  a=int(input())
  hoge.append(a)
N=2*G-R
print(N)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
R,G=(float(i) for i in input().split())
N=2*G-R
print(N)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
if a>=b:
    print('{}'.format((a+b)/2))
else :
    print('{}'.format((b-a)/2))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())
if a*b >= c*d:
  print(a*b)
else:
  print(c*d)

Submission status: Runtime Error

Solution code:
a, b= list(map(int,input().split()))
print(2*b-a)

Submission status: Runtime Error

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

print(2g - r)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print((int(input())+int(input())/2)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int r,g;
cin >> r >> g;

cout << 2 * g - r <<endl;

}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(2g-r)

Submission status: Runtime Error

Solution code:
N = int(input())
t = list(map(int,input().split()))
v = list(map(int,input().split()))

time = 0
sum_t = sum(t)
velo_cap =[float("inf")]*(2*sum_t+1)
for i in range(N):
  start_t = time
  goal_t = time + 2*t[i]
  for s in range(0,2*sum_t+1):
    if s < start_t:
      velo_cap[s] = min(velo_cap[s],2*v[i]+(start_t-s))
    elif s<goal_t:
      velo_cap[s] = min(velo_cap[s],2*v[i])
    else:
      velo_cap[s] = min(velo_cap[s],2*v[i]+(s-goal_t))
  time += 2*t[i]
for s in range(2*sum_t+1):
  velo_cap[s] = min(velo_cap[s],2*sum_t-s,s)


print(sum(velo_cap)/4-(velo_cap[0]+velo_cap[-1])/8)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
R,G = map(float, input().split())

X = 2*G - R
print(int(X))

Submission status: Runtime Error

Solution code:
R,G = map(float, input().split())

X = 2*G - R
print(X)

Submission status: Runtime Error

Solution code:
n = input('');
k = input('');
 
int32(1);
for 1:n
  min(int32(2)*ans, ans+k);
end
 
fprintf("%d\n", ans);

Submission status: Runtime Error

Solution code:
n = input('');
k = input('');

int32(1);
for 1:n
  min(int32(2)*ans, ans+K);
end

fprintf("%d\n", ans);

Submission status: Runtime Error

Solution code:
N = int(input())
t = [float(x) for x in input().rsplit()]
v = [float(x) for x in input().rsplit()]
t_0 = 0
t_now=0
v_0 = 0
v_now = 0
x = 0
t_end = sum(t)
for i in range(N-1):
    if t[i] > v[i] - v_now:
        x += (1 / 2) * (v[i] - v_now) ** 2
        v_now = v[i]
        x += v[i] * (t[i] - (v[i] - v_now))
    else :
        x+=t[i]*t[i]*(1/2)+v_now*t[i]
        v_now+=t[i]
    t_now +=t[i] 
x +=  (1 / 2) *(t_end-t_now) ** 2
print(x)

Submission status: Runtime Error

Solution code:
def main():
    s = input()
    t = input()

    for i in range(len(s)-len(t)+1):
        flag = True
        for j in range(len(t)):
            if s[i+j] != t[j] and s[i+j] != '?':
                flag = False
                break
        if flag:
            s = s[:i] + t + s[i+len(t):]
            #break

    if flag:
        print(s.replace('?', 'a'))
    else:
        print("UNRESTORABLE")
        

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
t = list(map(int, input().split()))
v = list(map(int, input().split()))

T = sum(t)

def f(l, r, v, x):
	maxv = 0
	if 0 <= x and x < l:
		maxv = v + l - x
	elif l <= x and x <= r:
		maxv = v
	else:
		maxv = v + x - r
	return maxv

def vel(x):
	minv = f(0, 0, 0, x)
	minv = min(minv, f(T, T, 0, x))
	l = 0
	r = 0
	for i in range(len(t)):
		r += t[i]
		minv = min(minv, f(l, r, v[i], x))
		l += t[i]
	return minv

area = 0
for i in range(T):
	area += 0.25 * (vel(i) + 2 * vel(i+0.5) + vel(i+1))

print(area)

Submission status: Runtime Error

Solution code:
def main():
    
    R = 0
    G = 0
    while (R>4500 or R <= 0):
        print("現在のレート")
        R = int(input('The integer is ')) 
     
    while (G>4500 or G <= 0):
        print("次のコンテストを含めたレーティング")
        G = int(input('The integer is  '))
        
    x = 2*G - R
    
    print('取るべきパフォーマンスは、{}'.format(x))

main()

Submission status: Runtime Error

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

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

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

main()

Submission status: Runtime Error

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

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

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

main()

Submission status: Runtime Error

Solution code:
pres_rate = input()
goal_rate = input()
next_rate = goal_rate * 2 - pres_rate
print(next_rate)

Submission status: Runtime Error

Solution code:
#ABC076A

r=int(raw_input())
d=int(raw_input())
print g*2-r

Submission status: Runtime Error

Solution code:
from itertools import chain
 
double = lambda c: int(c)*2
 
N = int(input())
T = tuple(map(double,input().split()))
V = tuple(map(double,input().split()))
 
dp = [0]
 
for t,v_max,vf_max in zip(T,V,chain(V[1:],(0,))):
  ndp = [0]*(min(vf_max,v_max)+1)
  
  for vf in range(len(ndp)):
    vi_min = max(0,vf-t)
    vi_max = min(v_max,vf+t)
    def it():
      for vi,d in enumerate(dp[vi_min:vi_max+1], start=vi_min):
        vp = (t+vi+vf)/2
        yield d + 2*vp*vp-vf*vf-vi*vi - 2*(max(0,vp-v_max))**2
    ndp[vf] = max(it())
  
  dp = ndp
 
print(dp[0]/8)

Submission status: Runtime Error

Solution code:
# coding:utf-8
R=int(input())
G=int(input())
print(2G-R)

Submission status: Runtime Error

Solution code:
# -＊- coding:utf-8 -＊-
R=int(input())
G=int(input())
print(2G-R)

Submission status: Runtime Error

Solution code:
R,G = map(int,input().split())
print(str(2*G-R))

Submission status: Runtime Error

Solution code:
R,G = map(int,input().split())
print(int(2*G-R))

Submission status: Runtime Error

Solution code:
r, a = map(int, input().split())
print(2*a-r)

Submission status: Runtime Error

Solution code:
#r+p = 2*a -> p = 2*a-r
r, a = map(int, input().split())
print(2*a-r)

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,g=map(int,input().split())
print(2*(n-g))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
words = input()
key = input()
for i in range(len(words)):
    if words[i:i+len(key)] == key:
         words[i:i+len(key)] = key
         print(words.replace('?', 'a'))
else:
    print('UNRESTORABLE')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print( ( input() + input() ) / 2 )

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
T = input()
rec = []
for i in range(len(S)):
    flag = True
    Z = S
    for j in range(len(T)):
        if Z[i] == T[j]:
            for e in range(i - j):
                if Z[e] == "?":
                    Z = Z.replace("?", "a", 1)
            for k in range(len(T)):
                if Z[i + k - j] == T[k]:
                    continue
                elif Z[i + k - j] == "?":
                    Z = Z.replace("?", T[k], 1)
                    print(Z)
                else:
                    flag = False
            if flag:
                Z = Z.replace("?", "a")
                rec.append(Z)
if rec == []:
    print("UNRESTORABLE")
else:
    print(rec[-1])

Submission status: Runtime Error

Solution code:
from sys import stdin

curRate = stdin.readline()
targetRate = stdin.readline()

a = targetRate * 2 - curRate

print(a)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
R = int(raw_input())
G = int(raw_input())
print (2*G) - R

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

a =  float(raw_input())
c = float(raw_input())
print 2*c-a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
r = raw_input()
g = raw_input()
k = 2*g - r
print k