Problem C
Campus Roads
Time Limit : 2 seconds
 

 

NGU has a beautiful campus. The authority of NGU has decided to take some more steps about beautification of this campus. One of these steps is tree plantation in some roads. To complete this project they will select some roads, and for any road they will also select a number that how many tree will be planted on that road. To make this campus more beautiful they decided in a single road, the gap between any two adjacent tree will be fixed, and this gap will be as large as possible. So If you walk through the road in a constant speed, you will reach a tree after constant intervals.

A road can be described by K points P1, P2, ...... , PK. Pi and Pi+1 are connected by a straight line. So, it is clear that a road consists of some contiguous straight lines.  

In this problem you have to find all the points, where to plant a tree. For the sake of simplicity, we will consider that roads will not have any width.

 

 
  Input    
  The first line of input is an integer N (N<100) that indicates the number of roads under this beautification project. From next line N roads is described one by one. Description of each road starts with a line containing two integers K (2≤K≤100) and T (2≤T≤100).  Here K represents number of points that represents the road, and T represents the number of trees to be planted. This line is followed by K lines having 2 integers x, y(-1000.00<=x<=1000.00 and -1000.00<=y<=1000.00) each, ith line of these K lines is the co-ordinate of  Pi.

 

 
     
  Output  
  You have to give your output for every roads one by one. Output of each road starts with a line "Road #n:" (without quotes), here n is the road number. Next T lines will give the co-ordinates of  trees to be planted. x, y co-ordinate will be separated by a single space and having two decimal points. You have to represent the points sequentially in the order in which order you will find those trees when you walk through the road P1 to PK. Print a blank line after describing each road.  
     
  Sample Input Sample Output    
  1
5 6
10.00 10.00
20.00 20.00
30.00 10.00
10.00 0.00
9.00 9.00
Road #1:
10.00 10.00
18.44 18.44
26.89 13.11
23.26 6.63
12.58 1.29
9.00 9.00

   
  Hint: You have to maximize the distance between two adjacent trees in a road. So it is sure that first and last tree will be on the first and last point, i.e. in P1 and Pk.
Problem Setter: Md. Arifuzzaman Arif
Special Thanks: Shamim Hafiz
Next Generation Contest 5