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 JavaScript (Node.js 12.16.1) (judge verdict: Wrong Answer)

function main(input) {
  const inputs = input.trim().split('\n');
  var input1 = inputs[0].split(' ');
  var A = input1[0].split('').reverse();
  var B = input1[1];

  var B1 = B.split('.')[0] - 0;
  var B2 = B.split('.')[1].split('').reverse();

  var temp = Array(A.length + 2 + 1);
  var tempLength = temp.length;

  for (var i = 0; i < tempLength; i++) {
    temp[i] = 0;
  }

  // 小数点部分の処理
  var multi = '';

  for (var i = 0; i < B2.length; i++) {
    for (var j = 0; j < A.length; j++) {
      multi = ('' + ((B2[i] - 0) * (A[j] - 0))).split('').reverse();
      for (var k = 0; k < multi.length; k++) {
        temp[tempLength - i - j - k - 1] += (multi[k] - 0);
        for (var l = tempLength - 1; l >= 0; l--) {
          if (temp[l] > 10) {
            temp[l] -= 10;
            temp[l - 1] += 1;
          }
        }
      }
    }
  }

  // 整数部分の処理
  var multi = '';
  for (var i = 0; i < A.length; i++) {
    multi = ('' + (B1 * (A[i] - 0))).split('');
    for (var k = 0; k < multi.length; k++) {
      temp[tempLength - 2 - i - k - 1] += (multi[k] - 0);
      for (var l = tempLength - 1; l >= 0; l--) {
        if (temp[l] > 10) {
          temp[l] -= 10;
          temp[l - 1] += 1;
        }
      }
    }
  }

  temp = temp.slice(0, -2);

  var cont = true;
  while (cont) {
    if (temp[0] == 0) {
      temp = temp.slice(1);
    } else {
      cont = false;
    }
  }

  if (temp.length == 0) {
    temp.push(0);
  }

  console.log(temp.join(''));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));