fork(1) download
  1. #include <cmath>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <iostream>
  5. #include <algorithm>
  6. #include <string>
  7. using namespace std;
  8.  
  9. int main() {
  10. int t;
  11. cin >> t;
  12. while (t--) {
  13. long long a, b;
  14. cin >> a >> b;
  15. if (a < 0 || a == 0 || b < 0 || b == 0) {
  16. printf("%lli\n", a);
  17. } else printf("%lli\n", a & b);
  18.  
  19.  
  20.  
  21. }
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 3144KB
stdin
81
551124992 551129087
2205057024 2205061119
4204900352 4204904447
2341777408 2341781503
971116544 971120639
1971425280 1971429375
2574172160 2574176255
3634294784 3634298879
3074641920 3074646015
2505687040 2505691135
3824623616 3824627711
312602624 312606719
4191993856 4191997951
1801621504 1801625599
727842816 727846911
2887520256 2887524351
2965008384 2965012479
130166784 130170879
3063283712 3063287807
974942208 974946303
151785472 151789567
3315060736 3315064831
607043584 607047679
842919936 842924031
549707776 549711871
1015558144 1015562239
3952988160 3952992255
3649171456 3649175551
546496512 546500607
3187011584 3187015679
28962816 28966911
224092160 224096255
760012800 760016895
2156093440 2156097535
3983396864 3983400959
1612738560 1612742655
927322112 927326207
2668310528 2668314623
3319889920 3319894015
657408000 657412095
1902571520 1902575615
2437660672 2437664767
3805020160 3805024255
4262723584 4262727679
4144484352 4144488447
1932922880 1932926975
2535608320 2535612415
3907411968 3907416063
1389105152 1389109247
2055303168 2055307263
265392128 265396223
3073138688 3073142783
1972703232 1972707327
3960741888 3960745983
1915539456 1915543551
1387044864 1387048959
1790742528 1790746623
3966676992 3966681087
2197168128 2197172223
1721774080 1721778175
3642773504 3642777599
2426195968 2426200063
684040192 684044287
4047433728 4047437823
3617705984 3617710079
3518025728 3518029823
752021504 752025599
3240005632 3240009727
1538572288 1538576383
1148952576 1148956671
740327424 740331519
696266752 696270847
3741663232 3741667327
2280386560 2280390655
4206542848 4206546943
3872428032 3872432127
1668132864 1668136959
116645888 116649983
586137600 586141695
2272591872 2272595967
854806528 854810623
stdout
551124992
2205057024
4204900352
2341777408
971116544
1971425280
2574172160
3634294784
3074641920
2505687040
3824623616
312602624
4191993856
1801621504
727842816
2887520256
2965008384
130166784
3063283712
974942208
151785472
3315060736
607043584
842919936
549707776
1015558144
3952988160
3649171456
546496512
3187011584
28962816
224092160
760012800
2156093440
3983396864
1612738560
927322112
2668310528
3319889920
657408000
1902571520
2437660672
3805020160
4262723584
4144484352
1932922880
2535608320
3907411968
1389105152
2055303168
265392128
3073138688
1972703232
3960741888
1915539456
1387044864
1790742528
3966676992
2197168128
1721774080
3642773504
2426195968
684040192
4047433728
3617705984
3518025728
752021504
3240005632
1538572288
1148952576
740327424
696266752
3741663232
2280386560
4206542848
3872428032
1668132864
116645888
586137600
2272591872
854806528