Polygon Relationship SOLUTIONS POLYREL

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.

 

 

March Long Challenge 2021 Solutions

April Long Challenge 2021 Solutions

Codechef Long Challenge Solutions

February Long Challenge 2021

1. Frog Sort Solution Codechef

2. Chef and Meetings Solution Codechef

3. Maximise Function Solution Codechef

4. Highest Divisor Solution Codechef

5. Cut the Cake Challenge Solution Codechef

6. Dream and the Multiverse Solution Codechef

7. Cell Shell Solution Codechef

8. Multiple Games Solution Codechef

9. Another Tree with Number Theory Solution Codechef

10. XOR Sums Solution Codechef

11. Prime Game Solution CodeChef

12. Team Name Solution Codechef

January Long Challenge 2021

November Challenge 2020 SOLUTION CodeChef

October Lunchtime 2020 CodeChef SOLUTIONS

RELATED :

Related :

Related :

Leave a Comment