Company: Hackereartth_2_Feb
Difficulty: medium
Ropes Problem Description You are given with N ropes of variable lengths A i . You can pick any two ropes and form the figure "X" with help of them. The rules of forming "X" are simple. Place the two ropes such that they intersect each other. There must be at least a unit distance between the point of intersection and any of the four ends of the two ropes chosen. The point of intersection can be any integer point. For example, if one of the ropes has length 5 and other rope has length 3, then we can have the center as (1, 2), (2, 2), (3, 2), (4, 2), (1, 1), (2, 1), (3, 1), (4, 1) where (x, y) means that center is at x units distance from the left end of rope 1 and y units distance from the left end of rope 2 (See Figure). [An image in the problem description shows two ropes crossing each other in an 'X' shape. The intersection point divides each rope into two segments.] There are many ways of picking the ropes of different lengths, and many ways of choosing the point of intersection of