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

9299번 - Math Tutoring 다국어

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

문제

You are helping a friend with the rule for taking the derivative of a polynomial, but he just can’t seem to get it! You’ve gone over many examples, and finally you decide to just write a program to compute the derivatives for him.

Recall that a polynomial of the form:

anxn + an−1xn−1 + . . . + a2x2 + a1x + a0

has as its derivative:

nanxn−1 + (n − 1)an−1xn−2 + . . . + 2a2x + a1

For example, the derivative of 2x3 − x + 3 is 6x2 − 1. Likewise, the derivatave of 3x4 + 2x3 + 7x2 + 5x + 7 is 12x3 + 6x2 + 14x + 5.

Given a polynomial, provide the derivative. We are only using polynomials of the form presented here.

입력

The first line of input is the number of test cases that follow.

Each input case appears on a single line, and will start with a single integer, n (1 ≤ n ≤ 100), which is the highest exponent of the polynomial. n + 1 values will follow, which are the coefficients of the terms xn down to x0 = 1, respectively. All coefficients will be integers between -1000 and 1000, inclusive. The highest exponent will always be positive. All numbers will be separated by a single space.

출력

For each case, output the line “Case x:” where x is the case number, on a single line. The output polynomial is to be formatted in the same manner as the input: the first value being the highest polynomial, and the successive values being the coefficients for the individual terms. Each output case should be on one line, with the values separated by one space.

제한

예제 입력 1

4
3 2 0 -1 3
4 3 2 7 5 7
5 6 5 4 3 2 1
1 5 10

예제 출력 1

Case 1: 2 6 0 -1
Case 2: 3 12 6 14 5
Case 3: 4 30 20 12 6 2
Case 4: 0 5

힌트

출처

School > University of Virginia High School Programming Contest > UVa HSPC 2012 D번

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

출처

대학교 대회

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

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