Logo
(追記) (追記ここまで)

7883번 - Business Cards 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB577660.000%

문제

Running a paper shop is not an easy job, especially with harsh customers. Today they brought their own rectangular sheets of paper, asking you to cut it into rectangular business cards of specific size. Moreover, they require that all the paper (which may not be cheap, but is definitely not that expensive!) has to be used, i.e. no tiny bit may be left over. Moreover, the brilliant idea of cutting the sheet into very small pieces, and then gluing them together in desired sheets was laughed at.

An example of a 9 × 6 paper sheet divided into 2 × 3 cards is given below.

입력

The input contains several test cases. The first line contains the number of test cases t (t ≤ 105). Then t test cases follow. Each of them consists of one line containing four integers a, b, c, d (1 ≤ a, b, c, d ≤ 109). Numbers a and b are dimensions of each business card; c and d are dimensions of the paper sheet.

출력

For each test case output one line containing word YES if it is possible to divide the whole sheet into business cards, and NO otherwise.

제한

예제 입력 1

4
2 3 9 6
2 3 8 6
2 3 6 8
2 3 5 7

예제 출력 1

YES
YES
YES
NO

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2008 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /