You are viewing a single comment's thread. Return to all comments →
PHP simple solution
<?php $handle = fopen ("php://stdin","r"); fscanf($handle,"%d",$t); for($a0 = 0; $a0 < $t; $a0++){ fscanf($handle,"%d %d",$n,$k); $res = ( (($k-1)|$k) > $n && $k%2 == 0) ? $k-2 : $k-1; echo $res. "\n"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 29: Bitwise AND
You are viewing a single comment's thread. Return to all comments →
PHP simple solution