#P16261. [蓝桥杯 2026 省 Python/Java B 组] 干涉条纹

    ID: 18281 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 显示难度普及− 上传者: 标签>数学提交答案2026蓝桥杯省赛

[蓝桥杯 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 aa (0a202698765432100 \leq a \leq 20269876543210), and the output power of Laser 2 be bb (0b202601234567890 \leq b \leq 20260123456789), where aa and bb are both non-negative integers.

Physical laws show that the interference fringes can be successfully locked only when the total system power S=a+bS = a + b is exactly a perfect square.

How many different power allocation plans (a,b)(a, b) can make the experiment successfully lock? Since the number of plans may be very large, you only need to output the result modulo 998244353998244353.

Note: Two plans (a1,b1)(a_1, b_1) and (a2,b2)(a_2, b_2) are considered different if and only if a1a2a_1 \neq a_2 or b1b2b_1 \neq b_2.

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