Problem:
Score : 300 points

Problem Statement

Compute A \times B, truncate its fractional part, and print the result as an integer.

Constraints

0 \leq A \leq 10^{15}

0 \leq B < 10

A is an integer.

B is a number with two digits after the decimal point.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the answer as an integer.

Sample Input 1

198 1.10

Sample Output 1

217

We have 198 \times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.

Sample Input 2

1 0.01

Sample Output 2

0

Sample Input 3

1000000000000000 9.99

Sample Output 3

9990000000000000

Solution in C (GCC 9.2.1) (judge verdict: Wrong Answer)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define MAXSIZE 20
int main(int argc, char *argv[]) {
//	

	char A[MAXSIZE], B[5];
	scanf("%s %s", A, B);
	int i;
	int j;
	int lenA = strlen(A);
	int lenB = strlen(B);
	char temp;
	for (i = 0; i < lenA/2; ++i)
	{
		temp = A[i];
		A[i] = A[lenA-1-i];
		A[lenA - 1 - i] = temp;
		
	}
//	printf("%s\n", A);
	
	for ( i = 1; i < 3; i++)
	{
		B[i] = B[i + 1];
	}
	B[3] = '\0';
	
	temp = B[0];
	B[0] = B[2];
	B[2] = temp;
//	printf("%s", B);
	lenB = strlen(B);
	int *res = (int *)calloc(lenA + lenB - 2, sizeof(int));
//	int res[lenA + 2] = 0;
	
	
	for ( i = 0; i < lenB - 1; ++i)
	{
		for (j = 0; j < lenA - 1; ++j)
		{
			res[i + j] += (A[j] - '0') * (B[i] - '0'); 
//			printf("%d", res[i + j]);
			if (res[i + j] >= 10)
			{
				res[i + j + 1] += 1;
				res[i + j] %= 10;  
			}
		}
	}
	
	i =  i + j;
	
	while (res[i] == 0)
	{
		i--;
	}
//	printf("%d\n", i);
	if (i < 2)
	{
		printf("%d", 0);
		
	}
	else
	{
//		printf("%d\n", res[i]);
	
		while (i >=  2)
		{
			printf("%d", res[i--]);
		}
		
	}
//1000 0000  0000 0000
//9990 0000  0000 0000
	
	return 0;
}