228. Archipelago
time limit per test: 0.25
sec.
memory limit per test: 4096
KB
input: standard
output: standard
Berislands Archipelago consists of N islands and has a form of regular Ngon. Islands are numbered in a clockwise order. Coordinates of the N1th island are (X1, Y1), and of the N2th island are  (X2, Y2). You are to write a program which will find coordinates of all islands.
Input
The input contains three integers N, N1, N2 (3<=N<=150, 1<=N1,N2<=N, N1<>N2). The following two pairs of real numbers are coordinates of N1th and N2th islands. All absolute values of coordinates do not exceed 10^6. All numbers separated by white spaces.
Output
Output coordinates of the islands in order of numeration on separate lines. The computed coordinates should be exact to six digits after the decimal point.
Sample test(s)
Input
4 1 3
1.0000 0.0000
1.0000 2.0000
Output
1.000000 0.000000
0.000000 1.000000
1.000000 2.000000
2.000000 1.000000
Author:  Michael R. Mirzayanov

Resource:  

Date:  

Server time: 20180222 00:19:46  Online Contester Team © 2002  2016. All rights reserved. 

