Quadratic Autopilot

면접 대비

시간 제한1초메모리 제한2048 MB

요약
포물선 위의 세 점 (시간, 고도)가 주어질 때 e(t) = at^2 + bt + c의 정수 계수 a, b, c를 구한다.
난이도

보통10점 중 4점

유형
수학, 구현, 완전 탐색, 배열
정답자
아직 제출이 없습니다

문제

Thomas is trying to model airplanes in his 3D modeling program. He has decided to use parabolic curves to model the movement paths of airplanes. To make his curves as accurate as possible, he has asked a few of his pilot friends to give him the elevations of their respective airplanes at three points in time during some of their flights. Using these three points of elevation data from a given flight, help Thomas find the integer constants aa, bb, and cc in the equation

\begin{equation*} e(t) = at^2 + bt + c \end{equation*} which gives the elevation of an airplane at time tt.

입력

The input consists of three lines, each with two integers separated by a single space. The first integer on a line is a time, tt, and the second integer is the elevation at time tt: e(t)e(t). The times will appear in order from smallest to greatest; i.e. t_1<t_2<t_3t\_1 < t\_2 < t\_3.

Input Restrictions

  • 0≤t,e(t)<⌊232−1−1⌋0 \leq t,e(t) < \left\lfloor \sqrt{2^{32-1}-1} \right\rfloor

출력

The output should be a single line with the three integers aa, bb, and cc satisfying the above equation, separated by spaces.

예제1

  1. 예제 1

    입력
    0 5280
    10 12780
    25 14655
    
    예상 출력
    -25 1000 5280