eolymp
bolt
Try our new interface for solving problems
Problems

Business Cards

Business Cards

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 \textbf{9}×\textbf{6} paper sheet divided into \textbf{2}×\textbf{3} cards is given below. \includegraphics{https://static.e-olymp.com/content/8f/8fd06755d70e2fd4e12a085f224e3a8a9a3264bd.jpg} \InputFile The first line contains the number of test cases \textbf{t }(\textbf{t }≤ \textbf{10^5}). Each of them consists of one line containing four integers \textbf{a}, \textbf{b}, \textbf{c}, \textbf{d} (\textbf{1 }≤ \textbf{a}, \textbf{b}, \textbf{c}, \textbf{d }≤ \textbf{10^9}). Numbers \textbf{a }and \textbf{b }are dimensions of each business card; \textbf{c} and \textbf{d} are dimensions of the paper sheet. \OutputFile For each test case output one line containing word "\textbf{YES}" if it is possible to divide the whole sheet into business cards, and "\textbf{NO}" otherwise.
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
4
2 3 9 6
2 3 8 6
2 3 6 8
2 3 5 7
Output example #1
YES
YES
YES
NO
Source 2008 ACM CERC, Poland, Wroclaw, November 28-30, Problem C