#P16261. [蓝桥杯 2026 省 Python/Java B 组] 干涉条纹
[蓝桥杯 2026 省 Python/Java B 组] 干涉条纹
Problem Description
In the National Precision Optics Laboratory, researchers are using two sets of high-power coherent lasers to carry out a “quantum interference fringes” locking experiment.
Let the output power of Laser 1 be (), and the output power of Laser 2 be (), where and are both non-negative integers.
Physical laws show that the interference fringes can be successfully locked only when the total system power is exactly a perfect square.
How many different power allocation plans can make the experiment successfully lock? Since the number of plans may be very large, you only need to output the result modulo .
Note: Two plans and are considered different if and only if or .
Output Format
This is an output-only fill-in-the-blank problem. You only need to compute the result and submit it. The answer is a single integer. When submitting, fill in only this integer; any extra content will result in no score.
Hint
Translated by ChatGPT 5