Fitting circles

3.4

82 votes
Basic Programming, Basics of Implementation, Implementation
Problem

You are given a rectangle of length a and width b. You are required to determine a circle that contains the maximum circumference that fits inside the rectangle. This type of circle is called a big circle. Your task is to determine the maximum number of big circles that can fit inside the rectangle. 

Input format

  • First line: An integer t denoting the number of test cases
  • First line of each test case: Integers a and b

Output format

For each test case, print the answer on a new line denoting the maximum number of big circles that can fit in the provided rectangle.  

Constraints

1t10001a,b109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

4 circles of radius 10 can fit inside the rectangle.

Editor Image

?