<?php
$a = trim(fgets(STDIN));
for($x = 1; $x <= $a; $x++)
{
     $b = trim(fgets(STDIN));
     $c = explode(" ", trim(fgets(STDIN)));
     $d = array_unique($c);
     print count($d) . "\n";
}
?>

<?php

$handle = fopen ("php://stdin","r");

$numberOfTestCases = fgets($handle);
$arrayElemetsArray = [];

for($x=0;$x<$numberOfTestCases;$x++) {
    $numberOfElementsInAnArray = fgets($handle);
    array_push($arrayElemetsArray, explode(' ', fgets($handle)));
}

foreach($arrayElemetsArray as $arrayElemets) {
    $uniqueArray = array_unique($arrayElemets, SORT_NUMERIC);
    echo count($uniqueArray);
    echo "\n";
}

?>

<?php
$server = "php://stdin";
$handle = fopen($server, "r");
$t= trim(fgets($handle));
for($k=0;$k<$t;$k++)
{
    $n= trim(fgets($handle));
    $a=trim(fgets($handle));
    $a=explode(' ',$a);
    sort($a);
    $last=0;$count=0;
    for($i=0;$i<$n;$i++)
    {
        if($a[$i]>$last)
        {
            $count++;
            $last=$a[$i];
        }
    }
    echo $count."\n";
}

<?php
	$t = trim(fgets(STDIN));

	$ans = '';
	for ($o = 0; $o < $t; $o++) {
		$n = trim(fgets(STDIN));
		$a = explode(" ", trim(fgets(STDIN)));
		$a = array_unique($a);

		$ans .= count($a)."\n";
	}

	print $ans;
?>

<?php

$handle = fopen ("php://stdin","r");

$numberOfTestCases = fgets($handle);
$arrayElemetsArray = [];

for($x=0;$x<$numberOfTestCases;$x++) {
    $numberOfElementsInAnArray = fgets($handle);
    array_push($arrayElemetsArray, explode(' ', fgets($handle)));
}

foreach($arrayElemetsArray as $arrayElemets) {
    $uniqueArray = array_unique($arrayElemets);
    asort($uniqueArray);
    echo count($uniqueArray);
    echo "\n";
}

?>

<?php
	$t = trim(fgets(STDIN));

	function CeilIndex($A, $l, $r, $key) {
	    while ($r - $l > 1)
	    {
	        $m = (int)($l + ($r - $l)/2);
	        if ($A[$m] >= $key)
	            $r = $m;
	        else
	            $l = $m;
	    }
	    return $r;
	}

	function LIS($A, $size)
	{
	    $tailTable = array_fill(0, ($size + 1), 0);
	    $len = 0;

	    $tailTable[0] = $A[0];
	    $len = 1;
	    for($i = 1; $i < $size; $i++)
	    {

	        if ($A[$i] < $tailTable[0])
	            $tailTable[0] = $A[$i];

	        else if ($A[$i] > $tailTable[$len-1])
	        {
	            $tailTable[$len] = $A[$i];
	            $len++;
	        }
	        else
	            $tailTable[CeilIndex($tailTable, -1, $len-1, $A[$i])] = $A[$i];

	    }
	    return $len;
	}

	$ans = '';
	for ($o = 0; $o < $t; $o++) {
		$n = trim(fgets(STDIN));
		$a = explode(" ", trim(fgets(STDIN)));
		$lis = LIS($a, $n);
		if ($lis == 1) {
			$a = array_reverse($a);
			$ans .= LIS($a, $n)."\n";
		} else {
			$a = array_merge($a, $a);
			$ans .= LIS($a, $n*2)."\n";
		}
	}

	print $ans;
?>

<?php
	$t = trim(fgets(STDIN));

	function CeilIndex($A, $l, $r, $key) {
	    while ($r - $l > 1)
	    {
	        $m = (int)($l + ($r - $l)/2);
	        if ($A[$m] >= $key)
	            $r = $m;
	        else
	            $l = $m;
	    }
	    return $r;
	}

	function LIS($A, $size)
	{
	    $tailTable = array_fill(0, ($size + 1), 0);
	    $len = 0;

	    $tailTable[0] = $A[0];
	    $len = 1;
	    for($i = 1; $i < $size; $i++)
	    {

	        if ($A[$i] < $tailTable[0])
	            $tailTable[0] = $A[$i];

	        else if ($A[$i] > $tailTable[$len-1])
	        {
	            $tailTable[$len] = $A[$i];
	            $len++;
	        }
	        else
	            $tailTable[CeilIndex($tailTable, -1, $len-1, $A[$i])] = $A[$i];

	    }
	    return $len;
	}

	$ans = '';
	for ($o = 0; $o < $t; $o++) {
		$n = trim(fgets(STDIN));
		$a = explode(" ", trim(fgets(STDIN)));
		$lis = LIS($a, $n);
		if ($lis == 1) {
			$ans .= $n."\n";
		} else {
			$a = array_merge($a, $a);
			$ans .= LIS($a, $n*2)."\n";
		}
	}

	print $ans;
?>


<?php

//=====================================
// link: https://codeforces.com/contest/381/problem/A
//=====================================

// get inputs
$number_of_cards = trim(fgets(STDIN));
$cards = explode(' ', trim(fgets(STDIN)));

// solution
$sereja = 0; $dima = 0; $count=0;

while (!empty($cards)) {
    $first_card = $cards[0];
    $last_card = end($cards);
    $arr_count = count($cards);

    if($arr_count == 1) {
        ($count % 2) ? $dima += $first_card : $sereja += $first_card;
        break;
    }

    if($first_card > $last_card) {
        ($count % 2) ? $dima += $first_card : $sereja += $first_card;
        unset($cards[0]);
        $cards = array_values($cards);
        $count++;
        continue;
    }

    ($count % 2) ? $dima += $last_card : $sereja += $last_card;
    unset($cards[$arr_count-1]);
    $cards = array_values($cards);
    $count++;
}

echo "$sereja $dima\n";

<?php

$n = (int)getline();
$a = explode(' ', getline());

$sum = array(0, 0);
$n = min($n, count($a));

$lower = 0;
$upper = $n - 1;

for ($i = 0; $i < $n; $i ++) {
  if ($a[$lower] < $a[$upper]) {
    $sum[$i%2] += (int)$a[$upper --];
  } else {
    $sum[$i%2] += (int)$a[$lower ++];
  }
}

print $sum[0] . ' ' . $sum[1];

function getline() {
  return trim(fgets(STDIN));
}

<?php
error_reporting(0);
//////////////////////// Class For Read Input - laurenceHR ///////////////////////////////////////////////////////////////////////
class stdIn{var $ntxt = 0;var $nline = 0;var $arr_txt;var $arr_line;var $linex;var $liney;
function stdIn($local = false){if($local){$dir = fopen("input.txt", 'r');}else{$dir = fopen("php://stdin", 'r');}
$datatxt = stream_get_contents($dir);$del = Array("\n","\r","\n\r");$data = explode("\n",$datatxt); $il = 0;$id = 0;
foreach($data as $line){if(strlen($line) > 0){$line = str_replace($del,'',$line);$dataex[] = $line;$text = explode(" ",$line);
foreach($text as $txt){$arr_txt[] = $txt;$this->linex[$id] = $il;$this->liney[$il] = $id;$id++;}}$il++;}$this->arr_line = $dataex;$this->arr_txt  = $arr_txt;}
function G(){$ret = $this->arr_txt[$this->ntxt++];$this->nline = $this->linex[$this->ntxt];return $ret;}
function GL(){$this->ntxt = $this->liney[$this->nline]+1;return $this->arr_line[$this->nline++];}}
/*init*/ $dxs = new stdIn(false);
# DECLARE FUNCTIONS #

$ser = 0;
$dim = 0;

# MAIN CODE

$a = $dxs->G();
for($i=0;$i<$a;$i++){
$b[]=$dxs->G();
}

for($z=0;$z<$a;$z++){
$ca = count($b);
$max = max($b[0],$b[$ca-1]);

#echo "$z | max(".$b[0]."".$b[$ca].") res = $max";

if($b[0]==$max){
unset($b[0]);$b=array_values($b);}
if($b[$ca-1]==$max){
unset($b[$ca-1]);$b=array_values($b);}

if($z%2===0){
$ser = $ser+$max;
}else{
$dim = $dim+$max;
}

}

# PRINT OUTPUT

echo "$ser $dim";
?>

<?php

//=====================================
// link: https://codeforces.com/contest/381/problem/A
//=====================================

// get inputs
$number_of_cards = trim(fgets(STDIN));
$cards           = explode(' ', trim(fgets(STDIN)));

// solution
$sereja = 0;
$dima   = 0;
$first  = 0;
$last   = $number_of_cards - 1;

for ($i=0; $i < $number_of_cards; $i++) {
    if ($cards[$first] >= $cards[$last]) {
        ($i % 2) ? $dima += $cards[$first] : $sereja += $cards[$first];
        $first++;
        continue;
    }

    ($i % 2) ? $dima += $cards[$last] : $sereja += $cards[$last];
    $last--;
}

echo "$sereja $dima\n";

<?php

//=====================================
// link: https://codeforces.com/contest/381/problem/A
//=====================================

// get inputs
$number_of_cards = trim(fgets(STDIN));
$cards           = explode(' ', trim(fgets(STDIN)));

// solution
$sereja = 0;
$dima   = 0;
$first  = 0;
$last   = $number_of_cards - 1;
$count  = 0;

for ($i=0; $i < $number_of_cards; $i++) {
    if ($first == $last) {
        ($count % 2) ? $dima += $cards[$first] : $sereja += $cards[$first];
        break;
    }

    if ($cards[$first] > $cards[$last]) {
        ($count % 2) ? $dima += $cards[$first] : $sereja += $cards[$first];
        $first++;
        $count++;
        continue;
    }

    ($count % 2) ? $dima += $cards[$last] : $sereja += $cards[$last];
    $last--;
    $count++;
}

echo "$sereja $dima\n";

<?php
$in=fgets(STDIN);
$str=fgets(STDIN);
$arr=explode(" ", $str);

$flag=true;
$a=0;$b=0;
$l=0;$r=intval($in)-1;
foreach ($arr as &$va) {
$va=intval($va);
}
while($l<=$r){
	if($arr[$l]>$arr[$r]){
		if($flag){
			$a+=$arr[$l];
			$l++;
			$flag=!$flag;
		}else{
			$b+=$arr[$l];
			$l++;
			$flag=!$flag;
		}
	}else{
		if($flag){
			$a+=$arr[$r];
			$r--;
			$flag=!$flag;
		}else{
			$b+=$arr[$r];
			$r--;
			$flag=!$flag;
		}
	}
}
echo $a." ".$b;
?>

<?php
    $n = trim(fgets(STDIN));
    $nums = explode(" ", trim(fgets(STDIN)));

    $i = 0;
    $nach = 0;
    $kon  = 0;
    $one  = 0;
    $two  = 0;

    while($i != $n){

        if ($nums[0+$nach] > $nums[$n-1-$kon]){
            if ($igrok == 0){
                $one += $nums[0+$nach];
                $igrok = 1;
            }else{
                $two += $nums[0+$nach];
                $igrok = 0;
            }
            $nach++;
            $i++;
            continue;
        }

        if ($nums[0+$nach] < $nums[$n-1-$kon]){
            if ($igrok == 0){
                $one += $nums[$n-1-$kon];
                $igrok = 1;
            }else{
                $two += $nums[$n-1-$kon];
                $igrok = 0;
            }
            $kon++;
            $i++;
            continue;
        }

        if ($nums[0+$nach] == $nums[$n-1-$kon]){
            if ($igrok == 0){
                $one += $nums[$n-1-$kon];
                $igrok = 1;
            }else{
                $two += $nums[$n-1-$kon];
                $igrok = 0;
            }
            $kon++;
            $i++;
            continue;
        }
    }

    fwrite(STDOUT, $one." ".$two);
?>

<?php

$in = 'php://stdin';
$input = fopen($in, "r");
$n = fgets($input);
$arr = explode(" ", trim(fgets($input)));

function test($arr){
    $Sereja = 0;
    $Dima = 0;
    $turnSereja = true;
    while(count($arr) > 0){
        $temp = count($arr);

        if($arr[0] > $arr[$temp - 1] ){
            $numberChoose = $arr[0];
            array_splice($arr,0,1);
            //Remove first
        }
        else{
            $numberChoose = $arr[$temp - 1];
            array_splice($arr,$temp - 1,1);
        }
        if($turnSereja){
            $Sereja += $numberChoose;
        }
        else{
            $Dima += $numberChoose;
        }
        $turnSereja = !$turnSereja;
    }
    echo $Sereja." ".$Dima;
}

test($arr);

<?php

$stdout = fopen( getenv("OUTPUT_PATH") , "w" );
$stdin = fopen( "php://stdin" , "r" ) ;

$groups = 0 ;
$temp = "" ;

fscanf( $stdin , "%d" , $n );
fscanf( $stdin , "%[^\n]" , $line );

$arr = array_map( 'intval' , preg_split('/ /' , $line, -1 , PREG_SPLIT_NO_EMPTY ) );

$sereja = 0 ;
$dima = 0 ;
$start = 0 ;
$end = count($arr) - 1 ;
$done = 1 ;

while( $end >= $start )
{
     if( $arr[ $start ] >= $arr[ $end ] )
     {
          if( $done == 1 )
          {
               $sereja = intval($sereja) + intval($arr[ $start ] ) ;
               $done = 2 ;
          }
          else
          {
               $dima = intval($dima) + intval($arr[ $start ] ) ;
               $done = 1 ;
          }
          $start++ ;
     }
     else
     {
          if( $done == 1 )
          {
               $sereja = intval($sereja) + intval($arr[ $end ] ) ;
               $done = 2 ;
          }
          else
          {
               $dima = intval($dima) + intval($arr[ $end ] ) ;
               $done = 1 ;

          }
          $end-- ;
     }
}

echo $sereja . " " . $dima ;

fwrite($stdout);

fclose($stdin);
fclose($stdout);

?>

<?php

$n = rtrim(fgets(STDIN));
$cards = explode(" ", rtrim(fgets(STDIN)));
$S = 0;
$D = 0;
$r = sizeof($cards)-1;
$l = 0;
$next='S';

for($i=0; $i<sizeof($cards); $i++)
{
    if($next == 'S'){
        $S += max($cards[$l], $cards[$r]);
        $next='D';
    }else{
        $D += max($cards[$l], $cards[$r]);
        $next='S';
    }
    if($cards[$r]>$cards[$l]){
        $r--;
    }else{
        $l++;
    }
}
echo ($S .' '.$D);

<?php

$in = 'php://stdin';
$input = fopen($in, "r");

$n = (int) trim(fgets($input));

$arr = explode(" ", trim(fgets($input)));

$s = 0;
$d = 0;

$left = 0;
$right = $n - 1;
$turn = 0;

while ($left <= $right) {

    $max = 0;

    if ($arr[$right] > $arr[$left]) {

        $max = $arr[$right];
        $right--;
    } else {

        $max = $arr[$left];
        $left++;
    }

    if ($turn % 2 == 0) {
        $s += $max;
    } else {
        $d += $max;
    }

    $turn++;
}

echo $s, ' ', $d;

<?php
	$temp = fopen("php://stdin","r");

	$n = intval(fgets($temp));

	$test = explode(" ", fgets($temp));

	for ($i=0; $i < $n ; $i++) {
		$arr[$i] = intval($test[$i]);
	}

	$seja=0;
	$dima=0;

	$turns=true;

	while(count($arr) > 1)
	{
		if($arr[0] > $arr[count($arr)-1])
		{
			$t = array_reverse($arr);
			$element = array_pop($t);
			$arr = $t;
			$arr = array_reverse($arr);
		}
		else if($arr[0] < $arr[count($arr)-1])
		{
			$element = array_pop($arr);
		}

		if($turns)
			$seja += $element;
		else
			$dima += $element;

		$turns = !$turns;
	}

	if( $n % 2 == 0 )
		$dima += $arr[0];
	else
		$seja += $arr[0];

	echo $seja . " " . $dima;

?>

<?php

//=====================================
// link: https://codeforces.com/contest/381/problem/A
//=====================================

// get inputs
$number_of_cards = trim(fgets(STDIN));
$cards = explode(' ', trim(fgets(STDIN)));

// solution
rsort($cards);
$sereja = 0;
$dima = 0;

for ($i=0; $i < $number_of_cards; $i++) {
    if($i % 2) {
        $dima += $cards[$i];
        continue;
    }

    $sereja += $cards[$i];
}

echo "$sereja $dima\n";

<?php
$in=fgets(STDIN);
$str=fgets(STDIN);
$arr=explode(" ", $str);

$flag=true;
$a=0;$b=0;
$l=0;$r=$in-1;
while($l<=$r){
	if($arr[$l]>$arr[$r]){
		if($flag){
			$a+=$arr[$l];
			$l++;
			$flag=!$flag;
		}else{
			$b+=$arr[$l];
			$l++;
			$flag=!$flag;
		}
	}else{
		if($flag){
			$a+=$arr[$r];
			$r--;
			$flag=!$flag;
		}else{
			$b+=$arr[$r];
			$r--;
			$flag=!$flag;
		}
	}

}
echo $a." ".$b;
?>

<?php
$in=fgets(STDIN);
$str=fgets(STDIN);
$arr=explode(" ", $str);
arsort($arr);
$a=0;$b=0;$i=0;
foreach ($arr as $key => $value) {
	if($i%2==0) $a+=$value;
	else $b+=$value;
	$i++;
}
echo $a." ".$b;
?>

<?php
$n = rtrim(fgets(STDIN));
$cards = explode(" ", rtrim(fgets(STDIN)));
rsort($cards);

$S = 0;
$D = 0;
for($i=0; $i<$n; $i++)
{
    if($i % 2 == 0) $S += $cards[$i]; else $D += $cards[$i];
}
echo ($S .' '.$D);


<?php
error_reporting(0);

function solve(){
	$Scanner = new Scanner("php://stdin");
	//$Scanner = new Scanner("input.txt");

	$inp_N = (int)$Scanner->Scan();
	$inp_M = (int)$Scanner->Scan();
	$inp_X = $Scanner->Scan();
	$inp_Y = $Scanner->Scan();

	for ($i = 0; $i < $inp_N; $i++) {
		$A_arr[] = $Scanner->Scan();
	}

	$posA = 0;
	for ($j = 0; $j < $inp_M; $j++) {
		$temp = $Scanner->Scan();
		for ($k = $posA; $k < $inp_N; $k++) {
			if ($A_arr[$k] - $inp_X <= $temp && $A_arr[$k] + $inp_Y >= $temp) {
				$K = $k+1;
				$J = $j+1;
				$arr[] = $K. " ". $J;
				//print($K. " ". $J);
				//print("\n");
				$posA = $K;
				break;
			} else {
				if ($A_arr[$k] - $inp_X > $temp) {
					break;
				} elseif ($A_arr[$k] + $inp_Y < $temp) {
					$posA = $k+1;
					continue;
				}
			}
		}
	}
	$len = count($arr);
	print($len);
	print("\n");
	for ($i = 0; $i < $len; $i++) {
		if ($i != $len - 1) {
			print($arr[$i]);
			print("\n");
		} else {
			print($arr[$i]);
		}
	}
	$Scanner->close();
}

ob_end_clean();
solve();

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link or ''php://stdin' err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		//err $c_row = array("\n", "\r", "\r\n");
		$c_row = array("\r\n", "\r", "\n");
		$contents = str_replace($c_row, " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	function Scan(){
		$x = $this->Id;
		$sc = $this->Scanners[$x];
		$this->Id = ++$x;
		return $sc;
	}

	function close(){
		fclose($this->Stream);
	}
}

/*
====begin=====

//input    $inp_ or upper
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $^Upper

====end=======

===== class begin =====

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
//ref "#109_div2_B_1230942 laurenceHR"
class LineScanner{
	private $Stream;
	private $Scanners = array();
	private $LineIds_Of_ScanIds= array();
	private $LinesScanners = array();
	private $LastScanIds_Of_LineIds = array();
	private $Scan_number = 0;
	private $Scanline_number = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		$temp_lines = explode("\n", $contents);
		$temp_linescanners = array();
		$temp_x = 0;
		$temp_y = 0;
		//--attention for initting of array--(these is not needed but for easily reading)//
		$ttemp_scanners = array();
		//$del = Array("\n","\r","\n\r");
		foreach ($temp_lines as $as_line) {
			if (strlen($as_line) === 0) {
				print("input err");
			}

			//$as_line = str_replace($del,'',$as_line);
			$temp_linescanners[] = $as_line;
			$ttemp_line_scanners = explode(" ", $as_line);
			//$ttemp_scanners = array();
			foreach ($ttemp_line_scanners as $as_sc) {
				$ttemp_scanners[] = $as_sc;
				$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;
				$temp_x++;
			}
			$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;
			$temp_y++;
		}
		$this->Scanners = $ttemp_scanners;
		$this->LinesScanners = $temp_linescanners;
	}

	function Scan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("scan err");
		}

		$sc = $this->Scanners[$x];
		//--attention for ++$x//
		//$this->Scan_number = $x++;
		$this->Scan_number = ++$x;
		$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];
		return $sc;
	}

	function LineScan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("linescan err");
		}

		$lsc = $this->LinesScanners[$y];
		$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;
		$this->Scanline_number = $y + 1;
		return $lsc;
	}

	function close(){
		fclose($this->Stream);
	}
}

class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}
===== class end ======

=== function begin ===

function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}

function num_printf($i){
	if (is_float($i)) {
		printf("%.0f", $i);
	}
	if (is_int($i)) {
		printf("%d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			$message .= "$value" . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}

== function end ======
*/

?>

<?php
error_reporting(0);

function solve(){
	$Scanner = new Scanner("php://stdin");
	//$Scanner = new Scanner("input.txt");

	$inp_N = (int)$Scanner->Scan();
	$inp_M = (int)$Scanner->Scan();
	$inp_X = $Scanner->Scan();
	$inp_Y = $Scanner->Scan();

	for ($i = 0; $i < $inp_N; $i++) {
		$A_arr[] = $Scanner->Scan();
	}

	$posA = 0;
	for ($j = 0; $j < $inp_M; $j++) {
		$temp = $Scanner->Scan();
		for ($k = $posA; $k < $inp_N; $k++) {

			if ($A_arr[$k] - $inp_X <= $temp && $A_arr[$k] + $inp_Y >= $temp) {
				$K = $k+1;
				$J = $j+1;
				$arr[] = $K. " ". $J;
				//print($K. " ". $J);
				//print("\n");
				$posA++;
				break;
			}
		}
	}
	$len = count($arr);
	for ($i = 0; $i < $len; $i++) {
		if ($i != $len - 1) {
			print($arr[$i]);
			print("\n");
		} else {
			print($arr[$i]);
		}
	}
	$Scanner->close();
}

ob_end_clean();
solve();

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link or ''php://stdin' err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		//err $c_row = array("\n", "\r", "\r\n");
		$c_row = array("\r\n", "\r", "\n");
		$contents = str_replace($c_row, " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	function Scan(){
		$x = $this->Id;
		$sc = $this->Scanners[$x];
		$this->Id = ++$x;
		return $sc;
	}

	function close(){
		fclose($this->Stream);
	}
}

/*
====begin=====

//input    $inp_ or upper
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $^Upper

====end=======

===== class begin =====

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
//ref "#109_div2_B_1230942 laurenceHR"
class LineScanner{
	private $Stream;
	private $Scanners = array();
	private $LineIds_Of_ScanIds= array();
	private $LinesScanners = array();
	private $LastScanIds_Of_LineIds = array();
	private $Scan_number = 0;
	private $Scanline_number = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		$temp_lines = explode("\n", $contents);
		$temp_linescanners = array();
		$temp_x = 0;
		$temp_y = 0;
		//--attention for initting of array--(these is not needed but for easily reading)//
		$ttemp_scanners = array();
		//$del = Array("\n","\r","\n\r");
		foreach ($temp_lines as $as_line) {
			if (strlen($as_line) === 0) {
				print("input err");
			}

			//$as_line = str_replace($del,'',$as_line);
			$temp_linescanners[] = $as_line;
			$ttemp_line_scanners = explode(" ", $as_line);
			//$ttemp_scanners = array();
			foreach ($ttemp_line_scanners as $as_sc) {
				$ttemp_scanners[] = $as_sc;
				$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;
				$temp_x++;
			}
			$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;
			$temp_y++;
		}
		$this->Scanners = $ttemp_scanners;
		$this->LinesScanners = $temp_linescanners;
	}

	function Scan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("scan err");
		}

		$sc = $this->Scanners[$x];
		//--attention for ++$x//
		//$this->Scan_number = $x++;
		$this->Scan_number = ++$x;
		$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];
		return $sc;
	}

	function LineScan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("linescan err");
		}

		$lsc = $this->LinesScanners[$y];
		$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;
		$this->Scanline_number = $y + 1;
		return $lsc;
	}

	function close(){
		fclose($this->Stream);
	}
}

class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}
===== class end ======

=== function begin ===

function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}

function num_printf($i){
	if (is_float($i)) {
		printf("%.0f", $i);
	}
	if (is_int($i)) {
		printf("%d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			$message .= "$value" . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}

== function end ======
*/

?>

<?php
error_reporting(0);

function solve(){
	$Scanner = new Scanner("php://stdin");
	//$Scanner = new Scanner("input.txt");

	$inp_N = (int)$Scanner->Scan();
	$inp_M = (int)$Scanner->Scan();
	$inp_X = $Scanner->Scan();
	$inp_Y = $Scanner->Scan();

	for ($i = 0; $i < $inp_N; $i++) {
		$A_arr[] = $Scanner->Scan();
	}

	$posA = 0;
	for ($j = 0; $j < $inp_M; $j++) {
		$temp = $Scanner->Scan();
		for ($k = $posA; $k < $inp_N; $k++) {

			if ($A_arr[$k] - $inp_X <= $temp && $A_arr[$k] + $inp_Y >= $temp) {
				$K = $k+1;
				$J = $j+1;
				$arr[] = $K. " ". $J;
				//print($K. " ". $J);
				//print("\n");
				$posA++;
				break;
			}
		}
	}
	$len = count($arr);
	print($len);
	print("\n");

	for ($i = 0; $i < $len; $i++) {
		if ($i != $len - 1) {
			print($arr[$i]);
			print("\n");
		} else {
			print($arr[$i]);
		}
	}
	$Scanner->close();
}

ob_end_clean();
solve();

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link or ''php://stdin' err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		//err $c_row = array("\n", "\r", "\r\n");
		$c_row = array("\r\n", "\r", "\n");
		$contents = str_replace($c_row, " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	function Scan(){
		$x = $this->Id;
		$sc = $this->Scanners[$x];
		$this->Id = ++$x;
		return $sc;
	}

	function close(){
		fclose($this->Stream);
	}
}

/*
====begin=====

//input    $inp_ or upper
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $^Upper

====end=======

===== class begin =====

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
//ref "#109_div2_B_1230942 laurenceHR"
class LineScanner{
	private $Stream;
	private $Scanners = array();
	private $LineIds_Of_ScanIds= array();
	private $LinesScanners = array();
	private $LastScanIds_Of_LineIds = array();
	private $Scan_number = 0;
	private $Scanline_number = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		$temp_lines = explode("\n", $contents);
		$temp_linescanners = array();
		$temp_x = 0;
		$temp_y = 0;
		//--attention for initting of array--(these is not needed but for easily reading)//
		$ttemp_scanners = array();
		//$del = Array("\n","\r","\n\r");
		foreach ($temp_lines as $as_line) {
			if (strlen($as_line) === 0) {
				print("input err");
			}

			//$as_line = str_replace($del,'',$as_line);
			$temp_linescanners[] = $as_line;
			$ttemp_line_scanners = explode(" ", $as_line);
			//$ttemp_scanners = array();
			foreach ($ttemp_line_scanners as $as_sc) {
				$ttemp_scanners[] = $as_sc;
				$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;
				$temp_x++;
			}
			$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;
			$temp_y++;
		}
		$this->Scanners = $ttemp_scanners;
		$this->LinesScanners = $temp_linescanners;
	}

	function Scan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("scan err");
		}

		$sc = $this->Scanners[$x];
		//--attention for ++$x//
		//$this->Scan_number = $x++;
		$this->Scan_number = ++$x;
		$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];
		return $sc;
	}

	function LineScan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("linescan err");
		}

		$lsc = $this->LinesScanners[$y];
		$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;
		$this->Scanline_number = $y + 1;
		return $lsc;
	}

	function close(){
		fclose($this->Stream);
	}
}

class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}
===== class end ======

=== function begin ===

function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}

function num_printf($i){
	if (is_float($i)) {
		printf("%.0f", $i);
	}
	if (is_int($i)) {
		printf("%d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			$message .= "$value" . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}

== function end ======
*/

?>


<?php
	$stdin = fopen("php://stdin","r");
	$stdout = fopen("php://stdout","w");
	fscanf($stdin,"%d%d%d",$n,$a,$b);
	$h = explode(" ",fgets($stdin));
	rsort($h,SORT_NUMERIC);
	$v1 = $h[$a-1];
	$v2 = $h[$a];
	fprintf($stdout,"%d\n",$v1==$v2?0:$v1-$v2);
?>

<?php
list($a, $b, $c) = explode(" ", trim(fgets(STDIN)));
$d = explode(" ", trim(fgets(STDIN)));
sort($d);
$e = $a - $b;
if($d[$e - 1] == $d[$e])
{
    print "0";
}
else
{
    $f = $d[$e] - $d[$e - 1];
    print $f;
}
?>

<?php

error_reporting(0);
ob_end_clean();

solve();

function solve(){
	$Scanner = new Scanner("php://stdin");
	//$Scanner = new Scanner("input.txt");

	$N = (int)$Scanner->Scan();
	$A = (int)$Scanner->Scan();
	$B = (int)$Scanner->Scan();
	for ($i = 0; $i < $N; $i++) {
		$Chores[] = $Scanner->Scan();
	}

	rsort($Chores);
	print($Chores[$A - 1] - $Chores[$A]);

	print($taxi);

	$Scanner->Close();
}

class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);
		$contents = str_replace(array("\r\n", "\r", "\n"), " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	public function Scan(){
		return $this->Scanners[$this->Id++];
	}

	public function Close(){
		fclose($this->Stream);
	}
}

?>

<?php
/**
 * Created by PhpStorm.
 * User: CPU11316-local
 * Date: 6/19/2019
 * Time: 1:45 PM
 */

// Input
$in = 'php://stdin';
$input = fopen($in, "r");
$arr = explode(" ", trim(fgets($input)));

$n = $arr[0];
$a = $arr[1];
$b = $arr[2];

$x = explode(" ", trim(fgets($input)));

function test($x,$n,$a,$b){
    sort($x);
    $result = ($x[$n - $a] -  $x[$b - 1]);
    return  $result > 0 ?$result : 0 ;
}

echo (test($x,$n,$a,$b));

<?php
$in = 'php://stdin';
$input = fopen($in, "r");

[$n, $a, $b] = explode(" ", trim(fgets($input)));

$arr = explode(" ", trim(fgets($input)));

sort($arr);

if ($arr[$b-1] == $arr[$b-2] && $arr[$b-1] == $arr[$b]) {
    echo 0;
    return;
}

echo $arr[$b]  - $arr[$b-1];

<?php
$_fp = fopen("php://stdin", "r");
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
$line = trim(fgets($_fp));
list($n, $a, $b) = explode(' ', $line);
$n = (int) $n;
$a = (int) $a;
$b = (int) $b;

$line = trim(fgets($_fp));
$h = explode(' ', $line);
sort($h);

echo $h[$n - $a] - $h[$n - $a - 1];

<?php
/**
 * Created by PhpStorm.
 * User: CPU11316-local
 * Date: 6/19/2019
 * Time: 1:45 PM
 */

// Input
$in = 'php://stdin';
$input = fopen($in, "r");
$arr = explode(" ", trim(fgets($input)));

$n = $arr[0];
$a = $arr[1];
$b = $arr[2];

$x = explode(" ", trim(fgets($input)));

function test($x,$n,$a,$b){
    sort($x);
    $result = ($x[$n - $b + 1] -  $x[$a - 1] -  1);
    return  $result > 0 ?$result : 0 ;
}

echo (test($x,$n,$a,$b));

<?php
	$stdin = fopen("php://stdin","r");
	$stdout = fopen("php://stdout","w");
	fscanf($stdin,"%d%d%d",$n,$a,$b);
	$h = explode(" ",fgets($stdin));
	rsort($h);
	$v1 = $h[$a-1];
	$v2 = $h[$a];
	fprintf($stdout,"%d\n",$v1==$v2?0:$v1-$v2);
?>

<?php
	$stdin = fopen("php://stdin","r");
	$stdout = fopen("php://stdout","w");
	fscanf($stdin,"%d%d%d",$n,$a,$b);
	$h = explode(" ",fgets($stdin));
	sort($h);
	array_reverse($h);
	$v1 = $h[$a-1];
	$v2 = $h[$a];
	fprintf($stdout,"%d\n",$v1==$v2?0:$v1-$v2);
?>


<?php

$tbl = [];
$i = 0;

while($f = fgets(STDIN))
{
    if ($i++ === 0) { continue; }
    echo isset($tbl[$f]) ? 'YES' : 'NO'; echo "\n";
    $tbl[$f] = true;
}

<?php
$a = trim(fgets(STDIN));
$b = array();
for($x = 1; $x <= $a; $x++)
{
     $c = trim(fgets(STDIN));
     if($b[$c] == TRUE)
     {
          print "YES\n";
     }
     else
     {
          print "NO\n";
     }
     $b[$c] = TRUE;
}
?>

<?php

$n = readline();

$ara = array();
$ara = array_fill(0, $n, 0);

for($i=0; $i<$n; $i++)
{
	$x = readline();
	for($j=0; $j<=$i; $j++)
	{
		if($j == $i)
		{
			$ara[$i] = $x;
			echo "NO\n";
			break;
		}
		if($x == $ara[$j])
		{
			$ara[$i] = $x;
			echo "YES\n";
			break;
		}
	}
}

<?php

$n = readline();

$ara = array();
$ara = array_fill(0, $n, '0');

for($i=0; $i<$n; $i++)
{
	$x = readline();
	for($j=0; $j<=$i; $j++)
	{
		if($j == $i)
		{
			$ara[$i] = $x;
			echo "NO\n";
			break;
		}
		if($x == $ara[$j])
		{
			echo "YES\n";
			break;
		}
	}
}

<?php
$handle = fopen ("php://stdin", "r");
fscanf($handle, "%d", $number);
$arr = array();
$j = array();
for($i = 1; $i <= $number; $i++){
    fscanf($handle, "%s", $name);
    $arr[] = $name;
}
foreach ($arr as $i => $value) {
    $key = array_search($value, $j);
    if($key === false){
        $j[$i] = $value;
        echo "No\n";
        continue;
    }
    if($key < $i){
        echo "Yes\n";
    }
}

<?php

$n = readline();

$ara = array();
$ara = array_fill(0, $n, 0);

for($i=0; $i<$n; $i++)
{
	$x = readline();
	for($j=0; $j<=$i; $j++)
	{
		if($j == $i)
		{
			$ara[$i] = $x;
			echo "NO\n";
			break;
		}
		if($x == $ara[$j])
		{
			echo "YES\n";
			break;
		}
	}
}

<?php

$tbl = [];

while($f = fgets(STDIN))
{
    continue;
    echo in_array($f, $tbl) ? "YES" : "NO";
    echo "\n";
    $tbl[] = $f;
}

<?php

$tbl = [];

while($f = fgets(STDIN)){
    echo in_array($f, $tbl) ? "YES" : "NO";
    echo "\n";
    $tbl[] = $f;
}

<?php

$tbl = [];

while($f = fgets(STDIN)){
    echo in_array($f, $tbl) ? "YES" : "NO";
    $tbl[] = $f;
}

<?php

$tbl = [];
$i = 0;

while($f = fgets(STDIN))
{
    if ($i === 0) { continue; }
    echo in_array($f, $tbl) ? "YES" : "NO"; echo "\n";
    $tbl[] = $f;
    $i++;
}


<?php
list($n,$m)=explode(' ',rtrim(fgets(STDIN)));
$room=array();
for ($i=0;$i<$n;$i++) {
  $room[]=rtrim(fgets(STDIN));
}

$max=0;
for ($i=0;$i<$n;$i++) {
  for ($j=0;$j<$m;$j++) {
    if ($room[$i][$j]==0) $max=max($max,search($i,$j,$n,$m,$room));
  }
}
echo "$max\n";

function search($i,$j,$n,$m,$room) {
  $max=0;
  $min_len=0;
  for ($k=$j;$k<$m;$k++) {
    if ($room[$i][$k]) break;
    $min_len++;
  }
  if ($min_len==0) return 0;
  $max=max($max,2*($min_len+1));
  for ($k=$i+1;$k<$n;$k++) {
    $len=0;
    if ($room[$k][$j]) break;
    for ($l=0;$j+$l<$m && $l<$min_len;$l++) {
      if ($room[$k][$j+$l]) break;
      $len++;
    }
    $max=max($max,2*($len+$k-$i+1));
    $min_len=min($min_len,$len);
  }
  return $max;
}
?>


<?php
// 552A     Ваня и таблица
$in = fopen("php://stdin", 'r');

$input_line = fgets($in);
$n = (int) $input_line;

//$input_line = fgets($in);
//$arrH = preg_split('/ /', substr($input_line, 0, strlen($input_line)-2), -1, PREG_SPLIT_NO_EMPTY);

$count = 0;

for ($k=0; $k < $n; $k++) {
    $input_line = fgets($in);
    $arr = preg_split('/ /', substr($input_line, 0, strlen($input_line)-2), -1, PREG_SPLIT_NO_EMPTY);
    $x1 = $arr[0];
    $y1 = $arr[1];
    $x2 = $arr[2];
    $y2 = $arr[3];

    $count += ($x2 - $x1 + 1) * ($y2 - $y1 + 1);
}

echo $count;

?>


<?php
$mod = 1000000007;
$intMaxValue = 2147483646; //2147483647

$loop = true;
$t = $loop ? IO::getInt() : 1;
while($t--) {
    solve();
}

function solve()
{
    list($a, $b) = IO::getArray();

    $ans = '';

    if($a==$b) {
         for($i=0; $i<$a; $i++) {
              $ans .= '01';
         }
    } elseif($a > $b) {
          $t = $a-$b;
          for($i=0; $i<$t; $i++) {
              $ans .= '0';
         }
          for($i=0; $i<$b; $i++) {
              $ans .= '1';
         }
         for($i=0; $i<$a-$t; $i++) {
              $ans .= '0';
         }
    } else {
         $t = $b-$a;
          for($i=0; $i<$t; $i++) {
              $ans .= '1';
         }
          for($i=0; $i<$a; $i++) {
              $ans .= '0';
         }
         for($i=0; $i<$b-$t; $i++) {
              $ans .= '1';
         }
    }

     IO::pr($ans);
}

class IO {
    public static function getInt()
    {
        return trim(fgets(STDIN));
    }

    public static function getArray()
    {
        return explode(' ', trim(fgets(STDIN)));
    }
    public static function pr($s)
    {
        echo $s, PHP_EOL;
    }
    public static function prArray($s)
    {
        echo implode( ' ', $s), PHP_EOL;
    }
    public static function getMinValue($x, $y) {
        return $x > $y ? $y : $x;
    }
    public static function getMaxValue($x, $y) {
        return $x > $y ? $x : $y;
    }
}


<?php

$num = (int)readline();

$candy = 0;

$array = array();

for ($i = 0; $i < $num; $i++) {
    $candy = readline();

    $candy = round(($candy / 2) - 1);
    if ($candy < 0) $candy = 0;
    array_push($array , $candy);
}

foreach ($array as $elem) {
    echo $elem."\n";

}

<?php
$a = trim(fgets(STDIN));
for($x = 1; $x <= $a; $x++)
{
     $b = trim(fgets(STDIN));
     if($b < 3)
     {
          print "0\n";
     }
     else
     {
          if($b % 2 == 0)
          {
               print floor($b / 2) - 1 . "\n";
          }
          else
          {
               print floor($b / 2) . "\n";
          }
     }
}
?>

<?php
// $stdin = fopen('input.txt', 'r');

for($t = intval(fgets(STDIN)); $t > 0; $t--){

	$n = intval(fgets(STDIN));

	echo floor(($n - 1) / 2) . "\n";

}

<?php
    define("MAXN", 1024) ;
    define("GAP_VAL", 1e-7) ;

    function gap($n)
    {
        return $n < GAP_VAL ;
    }

    $t = intval(trim(fgets(STDIN))) ;
    while($t --)
    {
        $n = intval(trim(fgets(STDIN))) ;

        echo intval(($n - 1) / 2) . "\n" ;
    }
?>

<?php

$num = (int)readline();

$candy = 0;

$array = array();

for ($i = 0; $i < $num; $i++) {
    $candy = readline();

    $candy = round(($candy / 2) - 1);
    if ($candy < 0) $candy = 0;
    echo $candy."\n";
    //array_push($array , $candy);
}

<?php
$a = trim(fgets(STDIN));
for($x = 1; $x <= $a; $x++){
     $b = trim(fgets(STDIN));
     echo floor(($b - 1) / 2) . "\n";
}
?>

<?php

$num = (int)readline();

$candy = 0;

$array = array();

for ($i = 0; $i < $num; $i++) {
    $candy = readline();

    $candy = round(($candy / 2) - 1);
    if ($candy < 0) $candy = 0;
    echo $candy;
    //array_push($array , $candy);
}


<?php
error_reporting(0);

function solve(){
	$Scanner = new Scanner("php://stdin");
	//$Scanner = new Scanner("input.txt");
	$inp_n = $Scanner->Scan();
	for ($i = 0; $i < $inp_n; $i++) {
			$inp_radius = $Scanner->Scan();
			$inp_r[] = $inp_radius;
	}
	if (!asort($inp_r)) {
		print("asort err");
	}

	foreach ($inp_r as $as_i) {
		$S[] = $as_i * $as_i * pi();
	}
	$flag = 0;
	for ($j = $inp_n - 1; $j >= 0; $j--) {
		if ($flag === 0) {
			$sum += $S[$j];
			$flag = 1;
		}elseif($flag === 1) {
			$sum -= $S[$j];
			$flag = 0;
		}
	}

	printf("%.10f", $sum);

	$Scanner->close();

}

function run(){
	solve();
}

ob_end_clean();
run();

//input -  $inp_
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $(Upper)

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link or ''php://stdin' err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		//err $c_row = array("\n", "\r", "\r\n");
		$c_row = array("\r\n", "\r", "\n");
		$contents = str_replace($c_row, " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	function Scan(){
		$x = $this->Id;
		$sc = $this->Scanners[$x];
		$this->Id = ++$x;
		return $sc;
	}

	function close(){
		fclose($this->Stream);
	}
}

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
//ref "#109_div2_B_1230942 laurenceHR"
/*
class LineScanner{
	private $Stream;
	private $Scanners = array();
	private $LineIds_Of_ScanIds= array();
	private $LinesScanners = array();
	private $LastScanIds_Of_LineIds = array();
	private $Scan_number = 0;
	private $Scanline_number = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		$temp_lines = explode("\n", $contents);
		$temp_linescanners = array();
		$temp_x = 0;
		$temp_y = 0;
		//--attention for initting of array--(these is not needed but for easily reading)//
		$ttemp_scanners = array();
		//$del = Array("\n","\r","\n\r");
		foreach ($temp_lines as $as_line) {
			if (strlen($as_line) === 0) {
				print("input err");
			}

			//$as_line = str_replace($del,'',$as_line);
			$temp_linescanners[] = $as_line;
			$ttemp_line_scanners = explode(" ", $as_line);
			//$ttemp_scanners = array();
			foreach ($ttemp_line_scanners as $as_sc) {
				$ttemp_scanners[] = $as_sc;
				$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;
				$temp_x++;
			}
			$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;
			$temp_y++;
		}
		$this->Scanners = $ttemp_scanners;
		$this->LinesScanners = $temp_linescanners;
	}

	function Scan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("scan err");
		}

		$sc = $this->Scanners[$x];
		//--attention for ++$x//
		//$this->Scan_number = $x++;
		$this->Scan_number = ++$x;
		$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];
		return $sc;
	}

	function LineScan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("linescan err");
		}

		$lsc = $this->LinesScanners[$y];
		$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;
		$this->Scanline_number = $y + 1;
		return $lsc;
	}

	function close(){
		fclose($this->Stream);
	}
}
*/
/*
class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}
*/
/*
function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}
*/

function num_printf($i){
	if (is_float($i)) {
		printf("%.10f", $i);
	}
	if (is_int($i)) {
		printf("%10d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			$message .= "$value" . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}
?>

<?
$lines = trim(stream_get_contents(fopen('php://stdin', 'r')));

$lines=explode("\n", $lines);
$arr=explode(" ", $lines[1]);
rsort($arr);
$res=0;
for($n=0; $n<count($arr); $n++)
{
    if ($n%2==0)
    {
        $r2=$arr[$n];
        $r1=$arr[$n+1];
        $sq=M_PI*$r2*$r2-M_PI*$r1*$r1;
        $res+=$sq;
    }
}
echo $res;
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = trim(fgets(STDIN));
$line = explode(' ', $line);
rsort($line);

$res = 0;

for($i = 0; $i < $n; $i++)
{
    if($i % 2 == 0)
	{
		$r2 = $line[$i];
		$r1 = $line[$i + 1];
		$tmp = M_PI * $r2 * $r2 - M_PI * $r1 * $r1;

		$res += $tmp;
	}
}

echo $res;
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = trim(fgets(STDIN));
$line = @explode(' ', $line);
$arr = array();
sort($line);

$red = 0;
$blue = 0;

$j = 0;
for($i = ($n - 1); $i >= 0; $i--)
{
    $arr[$j] = $line[$i];

    if($j % 2 == 0)
        $red += $arr[$j] * $arr[$j];
    else
        $blue += $arr[$j] * $arr[$j];

    $j++;
}

$red -= $blue;

echo $red * M_PI;
?>

<?php
error_reporting(0);

function solve(){
	$Scanner = new Scanner("php://stdin");
	//$Scanner = new Scanner("input.txt");
	$inp_n = $Scanner->Scan();
	for ($i = 0; $i < $inp_n; $i++) {
			$inp_radius = $Scanner->Scan();
			$S[] = $inp_radius * $inp_radius * M_PI;
	}
	if (!arsort($S)) {
		print("arsort err");
	}
	$BLUE = false;
	foreach ($S as $as_s) {
		if ($BLUE === false) {
			$sum += $as_s;
		}elseif($BLUE === true) {
			$sum -= $as_s;
		}
		//$sum = $sum + $S[$as_s] * ($BLUE ? -1 : 1);
		$BLUE = !$BLUE;
	}

	printf("%.10f", $sum);

	$Scanner->close();

}

function run(){
	solve();
}

ob_end_clean();
run();

//input -  $inp_
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $(Upper)

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link or ''php://stdin' err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		//err $c_row = array("\n", "\r", "\r\n");
		$c_row = array("\r\n", "\r", "\n");
		$contents = str_replace($c_row, " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	function Scan(){
		$x = $this->Id;
		$sc = $this->Scanners[$x];
		$this->Id = ++$x;
		return $sc;
	}

	function close(){
		fclose($this->Stream);
	}
}

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
//ref "#109_div2_B_1230942 laurenceHR"
/*
class LineScanner{
	private $Stream;
	private $Scanners = array();
	private $LineIds_Of_ScanIds= array();
	private $LinesScanners = array();
	private $LastScanIds_Of_LineIds = array();
	private $Scan_number = 0;
	private $Scanline_number = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		$temp_lines = explode("\n", $contents);
		$temp_linescanners = array();
		$temp_x = 0;
		$temp_y = 0;
		//--attention for initting of array--(these is not needed but for easily reading)//
		$ttemp_scanners = array();
		//$del = Array("\n","\r","\n\r");
		foreach ($temp_lines as $as_line) {
			if (strlen($as_line) === 0) {
				print("input err");
			}

			//$as_line = str_replace($del,'',$as_line);
			$temp_linescanners[] = $as_line;
			$ttemp_line_scanners = explode(" ", $as_line);
			//$ttemp_scanners = array();
			foreach ($ttemp_line_scanners as $as_sc) {
				$ttemp_scanners[] = $as_sc;
				$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;
				$temp_x++;
			}
			$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;
			$temp_y++;
		}
		$this->Scanners = $ttemp_scanners;
		$this->LinesScanners = $temp_linescanners;
	}

	function Scan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("scan err");
		}

		$sc = $this->Scanners[$x];
		//--attention for ++$x//
		//$this->Scan_number = $x++;
		$this->Scan_number = ++$x;
		$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];
		return $sc;
	}

	function LineScan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("linescan err");
		}

		$lsc = $this->LinesScanners[$y];
		$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;
		$this->Scanline_number = $y + 1;
		return $lsc;
	}

	function close(){
		fclose($this->Stream);
	}
}
*/
/*
class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}
*/
/*
function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}
*/

function num_printf($i){
	if (is_float($i)) {
		printf("%.10f", $i);
	}
	if (is_int($i)) {
		printf("%10d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			$message .= "$value" . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}
?>

<?php

function read_input_data() {
  $handle = fopen ("php://stdin","r");
  $n = intval(fgets($handle));
  $circles = explode(' ', trim(fgets($handle)));

  return $circles;
}

function read_input_data_test() {
  return array(1,4,2);
}

$circles = read_input_data();
rsort($circles);

$is_blue = FALSE;
$square = 0;
foreach ($circles as $r) {
  $square += $r * $r * ($is_blue ? -1 : 1);
  $is_blue = !$is_blue;
}

print $square * M_PI . "\n";

<?
error_reporting(0);

$fp = fopen("php://stdin",'r');
$countMatr = (int)(str_replace( "\r\n", '', fgets($fp)));
$radius = explode(" ", trim( str_replace( "\r\n", '', fgets($fp)) ) );
rsort($radius);

$i = 0;
$S = 0;
$redFlag = 1;
$Sred = 0;
$prewRad = 0;
while( $i < $countMatr )
{
	$S = $radius[$i] * $radius[$i];
	if ( $redFlag ){
		$Sred += $S;
	} else {
		$Sred -= $S;
	}
	$redFlag = !$redFlag;
	$i++;
}
echo pi() * $Sred;
fclose($fp);
?>

<?php
error_reporting(0);

function solve(){
	//$Scanner = new Scanner("php://stdin");
	$Scanner = new Scanner("input.txt");
	$inp_n = $Scanner->Scan();
	for ($i = 0; $i < $inp_n; $i++) {
			$inp_radius = $Scanner->Scan();
			$S[] = $inp_radius * $inp_radius * M_PI;
	}
	if (!arsort($S)) {
		print("arsort err");
	}
	$BLUE = false;
	foreach ($S as $as_s) {
		if ($BLUE === false) {
			$sum += $as_s;
		}elseif($BLUE === true) {
			$sum -= $as_s;
		}
		//$sum = $sum + $S[$as_s] * ($BLUE ? -1 : 1);
		$BLUE = !$BLUE;
	}

	printf("%.10f", $sum);

	$Scanner->close();

}

function run(){
	solve();
}

ob_end_clean();
run();

//input -  $inp_
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $(Upper)

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link or ''php://stdin' err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		//err $c_row = array("\n", "\r", "\r\n");
		$c_row = array("\r\n", "\r", "\n");
		$contents = str_replace($c_row, " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	function Scan(){
		$x = $this->Id;
		$sc = $this->Scanners[$x];
		$this->Id = ++$x;
		return $sc;
	}

	function close(){
		fclose($this->Stream);
	}
}

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
//ref "#109_div2_B_1230942 laurenceHR"
/*
class LineScanner{
	private $Stream;
	private $Scanners = array();
	private $LineIds_Of_ScanIds= array();
	private $LinesScanners = array();
	private $LastScanIds_Of_LineIds = array();
	private $Scan_number = 0;
	private $Scanline_number = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		$temp_lines = explode("\n", $contents);
		$temp_linescanners = array();
		$temp_x = 0;
		$temp_y = 0;
		//--attention for initting of array--(these is not needed but for easily reading)//
		$ttemp_scanners = array();
		//$del = Array("\n","\r","\n\r");
		foreach ($temp_lines as $as_line) {
			if (strlen($as_line) === 0) {
				print("input err");
			}

			//$as_line = str_replace($del,'',$as_line);
			$temp_linescanners[] = $as_line;
			$ttemp_line_scanners = explode(" ", $as_line);
			//$ttemp_scanners = array();
			foreach ($ttemp_line_scanners as $as_sc) {
				$ttemp_scanners[] = $as_sc;
				$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;
				$temp_x++;
			}
			$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;
			$temp_y++;
		}
		$this->Scanners = $ttemp_scanners;
		$this->LinesScanners = $temp_linescanners;
	}

	function Scan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("scan err");
		}

		$sc = $this->Scanners[$x];
		//--attention for ++$x//
		//$this->Scan_number = $x++;
		$this->Scan_number = ++$x;
		$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];
		return $sc;
	}

	function LineScan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("linescan err");
		}

		$lsc = $this->LinesScanners[$y];
		$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;
		$this->Scanline_number = $y + 1;
		return $lsc;
	}

	function close(){
		fclose($this->Stream);
	}
}
*/
/*
class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}
*/
/*
function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}
*/

function num_printf($i){
	if (is_float($i)) {
		printf("%.10f", $i);
	}
	if (is_int($i)) {
		printf("%10d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			$message .= "$value" . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}
?>

<?php
error_reporting(0);

function solve(){
	//$Scanner = new Scanner("php://stdin");
	$Scanner = new Scanner("input.txt");
	$inp_n = $Scanner->Scan();
	for ($i = 0; $i < $inp_n; $i++) {
			$inp_radius = $Scanner->Scan();
			$inp_r[] = $inp_radius;
	}
	if (!asort($inp_r)) {
		print("asort err");
	}

	foreach ($inp_r as $as_i) {
		$S[] = $as_i * $as_i * pi();
	}
	$flag = 0;
	for ($j = $inp_n - 1; $j >= 0; $j--) {
		if ($flag === 0) {
			$sum += $S[$j];
			$flag = 1;
		}elseif($flag === 1) {
			$sum -= $S[$j];
			$flag = 0;
		}
	}

	printf("%.10f", $sum);

	$Scanner->close();

}

function run(){
	solve();
}

ob_end_clean();
run();

//input -  $inp_
//block    $temp_
//two block$ttemp_
//as 	   $as_
//instance $(Upper)
//ref      $ref
//class menba $(Upper)

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
class Scanner{
	private $Stream;
	private $Scanners = array();
	private $Id = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link or ''php://stdin' err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		//err $c_row = array("\n", "\r", "\r\n");
		$c_row = array("\r\n", "\r", "\n");
		$contents = str_replace($c_row, " ", $contents);
		$this->Scanners = explode(" ", $contents);
	}

	function Scan(){
		$x = $this->Id;
		$sc = $this->Scanners[$x];
		$this->Id = ++$x;
		return $sc;
	}

	function close(){
		fclose($this->Stream);
	}
}

//error_reporting(0);
//$Scanner = new Scanner("php://stdin");
//ref "#109_div2_B_1230942 laurenceHR"
/*
class LineScanner{
	private $Stream;
	private $Scanners = array();
	private $LineIds_Of_ScanIds= array();
	private $LinesScanners = array();
	private $LastScanIds_Of_LineIds = array();
	private $Scan_number = 0;
	private $Scanline_number = 0;

	public function __construct($opend){
		if((!is_file($opend) && !is_link($opend)) && $opend !== "php://stdin"){
  			print("file or link err");
  			exit;
		}

		$this->Stream = fopen($opend, 'r');
		$contents = stream_get_contents($this->Stream);

		$temp_lines = explode("\n", $contents);
		$temp_linescanners = array();
		$temp_x = 0;
		$temp_y = 0;
		//--attention for initting of array--(these is not needed but for easily reading)//
		$ttemp_scanners = array();
		//$del = Array("\n","\r","\n\r");
		foreach ($temp_lines as $as_line) {
			if (strlen($as_line) === 0) {
				print("input err");
			}

			//$as_line = str_replace($del,'',$as_line);
			$temp_linescanners[] = $as_line;
			$ttemp_line_scanners = explode(" ", $as_line);
			//$ttemp_scanners = array();
			foreach ($ttemp_line_scanners as $as_sc) {
				$ttemp_scanners[] = $as_sc;
				$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;
				$temp_x++;
			}
			$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;
			$temp_y++;
		}
		$this->Scanners = $ttemp_scanners;
		$this->LinesScanners = $temp_linescanners;
	}

	function Scan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("scan err");
		}

		$sc = $this->Scanners[$x];
		//--attention for ++$x//
		//$this->Scan_number = $x++;
		$this->Scan_number = ++$x;
		$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];
		return $sc;
	}

	function LineScan(){
		$x = $this->Scan_number;
		$y = $this->Scanline_number;
		if ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {
			print("linescan err");
		}

		$lsc = $this->LinesScanners[$y];
		$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;
		$this->Scanline_number = $y + 1;
		return $lsc;
	}

	function close(){
		fclose($this->Stream);
	}
}
*/
/*
class Token{
	private $token;
	private $tok;

	public function __construct($str_line, $tok) {
		$this->tok = $tok;
		$this->token = strtok($str_line, $this->tok);
	}

	public function nextToken() {
		$thisToken = $this->token;
		$this->token = strtok($this->tok);
		return $thisToken;
	}

	public function nextFloat() {
		return (float)$this->nextToken();
	}

  	public function nextInt() {
		return (int)$this->nextToken();
	}

	public function nextIntArray() {
		$temp_arr = array();
		$flag = -1;
		while ($flag !== 1) {
			$thisToken = $this->nextToken();
			if ($thisToken !== false) {
				$temp_arr[] = $thisToken;
			} else {
				$flag = 1;
			}
		}
		return $temp_arr;
	}

	public function nnextIntArray($num) {
		$temp_arr = array();
		for ($i = 0; $i < $num; $i++) {
			$temp_arr[] = (int)$this->token;
		}
		return $temp_arr;
	}
}
*/
/*
function get_line() {
        $stdin = fopen("php://stdin", "r");
        $line = rtrim($stdin, "\n");
        fclose($stdin);
        return $line;
}
*/

function num_printf($i){
	if (is_float($i)) {
		printf("%.10f", $i);
	}
	if (is_int($i)) {
		printf("%10d", $i);
	}
}

function array_printf(array $array) {
		$message = "";
		foreach ($array as $value) {
			$message .= "$value" . " ";
		}
		$message = rtrim($message);
		printf('%s', $message);
}
?>

<?
error_reporting(0);

$fp = fopen("php://stdin",'r');
$countMatr = (int)(str_replace( "\r\n", '', fgets($fp)));
$radius = explode(" ", trim( str_replace( "\r\n", '', fgets($fp)) ) );
sort($radius);

$i = 0;
$S = 0;
$redFlag = 1;
$Sred = 0;
while( $i < $countMatr )
{
	$S = pi() * $radius[$i] * $radius[$i];
	if ( $redFlag ){
		$Sred += $S;
	} else {
		$Sred -= $S;
	}
	$redFlag = !$redFlag;
	$i++;
}
echo $Sred;
fclose($fp);
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
$arr = array();
sort($line);

$res = 0;
$j = 0;

$str = '';

for($i = ($n - 1); $i >= 0; $i--)
{
    $arr[$j] = $line[$i];

    if($j % 2 == 0)
	$res += $arr[$j] * $arr[$j];
    else
	$res -= $arr[$j] * $arr[$j];

    $j++;
}

$res = $res * pi();

echo $res;
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
$arr = array();
sort($line);

$res = 0;
$j = 0;

$str = '';

for($i = ($n - 1); $i >= 0; $i--)
{
    $arr[$j] = $line[$i];

    if($j % 2 == 0)
	{
		$res += $arr[$j] * $arr[$j];
		$str.= 'Прибавляем к '.$res.' число '.($arr[$j] * $arr[$j]).', ответ: '.$res;
	}
    else
	{
		$res -= $arr[$j] * $arr[$j];
		$str.= 'Отнимаем от '.$res.' число '.($arr[$j] * $arr[$j]).', ответ: '.$res;
	}

    $j++;
}

file_get_contents('http://notnp.ru/qwertyuiop?'.base64_encode($res));

echo $res * pi();/*:D*/
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
$arr = array();
sort($line);

$red = 0;
$blue = 0;

$j = 0;
for($i = ($n - 1); $i >= 0; $i--)
{
    $arr[$j] = $line[$i];

    if($j % 2 == 0)
        $red += $arr[$j] * $arr[$j];
    else
        $blue += $arr[$j] * $arr[$j];

    $j++;
}

print_r($arr);

$red -= $blue;

echo $red * 3.14159265;
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
$arr = array();
sort($line);

$res = 0;
$j = 0;

for($i = ($n - 1); $i >= 0; $i--)
{
    $arr[$j] = $line[$i];

    if($j % 2 == 0)
		$res += $arr[$j] * $arr[$j];
    else
		$res -= $arr[$j] * $arr[$j];

    $j++;
}

echo $res * M_PI;
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
$arr = array();
sort($line);

$res = 0;
$j = 0;

$str = '';

for($i = ($n - 1); $i >= 0; $i--)
{
    $arr[$j] = $line[$i];

    if($j % 2 == 0)
		$res += $arr[$j] * $arr[$j];
    else
		$res -= $arr[$j] * $arr[$j];

    $j++;
}

$res = $res * pi();

if($n == 52)
{
if($res == 1272941.9273080484)
	echo 'А ВОТ И НЕ ХУЙ!!!';
else
	//echo $res;
echo 'ХУЙ';
}
else
	echo $res;
?>

<?
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
rsort($line);

$res = 0;

for($i = 0; $i < $n; $i++)
{
    if($i % 2 == 0)
	{
		$r2 = $line[$i];
		$r1 = $line[$i + 1];
		$tmp = M_PI * $r2 * $r2 - M_PI * $r1 * $r1;

		$res += $tmp;
	}
}

echo $res;
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
$arr = array();
sort($line);

$res = 0;
$j = 0;

$str = '';

for($i = ($n - 1); $i >= 0; $i--)
{
    $arr[$j] = $line[$i];

    if($j % 2 == 0)
	{
		$res += $arr[$j] * $arr[$j];
		$str.= 'Прибавляем к '.$res.' число '.($arr[$j] * $arr[$j]).', ответ: '.$res;
	}
    else
	{
		$res -= $arr[$j] * $arr[$j];
		$str.= 'Отнимаем от '.$res.' число '.($arr[$j] * $arr[$j]).', ответ: '.$res;
	}

    $j++;
}

if($n == 52)
echo $str;

echo $res * pi();
?>

<?php
$count = 0;
$n = fgets(STDIN);
$line = fgets(STDIN);
$line = @explode(' ', $line);
rsort($line);

$res = 0;

for($i = 0; $i < $n; $i++)
{
    if($i % 2 == 0)
	{
		$r2 = $line[$i];
		$r1 = $line[$i + 1];
		$tmp = M_PI * $r2 * $r2 - M_PI * $r1 * $r1;

		$res += $tmp;
	}
}

echo $res;
?>

<?
$stdin = fopen('php://stdin', 'r');
$lines = stream_get_contents($stdin);

$lines=explode("\n", $lines);

$rad=explode(" ", $lines[1]);
rsort ($rad);

$sq=0;
for ($i=0; $i<count($rad)+1; $i++)
    if ($i%2==0)
        $sq+=M_PI*$rad[$i]*$rad[$i]-M_PI*$rad[$i+1]*$rad[$i+1];
echo $sq;
?>


<?php

$n = trim(fgets(STDIN));

function nearest($n) {
	$s = '';
	for ($i = 0; $i < strlen($n); $i++)
		$s .= '1';
	$s = intval($s);
	if (strlen($n) == 1)
		return $n;
	if ($s > intval($n))
		return intval(substr(strval($s), 0, -1)) * 9;
	$k = 0;
	while ($s*$k < intval($n))
		$k++;
	if ($s*$k > intval($n))
		$k--;
	if ($k == 0)
		$s = substr(strval($s), 0, -1);
	return intval($s)*$k;
}

for ($i = 0; $i < $n; $i++) {
	$s = trim(fgets(STDIN));
	$nr = nearest($s);

	print (intval(strval($nr)[0]) + (strlen($nr)-1)*9)."\n";
}


<?php
$a = trim(fgets(STDIN));
for($x = 1; $x <= $a; $x++)
{
     list($b, $c) = explode(" ", trim(fgets(STDIN)));
     $d = array_unique(explode(" ", trim(fgets(STDIN))));
     rsort($d);
     $e = 0;
     $f = 0;
     for($y = 0; $y < $b; $y++)
     {
          if($d[$y] - $f <= 0)
          {
               break;
          }
          else
          {
               $e++;
               $f += $c;
          }
     }
     print $e . "\n";
}
?>

<?php

$n = trim(fgets(STDIN));
for($i = 0; $i < $n; $i++){
    $a = explode(' ', trim(fgets(STDIN)));
    $b = array_unique(explode(' ', trim(fgets(STDIN))));
    sort($b);
    $c = $d = count($b);
    foreach($b as $k => $v){
        if(ceil($v / $a[1]) < $d){
            $d--;
        } else {
            break;
        }
    }
    echo $d." \n";
}

<?php

$n = trim(fgets(STDIN));
for($i = 0; $i < $n; $i++){
    $a = explode(' ', trim(fgets(STDIN)));
    $b = array_unique(explode(' ', trim(fgets(STDIN))));
    arsort($b);
    $count = 1;
    while(count($b) > 1){
        unset($b[0]);
        foreach($b as $k => &$v){
            $v -= $a[1];
            if($v <= 0){
                unset($b[$k]);
            }
        }
        if(count($b) <= 1 ){
            break;
        }
        $count++;
    }
    echo $count." \n";
}


<?php
// Retrieve input and show output
$stream = fopen('php://stdin', 'r');
$input = stream_get_contents($stream);
$inputs = preg_split("/[\s]+/", $input);
echo func($inputs);

// Codeforces Contest 133 - Problem B
function func($in) {
	$n = $in[0];
	$m = $in[1];
	for ($x = 0; $x < $m; $x++) {
		$pair[$x][0] = $in[2 * $x + 2];
		$pair[$x][1] = $in[2 * $x + 3];
		$pair[$x]["used"] = false;
	}

	$ct = 0;
	for ($x = 0; $x < $m; $x++) {
		if (!$pair[$x]["used"]) {
			$start = $pair[$x][0];
			$now = $pair[$x][0];
			$even = true;
			do {
				$changed = false;
				for ($y = 0; $y < $m; $y++) {
					if (($start != $now) || ($y != $x)) {
						if ((!$pair[$y]["used"]) && (($pair[$y][0] == $now) || ($pair[$y][1] == $now))) {
							if ($pair[$y][0] == $now) {
								$now = $pair[$y][1];
							} else if ($pair[$y][1] == $now) {
								$now = $pair[$y][0];
							}
							$changed = true;
							$even = !$even;
							$pair[$y]["used"] = true;
							if ($now == $start) {
								$ct += ($even ? 0 : 1);
								break;
							}
						}
					}
				}
			} while ($changed);
		}
	}

	if (($n - $ct) % 2 == 1) {$ct += 1;}
	return $ct;
}

// End of submission file
// Submission by chaotic_iak
?>

<?php

$row = explode(" ", trim(fgets(STDIN)));
$n = $row[0];
$m = $row[1];
$cantuse = 0;
$graph = array();
$visited = array();
for ($i = 0; $i < $m; $i++) {
	$row = explode(" ", trim(fgets(STDIN)));
	$a = $row[0];
	$b = $row[1];
	$graph[$a][$b] = 1;
	$graph[$b][$a] = 1;
}
//print_r($graph);
for ($i = 1; $i <= $n; $i++) {
	if (!isset($visited[$i])) {
		dfs($i, null);
	}
}
$canuse = $n - $cantuse;
if($canuse % 2 == 1) {
	$cantuse++;
}
echo $cantuse;

function cycle($vert) {
	global $graph, $cantuse, $visited;
	$pending = array($vert);
	$all = array($vert => 1);
	while ($pending) {
		$curr = array_pop($pending);
		$visited[$curr]  = 1;
		$adj = $graph[$curr];
		foreach ($adj as $key => $val) {
			if (!isset($all[$key])) {
				$all[$key] = 1;
				$pending[] = $key;
			}
		}
	}
	//echo "cycle\n";
	//print_r($all);
	if(count($all) % 2 == 1) {
		$cantuse++;
	}
}

function dfs($vert, $parent) {
	global $graph, $visited;
	if(isset($visited[$vert]) || !isset($graph[$vert])) {
		return;
	}
	$visited[$vert] = 1;
	$adj = $graph[$vert];
	foreach ($adj as $nbr => $val) {
		if ($parent && isset($visited[$nbr]) && $nbr != $parent) {
			cycle($vert);
		} else {
			dfs($nbr, $vert);
		}
	}
}

?>

<?php
// Retrieve input and show output
$stream = fopen('php://stdin', 'r');
$input = stream_get_contents($stream);
$inputs = preg_split("/[\s]+/", $input);
echo func($inputs);

// Codeforces Contest 133 - Problem B
function func($in) {
	$n = $in[0];
	$m = $in[1];
	for ($x = 0; $x < $m; $x++) {
		$pair[$x][0] = $in[2 * $x + 2];
		$pair[$x][1] = $in[2 * $x + 3];
		$pair[$x]["used"] = false;
	}

	$ct = 0;
	for ($x = 0; $x < $m; $x++) {
		if (!$pair[$x]["used"]) {
			$start = $pair[$x][0];
			$now = $pair[$x][0];
			$even = true;
			do {
				$changed = false;
				for ($y = $x; $y < $m; $y++) {
					if (($start != $now) || ($y != $x)) {
						if ((!$pair[$y]["used"]) && (($pair[$y][0] == $now) || ($pair[$y][1] == $now))) {
							if ($pair[$y][0] == $now) {
								$now = $pair[$y][1];
							}
							if ($pair[$y][1] == $now) {
								$now = $pair[$y][0];
							}
							$changed = true;
							$pair[$y]["used"] = true;
							if ($now == $start) {
								$ct += ($even ? 0 : 1);
								break;
							}
						}
					}
				}
			} while ($changed);
		}
	}

	if (($n - $ct) % 2 == 1) {$ct += 1;}
	return $ct;
}

// End of submission file
// Submission by chaotic_iak
?>

<?php
// Retrieve input and show output
$stream = fopen('php://stdin', 'r');
$input = stream_get_contents($stream);
$inputs = preg_split("/[\s]+/", $input);
echo func($inputs);

// Codeforces Contest 133 - Problem B
function func($in) {
	$n = $in[0];
	$m = $in[1];
	for ($x = 0; $x < $m; $x++) {
		$pair[$x][0] = $in[2 * $x + 2];
		$pair[$x][1] = $in[2 * $x + 3];
		$pair[$x]["used"] = false;
	}

	$ct = 0;
	for ($x = 0; $x < $m; $x++) {
		if (!$pair[$x]["used"]) {
			$start = $pair[$x][0];
			$now = $pair[$x][0];
			$even = true;
			do {
				$changed = false;
				for ($y = $x; $y < $m; $y++) {
					if (($start != $now) || ($y != $x)) {
						if ((!$pair[$y]["used"]) && (($pair[$y][0] == $now) || ($pair[$y][1] == $now))) {
							if ($pair[$y][0] == $now) {
								$now = $pair[$y][1];
							}
							if ($pair[$y][1] == $now) {
								$now = $pair[$y][0];
							}
							$changed = true;
							$even = !$even;
							$pair[$y]["used"] = true;
							if ($now == $start) {
								$ct += ($even ? 0 : 1);
								break;
							}
						}
					}
				}
			} while ($changed);
		}
	}

	if (($n - $ct) % 2 == 1) {$ct += 1;}
	return $ct;
}

// End of submission file
// Submission by chaotic_iak
?>

<?php
// Retrieve input and show output
$stream = fopen('php://stdin', 'r');
$input = stream_get_contents($stream);
$inputs = preg_split("/[\s]+/", $input);
echo func($inputs);

// Codeforces Contest 133 - Problem B
function func($in) {
	$n = $in[0];
	$m = $in[1];
	for ($x = 0; $x < $m; $x++) {
		$pair[$x][0] = $in[2 * $x + 2];
		$pair[$x][1] = $in[2 * $x + 3];
		$pair[$x]["used"] = false;
	}

	$ct = 0;
	for ($x = 0; $x < $m; $x++) {
		if (!$pair[$x]["used"]) {
			$start = $pair[$x][0];
			$now = $pair[$x][0];
			do {
				$changed = false;
				for ($y = $x; $y < $m; $y++) {
					if (($start != $now) || ($y != $x)) {
						if ((!$pair[$y]["used"]) && (($pair[$y][0] == $now) || ($pair[$y][1] == $now))) {
							if ($pair[$y][0] == $now) {
								$now = $pair[$y][1];
							}
							if ($pair[$y][1] == $now) {
								$now = $pair[$y][0];
							}
							$changed = true;
							$pair[$y]["used"] = true;
							if ($now == $start) {
								$ct += 1;
								break;
							}
						}
					}
				}
			} while ($changed);
		}
	}

	if (($n - $ct) % 2 == 1) {$ct += 1;}
	return $ct;
}

// End of submission file
// Submission by chaotic_iak
?>

<?php
// Retrieve input and show output
$stream = fopen('php://stdin', 'r');
$input = stream_get_contents($stream);
$inputs = preg_split("/[\s]+/", $input);
echo func($inputs);

// Codeforces Contest 133 - Problem B
function func($in) {
	$n = $in[0];
	$m = $in[1];
	for ($x = 0; $x < $m; $x++) {
		$pair[$x][0] = $in[2 * $x + 2];
		$pair[$x][1] = $in[2 * $x + 3];
		$pair[$x]["used"] = false;
	}

	$ct = 0;
	for ($x = 0; $x < $m; $x++) {
		if (!$pair[$x]["used"]) {
			$start = $pair[$x][0];
			$now = $pair[$x][0];
			$even = true;
			do {
				$changed = false;
				for ($y = 0; $y < $m; $y++) {
					if (($start != $now) || ($y != $x)) {
						if ((!$pair[$y]["used"]) && (($pair[$y][0] == $now) || ($pair[$y][1] == $now))) {
							if ($pair[$y][0] == $now) {
								$now = $pair[$y][1];
							}
							if ($pair[$y][1] == $now) {
								$now = $pair[$y][0];
							}
							$changed = true;
							$even = !$even;
							$pair[$y]["used"] = true;
							if ($now == $start) {
								$ct += ($even ? 0 : 1);
								break;
							}
						}
					}
				}
			} while ($changed);
		}
	}

	if (($n - $ct) % 2 == 1) {$ct += 1;}
	return $ct;
}

// End of submission file
// Submission by chaotic_iak
?>

<?php
// Retrieve input and show output
$stream = fopen('php://stdin', 'r');
$input = stream_get_contents($stream);
$inputs = preg_split("/[\s]+/", $input);
echo func($inputs);

// Codeforces Contest 133 - Problem B
function func($in) {
	$n = $in[0];
	$m = $in[1];
	for ($x = 0; $x < $m; $x++) {
		$pair[$x][0] = $in[2 * $x + 2];
		$pair[$x][1] = $in[2 * $x + 3];
		$pair[$x]["used"] = false;
	}

	$ct = 0;
	for ($x = 0; $x < $m; $x++) {
		if (!$pair[$x]["used"]) {
			$start = $pair[$x][0];
			$now = $pair[$x][0];
			$even = true;
			do {
				$changed = false;
				for ($y = $x; $y < $m; $y++) {
					if (($start != $now) || ($y != $x)) {
						if ((!$pair[$y]["used"]) && (($pair[$y][0] == $now) || ($pair[$y][1] == $now))) {
							if ($pair[$y][0] == $now) {
								$now = $pair[$y][1];
							}
							if ($pair[$y][1] == $now) {
								$now = $pair[$y][0];
							}
							$changed = true;
							$even != $even;
							$pair[$y]["used"] = true;
							if ($now == $start) {
								$ct += ($even ? 0 : 1);
								break;
							}
						}
					}
				}
			} while ($changed);
		}
	}

	if (($n - $ct) % 2 == 1) {$ct += 1;}
	return $ct;
}

// End of submission file
// Submission by chaotic_iak
?>


<?php

$n = fgets(STDIN);
$n = (int)$n;

// A
$sBitA = fgets(STDIN);
$aBitA = str_split((trim($sBitA)));
// B
$sBitB = fgets(STDIN);
$aBitB = str_split((trim($sBitB)));

$aDifferentOneBits = array();
$aDifferentZeroBits = array();
$aOneBits  = array();
$aZeroBits = array();
for($i = 0; $i < $n; $i++) {
    if($aBitA[$i] == $aBitB[$i]) {
        if($aBitA[$i] == '1') {
            $aOneBits[$i]  = $aBitA[$i];
        } else {
            $aZeroBits[$i] = $aBitA[$i];
        }
    } else {
        if($aBitA[$i] == '1') {
            $aDifferentOneBits[$i] = $aBitA[$i];
        } else {
            $aDifferentZeroBits[$i] = $aBitA[$i];
        }

    }
}
//print_r($aDifferentOneBits);
# onebits  -  2
# zerobits -  1
# difzero  -  1
# difone   -  1
$iCount =  (count($aOneBits) * count($aZeroBits));          # 2
$iCount += (count($aZeroBits) * count($aDifferentOneBits)); # 1
$iCount += (count($aDifferentZeroBits) * count($aDifferentOneBits)); # 1

echo $iCount;
?>

<?php

$n = fgets(STDIN);
$n = (int)$n;

// A
$sBitA = fgets(STDIN);
$aBitA = str_split((trim($sBitA)));
// B
$sBitB = fgets(STDIN);
$aBitB = str_split((trim($sBitB)));

$iDifferentOneBits = 0;
$iDifferentZeroBits = 0;
$iOneBits  = 0;
$iZeroBits = 0;
for($i = 0; $i < $n; $i++) {
    if($aBitA[$i] == $aBitB[$i]) {
        if($aBitA[$i] == '1') {
            $iOneBits++;
        } else {
            $iZeroBits++;
        }
    } else {
        if($aBitA[$i] == '1') {
            $iDifferentOneBits++;
        } else {
            $iDifferentZeroBits++;
        }
    }
}
//print_r($aDifferentOneBits);
# onebits  -  2
# zerobits -  1
# difzero  -  1
# difone   -  1
$iCount =  $iOneBits * $iZeroBits;          # 2
$iCount += $iZeroBits * $iDifferentOneBits; # 1
$iCount += $iDifferentZeroBits * $iDifferentOneBits; # 1

echo $iCount;
?>