AND Plus OR SOLUTION
Given an integer x, find two non-negative integers a and b such that (a∧b)+(a∨b)=x, where ∧ is the bitwise AND operation and ∨ is the bitwise OR operation.
The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
The first and only line of each test case contains a single integer x.
If there is no valid pair (a,b), print a single line containing the integer −1. Otherwise, print a single line containing two space-separated integers a and b.
If there are multiple solutions, you may print any one of them.
Subtask #1 (30 points):
Subtask #2 (70 points): original constraints
SOLUTION AFTER CONTEST
Free Coupon is Applied Claim the Offer!
ESET FREE LINCENSE KEYS UPDATED 2020 : https://www.cybergeeksquad.co/2020/11/eset-free-lincense-keys-updated-2020.html
Chegg FREE Premium Accounts:
Udemy Leak Courses:
November Challenge 2020 SOLUTION CodeChef
- Selecting Edges SOLUTION SELEDGE
- Panic! at the Disco SOLUTION PANIC
- Restore Sequence SOLUTION RESTORE
October Lunchtime 2020 CodeChef SOLUTIONS