시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB144575323452837.661%

문제

A×B를 계산하다 지겨워진 형택이는 A×B를 새로운 방법으로 정의하려고 한다.

A에서 한 자리를 뽑고 × B에서 임의로 한 자리를 뽑아 곱한다.

의 가능한 모든 조합 (A가 n자리, B가 m자리 수라면 총 가능한 조합은 n×m개)을 더한 수로 정의하려고 한다.

예를 들어 121×34는

1×3 + 1×4 + 2×3 + 2×4 + 1×3 + 1×4 = 28

이 된다. 이러한 형택이의 곱셈 결과를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 A와 B가 주어진다. 주어지는 두 수는 모두 10,000자리를 넘지 않는 음이 아닌 정수이다. 수가 0인 경우에는 0만 주어지며, 그 외의 경우 수는 0으로 시작하지 않는다.

출력

첫째 줄에 형택이의 곱셈 결과를 출력한다.

예제 입력 1

123 45

예제 출력 1

54
W3sicHJvYmxlbV9pZCI6IjEyMjUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM3NzRcdWMwYzFcdWQ1NWMgXHVhY2YxXHVjMTQ4IiwiZGVzY3JpcHRpb24iOiI8cD5BJnRpbWVzO0JcdWI5N2MgXHVhY2M0XHVjMGIwXHVkNTU4XHViMmU0IFx1YzljMFx1YWNhOFx1YzZjY1x1YzljNCBcdWQ2MTVcdWQwZGRcdWM3NzRcdWIyOTQgQSZ0aW1lcztCXHViOTdjIFx1YzBjOFx1Yjg1Y1x1YzZiNCBcdWJjMjlcdWJjOTVcdWM3M2NcdWI4NWMgXHVjODE1XHVjNzU4XHVkNTU4XHViODI0XHVhY2UwIFx1ZDU1Y1x1YjJlNC48XC9wPlxyXG5cclxuPHA+QVx1YzVkMFx1YzExYyBcdWQ1NWMgXHVjNzkwXHViOWFjXHViOTdjIFx1YmY1MVx1YWNlMCAmdGltZXM7IEJcdWM1ZDBcdWMxMWMgXHVjNzg0XHVjNzU4XHViODVjIFx1ZDU1YyBcdWM3OTBcdWI5YWNcdWI5N2MgXHViZjUxX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