Solar Farm

시간 제한1초메모리 제한2048 MB

요약
반지름 r인 원 안에 w x h 크기의 직사각형을 같은 방향으로 격자 배열할 때 넣을 수 있는 최대 개수를 구한다.
난이도

보통10점 중 6점

유형
기하, 수학, 완전 탐색
정답자
아직 제출이 없습니다

문제

You are building a new solar farm. The area in which you are allowed to build is a circular field of radius rr, and the solar panels each take up a rectangular space of size w×hw \times h. You must place all the panels in the same orientation of your choice in a single rectangular array (so that all of the panels combined exactly form a single rectangle). What is the maximum number of panels that you can fit in this farm?

입력

The first line of input contains a single integer TT (1≤T≤1,0001\leq T \leq 1\\,000). This is the number of test cases.

The next TT lines of input each represent one test case and consist of three space-separated integers rr, ww, and hh (1≤r,w,h≤1091 \leq r, w, h \leq 10^9): the radius of the field, the width of each solar panel, and the height of each solar panel, respectively.

출력

For each test case, print a line with a single integer: the maximum number of solar panels that can be placed in a solar farm within the circular field.

예제2

  1. 예제 1

    입력
    3
    5 4 3
    2 2 2
    8 1 5
    
    예상 출력
    4
    1
    24
    
  2. 예제 2

    입력
    2
    500000003 1 600000010
    511374200 637192506 100000000
    
    예상 출력
    799999999
    7