Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $handle = fopen ("php://stdin","r");
- fscanf($handle,"%d",$t);
- for($a0 = 0; $a0 < $t; $a0++){
- fscanf($handle,"%d",$n);
- $height = 1;
- for ($i=1; $i<=$n; $i++) {
- if ($i%2==0) {
- $height++;
- } else {
- $height = $height*2;
- }
- }
- echo $height."\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment