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

13957번 - Within Arm's Reach 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB104322750.943%

문제

Joao wants to jon the robotic football team of his university. However, since he knows little about robotics and mathematics, he decided to build a 2-dimensional robotic arm to bootstrap his knowledge.

The robotic arm is composed of N segments of various lengths. The segments can form any angle between them, including configurations that make it appear to self-intersect when viewed from above. The robotic arm works great, but it is not trivial to position the arm's tip as close as possible to given x, y target coordinates with so many joints to control. Can you help Joao?

Given the robotic arm description and target coordinates relative to the arm's origin, calculate a configuration that places the arm's tip as close as possible to the target.

입력

The first line contains N, the number of segments composing the robotic arm. N lines follow, each with an integer Li describing the length of the ith segment from the fixed point until the arm's tip. There is one more line with 2 integers: the x, y coordinates of the target point to reach.

출력

The output should contain N lines, each containing two real numbers xi, yi indicationg the coordinates of the tip of the ith segment.

The length of the ith segment computed from the solution and input Li may not differ by more than 0.01. Similarly, the absolute error between the solution's distance to the target and the minimum possible distance to the target cannot exceed 0.01.

Note that, in general, there are many solutions. Your program may output any of them.

제한

  • 1 ≤ N ≤ 20 Number of segments in the robotic arm
  • 1 ≤ Li ≤ 1000 Length of the ith segment
  • -20000 ≤ x,y ≤ 20000 Target coordinates to attempt to reach

예제 입력 1

3
5
3
4
5 3

예제 출력 1

4.114 -2.842
6.297 -0.784
5.000 3.000

예제 입력 2

2
4
2
-8 -3

예제 출력 2

-3.745 -1.404
-5.618 -2.107

힌트

출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2016 A번

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

출처

대학교 대회

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

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