Cake Cutting
Practice
3 (2 votes)
Easy
Math
Problem
10% Success 1015 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Given a Diameter D of circle and two points A and B are fixed at end of the diameter as shown in the figure. Figure
Sachin drew all distinct possible quadrilaterals with the following properties:
1. One of the diagonals is diameter AB (fixed)
2. Other two points lie on the circumference of the circle on opposite sides of \(AB\).
3. All the sides have positive integral lengths.

Two quadrilaterals are said to be distinct if at least one of their vertices is not on the same point on the circumference of the circle.

Let \(A1, A2, B1, B2\) be the areas formed between the quadrilateral and circle, as shown in the figure.

Your task is to find
1. Number of quadrilaterals L with \(A1+A2 > B1+B2\)
2. Number of quadrilaterals E with \(A1+A2 = B1+B2\)
3. Number of quadrilaterals R with \(A1+A2 < B1+B2\)

Input Format

First line of the input consists of an integer T denoting the number of testcases. Each testcase consists of single integer D, diameter of circle.

Constraints

  • \(1≤ T ≤ 20\)

  • \(2 ≤ D ≤ 10^6\)

Output Format

For each of the testcases, output three space separated integers \(L, E, R.\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
4 votes
Tags:
Easy
Points:20
10 votes
Tags:
OpenAlgorithmsApprovedEasy
Points:20
18 votes
Tags:
Ad-HocBasic ProgrammingOpenApprovedEasyMathamatics