#P10372. [AHOI2024 初中组 / 科大国创杯初中组 2024] 家庭作业

[AHOI2024 初中组 / 科大国创杯初中组 2024] 家庭作业

Background

The testdata for this problem is not official.

Official testdata (that can be uploaded here) is being collected.

Official testdata (that cannot be uploaded here): https://www.luogu.com.cn/training/499869

Unofficial testdata download: https://scg3.piaoztsdy.cn/training/69bce235a7cf509104565c83

Problem Description

Xiao Keke has TT calculation problems of the form a+b=ca + b = c. You need to check whether she got each problem correct.

Input Format

The first line contains a positive integer TT.

The next TT lines each contain an expression in the form a+b=c.

It is guaranteed that the input format is correct, the numbers have no leading zeros, and there are no spaces between numbers and operators.

See the sample for the exact format.

Output Format

Output TT lines. If the ii-th expression is correct, output Right! on the ii-th line; otherwise, output Wrong! on the ii-th line.

5
1+1=2
1+2=2
15+66=81
5+37=40
99+99=99
Right!
Wrong!
Right!
Wrong!
Wrong!

Hint

Sample 1 Explanation

Note from the problem porter: To avoid insulting everyone’s intelligence, the sample will not be explained. (There is no sample explanation in the setter’s PDF either.)

Constraints

For 40%40\% of the testdata, a=b=1a = b = 1 and c=2c = 2.

For 80%80\% of the testdata, a,b,c9a,b,c \le 9.

For 100%100\% of the testdata, 1T101 \le T \le 10 and 1a,b,c991 \le a,b,c \le 99.

Translated by ChatGPT 5