#P10584. [蓝桥杯 2024 国 A] 数学题
[蓝桥杯 2024 国 A] 数学题
Problem Description
Compute , where equals if is a perfect square, and otherwise.
Input Format
Input one line containing two positive integers, separated by a space, representing and in the problem statement.
Output Format
Output one line containing one positive integer, representing the answer.
Hint: The testdata guarantees that the answer will not exceed the range representable by unsigned long long.
2 3
2
1000000000 1000000000
12735999860
Hint
For of the test cases, .
For of the test cases, , .
For of the test cases, .
For of the test cases, .
For all test cases, .
Thanks to
https://www.luogu.com.cn/user/320423
ing the testdata.
Translated by ChatGPT 5