아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Quadratic Dissonance

면접 대비

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

요약
이차항 계수가 1인 두 포물선이 주어질 때 두 함수의 최댓값을 최소로 하는 x와 그 최솟값을 구한다.
난이도

보통10점 중 4점

유형
수학, 기하
정답자
아직 제출이 없습니다

문제

Oh no! Both you and your lab partner forgot to complete one part of the latest assignment and it is due in an hour!

The purpose of this lab assignment was to have you analyze some experimental data, find a quadratic function that best describes the data, and report the minimum value that can be taken by this quadratic.

Both you and your partner have tried this part on your own, in order to double-check your answers. Unfortunately, you both found different quadratic functions!

You don’t have time to repeat the experiment. To try and maximize your chances of reporting a value that is close to the minimum (i.e. to get partial credit), you decide to find a value xx that minimizes the maximum of your two quadratic functions.

More precisely, your task is the following. Given two quadratic functions f(x)=x2+A⋅x+Bf(x)=x^2+A⋅x+B and g(x)=x2+C⋅x+Dg(x)=x^2+C⋅x+D (here A,B,C,DA,B,C,D will be given values), you should find a value x∗x^∗ minimizing the maximum of these two functions. That is, x∗x^∗ should be chosen to minimize the function h(x)=max⁡f(x),g(x)h(x)=\max{\\{f(x),g(x)\\}}.

입력

Input consists of a single line containing four integers A,B,C,DA,B,C,D, each lying in the range \[−1000,1000]\[-1000,1000].

출력

Display two values x∗,h(x∗)x^∗,h(x^∗) on a single line where x∗x^∗ is the point that minimizes the function h(x)=max⁡x2+A⋅x+B,x2+C⋅x+Dh(x)=\max{\\{x^2+A⋅x+B,x^2+C⋅x+D\\}}.

Your answer will be accepted if both values are within an absolute or relative error of 10−410^{-4} of the correct answer.

예제5

  1. 예제 1

    입력
    1 0 0 1
    
    예상 출력
    0 1
    
  2. 예제 2

    입력
    2 -1 0 -2
    
    예상 출력
    -0.5 -1.75
    
  3. 예제 3

    입력
    3 1 3 -2
    
    예상 출력
    -1.5 -1.25
    
  4. 예제 4

    입력
    2 2 2 2
    
    예상 출력
    -1 1
    
  5. 예제 5

    입력
    25 -73 -23 41
    
    예상 출력
    2.375 -7.984375