Problem Statement 
 In this problem you will be drawing a graph on a plane. Each vertex will be drawn as a point, and each edge will be drawn as a line segment between two vertices. Each edge has a desired length  the length it should have on the drawing. Your task is to assign to each vertex integer coordinates from a limited area so that the ratio of the actual edge length to the desired length is as similar across all edges as possible.
Implementation
Your code must implement one method plot(int NV, int[] edges):

NV is the number of vertices in the graph.

edges describes the desired lengths of the edges in the graph: the ith edge connects vertices edges[3*i] and edges[3*i+1] and has the desired length of edges[3*i+2].

Each vertex present in the graph is used in at least one edge. No pair of vertices is connected by two different edges.
The return from this method will describe the assigned coordinates of the graph vertices. It must contain exactly 2*NV elements and give the coordinates of the jth vertex as (ret[2*j], ret[2*j+1]). Each coordinate of each vertex must be between 0 and 700, inclusive. All vertices must be placed in distinct points.
Scoring
For each test case we will calculate your raw score. If your solution produced an invalid return (contained invalid number of elements, placed two vertices at the same point etc.), raw score for this test case will be 0. Otherwise, raw score will be calculated as follows. For each edge of the graph, its actual length on the drawing and the ratio "actual length / desired length" are calculated. Then minimal and maximal ratios across all edges are selected, and the raw score for a test case is calculated as MIN_RATIO/MAX_RATIO.
Your overall score will be the average of your raw scores over all test cases, multiplied by 1,000,000.
Test Case Generation
To generate the desired lengths of the graph edges, we will use the following procedure:

Assign random integer coordinates from [0, 700] x [0, 700] to each vertex of the graph, so that the coordinates of all vertices are distinct.

Calculate actual lengths of edges based on these coordinates.

Pick a random distortion percentage P between 0 and 99, inclusive.

For each edge, multiply its length by 1.1^G with probability P (and keep the length unchanged with probability 1P). G is sampled from normal distribution with mean 0.0 and standard deviation 1.0. The new lengths are capped to be between 1 and 991, inclusive.
Tools
An offline tester is available here. You can use it to test/debug your solution locally. You can also check its source code for exact implementation of test case generation and score calculation. That page also contains links to useful information and sample solutions in several languages.


Definition 
 Class:  GraphDrawing  Method:  plot  Parameters:  int, int[]  Returns:  int[]  Method signature:  int[] plot(int NV, int[] edges)  (be sure your method is public) 




Notes 
  The time limit is 10 seconds per test case (this includes only the time spent in your code). The memory limit is 1024 megabytes. 
  There is no explicit code size limit. The implicit source code size limit is around 1 MB (it is not advisable to submit codes of size close to that or larger). Once your code is compiled, the binary size should not exceed 1 MB. 
  The compilation time limit is 30 seconds. You can find information about compilers that we use and compilation options here. 
  There are 10 example test cases and 100 full submission (provisional) test cases. 
  The match is rated. 

Constraints 
  The number of vertices NV will be between 10 and 1000, inclusive. 
  The number of edges will be between NV  1 and NV * min(10, (NV  1) / 4), inclusive. 

Examples 
0)  
 seed = 1
Number of vertices NV = 5
Number of edges NE = 5
Required edge lengths:
01 = 265
12 = 296
13 = 210
04 = 421
03 = 96
 

1)  
 seed = 2
Number of vertices NV = 20
Number of edges NE = 69
Required edge lengths:
011 = 425
115 = 250
212 = 684
319 = 94
46 = 566
58 = 79
47 = 336
59 = 384
1019 = 546
013 = 712
1417 = 110
1016 = 193
618 = 412
910 = 315
817 = 130
515 = 306
17 = 611
1017 = 125
410 = 175
218 = 436
09 = 641
010 = 353
419 = 448
716 = 193
79 = 165
014 = 426
813 = 421
118 = 644
1219 = 96
414 = 221
019 = 598
819 = 381
1117 = 202
89 = 241
916 = 347
78 = 343
113 = 555
717 = 243
1318 = 544
1214 = 445
01 = 312
914 = 330
1619 = 333
216 = 381
816 = 317
616 = 494
15 = 227
34 = 467
711 = 345
316 = 310
713 = 460
1517 = 426
37 = 87
119 = 592
1718 = 276
36 = 203
712 = 224
718 = 116
213 = 742
05 = 223
1114 = 110
619 = 117
117 = 444
111 = 616
14 = 387
1516 = 552
1319 = 286
1014 = 132
112 = 688
 

2)  
 seed = 3
Number of vertices NV = 1000
Number of edges NE = 7395
 

3)  
 seed = 4
Number of vertices NV = 761
Number of edges NE = 3992
 

4)  
 seed = 5
Number of vertices NV = 852
Number of edges NE = 4228
 

5)  
 seed = 6
Number of vertices NV = 586
Number of edges NE = 1714
 

6)  
 seed = 7
Number of vertices NV = 506
Number of edges NE = 1181
 

7)  
 seed = 8
Number of vertices NV = 289
Number of edges NE = 1617
 

8)  
 seed = 9
Number of vertices NV = 164
Number of edges NE = 1470
 

9)  
 seed = 10
Number of vertices NV = 620
Number of edges NE = 4353
 
