<?
$n = fgets(STDIN);
$names = array('Howard','Sheldon','Leonard','Penny','Rajesh')
$x = $n%5;
echo $names[$x];
?>


<?php
	$total = 0;
	list($n,$k) = explode(' ',trim(fgets(STDIN)));
	$val = explode(' ',trim(fgets(STDIN)));
	foreach ($x = 0; $x < $n; $x++) {
		if ($val[$x] > $k) $total++;
		else break;
	}
	echo $total;
?>


<?php

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

$input_line = fgets($in);

list($n, $k) = split(" ", $input_line);

$n = (int) $n;
$k = (int) $k;

$input_line = fgets($in);

fclose($in);

$a = split(" ", $input_line);
foreach ($a as $value) {
    $value = (int) $value;
}

if ($a[$k] !== 0) {
    $count = $k;

    for ($i = $k; $i < $n; $i++ ) {
        if ($a[$i] == $a[$k]) $count++
        else break;
    }

} else {
    $count = 0;

}

echo $count;

?>


<?php

	list($n,$k)=explode(' ',fgets(STDIN));

	$a=explode(' ',fgets(STDIN));

	$ke=$k-1;
	$score=$a[$ke];
	$jlh=0;
	$x=count($a)

	if ($score > 0)
	{
		for($i=0;$i<=$x;$i++)
		{
			if($a[$i] >= $score)
			{
				$jlh=$jlh+1;
			}
		}
	}

	echo $jlh;

?>


<?php

	list($n,$k)=explode(' ',fgets(STDIN));

	$a=explode(' ',fgets(STDIN));

	$ke=$k-1
	$score=$a[$ke];
	$jlh=0;

	if ($score > 0)
	{
		for($i=0;$i<=count($a);$i++)
		{
			if($a[$i]>=$score)
			{
				$jlh=$jlh+1;
			}
		}
	}

	echo $jlh;

?>


<?php

$line = trim(fgets(STDIN));
$data = explode(' ', $line);

$n = 0;
$k = 0;

if (isset($data[0])) $n = $data[0];
if (isset($data[1])) $k = $data[1];

$line2 = trim(fgets(STDIN));
$data2 = explode(' ', $line2);

if (count($data2) != $n or $k <= 0) die('error: invalid arguments');

$result = 0;
foreach ($data2 as $key => $bal) {
	if ($bal == 0) break;
	if ($result >= $k) {
		if ($data2[$key-1] == $bal) $result++;
		else break;
	} else {$result++;
}

file_put_contents('php://stderr', $result);


<?php

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

$input_line = fgets($in);

list($n, $m, $a) = split(" ", $input_line);

$m = (int) $m;
$n = (int) $n;
$a = (int) $a;

$colX = floor($n / $a);

if (($n % $a)  !== 0)  $colX ++;

$coly = floor($m / $a);

if (($m % $a)  !== 0)  $coly ++;

fclose($in);

// printf("%d\n", $colX * $coly);

$answer = $colX * $coly;
// $answer = 4.0;

echo ($answer)


<?php

$output = 1000000000000000
$in = fopen("php://stdin", "r");
$input = fgets($in);
$input = explode(" ", $input);

if($input[0] % $input[2] == 0){
    $input[0] = floor($input[0] / $input[2]);
}else{
    $input[0] = floor($input[0] / $input[2]) + 1;
}

if($input[1] % $input[2] == 0){
    $input[1] = floor($input[1] / $input[2]);
}else{
    $input[1] = floor($input[1] / $input[2]) + 1;
}

$output = ($input[0] * $input[1]);
echo bcmod($output);

?>


<?php

	$f = file_get_contents('php://stdin');
	$f = explode(' ', $f);

	$n = intval( $f[0] );
	$m = intval( $f[1] );
	$a = intval( $f[2] );

	// $f = ceil( $n / $a ) * ceil( $m / $a );
	// printf( "%u" , $f );

	// $r = gmp_mul( gmp_div_q($n, $a, GMP_ROUND_PLUSINF) , gmp_div_q($m, $a, GMP_ROUND_PLUSINF) );
	// echo gmp_strval($r);

	$f = s_mult_ent( ceil( $n / $a ) , ceil( $m / $a ) );
	printf( "%s" , $f );

	function s_mult_ent( $a , $b ){
		$a = array_reverse( str_split( ''.$a ) );
		$b = array_reverse( str_split( ''.$b ) );

		if (count($a) < count($b) ){
			$tmp = $a;
			$a = $b;
			$b = $tmp;
		}

		for ( $i = count($b) ; $i < count($a) ; $i ++ ){
			$b[$i] = '0';
		}

		$c = array();
		$r = array();

		for ($i = 0; $i < count($a) ; $i++) {
			$tmp = intval( $a[$i] ) * intval( $b[$i] );
			if ( isset( $c[ $i ] ) )
				$tmp += $c[ $i ];

			$r[$i] = ( $tmp % 10 );
			$c[$i + 1 ] = ( $tmp - $r[$i] ) / 10;
		}
		if (isset( $c[ count($a) ] ) )
			$r[ count($a) ] = $c[ count($a) ]

		$r = array_reverse( $r );
		$r = implode( '', $r );

		return $r;
	}


<?php
$stdin = fopen("php://stdin","r");
$stdout = fopen("php://stdout","w");
fscanf($stdin,"%d%d%d",$m,$n,$a);
$one = 1
$t = (($n + $a - $one) / $a) * (($m + $a - $one) / $a);
fprintd($stdout, "%d", $t);
?>


<?php
fscanf(STDIN,"%d %d %d",$n,$m,$a);
$an = ceil($n/$a);
$am = ceil($m/$a);
$result = $an * $am;
printf $result;


<?php

    fscanf(STDIN, "%d %d %d", $m,$n, $a);
    printf("%d",(ceil(%m/$a)*ceil(%m/$a)));

?>


<?php

	$f = file_get_contents('php://stdin');
	$f = explode(' ', $f);

	$n = intval( $f[0] );
	$m = intval( $f[1] );
	$a = intval( $f[2] );

	$f = ceil( $n / $a ) * ceil( $m / $a )
	echo $f;


<?php
// define('STDIN',fopen("php://stdin","r"));
    $dir = fopen("php://stdin", 'r');
    // $input = stream_get_contents($dir);
    // $dir = fopen("php://stdin", 'r');
    // $input = stream_get_contents($dir);

            if($dir % 2 ==0)
                echo "YES";
            else
                echo "NO";
        }
?>


<?php

fscanf(STDIN, "%d\n", $weight);

if ($weight % 2 = 0) echo 'YES';
if ($weight % 2 = 1) echo 'NO';

?>


<?php
    $wt = (int)fgets(STDIN);
    if($wt%2)
        echo "NO
";
    else
        echo "YES
;
?>


<?php
$w = trim(fgets(STDIN));
$sub = intval($/2);
if($sub&1){
echo "NO";
}
else{
echo "YES";
}
?>


<?php
    $temp = fopen ("php://stdin","r");
    $line = fgets($temp);
     if ((($temp % 2) == 0)and($temp!=2))
        { echo "YES" };
    else
        {echo "NO"};

?>


<?php
	$str = trim(fgets(STDIN));
	echo (preg_match_all("/[A-Z]/", $str) > preg_match_all("/[a-z]/", $str)?strtoupper($str):strtolower($str);
?>


<?php
// 118A     Упражнение на строки

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

$input_line = fgets($in);

$input_line = strtolower($input_line);

$a = ['a', 'o', 'y', 'e', 'u', 'i'];
$input_line = str_replace($a, '', $input_line);
$out = '';

$len = strlen($input_line);
for ($i=0; $i<$len-3; $i++) {
    $out .= '.' . $input_line[$i];
}

echo $out;

?>


<?php
	echo ucwords(strtolower(fgets(STDIN));


<?php
	$i = trim(fgets(STDIN));
	if(preg_match('/\A[a-z]+[A-Z]+[a-z].\z/', $i) == 1){
		echo ucfirst(strtolower($i));
	} else if(preg_match('/[A-Z]+/', $i) == 1){
		echo strtolower($i);
	} else {
		echo $i;
	}/
?>


<?php

    $nick = rtrim( fgets( STDIN ), "\n" );
    $t = str_split($nick);
    $t = array_unique($t);

    if (count($t) % 2 == 0) {
        echo "CHAT WITH HER!";
    } else {
        echo "IGNORE HIM!";
    }

?>


<?php

    $nick = readline();
    $t = str_split($nick);
    $t = array_unique($t);

    if (count($t) % 2 == 0 ) {
        echo "CHAT WITH HER!";
    } else {
        echo "IGNORE HIM!";
    }

?>


<?php

$nickname = str_split(trim(fgets(STDIN)));

echo (count(array_count_values($nickname)%2==0)?"CHAT WITH HER!":"IGNORE HIM!";
?>


<?
$a=fgets(STDIN);
$h=strpos($a,h);
$e=strpos($a,e,$h);
$l=strpos($a,l,$e);
$l2=strpos($a,l,$l);
$o=strpos($a,l,$l2);
if($h<$e<$l<$l2<$o)echo "YES";
else echo "NO";
?>


<?php

	strcmp(strtolower(trim(fgets(STDIN))), strtolower(trim(fgets(STDIN)))

?>


<?php
	$in = fgets(STDIN):
	$len = strlen($in);
	$flag = true;
	for ($x = 0; $x < $len; $x++) {
		if ($in[$x] >= 'A' && $in[$x] <= 'Z') {
			$flag = false;
			break;
		}
	}
	if ($flag) {
		echo strtoupper(substr($in,0,1)).substr($in,1,$len-1);
	} else echo $in;


<?php

    $m = explode(" " trim(fgets(STDIN)));
    sort($m);
    echo implode('+', $m);

?>


<?php
    fscanf(STDIN, "%s\n", $string);
    $b = explode("+",$string)
    sort($b);
    $string2 = $b;
    echo(implode($string2);

?>


<?
$a=explode("+",fgets(STDIN));
sort($a);
foreach($a as $v)
    {
        if(isset($c))echo "+$v";
        $c++;
        else echo $v;
    }
?>


<?php
$time=fgets(STDIN)
$list=explode(':',$time)
$count=0
while(true){
    $cur=strrev($time)
    if ($cur==$time){
        echo $count
        break
    }
    $list[1]=(intval($list[1])+(intval($list[0])+1)/60)%24
    $list[0]=(intval($list[0])+1)%60
    $list[0]=str_pad(strval($list[0]),2,'0',STR_PAD_RIGHT)
    $time=implode(':',$list)
}
?>


<?php
$line = trim(fgets(STDIN)); // reads one line from STDIN

$array=explode(" ",$line);

$mes = $array[0];
$dia = $array[1];

switch($mes) {

case 1:
$dias = 31;
break;

case 2:
$dias = 28;
break;

case 3:
$dias = 31;
break;

case 4:
$dias = 30;
break;

case 5:
$dias = 31;
break;

case 6
$dias = 30;
break;

case 7
$dias = 31;
break;

case 8
$dias = 31;
break;

case 9
$dias = 30;
break;

case 10
$dias = 31;
break;

case 11:
$dias = 30;
break;

case 12:
$dias = 31;
break;

}

$diasTotal = $dias + $dia;

$int=intval($diasTotal/7);

echo $int;

?>


bmit
My submissions
Status
Hacks
Room
Standings
Custom test

 My submissions

 #	When	Who	Problem	Lang	Verdict	Time	Memory
2388517 	 Oct 19, 2012 11:01:12 PM 	taka_taka 	 B - Non-square Equation 	 PHP 	Time limit exceeded on test 5 	 1000 ms 	 0 KB

 My contest submissions

 #	When	Who	Problem	Lang	Verdict	Time	Memory
No items

Codeforces (c) Copyright 2010-2012 Mike Mirzayanov
The only programming contests Web 2.0 platform
Server time: 10/19/2012 11:26PM.By taka_taka, contest: Codeforces Round #144 (Div. 2), problem: (B) Non-square Equation, Time limit exceeded on test 5, #
<?php

error_reporting(0);

solve();

function solve(){

	//$Input = new Input("input.txt");
	$Input = new Input();

	//$N = (int)$Input->in();
	$N = $Input->in();

	for ($i = max(1, (int)sqrt($N) - 1000000; $i <= (int)sqrt($N); $i++)
	{
		if ($N % $i !== 0) continue;
		else
		{
			$temp = $i;
			$ans = $temp;
			$sum = 0;
			while ($temp > 0)
			{
				$sum += (int)($temp % 10);
				$temp = (int)($temp / 10);
			}

			if ($sum + $ans === intval($N / $i))
			{
				print($i);
				exit;
			}
		}
	}

	print(-1);

	$Input->close();
}

class Input{
	private $handle = "";
	private $values = array();
	private $index = 0;

	public function __construct($localfile){

		if (is_file($localfile)) {

			$this->handle = fopen($localfile, "r");
			$contents = stream_get_contents($this->handle);

		} else {

			$contents = stream_get_contents(STDIN);

		}

		$no_newlines = str_replace(array("\r\n", "\r", "\n"), " ", $contents);
		$this->values = explode(" ", $no_newlines);
	}

	public function in(){

		return $this->values[$this->index++];

	}

	public function close(){

		if (is_file($localfile) && feof($this->handle)) fclose($this->handle);

	}
}

?>


<form action="" method="post">
	<input type="text" name="cardOnTable">
	<input type="text" name="cardsOnHand">
	<input type="submit" name="submit">
</form>
<?php
if(isset($_POST['submit'])) {
	//$rank = array('2','3','4','5','6','7','8','9','T','J','Q','K','A');
	//$suit = array('D','C','S','H');
	$valide = 'NO';
	$hand = explode(" ", $_POST['cardsOnHand']);
	$tab = $_POST['cardOnTable'];

	for ($i=0; $i < 5; $i++) {
		$card = str_split($hand[$i]);
		if ($card[0] == $tab[0]) {
			$valide = 'YES';
			break;
		}elseif ($card[1] == $tab[1]) {
			$valide = 'YES';
			break;
		}
	}
	echo $valide;

	function check(){
		if(in_array($card[0],$rank)){
			echo 'Yes';
			break;
		}else if (in_array($card[1],$suit)) {
			echo 'Yes';
			break;
		}
	}
}
?>


<?php
error_reporting(0);

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

	$inp_N = $Scanner->Scan();
	$inp_K = (int)$Scanner->Scan();

	$start = $inp_N - (int)($inp_N / $inp_K);
	//for ($i = 1; $i <= $inp_N; $i++) {
	/for ($i = $start; $i <= $inp_N; $i++) {
		$temp = $i;
		$sum = 0;
		while ($temp !== 0) {
			$sum += $temp;
			//$temp = $temp / $inp_K;
			$temp = (int)($temp / $inp_K);
		}
		//if ($sum > $inp_N) {
		if ($sum >= $inp_N) {
			$V = $i;
			break;
		}
	}
	printf("%d", $V);
	$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
// Retrieve input
$stdin = fopen('php://stdin', 'r');
function g() {
	global $stdin;
	return explode(" ", trim(fgets($stdin)));
}

// Codeforces Contest 157 Div 2 Problem A
$res = true;
for ($i = 0; $i < 8; $i++) {
	$str[$i] = g();
	if (($str[$i][0] != "BWBWBWBW") && ($str[$i][0] != "WBWBWBWB")) {$res = false;}
}
if ($res) {echo "YES";} else {echo "NO";}

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


<?php

###### IO ######
error_reporting(E_ALL);
#error_reporting(0);

function readString($f) {
	$r = array(
		"\r" => '',
		"\n" => '',
	);
	return strtr(fgets($f), $r);
}

function readNumString($f) {
	return trim(fgets($f));
}

function stringToArray($str) {
	return str_split($str);
}

function readNum($f, $is_int = false) {
	$v = readNumString($f);
	return $is_int ? intval($v) : floatval($v);
}

function readStringExplode($f, $delimiter = ' ') {
	$v = readNumString($f);
	if ($delimiter == '') {
		$return = stringToArray($v);
	} else {
		$return = explode($delimiter, $v);
	}
	$callf = 'trim';
	return array_map($callf, $return);
}

function readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {
	$v = readNumString($f);
	if ($delimiter == '') {
		$return = stringToArray($v);
	} else {
		$return = explode($delimiter, $v);
	}
	$callf = $is_int ? 'intval' : 'floatval';
	return array_map($callf, $return);
}

function readNumArray($f) {
	return readStringExplodeNum($f, ' ', true);
}

function readArray($f) {
	return readStringExplodeNum($f, ' ');
}

function readTrimString($f) {
	return trim(readString($f));
}

###### /IO ######
# for($i=0;$i<$n;$i++)

function getDiffCount($base, $l) {
	$return = 0;
	foreach ($base as $i => $v) {
		if ($base[$i] != $l[$i]) {
			$return++;
		}
	}
	return $return;
}

function getAnswer($is_test = false, $f = false) {
	if ($is_test === false) {
		$f = STDIN;
	}
	/* begin body */
	list($n, $k) = readNumArray($f);
	$str = trim(readString($f));
	$positions = array_combine(range('A', 'Z'), array_fill(0, 26, 0));
	for ($i = 0; $i < $n; $i++) {
		$positions[$str[$i]] ++;
	}

	$oPos = array_combine(range(0, $k - 1), array_fill(0, $k, ''));
	for ($i = 0; $i < $n; $i++) {
		$founded = false;
		for ($j = 0; $j < $k; $j++) {
			if (empty($oPos[$j]) || $oPos[$j] == $str[$i]) {
				$oPos[$j] = $str[$i];
				$positions[$str[$i]] --;
				if (empty($positions[$str[$i]])) {
					$oPos[$j] = '';
				}
				$founded = true;
				break;
			}
		}
		if (!$founded) {
			echo 'YES';
			return;
		}
	}
	echo 'NO';
	/* / end body */
}

if (empty($is_test))
	getAnswer();


<?php
$IN = STDIN;
fscanf($IN, "%d %d %d %d %d %d", $k1, $k2, $k3, $k4, $a, $b);
$min = min(array($k1, $k2, $k3, $k4));
if ($min>$b)
   echo $b-$a;
elseif (($min>$a)&&($min<$b))
  echo $min - $a;
else
    echo 0;
?>


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
if($a == $b)
{
     print "Yes";
}
else
{
     print "No";
}
?>


<?php

function sameXxorY($a,$b,$c){
    if($a == $b && $c == $a){
        return TRUE;
    }
    return FALSE;
}

function judge(array $a ,array $b){
    if($a[0] == $b[0] ){
        return 1;
    }
    if($a[1] == $b[1]){
        return 2;
    }
    return 0;
}

$aData = array();
for($i = 0; $i < 3;$i++){
    $sLine = trim(fgets(STDIN));
    $aData[] = explode(' ',$sLine);
}

if(sameXxorY($aData[0][0],$aData[1][0],$aData[2][0]) ||sameXxorY($aData[0][1],$aData[1][1],$aData[2][1]) ){
    echo 1;
    exit;
}

for($i = 0; $i < 3;$i++){
    for($j = $i + 1; $j < 3; $j++){
        $t = judge($aData[$i],$aData[$j]);
        if( $t != 0){
            $k = 3 - $i - $j ;
            if($aData[$k][$t] >= min($aData[$i][$t] , $aData[$j][$t]) && $aData[$k][$t] <= max($aData[$i][$t],$aData[$j][$t])){
                echo 2;
                exit;
            }

        }
    }
}

echo 3;
#var_dump($aData);


<?php

$batch = readline();
for($a = 0;$a < $batch; $a++){

    $serial_info = readline();

    $serial_info_array = explode(' ', $serial_info);
    $n = $serial_info_array[0];
    $k = $serial_info_array[1];
    $d = $serial_info_array[2];

    $serial_data = readline();

    $serial_array = explode(' ', $serial_data);

    $min = $k;

    for($day = 0; $day <= $n - $d; $day++){
        $sub = array_slice($serial_array, $day, $d);
        $unique_count = count(array_unique($sub));
        if($unique_count < $min){
            $min = $unique_count;
        }
    }

    print_r($min);
    if($a+1 != $batch){
         print_r(PHP_EOL);
    }
}

return 0;


#!/usr/bin/php
<?php

$s = fopen("php://stdin", 'r');
$n = fgets($s);
$dum = explode(" " , $n);
$candiesNum = $dum[0];
$friendsNum = $dum[1];

$division = intval($candiesNum / $friendsNum);
$difference = $candiesNum % $friendsNum;
$result = NULL;
for($n = 0; $n < $friendsNum - $difference; $n++)
{
     $result .= $division . ' ';
}
for($n = 0; $n < $difference; $n++)
{
     $result .= $division+1 . ' ';
}
echo substr($result , 0 , -1);


<?php
fscanf(STDIN,"%d",$n);
$str=trim(fgets(STDIN));
if($str=='......')
echo "espeon";
elseif ($str=='........')
 {
 	echo "vaporeon";
	# code...
}
else
{
$trgetStr="";
for ($i=0; $i <strlen($str) ; $i++)
{
	if($str[$i]=='.')
		continue;
	else
		$trgetStr.=$str[$i];

}
$eve=[
		 0=>"vaporeon",
		 1=>"jolteon",
		 2=>"flareon",
		 3=>"espeon",
		 4=>"umbreon",
		 5=>"leafeon",
		 6=>"glaceon",
		 7=>"sylveon"
    ];

   $flag=0;
   $max=0;
for ($i=0; $i <count($eve) ; $i++)
{   $count=0;
   for ($j=0; $j <5 ; $j++)
    {

   	   if($eve[$i][$j]==$trgetStr[$count])
   	   {

   	   	   $count++;
   	   	  // $str3=$eve[$i];

   	   	   if($count==strlen($trgetStr))
   	   	   {
             //echo "$str3\n";
   	   	   	$flag=1;
   	   	   	break;
   	   	   }
   	   }

    }
          if($count>=$max)
          {
          	$max=$count;
          	$str3=$eve[$i];
          }
          //echo "$max\n";

   if($flag==1)
   	break;

}
echo "$str3\n";
}


<?php
/**
 * User: Nash
 * Date: 7/27/14
 * Time: 10:29 PM
 */
$in = fopen('php://stdin', 'r');

$names = array("jolteon", "flareon", "umbreon", "leafeon", "glaceon", "sylveon");
$pos = array(1,1,1,1,1,1);
$n = intval(rtrim(fgets($in)));
$s = rtrim(fgets($in));

if($n==6){
    echo "espeon";
}
else if($n==8){
    echo "vaporeon";
}else{
    $c = 6;
    for($i=0; $i<$n; $i++){
        if($s[$i]!="."){
            foreach($names as $k => $name){
                if($pos[$k] && $s[$i]!=$name[$i]){
                    $pos[$k] = 0;
                    $c--;
                }
            }
            if($c==1){
                break;
            }
        }
    }

    for($i=0; $i<$n; $i++){
        if($pos[$i]){
            echo $names[$i];
            break;
        }
    }

}


<?php
$line1 = explode(' ', trim(fgets(STDIN)));
$line2 = explode(' ', trim(fgets(STDIN)));
$line3 = explode(' ', trim(fgets(STDIN)));
$res = array_uintersect($line2, $line3);
$min = min(min($line2), min($line3));
$max = max(min($line2), min($line3));
if(!empty($res)){
    echo min($res);
}else{
    echo $min.$max;
}


<?php
	//God & me
	//Damned if Amirjoon doesn't take what he wants.

	$INPUTS = preg_split("/[\s]+/", file_get_contents('php://stdin'));
	function in() {
	    static $i;
	    global $INPUTS;
	    if(!isset($i)) $i = 0;
	    return $INPUTS[$i++];
	}

	$n = in();
	$kol = 1;
	for($i = 0;$i < $n;$i++){
		$m[ $i ] = in();
		$kol *= $m[$i];
	}
	for($i = 0;$i < $n;$i++){
		$x = in();
		for($j = $x;$j < $kol;$j+=$m[ $i ])
			$ok[ $j ] = 1;
	}
	$ans = 0;
	for($i = 0;$i < $kol;$i++)
		if($ok[ $i ])
			$ans++;
	echo "\n".$ans / $kol;
?>


<?php
    function getNumber($iNumber, &$aData, $iLen)
    {
        $aNumber = str_split($iNumber);
        foreach ($aNumber AS $iVal) {
            if ($iVal > 0) {
                $iVal = bcmul($iVal, $iNumber);
                if (strlen($iVal) >= $iLen) {
                    return true;
                }
                $aData[$iVal] = $iVal;
            }
        }
        return false;
    }

    list($n, $x) = explode(' ', trim(fgets(STDIN)));
    $aData[$x] = $x;
    $iCheck = 0;
    $bCheck = false;
    while(!$bCheck) {
        if (strlen($x) >= $n) {
            echo 0 . PHP_EOL;
            exit;
        } elseif (mb_strpos($x, 1) !== false) {
            echo -1 . PHP_EOL;
            exit;
        } else {
            foreach ($aData as $iVal) {
                if (strlen($iVal) >= $n) {
                    echo $iCheck . PHP_EOL;
                    exit;
                }
                $bCheck = getNumber($iVal, $aData, $n);
                if ($bCheck) {
                    $iCheck++;
                    echo $iCheck . PHP_EOL;
                    exit;
                }
            }
            $iCheck++;
        }
    }

?>


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

$p = range(1, $n);

function perms($p) {
  if (count($p) <= 1) {
    return array($p);
  }
  $res = array();
  $c = count($p);
  for ($i = 0; $i < $c; $i++) {
    $tp = $p;
    $elt = array_splice($tp, $i, 1);
    foreach (perms($tp) as $perm) {
      $res[] = array_merge($elt, $perm);
    }
  }
  return $res;
}

$allP = perms($p);
$scores = array();

foreach ($allP as $permI => $perm) {
  $score = 0;
  for ($i = 0; $i < $n; $i++) {
    for ($j = $i; $j < $n; $j++) {
      $score += min(array_slice($perm, $i, $j - $i + 1));
    }
  }
  $scores[$score][] = $permI;
}

krsort($scores);
echo implode(" ", $allP[$scores[key($scores)][$m - 1]]), "\n";


<?php

    $a = trim(fgets(STDIN));

    $sumTop = 0;
    $sumBot = 0;
    $dTop = array();
    $dBot = array();
    $res = 0;

    for($i = 1; $i <= $a; $i++)
    {
        $temp = explode(" ", trim(fgets(STDIN)));
        $dTop[$i] = $temp[0];
        $dBot[$i] = $temp[1];
        $sumTop += $temp[0];
        $sumBot += $temp[1];
    }

    while ($sumTop % 2 != 0 | $sumBot % 2 != 0)
    {
        $res++;
        $up = 1;
        while ($up <= $a && ($dTop[$up] % 2 == $dBot[$up] % 2)) $up++;

        if(($up > $a) | ($sumTop % 2 != $sumBot % 2))
        {
            $res = -1;
            break;
        }
        else
        {
            $sumTop += $dBot[$up] - $dTop[$up];
            $sumBot += $dTop[$up] - $dBot[$up];
        }

    }

    printf($res);
?>


<?php
$a = trim(fgets(STDIN));
$b = explode(" ", trim(fgets(STDIN)));
rsort($b);
$c = 0;
while(TRUE)
{
     for($x = 0; $x < count($b); $x++)
     {
          $d = $b[0];
          $c += $d;
          $b = array_slice($b, 1);
          if($b[$x] == $d)
          {
               $b[$x]--;
          }
          else
          {
               break;
          }
     }
     if($b[0] == 0)
     {
          break;
     }
}
print $c;
?>


<?php
	function gao($c)
	{
		switch($c)
		{
			case '>':
				return "8";
			case '<':
				return "9";
			case '+':
				return "10";
			case '-':
				return "11";
			case '.':
				return "12";
			case ',':
				return "13";
			case '[':
				return "14";
			case ']':
				return "15";
		}
	}
	$stdin = fopen("php://stdin", "r");
	$str = fgets($stdin);
	$len = strlen($str);
	$num = "0";
	for($i = 0; $i < $len-1; $i++)
	{
		$num = bcmul($num, "16");
		$num = bcadd($num, gao($str[$i]));
	}
	echo (bcmod($num, "1000003"))."\n";
?>