Logo
(追記) (追記ここまで)

7892번 - Johnny and the Quadratic Equation 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB1822100.000%

문제

Johnny recently learned about this whole quadratic equation thing. Being an avid young programmer, he immediately wrote the following code that was supposed to help in his homework:

#include<cstdio>
int main() {
 unsigned int a,b,c,x=0;
 scanf("%u %u %u",&a,&b,&c);
 do {
 if (a*x*x+b*x+c==0) {
 puts("YES");
 return 0;
 }
 x++;
 } while(x);
 puts("NO");
 return 0;
}

where all calculations are performed on unsigned 32-bit integers (in other words, modulo 232). But, well, it turned out that this code runs rather slow, even on his recently updated monster gaming rig. Maybe you could help him?

입력

The input contains several test cases. The first line contains an integer t (t ≤ 104) denoting the number of test cases. Then t tests follow, each of them consisting of three space separated integers a, b and c (0 ≤ a, b, c < 232).

출력

For each test case output the answer of the program above.

제한

예제 입력 1

3
948 43958 1429912782
95348 54988 345335
943428 4353958 3444096692

예제 출력 1

YES
NO
YES

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2008 연습 세션 PB번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /