File tree Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Expand file tree Collapse file tree 1 file changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ import java .util .*;
2
+ import java .lang .*;
3
+ import java .io .*;
4
+
5
+ class Codechef
6
+ {
7
+ static class FastReader
8
+ {
9
+ BufferedReader br ;
10
+ StringTokenizer st ;
11
+
12
+ public FastReader ()
13
+ {
14
+ br = new BufferedReader (new
15
+ InputStreamReader (System .in ));
16
+ }
17
+
18
+ String next ()
19
+ {
20
+ while (st == null || !st .hasMoreElements ())
21
+ {
22
+ try
23
+ {
24
+ st = new StringTokenizer (br .readLine ());
25
+ }
26
+ catch (IOException e )
27
+ {
28
+ e .printStackTrace ();
29
+ }
30
+ }
31
+ return st .nextToken ();
32
+ }
33
+
34
+ int nextInt ()
35
+ {
36
+ return Integer .parseInt (next ());
37
+ }
38
+
39
+
40
+ long nextLong ()
41
+ {
42
+ return Long .parseLong (next ());
43
+ }
44
+
45
+ double nextDouble ()
46
+ {
47
+ return Double .parseDouble (next ());
48
+ }
49
+
50
+ String nextLine ()
51
+ {
52
+ String str = "" ;
53
+ try
54
+ {
55
+ str = br .readLine ();
56
+ }
57
+ catch (IOException e )
58
+ {
59
+ e .printStackTrace ();
60
+ }
61
+ return str ;
62
+ }
63
+ }
64
+ public static void main (String [] args ) throws java .lang .Exception {
65
+ FastReader sc =new FastReader ();
66
+ int t =sc .nextInt ();
67
+ while (t -->0 ) {
68
+ long x =sc .nextLong ();
69
+ long y =sc .nextLong ();
70
+ long n =sc .nextLong ();
71
+ long res =0 ;
72
+ for (long i =n ;i >=0 ;i --) {
73
+ if ((x ^i )<(y ^i )) {
74
+ res ++;
75
+ }
76
+ }
77
+ System .out .println (res );
78
+ }
79
+ }
80
+ }
You can’t perform that action at this time.
0 commit comments