Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Thursday, March 5, 2015

HackerRank. Contest 101. Marble Cut

Problem Statement

Given a marble of size l * b, your task is to find out if it can be cut into pieces of size 3×1 or not.


Input Format

First line will contain T i.e. number of the test cases.
Next T lines will contain pair of integers l and b separated by a single space.


Constraints

1≤T≤10^5
1≤l,b≤10^9


Output Format

Print "YES" if it is possible to cut the given marble without any area left, else print "NO" followed by remaining area.
Link: https://www.hackerrank.com/contests/101hack22/challenges/marble-cut