GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Friday 6 May 2022

Very Suspicious Codeforces Solution | Codeforces Problem Solution 2022

D. Very Suspicious
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Sehr Sus is an infinite hexagonal grid as pictured below, controlled by MennaFadali, ZerooCool and Hosssam.

Solution Click Below:-  CLICK HERE

They love equilateral triangles and want to create n equilateral triangles on the grid by adding some straight lines. The triangles must all be empty from the inside (in other words, no straight line or hexagon edge should pass through any of the triangles).

Prof. Slim Codeforces Solution | Codeforces Problem Solution 2022

Dorms War Codeforces Solution | Codeforces Problem Solution 2022

Where is the Pizza? Codeforces Solution | Codeforces Problem Solution 2022

Very Suspicious Codeforces Solution | Codeforces Problem Solution 2022

Hemose on the Tree Codeforces Solution | Codeforces Problem Solution 2022

Jee, You See? Codeforces Solution | Codeforces Problem Solution 2022


You are allowed to add straight lines parallel to the edges of the hexagons. Given n, what is the minimum number of lines you need to add to create at least n equilateral triangles as described?

Adding two red lines results in two new yellow equilateral triangles.
Input

The first line contains a single integer t (1t105) — the number of test cases. Then t test cases follow.

Each test case contains a single integer n (1n109) — the required number of equilateral triangles.

Output

For each test case, print the minimum number of lines needed to have n or more equilateral triangles.

Join Now for Solution:- 

No comments:

Post a Comment