Problem:


Score : 700 points

Problem Statement

Aoki is in search of Takahashi, who is missing in a one-dimentional world.
Initially, the coordinate of Aoki is 0, and the coordinate of Takahashi is known to be x, but his coordinate afterwards cannot be known to Aoki.

Time is divided into turns. In each turn, Aoki and Takahashi take the following actions simultaneously:

Let the current coordinate of Aoki be a, then Aoki moves to a coordinate he selects from a-1, a and a+1.

Let the current coordinate of Takahashi be b, then Takahashi moves to the coordinate b-1 with probability of p percent, and moves to the coordinate b+1 with probability of 100-p percent.

When the coordinates of Aoki and Takahashi coincide, Aoki can find Takahashi.
When they pass by each other, Aoki cannot find Takahashi.

Aoki wants to minimize the expected number of turns taken until he finds Takahashi. Find the minimum possible expected number of turns.

Constraints

1 ≦ x ≦ 1,000,000,000

1 ≦ p ≦ 100

x and p are integers.

Partial Scores

In the test set worth 200 points, p=100.

In the test set worth 300 points, x ≦ 10.

Input

The input is given from Standard Input in the following format:

x
p

Output

Print the minimum possible expected number of turns.
The output is considered correct if the absolute or relative error is at most 10^{-6}.

Sample Input 1

3
100

Sample Output 1

2.0000000

Takahashi always moves by -1.
Thus, by moving to the coordinate 1 in the 1-st turn and staying at that position in the 2-nd turn, Aoki can find Takahashi in 2 turns.

Sample Input 2

6
40

Sample Output 2

7.5000000

Sample Input 3

101
80

Sample Output 3

63.7500000



Sample input:
3
100


Sample output:
2.0000000

Submission status: Wrong Answer

Solution code:
sx = input()
sp = input()
x = int(sx)
p = int(sp)
ret = 0
e = 0
cnt = x % 2
if p == 100:
    ret = int(x / 2) + cnt
        
print(ret)

Submission status: Wrong Answer

Solution code:
x = int(raw_input())
p = int(raw_input())

if p==100:
	print x/2 + x%2

Submission status: Wrong Answer

Solution code:
import sys

X = int(sys.stdin.readline())
P = int(sys.stdin.readline())

print((X+1)//2)

Submission status: Accepted

Solution code:
x = int(input())
p = int(input()) / 100
print(((x + 1) // 2) / p)

Submission status: Accepted

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

Submission status: Accepted

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

# 偶奇をあわせて寄せていくだけ

X,P = map(int,read().split())

def f(x):
    y = x // 2
    return y * 100 / P

if X % 2 == 0:
    answer = f(X)
else:
    answer = 1 + (P * f(X-1) + (100-P) * f(X+1))/100

print(answer)

Submission status: Accepted

Solution code:
x = int(input())
p = int(input())
l = p / 100

def f(d):
    return (d / 2) * 100 / p

if x % 2 == 0:
    res = f(x)
else:
    res = 1 + l * f(x - 1) + (1 - l) * f(x + 1)

print(res)

Submission status: Accepted

Solution code:

x = int(input())

p = int(input())

if x % 2 == 0:
    print (100 * (x//2) / p)
else:
    print ((100 * (x//2+1) / p))

Submission status: Accepted

Solution code:
x = int(input())
p = int(input())
print("%.016f\n" % ((((x+(x%2))/2)*100/p)))

Submission status: Accepted

Solution code:
x=int(input())
p=int(input())/100
print((x+1)//2 * 1 / p)

Submission status: Accepted

Solution code:
N = int(input())
M = int(input())
if N%2:
 print(1 + (N-1)  /  2 + (100 - M) * (N+1) /2 / M)
else:
 print(N * 50 / M)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math
x = int(input())
p = int(input())/100
print(math.ceil(x / 2) / p)

Submission status: Accepted

Solution code:
x = int(input())
p = int(input())
p *= 0.01
print((x+1)//2/p)

Submission status: Accepted

Solution code:
from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(1000000)

x = read()
p = read()

p *= 0.01


if x % 2 == 0:
  print((x // 2) / p)
else:
  y = x // 2
  print(1 + p * y / p + (1 - p) * (y + 1) / p)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long x; 
    double p;
    cin>>x>>p;
  if(x%2){cout<<setprecision(20)<<(((double)x+1)/2)/p*100<<endl;}
  else{ cout<<setprecision(20)<<(((double)x)/2)/p*100<<endl;}
}