TnT/CodeNet4Repair huggingface dataset:
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
s = [input() for _ in range(n)]

c = [s.count("AC"),s.count("WA"),s.count("TLE"),s.count("RE")]

print("AC","×",c[0])
print("WA","×",c[1])
print("TLE","×",c[2])
print("RE","×",c[3])

Fixed, accepted submission:
n = int(input())
s = [input() for _ in range(n)]

c = [s.count("AC"),s.count("WA"),s.count("TLE"),s.count("RE")]

print("AC","x",c[0])
print("WA","x",c[1])
print("TLE","x",c[2])
print("RE","x",c[3])
Problem:
We have a grid with H rows and W columns, where all the squares are initially white.  You will perform some number of painting operations on the grid. In one operation, you can do one of the following two actions:    * Choose one row, then paint all the squares in that row black.   * Choose one column, then paint all the squares in that column black.  At least how many operations do you need in order to have N or more black squares in the grid? It is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.

Incorrect submission (verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
print(n//max(h, w))

Fixed, accepted submission:
import math
h = int(input())
w = int(input())
n = int(input())
print(math.ceil(n/max(h, w)))
Problem:
Write a program which reads two integers a, b and an operator op, and then prints the value of a op b.  The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.

Incorrect submission (verdict: Wrong Answer):
op = ""
while op != "?":
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a / b)
    elif op == "?":
        break

Fixed, accepted submission:
a, op, b = input().split()
a = int(a)
b = int(b)
while op != "?":
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)
    a, op, b = input().split()
    a = int(a)
    b = int(b)
Problem:
We have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.  How many grams of sand will the upper bulb contains after t seconds?

Incorrect submission (verdict: Wrong Answer):
x,y=map(int,input().split())
print(min(0,abs(x-y)))

Fixed, accepted submission:
x,y=map(int,input().split())
print(max(0,x-y))
Problem:
Ringo is giving a present to Snuke.  Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes grilled things starting with `YAKI` in Japanese, and does not like other things.  You are given a string S representing the Japanese name of Ringo's present to Snuke. Determine whether S starts with `YAKI`.

Incorrect submission (verdict: Wrong Answer):
print("YNEOS"[input()[:4]!="YAKI"::2])

Fixed, accepted submission:
print("YNeos"[input()[:4]!="YAKI"::2])
Problem:
Given is a rooted tree with N vertices numbered 1 to N. The root is Vertex 1, and the i-th edge (1 \leq i \leq N - 1) connects Vertex a_i and b_i.  Each of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.  Now, the following Q operations will be performed:    * Operation j (1 \leq j \leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.  Find the value of the counter on each vertex after all operations.

Incorrect submission (verdict: Wrong Answer):
import sys
input = sys.stdin.readline

N, Q = map(int, input().split())
v = [[] for _ in range(N + 1)]
ans = [0] * (N + 1)

for i in range(N - 1):
    a, b = map(int, input().split())
    v[a].append(b)
    v[b].append(a)
print(v)

for i in reversed(range(2, N + 1)):
    v[i].sort()
    v[v[i][0]].extend(v[i][1:])

v[1].append(0)

for i in range(Q):
    p, q = map(int, input().split())
    for j in v[p]:
        ans[j] += q
    ans[p] += q

print(' '.join(map(str, ans[1:])))

Fixed, accepted submission:
import sys

readline = sys.stdin.readline
read = sys.stdin.read

N, Q = map(int, readline().split())
graph = [[] for _ in range(N + 1)]
cnt = [0] * (N + 1)

for _ in range(N - 1):
    a, b = map(int, readline().split())
    graph[a].append(b)
    graph[b].append(a)

px = map(int, read().split())
for p, x in zip(*[px] * 2):
    cnt[p] += x

stack = [1]
checked = [False] * (N + 1)
checked[1] = True
while stack:
    V = stack.pop()
    for i in graph[V]:
        if checked[i]:
            continue
        checked[i] = True
        stack.append(i)
        cnt[i] += cnt[V]

print(' '.join(map(str, cnt[1:])))
Problem:
Compute A \times B, truncate its fractional part, and print the result as an integer.

Incorrect submission (verdict: Wrong Answer):
a,b=map(float,input().split())
print((a*b)//1)

Fixed, accepted submission:
from decimal import *
a,b=input().split()
a=int(a)
b=Decimal(b)*100
print(a*b//100)
Problem:
Rng is going to a festival.  The name of the festival is given to you as a string S, which ends with `FESTIVAL`, from input. Answer the question: "Rng is going to a festival of what?" Output the answer.  Here, assume that the name of "a festival of s" is a string obtained by appending `FESTIVAL` to the end of s. For example, `CODEFESTIVAL` is a festival of `CODE`.

Incorrect submission (verdict: Wrong Answer):
s=input()
print(s[:-7])

Fixed, accepted submission:
print(input()[:-8])
Problem:
Find a cycle in a directed graph G(V, E).

Incorrect submission (verdict: Wrong Answer):


from collections import deque
import sys

def dfs(G,u):
    n = len(G)
    vis=[-1]*n
    stackV = []
    pila = deque()
    pila.append(u)
    vis[u]=1
    stackV.append(u)
    while(pila):
        w = pila.pop()
        for v in G[w]:
            if(vis[v]==-1):
                vis[v]=1
                pila.append(v)
                stackV.append(v)
            elif(vis[v]==1 and v==u):
                print(stackV)
                return True
    return False

def main():
    G =[]
    val = [int(x) for x in sys.stdin.readline().strip().split()]
    for i in range(val[0]):
        G.append([])
    for i in range(val[1]):
        L = [int(x) for x in sys.stdin.readline().strip().split()]
        G[L[0]].append(L[1]) 
    veri=[]

    for i in range(val[0]):
        veri.append(dfs(G,i))
    print(veri)
    if(True in veri):print(1)
    else:print(0)
        
main()
        



Fixed, accepted submission:


from collections import deque
import sys

def dfs(G,u):
    n = len(G)
    vis=[-1]*n
    stackV = []
    pila = deque()
    pila.append(u)
    vis[u]=1
    stackV.append(u)
    while(pila):
        w = pila.pop()
        for v in G[w]:
            if(vis[v]==-1):
                vis[v]=1
                pila.append(v)
                stackV.append(v)
            elif(vis[v]==1 and v==u):
                return True
    return False

def main():
    G =[]
    val = [int(x) for x in sys.stdin.readline().strip().split()]
    for i in range(val[0]):
        G.append([])
    for i in range(val[1]):
        L = [int(x) for x in sys.stdin.readline().strip().split()]
        G[L[0]].append(L[1]) 
    veri=[]

    for i in range(val[0]):
        veri.append(dfs(G,i))
    if(True in veri):print(1)
    else:print(0)
        
main()
Problem:
AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i.  If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1,y), (x,y+1) and (x,y-1). Note that **he cannot stay at his place**. Determine whether he can carry out his plan.

Incorrect submission (verdict: Wrong Answer):
# AtCoder
N = int(input())
txy = [list(map(int, input().split())) for _ in range(N)]

if txy[0][0] < txy[0][1]+txy[0][2]:
    print('No')
    exit()

for i in range(1, N):
    ct = txy[i][0]
    cx = txy[i][1]
    cy = txy[i][2]
    pt = txy[i-1][0]
    px = txy[i-1][1]
    py = txy[i-1][2]

    cxy = cx + cy
    pxy = px + py

    difxy = abs(cxy - pxy)
    dift = abs(ct-pt)
    print(difxy, dift)
    if dift % 2 != 0 and difxy % 2 == 0:
        print('No')
        exit()
    elif dift % 2 == 0 and difxy % 2 != 0:
        print('No')
        exit()

    if difxy > dift:
        print('No')
        exit()
print('Yes')


Fixed, accepted submission:
N = int(input())
pt, px, py = 0, 0, 0
for _ in range(N):
    ct, cx, cy = map(int, input().split())
    diff_t = ct - pt
    diff_x = cx - px
    diff_y = cy - py

    diff_xy = abs(diff_x+diff_y)
    if diff_xy > diff_t:
        print('No')
        exit()
    if (diff_xy + diff_t) % 2 != 0:
        print('No')
        exit()

    px = cx
    py = cy
    pt = ct

print('Yes')
Problem:
You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total?  Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.

Incorrect submission (verdict: Wrong Answer):
ans = 0
a = int(input())
b = int(input())
c = int(input())
x = int(input())
for i in range(a):
  for j in range(b):
    for k in range(c):
      if 100*a + 50*b + 10*c == x:
        ans += 1
print(ans)

Fixed, accepted submission:

ans = 0
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == x:
        ans += 1
 
print(ans)
Problem:
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.

Incorrect submission (verdict: Wrong Answer):
a=int(input())
b=int(input())
c=a-b
print(b+c)

Fixed, accepted submission:
a=int(input())
b=int(input())
c=b-a
print(b+c)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
print(n % 1000)

Fixed, accepted submission:
print(-int(input())%1000)
Problem:
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.  Determine if it is possible that there are exactly X cats among these A + B animals.

Incorrect submission (verdict: Wrong Answer):
a, b, x = [int(x) for x in input().split()]

if x - b <= a <= x:
    print('Yes')
else:
    print('No')


Fixed, accepted submission:
a, b, x = [int(x) for x in input().split()]

if x - b <= a <= x:
    print('YES')
else:
    print('NO')
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
a, b, c = map(int, input().split())
if a == 5 and b == 7 and c == 5:
    print('YES')
else:
    print('NO')


Fixed, accepted submission:
cnt = [0] * 11
for x in map(int, input().split()):
    cnt[x] += 1

if cnt[5] == 2 and cnt[7] == 1:
    print('YES')
else:
    print('NO')
Problem:
You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`.

Incorrect submission (verdict: Wrong Answer):
s = input()
if (sorted(s) == 'abc'):
  print('Yes')
else:
  print('No')


Fixed, accepted submission:
s = ''.join(sorted(input()))
if (s == 'abc'):
  print('Yes')
else:
  print('No')
Problem:
The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen `-`, and the other characters are digits from `0` through `9`.  You are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.

Incorrect submission (verdict: Wrong Answer):
A , B = map(int,input().split())
s = input()
l = len(s)
def check(a):
    li = ["0","1","2","3","4","5","6","7","8","9"]
    if li in a:
        return True
    else:
        return False
torf = False
for i in range(A):
    torf = torf and check(s[i])
for i in range(B):
    torf = torf and check(s[i + A])
if torf and l == (A+B+1) and s[A] == "-":
    print("Yes")
else:
    print("No")


Fixed, accepted submission:
A , B = map(int,input().split())
s = input()
a = s[0:A].isdigit()
b = s[A+1:A+B + 1].isdigit()
if a and b and s[A] == "-":
    print("Yes")
else:
    print("No")
Problem:
We have N cards. A number a_i is written on the i-th card.   Alice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first.   The game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the cards he/she has taken. When both players take the optimal strategy to maximize their scores, find Alice's score minus Bob's score.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = sorted(list(map(int, input().split())))
al = 0
bb = 0
for i in range(n):
  if i % 2 == 0:
    al += a[i]
  else:
    bb += a[i]
print(al - bb)

Fixed, accepted submission:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
al = 0
bb = 0
for i in range(n):
  if i % 2 == 0:
    al += a[i]
  else:
    bb += a[i]
print(al - bb)
Problem:
We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not.  You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S. It is guaranteed that such a non-empty string exists for a given input.

Incorrect submission (verdict: Wrong Answer):
string = input()
length = len(string)
for i in range(length):
    if length-(i+1)%2 != 0:
        continue
    else:
        if string[:(length-(i+1))/2] == string[(length-(i+1))/2:length-(i+1)]:
            print(length-(i+1))
            break


Fixed, accepted submission:
string = input()
length = len(string)
for i in range(length):
    if (length-(i+1))%2 == 0:
        if string[0:int((length-(i+1))/2)] == string[int((length-(i+1))/2):length-(i+1)]:
            print(length-(i+1))
            break
Problem:
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd.

Incorrect submission (verdict: Wrong Answer):
a,b=map(int,input().split())
if a*b/2 == 0:
    print("Even")
else:
    print("Odd")

Fixed, accepted submission:
a,b = map(int,input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")
Problem:
It is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.  You are given an integer N. Find the N-th Lucas number.  Here, the i-th Lucas number L_i is defined as follows:    * L_0=2   * L_1=1   * L_i=L_{i-1}+L_{i-2} (i≥2)

Incorrect submission (verdict: Wrong Answer):
N = int(input())
lucas = [2, 1]
for i in range(2, N):
    lucas.append(lucas[i - 1] + lucas[i - 2])

print(lucas[N - 1])

Fixed, accepted submission:
N = int(input())
lucas = [2, 1]
for i in range(2, N + 1):
    lucas.append(lucas[i - 1] + lucas[i - 2])

print(lucas[N])
Problem:
AtCoder Mart sells 1000000 of each of the six items below:    * Riceballs, priced at 100 yen (the currency of Japan) each   * Sandwiches, priced at 101 yen each   * Cookies, priced at 102 yen each   * Cakes, priced at 103 yen each   * Candies, priced at 104 yen each   * Computers, priced at 105 yen each  Takahashi wants to buy some of them that cost exactly X yen in total. Determine whether this is possible.   (Ignore consumption tax.)

Incorrect submission (verdict: Wrong Answer):
x = int(input())
for i in range(5, 0, -1):
    x -= (100 + i) * ((x % 100) // i)
    print(x)
    if x < 0:
        print(0)
        exit()
if x % 100:
    print(0)
else:
    print(1)


Fixed, accepted submission:
x = int(input())
for i in range(5, 0, -1):
    x -= (100 + i) * ((x % 100) // i)
    if x < 0:
        print(0)
        exit()
if x % 100:
    print(0)
else:
    print(1)
Problem:
You are playing the following game with Joisino.    * Initially, you have a blank sheet of paper.   * Joisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.   * Then, you are asked a question: How many numbers are written on the sheet now?  The numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=[]
for i in range(n):
	a.append(int(input()))
a.sort()

now=a[0]
odd=0
ans=0
for i in range(n):
	if a[i]==now:
		odd=(odd+1)%2
	else:
		if odd==1:
			ans+=1
		if i+1<n:
			now=a[i+1]
			odd=0
print(ans+odd)

Fixed, accepted submission:
n=int(input())
a=sorted([int(input()) for i in range(n)])

now=a[0]
odd=False
ans=0
for i in range(n):
	
	if a[i]==now:
		odd=not odd
	
	else:
		
		ans+=odd
		
		now=a[i]
		odd=True

print(ans+odd)
Problem:
Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.

Incorrect submission (verdict: Wrong Answer):
from math import factorial as f
n=int(input())
a=list(map(int,input().split()))

def comb(n,r):
    return int(f(n)/(f(r)*f(n-r)))

m=max(a)
r=0
for i in range(n):
    if abs(m/2-a[i])<abs(m/2-r):
        r=a[i]

print(comb(m,r))

Fixed, accepted submission:
n=int(input())
a=list(map(int,input().split()))

m=max(a)
r=0
for i in range(n):
    if abs(m/2-a[i])<abs(m/2-r):
        r=a[i]

print(m,r)
Problem:
How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December?

Incorrect submission (verdict: Wrong Answer):
a=int(input())
b=24-a
print(a)

Fixed, accepted submission:
a=int(input())
b=48-a
print(b)
Problem:
You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:    * Wield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.   * Throw one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.  The monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?

Incorrect submission (verdict: Wrong Answer):


def solve():
    # n, m = map(int, input().split())
    n, m = 4, 1000000000
    swing, throw = [1, 1, 1, 1], [1, 10000000, 99999999, 30000000]
    # swing, throw = [], []
    # for _ in range(n):
    #     a, b = map(int, input().split())
    #     swing.append(a)
    #     throw.append(b)
    swing = sorted(swing)
    throw = sorted(throw)
    max_swing = swing[-1]
    will_throw = [x for x in throw if x > max_swing]

    all_damage = sum(will_throw)
    answer = len(will_throw)
    if all_damage > m:
        for damage in will_throw:
            if all_damage - damage < m:
                print(answer)
            else:
                all_damage -= damage
                answer -= 1
    else:
        print(answer + ((m - all_damage) + (max_swing - 1)) // max_swing)

solve()

Fixed, accepted submission:


def solve():
    n, m = map(int, input().split())
    # n, m = 4, 1000000000
    # swing, throw = [1, 1, 1, 1], [1, 10000000, 99999999, 30000000]
    swing, throw = [], []
    for _ in range(n):
        a, b = map(int, input().split())
        swing.append(a)
        throw.append(b)
    swing = sorted(swing)
    throw = sorted(throw)
    max_swing = swing[-1]
    will_throw = [x for x in throw if x > max_swing]

    all_damage = sum(will_throw)
    answer = len(will_throw)
    if all_damage > m:
        for damage in will_throw:
            if all_damage - damage < m:
                print(answer)
                return
            else:
                all_damage -= damage
                answer -= 1
    else:
        print(answer + ((m - all_damage) + (max_swing - 1)) // max_swing)
        return

solve()
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))

count=0
ans=0
for i in range(n):
  count=0
  while(a[i]%2==0):
    a[i]=a[i]//2
    count+=1
  ans=max(ans,count)
  
print(ans)

Fixed, accepted submission:
n=int(input())
a=list(map(int,input().split()))
 
count=0
ans=a[0]
for i in range(n):
  count=0
  while(a[i]%2==0):
    a[i]=a[i]//2
    count+=1
  ans=min(ans,count)
  
print(ans)
Problem:
There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N).  For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.  We say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:    * For every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.  Does there exist a good set of choices? If the answer is yes, find one good set of choices.

Incorrect submission (verdict: Wrong Answer):
N=int(input())
a=list(map(int,input().split()))

sum=0

for A in a:
    sum+=A

print(sum)

Fixed, accepted submission:
N=int(input())
a=list(map(int,input().split()))

A=[0]*N
sum=0
b=[]

for i in range(N,0,-1):
    #print(i)
    count=0
    for j in range(i-1,N,i):
        count+=A[j]
    if count%2==a[i-1]:
        pass
    else:
        A[i-1]=1
        sum+=1
        b.append(i)

print(sum)
if len(b)!=0:
    print(" ".join(map(str,b)))
Problem:
Compute A \times B, truncate its fractional part, and print the result as an integer.

Incorrect submission (verdict: Wrong Answer):
a,b = map(str, input().split())
a = int(a)
b = float(b)
c = (a*b)//1
print(c)

Fixed, accepted submission:
import decimal
a,b = map(str, input().split())
a = int(a)
b = decimal.Decimal(b)
c = decimal.Decimal(a*b)
d = decimal.Decimal(c//1)
print(d)