Hello Programmers In this post, you will know how to solve the AND Plus OR Codechef Solution. The Problem Code: ANDORAND Plus OR Codechef SolutionOne more thing to add, don’t directly look for the solutions, first try to solve the problems of Codechef by yourself. If you find any difficulty after trying several times, then you can look for solutions.ProblemGiven an integer x, find two non-negative integers a and b such that (a∧b)+(a∨b)=x(a∧b)+(a∨b)=x, where ∧ is the bitwise AND operation and ∨ is the bitwise OR operation.InputThe 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.OutputIf 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 aa and bb.If there are multiple solutions, you may print any one of them.Constraints1≤T≤1051≤T≤1051≤x≤10181≤x≤1018SubtasksSubtask #1 (30 points):1≤T≤2001≤T≤2001≤x≤2001≤x≤200Subtask #2 (70 points): original constraintsSample Input 1 2 1 8Sample Output 1 0 1 5 3 AND Plus OR CodeChef Solution in JAVAimport java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int tc = 0; tc < T; ++tc) { long x = sc.nextLong(); System.out.println(solve(x)); } sc.close(); } static String solve(long x) { return String.format("0 %d", x); } }Disclaimer: The above Problem (AND Plus OR) is generated by CodeChef but the solution is provided by BrokenProgrammers. This tutorial is only for Educational and Learning purposes.Note:- I compile all programs, if there is any case program is not working and showing an error please let me know in the comment section. If you are using adblocker, please disable adblocker because some functions of the site may not work correctly.Next: Subtraction Game 1 Codechef Solution Post navigationBlack & White Ring Game Codechef Solution Subtraction Game 1 Codechef Solution