# Polygon Relationship SOLUTIONS POLYREL

Page Contents

### Polygon Relationship SOLUTIONS POLYREL

You are given a carefully arched polygon with N vertices (numbered 1 through N). For each legitimate I, the directions of the I-th vertex are (Xi,Yi). You may play out the accompanying activity quite a few times (counting zero):

Think about a parent polygon. At first, this is the polygon you are given.

Draw one of its youngster polygons ― a straightforward non-degenerate polygon with the end goal that every one of its sides is a harmony of the parent polygon (it can’t be a side of the parentzpolygon). The activity can’t be performed if the parent polygon doesn’t have any kid polygons.

The youngster polygon which you drew turns into the new parent polygon.

You will probably draw however many sides of polygons altogether as would be prudent (counting the polygon given toward the beginning). Locate this greatest complete number of sides.

Info

The main line of the info contains a solitary whole number T indicating the quantity of experiments. The portrayal of T experiments follows.

The principal line of each experiment contains a solitary number N.

N lines follow. For each substantial I, the I-th of these lines contains two space-isolated numbers Xi and Yi.

Yield : Print a solitary line containing one number ― the most extreme conceivable number of sides of polygons.

Imperatives

1≤T≤1,000

3≤N≤105

|Xi|,|Yi|≤109 for each substantial I

the entirety of N over all experiments doesn’t surpass 2⋅106

Model Input

– 100 1

0 2

100 1

– 4 0

– 3 – 2

– 3 2

0 – 4

2 – 3

2 3

3 2

Model Output

10

Clarification

Model case 1: It is beyond the realm of imagination to expect to draw a kid polygon.

Model case 2: We can draw a youngster polygon once, for example with vertices (−3,−2), (−3,2) and (3,2). Despite the fact that there are a few different approaches to draw a kid polygon, it must be a triangle, so the complete number of sides can’t surpass 7+3=10.