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

4124번 - Secret Polynomial 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB50141334.211%

문제

You may have encountered IQ tests with inane questions such as the following: find the next number in the sequence 1, 2, 3, __. Obviously the correct answer is 16, since the sequence lists the values f(1), f(2), f(3), f(4), ..., where f(x) = 2x3 - 12x2 + 23x - 12. More generally, given some information about the values of a polynomial, can you find the polynomial? We will restrict our attention to polynomials whose coefficients are all non-negative integers.

입력

The first line of input contains an integer 0 < n <= 10000, the number of polynomials to be identified. Each of the next n lines contains two integers, the values f(1) and f(f(1)), where f is the polynomial to be found. Each of these values fits within the range of a signed two's complement 32-bit integer.

출력

For each polynomial to be found, output a single line listing its coefficients separated by spaces. Assuming the degree of the polynomial is d, list the d+1 coefficients in descending order of power (i.e. starting with the coefficient of xd and finishing with the coefficient of x0). If the polynomial is the zero polynomial, just output 0. If no polynomial f has the desired values of f(1) and f(f(1)), instead output a line containing the word IMPOSSIBLE. If multiple polynomials f have the desired values of f(1) and f(f(1)), instead output a line containing the word AMBIGUOUS.

제한

예제 입력 1

1
3 5

예제 출력 1

1 2

힌트

출처

Contest > Waterloo's local Programming Contests > 13 October, 2012 B번

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

출처

대학교 대회

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

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