GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Sunday 14 August 2022

[Solution] Hello Equation CodeChef Solution 2022


Problem

You are given a positive integer X. Your task is to tell whether there exist two positive integers a and b (a \gt 0, b \gt 0) such that

2\cdot a + 2\cdot b + a\cdot b = X

If there exist positive integers a and b satisfying the above condition print YES, otherwise print NO.

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.
  • Each test case consists of single line containing a positive integer X.

Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

Output Format

For each test case, output on a new line YES or NO.

You may print each character of the string in either uppercase or lowercase (for example, the strings yesYESYes, and yeS will all be treated as identical).

Explanation:

Test case 1: There do not exist any positive integers a and b such that 2\cdot a + 2\cdot b + a\cdot b = 2.

Test case 2: Let a=1 and b=1, then 2\cdot a+2\cdot b+a\cdot b=5.

Test case 3: There do not exist any positive integers a and b such that 2\cdot a + 2\cdot b + a\cdot b = 6.

Test case 4: Let a=2 and b=2, then 2\cdot a+2\cdot b+a\cdot b=12.

No comments:

Post a Comment