{"source_code": " $time) {\n\t\t$num = 1;\n\t\t++$day;\n\t}\n\telse if ($last_time == $time)\n\t\t++$num;\n\telse\n\t\t$num = 1;\n\n\tif ($num == 11) {\n\t\t++$day;\n\t\t$num = 1;\n\t}\n\n\t$last_time = $time;\n}\n\necho $day.\"\\n\";\n\nfclose($handle);\n\n?>\n", "positive_code": [{"source_code": "\n $time) {\n\t\t$num = 1;\n\t\t++$day;\n\t}\n\telse if ($last_time == $time)\n\t\t++$num;\n\telse\n\t\t$num = 1;\n\t\t\n\tif ($num == 10) {\n\t\t++$day;\n\t\t$num = 1;\n\t}\n\t\n\t$last_time = $time;\n}\n\necho $day.\"\\n\";\n\nfclose($handle);\n\n?>\n"}, {"source_code": " $time) {\n\t\t$num = 1;\n\t\t++$day;\n\t}\n\telse if ($last_time == $time)\n\t\t++$num;\n\telse\n\t\t$num = 1;\n\t\n\t$last_time = $time;\n}\n\necho $day.\"\\n\";\n\nfclose($handle);\n\n?>\n"}, {"source_code": "= 1440)\n\t\t$time -= 1440;\n\t\n\tif ($last_time > $time) {\n\t\t$num = 1;\n\t\t++$day;\n\t}\n\telse if ($last_time == $time)\n\t\t++$num;\n\telse\n\t\t$num = 1;\n\t\t\n\tif ($num == 10) {\n\t\t++$day;\n\t\t$num = 1;\n\t}\n\t\n\t$last_time = $time;\n}\n\necho $day.\"\\n\";\n\nfclose($handle);\n\n?>\n"}, {"source_code": " $time) {\n\t\t$num = 1;\n\t\t++$day;\n\t}\n\telse if ($last_time == $time)\n\t\t++$num;\n\telse\n\t\t$num = 1;\n\t\t\n\tif ($num == 10) {\n\t\t++$day;\n\t\t$num = 1;\n\t}\n\t\n\t$last_time = $time;\n}\n\necho $day.\"\\n\";\n\nfclose($handle);\n\n?>\n"}], "src_uid": "54f8b8e6711ff5c69e0bc38a6e2f4999"} {"source_code": " $x)\n {\n $e += $b[$y] - ($x + 1);\n }\n }\n if($e < $d)\n {\n $c = $x;\n $d = $e;\n }\n}\nprint $c . \" \" . $d;\n?>", "positive_code": [{"source_code": "\n$stdin = fopen('php://stdin', 'r');\nini_set('display_errors', '1');\nfunction read() {\n return trim(fgets(STDIN));\n}\n$t1 = microtime(true);\n$debag = 0;\n/*\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013*/\nfunction arr($arr, $num) {\n $sum = 0;\n foreach($arr as $val) {\n $s = abs($val-$num);\n $sum += $s;\n if ($s > 0) {\n $sum--;\n }\n }\n return $sum;\n}\n$n = read();\n$arr = explode(' ', read());\n$t = null;\n$cst = null;\n$min = min($arr);\n$max = max($arr);\nif ($n == 1 || $max-$min === 0) {\n $t = $arr[0];\n $cst = 0;\n} elseif ($max - $min <= 2 && array_search($max-1, $arr)) {\n $t = $max-1;\n $cst = 0;\n} else {\n for ($i = $min; $i < $max; $i++) {\n $r = arr($arr, $i);\n if ($cst == null || $r < $cst) {\n $t = $i;\n $cst = $r;\n }\n }\n}\n\necho $t.' '.$cst;\n/*\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013*/\nif ($debag === 1) {\n echo '
\u8fd9\u6570\u636e\u4e5f\u592a\u5751\u4e86\u3002\u3002\u3002\u3002
\n\n
@author: Zyzsdy
\n@Website: http://www.namido.net
\n@date: 2014/1/18 15:02 (UTC+8)
\n\n
\u611f\u60f3\uff1a \u8fd9\u6b21CF\u5c31\u8fc7\u4e00\u9898\u5c45\u7136\u6ca1\u6263\u5206\u3002\u3002\u3002\u3002\u3002\u3002
\n\u4e0d\u8fc7\u6211\u8fd9\u9898\u5dee\u4e00\u70b9\u5c31\u505a\u51fa\u6765\u4e86\u3002\u3002\u3002
\n\u3002\u3002\u3002\u3002\u3002\u3002\u3002
\n\u5509\u3002\u3002\u3002\u3002
\n \n\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=2){\n\techo 0;\n\texit();\n} \nelse if($errorcount==1){\n\tif($error[0][1]-$deim!=$deim){\n\t\techo 0;\n\t\texit();\n\t} \n\telse{\n\t\techo \"1\\n\";\n\t\techo $n2[$error[0][0]]-$deim;\n\t\texit();\n\t}\n}\nelse if($errorcount==0){\n\t$result=array();\n\tarray_push($result,$n2[0]-$deim,$n2[$ct-1]+$deim);\n\t$result=array_unique($result);\n\tsort($result);\n\techo count($result);\n\techo \"\\n\";\n\tforeach ($result as $v) {\n\t\techo $v.\" \";\n\t}\n\texit();\n\n}\n\n?>"}, {"source_code": "=2){\n\techo 0;\n\texit();\n} \nelse if($errorcount==1){\n\tif($error[0][1]-$deim!=$deim){\n\t\techo 0;\n\t\texit();\n\t} \n\telse{\n\t\techo \"1\\n\";\n\t\techo $n2[$error[0][0]]-$deim;\n\t\texit();\n\t}\n}\nelse if($errorcount==0){\n\t$result=array();\n\tarray_push($result,$n2[0]-$deim,$n2[$ct-1]+$deim);\n\t$result=array_unique($result);\n\tsort($result);\n\techo count($result);\n\techo \"\\n\";\n\tforeach ($result as $v) {\n\t\techo $v.\" \";\n\t}\n\texit();\n\n}\n\n?>"}], "src_uid": "e3ca8338beb8852c201be72650e9aabd"} {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$lu = strlen($inp_u);\n\tfor ($k = 0; $k < $lu - 1; $k++) {\n \t $str .= \"*\";\n\t}\n\n\t$inp_s = $str. $inp_s. $str;\n\t$ls = strlen($inp_s);\n\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t$max = 0;\n\tfor ($i = 0; $i < $ls - $lu + 1; $i++) {\n\t$c = 0;\n \tfor ($j = 0; $j < $lu; $j++) {\n \t \tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n \t}\n \tif ($max < $c) $max = $c;\n \tif ($max === $lu) break;\n\t}\n\t$change = $lu - $max;\n\tprintf(\"%d\", $change);\n\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "= count($b))\n{\n $c = array_fill(0, count($b), \".\");\n $a = array_merge($c, $a, $c);\n $d = 0;\n for($x = 0; $x < count($a) + 1 - count($b); $x++)\n {\n $e = array_slice($a, $x, count($b));\n $f = count(array_intersect_assoc($b, $e));\n $d = max($d, $f);\n }\n print count($b) - $d;\n}\nelse\n{\n $c = array_fill(0, count($a), \".\");\n $b = array_merge($c, $b, $c);\n $d = 0;\n for($x = 0; $x < count($b) + 1 - count($a); $x++)\n {\n $e = array_slice($b, $x, count($a));\n $f = count(array_intersect_assoc($a, $e));\n $d = max($d, $f);\n }\n print $b2 - $d;\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$lu = strlen($inp_u);\n\tfor ($k = 0; $k < $lu - 1; $k++) {\n \t $str .= \"*\";\n\t}\n\n\t$inp_s = $str. $inp_s. $str;\n\t$ls = strlen($inp_s);\n\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t$max = 0;\n\tfor ($i = 0; $i < $ls - $lu + 1; $i++) {\n\t$c = 0;\n \tfor ($j = 0; $j < $lu; $j++) {\n \t \tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n\t\t\t//if ($inp_u[$j] === $inp_s[$i + $j]) $c++;\n \t}\n \tif ($max < $c) $max = $c;\n \tif ($max === $lu) break;\n\t}\n\t$change = $lu - $max;\n\tprintf(\"%d\", $change);\n\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_u_arr = str_split($inp_u);\t\n\t$lu = count($inp_u_arr);\n\t\n\t$str = str_repeat(\"*\", $lu);\n\t$inp_s = $str.$inp_s.$str;\n\t$inp_s_arr = str_split($inp_s);\n\t$ls = count($inp_s_arr);\n\t\n\t$c = 0;\n\t$max = array();\n\tfor ($i = 1; $i < $ls- $lu; $i++) {\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n\t\t}\n\t\t$match[] = $c;\n\t\t$c = 0;\n\t}\n\trsort($match);\n\tprintf(\"%d\", $lu - $match[0]);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_u_arr = str_split($inp_u);\t\n\t$lu = count($inp_u_arr);\n\t\n\t$str = str_repeat(\"*\", $lu - 1);\n\t$inp_s = $str.$inp_s.$str;\n\t$inp_s_arr = str_split($inp_s);\n\t$ls = count($inp_s_arr);\n\t\n\t$c = 0;\n\t$max = 0;\n\tfor ($i = 0; $i < $ls - $lu + 1; $i++) {\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\t//if ($inp_u_arr[$i] === $inp_s_arr[$j]) $c++;\n\t\t\tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n\t\t}\n\t\tif ($max < $c) $max = $c;\n\t\tif ($max === $lu) break;\n\t\t$c = 0;\n\t}\n\t$change = $lu - $max;\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_u_arr = str_split($inp_u);\t\n\t$lu = count($inp_u_arr);\n\t\n\t$str = str_repeat(\"*\", $lu);\n\t$inp_s = $str.$inp_s.$str;\n\t$inp_s_arr = str_split($inp_s);\n\t$ls = count($inp_s_arr);\n\t\n\t$c = 0;\n\t$max = 0;\n\tfor ($i = 1; $i < $ls - $lu; $i++) {\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\t//if ($inp_u_arr[$i] === $inp_s_arr[$j]) $c++;\n\t\t\tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n\t\t}\n\t\tif ($max < $c) $max = $c;\n\t\tif ($max === $lu) break;\n\t\t$c = 0;\n\t}\n\t$change = $lu - $max;\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}], "negative_code": [{"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t\n\t$temp_Sa = array();\n\t//$temp_S = \"\";\n\t$pos = 0;\n\t$ls = count($inp_s_arr);\n\t$lu = count($inp_u_arr);\n\tfor ($i = 0; $i < $lu; $i++) {\n\t\t$flag = 0;\n\t\tfor ($j = $i; $j < $ls; $j++) {\n\t\t\t\n\t\t\tif ($inp_u_arr[$i] === $inp_s_arr[$j]) {\n\t\t\t\t$temp_S = $temp_S.$inp_u_arr[$i];\n\t\t\t\t$flag = 1;\n\t\t\t\t$c++;\n\t\t\t\t$i++;\n\t\t\t} elseif ($flag === 1){\n\t\t\t\tif (strlen($temp_S) > strlen($temp_Sa[$pos])) {\n\t\t\t\t\t$temp_Sa[$pos] = $temp_S;\n\t\t\t\t}\n\t\t\t\t$flag = 0;\n\t\t\t\t$i = $i - $c;\n\t\t\t\t$c = 0;\n\t\t\t\t$temp_S = \"\";\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t$pos++;\n\t}\n\t\n\t$max = 0;\n\t//foreach ($temp_S as $as_S) {\n\tforeach ($temp_Sa as $as_S) {\n\t\t$len = strlen($as_S);\n\t\tif ($max < $len) $max = $len;\n\t}\n\t$inp_len = strlen($inp_u);\n\t$change = $inp_len - $max;\n\t\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$lu = strlen($inp_u);\n\t$str = str_repeat(\"*\", $lu);\n\t$inp_s = $str.$inp_s.$str;\n\t$ls = strlen($inp_s_arr);\n\t\n\t$c = 0;\n\t$max = 0;\n\tfor ($i = 0; $i < $ls; $i++) {\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\t//if ($inp_u_arr[$i] === $inp_s_arr[$j]) $c++;\n\t\t\tif ($inp_u[$j] === $inp_s[$i + $j]) $c++;\n\t\t}\n\t\tif ($max < $c) $max = $c;\n\t\tif ($max === $lu) break;\n\t\t$c = 0;\n\t}\n\t$change = $lu - $max;\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$lu = strlen($inp_u);\n\t$ls = strlen($inp_s);\n\t\n\t$min = PHP_INT_MAX;\n\tfor ($i = -1 * $lu; $i < $ls; $i++) {\n\t\t$c = 0;\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\t//if ($inp_u_arr[$i] === $inp_s_arr[$j]) $c++;\n\t\t\tif ($i + $j < 0 || $i + $j >= $lu || $inp_u[$j] !== $inp_s[$i + $j]) $c++;\n\t\t}\n\t\tif ($min > $c) $min = $c;\n\t}\n\tprintf(\"%d\", $min);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t\n\t$temp_Sa = array();\n\t//$temp_S = \"\";\n\t$pos = 0;\n\t$ls = count($inp_s_arr);\n\t$lu = count($inp_u_arr);\n\tfor ($i = 0; $i < $lu; $i++) {\n\t\t$flag = 0;\n\t\t$temp_S = \"\";\n\t\tfor ($j = $i; $j < $ls; $j++) {\n\t\t\t\n\t\t\tif ($inp_u_arr[$i] === $inp_s_arr[$j]) {\n\t\t\t\t$temp_S = $temp_S.$inp_u_arr[$i];\n\t\t\t\t$flag = 1;\n\t\t\t\t$c++;\n\t\t\t\t$i++;\n\t\t\t} elseif ($flag === 1){\n\t\t\t\tif (strlen($temp_S) > strlen($temp_Sa[$pos])) {\n\t\t\t\t\t$temp_Sa[$pos] = $temp_S;\n\t\t\t\t}\n\t\t\t\t$flag = 0;\n\t\t\t\t$i = $i - $c;\n\t\t\t\t$c = 0;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t$pos++;\n\t}\n\t\n\t$max = 0;\n\t//foreach ($temp_S as $as_S) {\n\tforeach ($temp_Sa as $as_S) {\n\t\t$len = strlen($as_S);\n\t\tif ($max < $len) $max = $len;\n\t}\n\t$inp_len = strlen($inp_u);\n\t$change = $inp_len - $max;\n\t\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t\n\t$temp_Sa = array();\n\t//$temp_S = \"\";\n\t$pos = 0;\n\t$ls = count($inp_s_arr);\n\t$lu = count($inp_u_arr);\n\tfor ($i = 0; $i < $lu; $i++) {\n\t\t$flag = 0;\n\t\tfor ($j = $i; $j < $ls; $j++) {\n\t\t\t\n\t\t\tif ($inp_u_arr[$i] === $inp_s_arr[$j]) {\n\t\t\t\t$temp_S = $temp_S.$inp_u_arr[$i];\n\t\t\t\t$flag = 1;\n\t\t\t\t$c++;\n\t\t\t\t$i++;\n\t\t\t} elseif ($flag === 1){\n\t\t\t\tif (strlen($temp_S) > strlen($temp_Sa[$pos])) {\n\t\t\t\t\t$temp_Sa[$pos] = $temp_S;\n\t\t\t\t}\n\t\t\t\t$flag = 0;\n\t\t\t\t$i = $i - $c;\n\t\t\t\t$c = 0;\n\t\t\t\t$temp_S = \"\";\n\t\t\t}\n\t\t}\n\t\t$pos++;\n\t\tif ($flag === 1) {\n\t\t\tif (strlen($temp_S) > strlen($temp_Sa[$pos])) {\n\t\t\t\t\t$temp_Sa[$pos] = $temp_S;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$max = 0;\n\t//foreach ($temp_S as $as_S) {\n\tforeach ($temp_Sa as $as_S) {\n\t\t$len = strlen($as_S);\n\t\tif ($max < $len) $max = $len;\n\t}\n\t$inp_len = strlen($inp_u);\n\t$change = $inp_len - $max;\n\t\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$lu = strlen($inp_u);\n\tfor ($k = 0; $k < $lu - 1; $k++) {\n \t $str .= \"*\";\n\t}\n\n\t$inp_s = $str. $inp_s. $str;\n\t$ls = strlen($inp_s);\n\n\t$max = 0;\n\tfor ($i = 1; $i < $ls - $lu + 1; $i++) {\n\t$c = 0;\n \tfor ($j = 0; $j < $lu; $j++) {\n \t \tif ($inp_u[$j] === $inp_s[$i + $j]) $c++;\n \t}\n \tif ($max < $c) $max = $c;\n \tif ($max === $lu) break;\n\t}\n\t$change = $lu - $max;\n\tprintf(\"%d\", $change);\n\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.util.StringTokenizer;\n\npublic class taskC {\n\tBufferedReader reader;\n\tStringTokenizer tokenizer = new StringTokenizer(\"\");;\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tnew taskC().run();\n\t}\n\n\tprivate void run() throws IOException {\n\t\ttokenizer = null;\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\tsolve();\n\n\t}\n\n\tprivate void solve() throws IOException {\n\t\tString s = nextToken();\n\t\tString u = nextToken();\n\n\t\tint lenU = u.length();\n\t\tString str = \"\";\n\t\tfor (int i = 0; i < lenU; i++) {\n\t\t\tstr += \"*\";\n\t\t}\n\n\t\ts = str + s + str;\n\t\tint lenS = s.length();\n\t\tint max = 0;\n\t\tfor (int i = 1; i < lenS - lenU; i++) {\n\t\t\tint c = 0;\n\t\t\tfor (int j = 0; j < lenU; j++) {\n\t\t\t\tif (u.charAt(j) == s.charAt(i + j)) c++;\n\t\t\t}\n\t\t\tif (max < c) max = c;\n\t\t\tif (max == lenU) break;\n\t\t\tc = 0;\n\t\t}\n\t\tint num = lenU - max;\n\t\tSystem.out.print(num);\n\t}\n\t\n\tBufferedReader in;\n\tStringTokenizer st = new StringTokenizer(\"\");\n\n\tString nextToken() throws IOException {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens())\n\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\treturn tokenizer.nextToken();\n\t}\n\n\tint nextInt() throws IOException {\n\t\treturn Integer.parseInt(nextToken());\n\t}\n\n\tlong nextLong() throws IOException {\n\t\treturn Long.parseLong(nextToken());\n\t}\n\n\tdouble nextDouble() throws IOException {\n\t\treturn Double.parseDouble(nextToken());\n\t}\n\n\tint[] nextIntArray(int size) throws IOException {\n\t\tint[] ret = new int [size];\n\t\tfor (int i = 0; i < size; i++)\n\t\t\tret[i] = nextInt();\n\t\treturn ret;\n\t}\n \n\tlong[] nextLongArray(int size) throws IOException {\n\t\tlong[] ret = new long [size];\n\t\tfor (int i = 0; i < size; i++)\n\t\t\tret[i] = nextLong();\n\t\treturn ret;\n\t}\n \n\tdouble[] nextDoubleArray(int size) throws IOException {\n\t\tdouble[] ret = new double [size];\n\t\tfor (int i = 0; i < size; i++)\n\t\t\tret[i] = nextDouble();\n\t\treturn ret;\n\t}\n\n\tString nextLine() throws IOException {\n\t\tst = new StringTokenizer(\"\");\n\t\treturn in.readLine();\n\t}\n\n boolean EOF() throws IOException {\n\t\twhile (!st.hasMoreTokens()) {\n\t\t\tString s = in.readLine();\n\t\t\tif (s == null)\n\t\t\t\treturn true;\n \t\t\tst = new StringTokenizer(s);\n\t\t}\n\t\treturn false;\n\t}\n}"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t\n\t$temp_Sa = array();\n\t//$temp_S = \"\";\n\t$pos = 0;\n\t$ls = count($inp_s_arr);\n\t$lu = count($inp_u_arr);\n\tfor ($i = 0; $i < $lu; $i++) {\n\t\t$flag = 0;\n\t\t$temp_S = \"\";\n\t\tfor ($j = $i; $j < $ls; $j++) {\n\t\t\t\n\t\t\tif ($inp_u_arr[$i] === $inp_s_arr[$j]) {\n\t\t\t\t$temp_S = $temp_S.$inp_u_arr[$i];\n\t\t\t\t$flag = 1;\n\t\t\t\t$c++;\n\t\t\t\t$i++;\n\t\t\t} elseif ($flag === 1){\n\t\t\t\tif (strlen($temp_S) > strlen($temp_Sa[$pos])) {\n\t\t\t\t\t$temp_Sa[$pos] = $temp_S;\n\t\t\t\t}\n\t\t\t\t$flag = 0;\n\t\t\t\t$i = $i - $c;\n\t\t\t\t$c = 0;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t$pos++;\n\t}\n\t\n\t$max = 0;\n\t//foreach ($temp_S as $as_S) {\n\tforeach ($temp_Sa as $as_S) {\n\t\t$len = strlen($as_S);\n\t\tif ($max < $len) $max = $len;\n\t}\n\t$inp_len = strlen($inp_u);\n\t$change = $inp_len - $max;\n\t\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t\n\t$temp_S = array();\n\t$pos = 0;\n\t$ls = count($inp_s_arr);\n\t$i = 0;\n\tfor ($j = 0; $j < $ls; $j++) { \n\t\tif ($inp_u_arr[$i] === $inp_s_arr[$j]) {\n\t\t\t$temp_S[$pos] = $temp_S[$pos].$inp_u_arr[$i];\n\t\t\twhile ($inp_u_arr[++$i] === $inp_s_arr[++$j]){\n\t\t\t\t\t$temp_S[$pos] = $temp_S[$pos].$inp_u_arr[$i];\n\t\t\t}\n\t\t\t$i = 0;\n\t\t\t$pos++;\t\n\t\t}\n\t}\n\t\n\t$max = 0;\n\tforeach ($temp_S as $as_S) {\n\t\t$len = strlen($as_S);\n\t\tif ($max < $len) $max = $len;\n\t}\n\t$inp_len = strlen($inp_u);\n\t$change = $inp_len - $max;\n\t\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t\n\t$temp_Sa = array();\n\t//$temp_S = \"\";\n\t$c = 0;\n\t$max = 0;\n\t$ls = count($inp_s_arr);\n\t$lu = count($inp_u_arr);\n\tfor ($i = 0; $i < $ls; $i++) {\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\t//if ($inp_u_arr[$i] === $inp_s_arr[$j]) $c++;\n\t\t\tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n\t\t}\n\t\t$max = max($max, $c);\n\t\t$c = 0;\n\t}\n\t$change = count($inp_u_arr) - $max;\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$lu = strlen($inp_u);\n\tfor ($k = 0; $k < $lu - 1; $k++) {\n \t $str .= \"*\";\n\t}\n\n\t$inp_s = $str. $inp_s. $str;\n\t$ls = strlen($inp_s);\n\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t$max = 0;\n\tfor ($i = 0; $i < $ls - $lu + 1; $i++) {\n\t$c = 0;\n \tfor ($j = 0; $j < $lu; $j++) {\n \t \tif ($inp_s_arr[$j] === $inp_u_arr[$i + $j]) $c++;\n \t}\n \tif ($max < $c) $max = $c;\n \tif ($max === $lu) break;\n\t}\n\t$change = $lu - $max;\n\tprintf(\"%d\", $change);\n\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_u_arr = str_split($inp_u);\t\n\t$lu = count($inp_u_arr);\n\t\n\t$str = str_repeat(\"*\", $lu);\n\t$inp_s = $str.$inp_s.$str;\n\t$inp_s_arr = str_split($inp_s);\n\t$ls = count($inp_s_arr);\n\t\n\t$c = 0;\n\t//$max = 0;\n\t$max = array();\n\tfor ($i = 1; $i < $ls- $lu; $i++) {\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\t//if ($inp_u_arr[$i] === $inp_s_arr[$j]) $c++;\n\t\t\tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n\t\t}\n\t\t$match[] = $c;\n\t\t//if ($c === $lu) break;\n\t\t$c = 0;\n\t}\n\trsort($match);\n\tprintf(\"%d\", $match[0]);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_u_arr = str_split($inp_u);\t\n\t$lu = count($inp_u_arr);\n\t\n\t$str = str_repeat(\"*\", $lu);\n\t$inp_s = $str.$inp_s.$str;\n\t$inp_s_arr = str_split($inp_s);\n\t$ls = count($inp_s_arr);\n\t\n\t$c = 0;\n\t$max = array();\n\tfor ($i = 1; $i < $ls- $lu; $i++) {\n\t\tfor ($j = 0; $j < $lu; $j++) {\n\t\t\tif ($inp_u_arr[$j] === $inp_s_arr[$i + $j]) $c++;\n\t\t}\n\t\t$match[] = $c;\n\t\t$c = 0;\n\t}\n\trsort($match);\n\tprintf(\"%d\", $match[0]);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_u = $Scanner->Scan();\n\t\n\t$inp_s_arr = str_split($inp_s);\n\t$inp_u_arr = str_split($inp_u);\n\t\n\t$temp_Sa = array();\n\t$temp_S = \"\";\n\t$pos = 0;\n\t$ls = count($inp_s_arr);\n\t$lu = count($inp_u_arr);\n\tfor ($i = 0; $i < $lu; $i++) {\n\t\t$flag = 0;\n\t\tfor ($j = $i; $j < $ls; $j++) {\n\t\t\t\n\t\t\tif ($inp_u_arr[$i] === $inp_s_arr[$j]) {\n\t\t\t\t$temp_S = $temp_S.$inp_u_arr[$i];\n\t\t\t\t$flag = 1;\n\t\t\t\t$c++;\n\t\t\t\t$i++;\n\t\t\t} elseif ($flag === 1){\n\t\t\t\tif (strlen($temp_S) > strlen($temp_Sa[$pos])) {\n\t\t\t\t\t$temp_Sa[$pos] = $temp_S;\n\t\t\t\t}\n\t\t\t\t$flag = 0;\n\t\t\t\t$i = $i - $c;\n\t\t\t\t$c = 0;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t$pos++;\n\t}\n\t\n\t$max = 0;\n\tforeach ($temp_S as $as_S) {\n\t\t$len = strlen($as_S);\n\t\tif ($max < $len) $max = $len;\n\t}\n\t$inp_len = strlen($inp_u);\n\t$change = $inp_len - $max;\n\t\n\tprintf(\"%d\", $change);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": " $u = \". levenshtein(substr($s, $i, $u_len), $u) .\"\\n\";\n $diffs[] = levenshtein(substr($s, $i, $u_len), $u);\n}\n\nsort($diffs);\nprint $diffs[0] .\"\\n\";\n\n\n"}, {"source_code": "= $d)\n {\n break;\n }\n}\nprint ($x + 1);\n?>", "positive_code": [{"source_code": "= ($sum / 2)) {\n\t\t$res = $i + 1;\n\t\tbreak ;\n\t}\n}\n\necho $res.\"\\n\";"}, {"source_code": "=$tetrbatknianebi){\n echo($i+1);\n exit();\n }\n}\n\n?>"}, {"source_code": " $value) {\n\t$total += $value;\n}\n\n$cur = 0;\n$day = 0;\nforeach ($b as $key => $value) {\n\t$day++;\n\t$cur += $value;\n\tif ($cur >= $total/2) {\n\t\tbreak;\n\t}\n}\n\necho $day;\n?>"}], "negative_code": [], "src_uid": "241157c465fe5dd96acd514010904321"} {"source_code": "= $a[$j] && $b[$i] >= $b[$j]) {\r\n $temp = $a[$i];\r\n $a[$i] = $a[$j];\r\n $a[$j] = $temp;\r\n \r\n $temp = $b[$i];\r\n $b[$i] = $b[$j];\r\n $b[$j] = $temp; \r\n $tt = $i+1;\r\n $bb = $j+1;\r\n $ans .= \"$tt $bb\\n\";\r\n $count++;\r\n }\r\n }\r\n }\r\n \r\n $sol = true;\r\n for($i=0; $i<$n-1; $i++) {\r\n if($a[$i] > $a[$i+1] || $b[$i] > $b[$i+1]) {\r\n $sol = false;\r\n break;\r\n }\r\n }\r\n if(!$sol) {\r\n IO::pr('-1');\r\n } else {\r\n echo $count, PHP_EOL; \r\n if($count > 0) {\r\n echo $ans, PHP_EOL;\r\n }\r\n \r\n // for($i=0; $i<$count; $i++) {\r\n // echo $ans[$i], PHP_EOL; \r\n // }\r\n }\r\n \r\n \r\n }\r\n \r\nfunction maxVal($x) {\r\n $max = $x[0];\r\n for($i=1; $i\";\n//print_r( $arr_commands );\n\n\n\nforeach( $arr_commands as $t ){\n\n\t$tag = 'pwd';\n\tif( substr($t, 0, strlen($tag)) == $tag){\n\t\t//echo \"\\n+++pwd\";\n\t\tmy_pwd();\n\t\tcontinue;\n\t} \n\t\n\t$tag = 'cd';\n\tif( substr($t, 0, strlen($tag)) == $tag){\n\t\t//echo \"\\n+++cd:\";\n\t\tmy_cd( substr( $t, strlen($tag)));\n\t\tcontinue;\n\t} \n\t\n}\n\n\n//EOF"}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n$cur_path=array(0=>\"/\");\n\nfor ($l=1; $l';} \n function read_line()\n { \n if(DEBUG) { $file = $GLOBALS['file'];$line = trim(fgets($file));}\n else $line = trim(fgets(STDIN));\n return $line;\n }\n function get_array($line){return explode(' ', $line);}\n function read_array(){return get_array(read_line());} \n //echo \"$s\\n\";\n /*****************************************************************/\n \n $n = read_line();\n $x=0;\n $y=0;\n $z=0;\n \n \n for($i=1; $i<=$n; $i++)\n {\n $arr=read_array();\n $x+=$arr[0];\n $y+=$arr[1];\n $z+=$arr[2];\n }\n \n if(!($x||$y||$z)) echo 'YES';\n else echo 'NO';\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "\";\n\n //\u0415\u0441\u043b\u0438 \u0438\u0434\u0435\u043c \u043e\u0442 \u043a\u043e\u0440\u043d\u044f\n if ($path{0}==\"/\")\n $cur_path=array(0=>\"/\");\n\n if($path==\"/\")\n {\n $cur_path=array(0=>\"/\");\n continue;\n }\n\n $struc=explode(\"/\", ltrim($path,\"/\"));\n foreach ($struc as $deep=>$dir)\n {\n if ($dir==\"..\")\n array_pop($cur_path);\n else\n $cur_path[]=$dir;\n }\n //print_r($cur_path);\n }\n}\necho implode(\"\\n\", $cmds);"}, {"source_code": " 0 )\n\t{\n\t\t$result .= implode( '/', $path ) . '/';\n\t}\n return $result;\n}\n\nfile_put_contents( 'php://stdout', implode( \"\\n\", $result ) );"}, {"source_code": " 0)\n echo \"/\";\n if (!$isLast)\n echo \"\n\";\n}\n\n$current = array();\nforeach ($strs as $k => $str) {\n if (trim($str) == \"pwd\") {\n $isLast = count($strs) == $k+1;\n\n printPath($current, $isLast);\n } else {\n $path = explode(\" \", $str);\n $path = trim($path[1]);\n $path = explode(\"/\", $path);\n \n foreach($path as $dir) {\n switch ($dir) {\n case \"\": $current = array(); break;\n case \"..\": array_pop($current); break;\n default: if ($dir !== '') array_push($current, $dir); \n }\n }\n }\n}"}, {"source_code": " 0) {\n array_pop($path);\n }\n } else {\n $path[] = $folder;\n }\n }\n\n}\n\nfunction print_path($path) {\n if (!empty($path)) {\n $path = implode(\"/\",$path).\"/\";\n } else {\n $path = \"\";\n }\n fputs(STDOUT, \"/\". $path.\"\\r\\n\");\n}\n\n?>\n\n"}, {"source_code": ""}, {"source_code": "= 0; $z--)\n {\n if(($g[$z] == \"/\") && ($i == 0))\n {\n $i = 1;\n }\n elseif(($g[$z] == \"/\") && ($i == 1))\n {\n array_splice($g, $z, $h + 2 - $z);\n break;\n }\n }\n }\n else\n {\n break;\n }\n }\n $e = $g;\n for($y = 0; $y < count($e) - 1; $y++)\n {\n if(($e[$y] == \"/\") && ($e[$y + 1] == \"/\"))\n {\n unset($e[$y]);\n }\n }\n $d = implode(\"\", $e);\n }\n}\nlist($b, $c) = explode(\" \", trim(fgets(STDIN)));\nif($b == \"pwd\")\n{\n print $d;\n}\nelse\n{\n if($c[0] == \"/\")\n {\n $d = \"/\" . $c . \"/\";\n }\n else\n {\n $d .= \"/\" . $c . \"/\";\n }\n $e = str_split($d);\n for($y = 0; $y < count($e) - 1; $y++)\n {\n if(($e[$y] == \"/\") && ($e[$y + 1] == \"/\"))\n {\n unset($e[$y]);\n }\n }\n $f = implode(\"\", $e);\n $g = str_split($f);\n for($y = 1; $y < 1000; $y++)\n {\n $h = array_search(\".\", $g);\n if($h == TRUE)\n {\n $i = 0;\n for($z = $h; $z >= 0; $z--)\n {\n if(($g[$z] == \"/\") && ($i == 0))\n {\n $i = 1;\n }\n elseif(($g[$z] == \"/\") && ($i == 1))\n {\n array_splice($g, $z, $h + 2 - $z);\n break;\n }\n }\n }\n else\n {\n break;\n }\n }\n $e = $g;\n for($y = 0; $y < count($e) - 1; $y++)\n {\n if(($e[$y] == \"/\") && ($e[$y + 1] == \"/\"))\n {\n unset($e[$y]);\n }\n }\n $d = implode(\"\", $e);\n}\n?>"}, {"source_code": "dirs as $dir)\n {\n $postfix = $dir=='/'?'':'/';\n $result .= $dir.$postfix;\n }\n return $result;\n }\n\n public function cd($dir)\n {\n if ($dir == '/') {\n $this->setRoot();\n } elseif ($dir == '..')\n {\n $this->moveBack();\n } else {\n $this->dirs[] = $dir;\n }\n\n }\n\n protected function setRoot()\n {\n $this->dirs = array('/');\n }\n\n protected function moveBack()\n {\n if (count($this->dirs) == 1) {\n return;\n }\n array_pop($this->dirs);\n }\n}\n\n$filesystem = new Filesystem();\nwhile ($commands)\n{\n $commands--;\n $command = trim(fgets(STDIN));\n if ($command == 'pwd') {\n echo $filesystem->pwd().PHP_EOL;\n } else {\n preg_match('/cd (.*)/', $command, $match);\n $cd = $match[1];\n $newDirs = explode('/', $cd);\n if ($newDirs[0] == '') {\n $filesystem->cd('/');\n unset($newDirs[0]);\n }\n foreach ($newDirs as $dir)\n {\n if (empty($dir)) continue;\n $filesystem->cd($dir);\n }\n }\n}"}, {"source_code": ""}, {"source_code": "'');\n$dirs = Array();\n$coms = Array();\n$output = '';\n\n$fp = fopen('php://stdin', 'r');\n\nwhile($n <= $t && $line = fgets($fp, 4096)) {\n\t$buf = $line;\n\t$n++;\n\tif(preg_match(\"/\\d{1,2}/\",$buf)) \n\t\t$t = $buf;\n\telse\n\t\t$coms[] = trim($buf);\n}\n\nforeach ($coms as $com) {\n\tif($com==\"pwd\") {\n\t\techo implode(\"/\",$current).\"/\\n\";\n\t}\n\telse {\n\t\t$dirs = explode(\"/\",substr($com,3));\n\t\t\n\t\tforeach($dirs as $dir) {\n\t\t\tif($dir == \"..\" && count($current)>1) {\n\t\t\t\tunset($current[count($current)-1]);\n\t\t\t\t$current = array_values($current);\n\t\t\t} else if($dir == '') {\n\t\t\t\t$current = Array(0=>'');\n\t\t\t} else {\n\t\t\t\t$current[] = $dir;\n\t\t\t}\n\t\t}\n\t}\n}\n\n?>"}, {"source_code": "\n list($n)=fscanf(STDIN,\"%d\");\n $path=\"/\";\n for($i=0;$i<$n;$i++){\n $u=fgets(STDIN);\n $u=str_replace(\"\\n\",'',$u);\n $u=str_replace(\"\\r\",'',$u);\n if ($u[0]==\"p\"){\n fputs(STDOUT,\"\\n\".$path);\n }else{\n $h=substr($u,3);\n if ($h[0]==\"/\") {$path=\"/\";$h=substr($h,1);}\n $j=explode('/',$h);\n foreach($j as $x){\n if ($x=='..') {\n $g=strrpos($path,'/',-2);\n $path=substr($path,0,$g+1);\n }else{\n $path.=($x.\"/\");\n }\n }\n }\n }\n?>"}, {"source_code": " array(\n'7',\n'pwd',\n'cd /home/vasya',\n'pwd',\n'cd ..',\n'pwd',\n'cd vasya/../petya',\n'pwd',\n));\n $input = dataProvider::get();\n $data = array();\n $i = 0;\n $current_dir = array();\n foreach($input['lines'] as $line) {\n if ($i == 0) {$i++; continue;} // \u044d\u0442\u043e \u043b\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0434\u0440\u0435\u0432\u043d\u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\n if($line == 'pwd') {$data[] = empty($current_dir) ? '/' : '/'. (string) implode('/', $current_dir).'/'; continue;}\n\n $line = substr($line, 3);\n if ($line[0] == '/') {$current_dir = array();}\n $dirs = explode('/', $line);\n foreach ($dirs as $dir) {\n if(!empty($dir)) {\n if($dir == '..') {\n //echo '
path wos '. '/'. (string) implode('/', $current_dir);\n $k = 0;\n foreach($current_dir as $key => $value)\n {\n $k++;\n if($k == count($current_dir)) {\n unset($current_dir[$key]);\n }\n }\n //$current_dir = array_diff($current_dir, array(array_pop($current_dir)));\n //echo ' path now '. '/'. (string) implode('/', $current_dir).'
';\n } else {\n $current_dir[] = $dir;\n }\n }\n }\n }\n\n//var_dump($data); die();\n\n dataProvider::set($data);\n\n\n class dataProvider\n {\n public static function get()\n {\n $stdin = file_get_contents('php://stdin');\n $stdin = str_replace(array(\"\\r\"), \"\\n\", $stdin);\n $stdin = str_replace(array(\"\\n\\n\"), \"\\n\", $stdin);\n $lines = explode(\"\\n\", $stdin);\n return array(\n 'lines' => $lines,\n );\n }\n\n public static function set($data)\n {\n file_put_contents('php://stdout', implode(\"\\n\", $data));\n }\n }\n?>"}, {"source_code": "\n"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = (int)(fgets($fp));\n\n$dir[0] = '';\n$flag = false;\nwhile( $count-- )\n{\n list($command, $way) = explode(\" \", str_replace( \"\\r\\n\", '', fgets($fp) ) );\n if( $command == 'pwd' )\n {\n if( !$flag ){\n $flag = true;\n } else {\n echo \"\\r\\n\";\n }\n if( count($dir) > 1 ){\n echo implode('/', $dir);\n }\n echo \"/\"; \n } else {\n $wayPart = explode(\"/\", $way);\n $i = 0;\n while( isset($wayPart[$i]) )\n {\n switch( $wayPart[$i] ){\n case '' :\n if($i == 0)\n {\n $dir = array();\n $dir[0] = '';\n }\n break;\n case '..' :\n if( count( $dir ) > 1 )\n {\n unset( $dir[count( $dir ) - 1] );\n }\n break;\n default:\n $dir[count( $dir )] = $wayPart[$i];\n break;\n }\n $i++;\n }\n }\n}\n\n\nfclose($fp);\n?>"}, {"source_code": ""}, {"source_code": "pwd().\"\\n\";\n }else{\n $comm=explode(' ',$command);\n $m->cd($comm[1]);\n }\n}\n?>"}, {"source_code": " 0) {\n echo '/';\n }\n echo PHP_EOL;\n}"}, {"source_code": " 50 || preg_match('/[^0-9]/', $commands)) {\n fwrite(STDERR, 'invalid string');\n exit();\n}\n$results = array();\nfor ($i = 0; $i < $commands; $i++) {\n $input = trim(fgets(STDIN));\n if ($input == 'pwd') {\n if ($current_dir != \"/\") {\n $str=$current_dir . \"/\";\n $results[] = str_replace(\"//\", \"/\", $str);\n } else {\n $str=$current_dir;\n $results[] = str_replace(\"//\", \"/\", $str);\n }\n } else if (substr($input, 0, 2) == 'cd') {\n $tmp = substr($input, 3);\n $tmp = explode(\"/\", $tmp);\n //print_r($tmp);\n if (count($tmp) > 2 && empty($tmp[count($tmp) - 1])) {\n fwrite(STDERR, 'invalid string');\n exit();\n }\n if (count($tmp) == 2 && empty($tmp[0]) && empty($tmp[1])) {\n $current_dir = \"/\";\n } else if (count($tmp) == 1 && $tmp[0] == \"..\") {\n $current_dir = explode(\"/\", $current_dir);\n if (count($current_dir) == 2 && empty($current_dir[0]) && empty($current_dir[1])) {\n $current_dir = \"/\";\n } else {\n unset($current_dir[count($current_dir) - 1]);\n $current_dir = implode(\"/\", $current_dir);\n //$current_dir= str_replace(\"//\", \"/\", $current_dir);\n }\n } else if (count($tmp) == 2 && empty($tmp[0]) && $tmp[1] == \"..\") {\n $current_dir = \"/\";\n } else {\n foreach ($tmp as $val) {\n if (empty($val)) {\n $current_dir = \"\";\n } else if ($val == \"..\") {\n $current_dir = explode(\"/\", $current_dir);\n if (count($current_dir) == 2 && empty($current_dir[0]) && empty($current_dir[1])) {\n $current_dir = \"\";\n } else {\n unset($current_dir[count($current_dir) - 1]);\n $current_dir = implode(\"/\", $current_dir);\n //$current_dir= str_replace(\"//\", \"/\", $current_dir);\n }\n } else {\n $current_dir = explode(\"/\", $current_dir);\n $current_dir[] = $val;\n $current_dir = implode(\"/\", $current_dir);\n //$current_dir= str_replace(\"//\", \"/\", $current_dir);\n }\n }\n }\n }\n}\nfwrite(STDOUT, implode(\"\\n\", $results));\n?>\n"}, {"source_code": "\", (microtime() - $t), \"\\r\\n\";"}, {"source_code": ""}, {"source_code": " $value) {\n $d[$key] = trim($d[$key]);\n if($value == '..') { \n unset($d[$key]);\n unset($d[$key-1]);\n $d = array_values($d);\n $b = true;\n break;\n }\n \n $b = false; \n }\n\n\n }\n $directory = implode(\"/\", $d);\n\n if(strlen($directory) > 1) {\n if($directory[0] !== '/') $directory = '/'.$directory;\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n }\n\n while (substr_count($directory, '//')) {\n $directory = str_replace('//', '/', $directory);\n }\n}\n\n$text = explode(\"\\r\\n\", $text);\nforeach($text as $val) {\n $val = trim($val);\n if(substr($val, 0, 3) == 'pwd') {\n refresh();\n \n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n echo trim($directory).\"/\\r\\n\";\n continue;\n }\n\n if(substr($val, 0, 2) == 'cd') {\n\n $path = str_replace('cd ', '', $val);\n if($path == '..') {\n $d = explode(\"/\", $directory);\n unset($d[count($d)-1]);\n $directory = implode(\"/\", $d);\n } else {\n if(substr($path, 0, 1) == '/') {\n $directory = $path;\n } else {\n $directory .= '/'.$path;\n }\n\n refresh();\n }\n }\n}"}, {"source_code": " $item)\n {\n if ($key == 0 && $item == \"\")\n {\n $dir = array();\n continue;\n } \n if ($item == \"..\")\n {\n if (count($dir) > 0)\n {\n array_pop($dir);\n }\n continue;\n }\n $dir[] = $item;\n }\n }\n\n function command($str)\n {\n if ($str == \"pwd\")\n {\n get_dir();\n return;\n }\n $arr = split(\" \", $str);\n set_dir($arr[1]);\n }\n \n $arr = array();\n $i = 0;\n $count = 0;\n while(($line = fgets(STDIN)) != false)\n {\n if ($i == 0)\n {\n $count = $line;\n }\n else\n {\n $arr[] = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), '', $line);\n }\n $i++;\n }\n foreach ($arr as $key => $cmd)\n {\n command($cmd);\n }\n \n\n\n?>"}], "negative_code": [{"source_code": "= 0; $z--)\n {\n if(($g[$z] == \"/\") && ($i == 0))\n {\n $i = 1;\n }\n elseif(($g[$z] == \"/\") && ($i == 1))\n {\n array_splice($g, $z, $h + 2 - $z);\n break;\n }\n }\n }\n else\n {\n break;\n }\n }\n $e = $g;\n for($y = 0; $y < count($e) - 1; $y++)\n {\n if(($e[$y] == \"/\") && ($e[$y + 1] == \"/\"))\n {\n unset($e[$y]);\n }\n }\n $d = implode(\"\", $e);\n }\n}\nlist($b, $c) = explode(\" \", trim(fgets(STDIN)));\nif($b == \"pwd\")\n{\n print $d;\n}\nelse\n{\n $d .= \"/\" . $c . \"/\";\n $e = str_split($d);\n for($y = 0; $y < count($e) - 1; $y++)\n {\n if(($e[$y] == \"/\") && ($e[$y + 1] == \"/\"))\n {\n unset($e[$y]);\n }\n }\n $f = implode(\"\", $e);\n $g = str_split($f);\n for($y = 1; $y < 1000; $y++)\n {\n $h = array_search(\".\", $g);\n if($h == TRUE)\n {\n $i = 0;\n for($z = $h; $z >= 0; $z--)\n {\n if(($g[$z] == \"/\") && ($i == 0))\n {\n $i = 1;\n }\n elseif(($g[$z] == \"/\") && ($i == 1))\n {\n array_splice($g, $z, $h + 2 - $z);\n break;\n }\n }\n }\n else\n {\n break;\n }\n }\n $e = $g;\n for($y = 0; $y < count($e) - 1; $y++)\n {\n if(($e[$y] == \"/\") && ($e[$y + 1] == \"/\"))\n {\n unset($e[$y]);\n }\n }\n $d = implode(\"\", $e);\n}\n?>"}, {"source_code": ""}, {"source_code": "\n list($n)=fscanf(STDIN,\"%d\");\n print_r($n);\n $path=\"/\";\n for($i=0;$i<$n;$i++){\n $u=fgets(STDIN);\n $u=str_replace(\"\\n\",'',$u);\n $u=str_replace(\"\\r\",'',$u);\n if ($u[0]==\"p\"){\n fputs(STDOUT,\"\\n\".$path);\n }else{\n $h=substr($u,3);\n if ($h[0]==\"/\") {$path=\"/\";$h=substr($h,1);}\n $j=explode('/',$h);\n foreach($j as $x){\n if ($x=='..') {\n $g=strrpos($path,'/',-2);\n $path=substr($path,0,$g+1);\n }else{\n $path.=($x.\"/\");\n }\n }\n }\n }\n?>"}, {"source_code": " array(\n'7',\n'pwd',\n'cd /home/vasya',\n'pwd',\n'cd ..',\n'pwd',\n'cd vasya/../petya',\n'pwd',\n));\n $input = dataProvider::get();\n $data = array();\n $i = 0;\n $current_dir = array();\n foreach($input['lines'] as $line) {\n if ($i == 0) {$i++; continue;} // \u044d\u0442\u043e \u043b\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0434\u0440\u0435\u0432\u043d\u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\n if($line == 'pwd') {$data[] = empty($current_dir) ? '/' : '/'. (string) implode('/', $current_dir).'/'; continue;}\n\n $line = ltrim($line, 'cd ');\n if ($line[0] == '/') {$current_dir = array();}\n $dirs = explode('/', $line);\n foreach ($dirs as $dir) {\n if(!empty($dir)) {\n if($dir == '..') {\n //echo '
path wos '. '/'. (string) implode('/', $current_dir);\n $k = 0;\n foreach($current_dir as $key => $value)\n {\n $k++;\n if($k == count($current_dir)) {\n unset($current_dir[$key]);\n }\n }\n //$current_dir = array_diff($current_dir, array(array_pop($current_dir)));\n //echo ' path now '. '/'. (string) implode('/', $current_dir).'
';\n } else {\n $current_dir[] = $dir;\n }\n }\n }\n }\n\n//var_dump($data); die();\n\n dataProvider::set($data);\n\n\n class dataProvider\n {\n public static function get()\n {\n $stdin = file_get_contents('php://stdin');\n $stdin = str_replace(array(\"\\r\"), \"\\n\", $stdin);\n $stdin = str_replace(array(\"\\n\\n\"), \"\\n\", $stdin);\n $lines = explode(\"\\n\", $stdin);\n return array(\n 'lines' => $lines,\n );\n }\n\n public static function set($data)\n {\n file_put_contents('php://stdout', implode(\"\\n\", $data));\n }\n }\n?>"}, {"source_code": " array(\n'7',\n'pwd',\n'cd /home/vasya',\n'pwd',\n'cd ..',\n'pwd',\n'cd vasya/../petya',\n'pwd',\n));\n $input = dataProvider::get();\n $data = array();\n $i = 0;\n $current_dir = array();\n foreach($input['lines'] as $line) {\n if ($i == 0) {$i++; continue;} // \u044d\u0442\u043e \u043b\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0434\u0440\u0435\u0432\u043d\u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\n if($line == 'pwd') {$data[] = empty($current_dir) ? '/' : '/'. (string) implode('/', $current_dir).'/'; continue;}\n\n $line = substr($line, 4);\n if ($line[0] == '/') {$current_dir = array();}\n $dirs = explode('/', $line);\n foreach ($dirs as $dir) {\n if(!empty($dir)) {\n if($dir == '..') {\n //echo '
path wos '. '/'. (string) implode('/', $current_dir);\n $k = 0;\n foreach($current_dir as $key => $value)\n {\n $k++;\n if($k == count($current_dir)) {\n unset($current_dir[$key]);\n }\n }\n //$current_dir = array_diff($current_dir, array(array_pop($current_dir)));\n //echo ' path now '. '/'. (string) implode('/', $current_dir).'
';\n } else {\n $current_dir[] = $dir;\n }\n }\n }\n }\n\n//var_dump($data); die();\n\n dataProvider::set($data);\n\n\n class dataProvider\n {\n public static function get()\n {\n $stdin = file_get_contents('php://stdin');\n $stdin = str_replace(array(\"\\r\"), \"\\n\", $stdin);\n $stdin = str_replace(array(\"\\n\\n\"), \"\\n\", $stdin);\n $lines = explode(\"\\n\", $stdin);\n return array(\n 'lines' => $lines,\n );\n }\n\n public static function set($data)\n {\n file_put_contents('php://stdout', implode(\"\\n\", $data));\n }\n }\n?>"}, {"source_code": " array(\n'7',\n'pwd',\n'cd /home/vasya',\n'pwd',\n'cd ..',\n'pwd',\n'cd vasya/../petya',\n'pwd',\n));\n $input = dataProvider::get();\n $data = array();\n $i = 0;\n $current_dir = array();\n foreach($input['lines'] as $line) {\n if ($i == 0) {$i++; continue;} // \u044d\u0442\u043e \u043b\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0434\u0440\u0435\u0432\u043d\u0438\u0445 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\n if($line == 'pwd') {$data[] = empty($current_dir) ? '/' : '/'. (string) implode('/', $current_dir).'/'; continue;}\n\n $line = ltrim($line, 'cd ');\n if ($line[0] == '/') {$current_dir = array();}\n $dirs = explode('/', $line);\n foreach ($dirs as $dir) {\n if(!empty($dir)) {\n if($dir == '..') {\n //echo '
path wos '. '/'. (string) implode('/', $current_dir);\n $current_dir = array_diff($current_dir, array(array_pop($current_dir)));\n //echo ' path now '. '/'. (string) implode('/', $current_dir).'
';\n } else {\n $current_dir[] = $dir;\n }\n }\n }\n }\n\n//var_dump($data); die();\n\n dataProvider::set($data);\n\n\n class dataProvider\n {\n public static function get()\n {\n $stdin = file_get_contents('php://stdin');\n $stdin = str_replace(array(\"\\r\"), \"\\n\", $stdin);\n $stdin = str_replace(array(\"\\n\\n\"), \"\\n\", $stdin);\n $lines = explode(\"\\n\", $stdin);\n return array(\n 'lines' => $lines,\n );\n }\n\n public static function set($data)\n {\n file_put_contents('php://stdout', implode(\"\\n\", $data));\n }\n }\n?>"}, {"source_code": " 50 || preg_match('/[^0-9]/', $commands)) {\n fwrite(STDERR, 'invalid string');\n exit();\n}\n$results = array();\nfor ($i = 0; $i < $commands; $i++) {\n $input = trim(fgets(STDIN));\n if ($input == 'pwd') {\n if ($current_dir!=\"/\"){\n $results[] = $current_dir.\"/\";\n } else {\n $results[] = $current_dir;\n }\n \n } else if (substr($input, 0, 2) == 'cd') {\n $tmp = substr($input, 3);\n $tmp = explode(\"/\", $tmp);\n if (count($tmp) > 2 && empty($tmp[count($tmp) - 1])) {\n fwrite(STDERR, 'invalid string');\n exit();\n }\n if (count($tmp) == 2 && empty($tmp[0]) && empty($tmp[1])) {\n $current_dir = \"/\";\n } else if (count($tmp) == 1 && $tmp[0] == \"..\") {\n $current_dir = explode(\"/\", $current_dir);\n if (count($current_dir) == 2 && empty($current_dir[0]) && empty($current_dir[1])) {\n $current_dir = \"/\";\n } else {\n unset($current_dir[count($current_dir) - 1]);\n $current_dir = implode(\"/\", $current_dir);\n //$current_dir= str_replace(\"//\", \"/\", $current_dir);\n }\n } else if (count($tmp) == 2 && empty($tmp[0]) && $tmp[1] == \"..\") {\n $current_dir = \"/\";\n } else {\n foreach ($tmp as $val) {\n if (empty($val)) {\n $current_dir = \"\";\n } else if ($val == \"..\") {\n $current_dir = explode(\"/\", $current_dir);\n if (count($current_dir) == 2 && empty($current_dir[0]) && empty($current_dir[1])) {\n $current_dir = \"\";\n } else {\n unset($current_dir[count($current_dir) - 1]);\n $current_dir = implode(\"/\", $current_dir);\n //$current_dir= str_replace(\"//\", \"/\", $current_dir);\n }\n } else {\n $current_dir = explode(\"/\", $current_dir);\n $current_dir[]=$val;\n $current_dir = implode(\"/\", $current_dir);\n //$current_dir= str_replace(\"//\", \"/\", $current_dir);\n }\n }\n }\n\n //print_r($tmp);\n }\n}\nfwrite(STDOUT, implode(\"\\n\", $results));\n?>\n"}, {"source_code": "= 1 && $number <= 50) {\n for ($i = 1; $i <= $number; $i++) {\n $commands[] = trim(fgets(STDIN));\n }\n for ($j = 0; $j < count($commands); $j++) {\n if ($j != (count($commands) - 1)) {\n parse_command($commands[$j]);\n } else {\n parse_command($commands[$j], true);\n }\n }\n} else {\n fwrite(STDERR, 'invalid commands count');\n}\n\nfunction parse_command($str, $last = false) {\n global $home_dir;\n if ($str == \"pwd\") {\n if ($last == false) {\n $last_str = \"\\n\";\n } else {\n $last_str = \"\";\n }\n if ($home_dir != '/' && !empty($home_dir)) {\n fwrite(STDOUT, \"/\" . $home_dir . \"/\" . $last_str);\n } else if (empty($home_dir)) {\n fwrite(STDOUT, \"/\" . $last_str);\n } else {\n fwrite(STDOUT, $home_dir . $last_str);\n }\n } else if (substr($str, 0, 2) == \"cd\") {\n $cmd = trim(substr($str, 2));\n $cmd = explode('/', $cmd);\n $home_dir = explode('/', $home_dir);\n for ($j = 0; $j < count($cmd); $j++) {\n if ($j == 0 && empty($cmd[$j])) {\n $home_dir = array();\n } else if ($cmd[$j] == '..') {\n if (count($home_dir) > 1) {\n unset($home_dir[count($home_dir) - 1]);\n } else {\n $home_dir = array();\n }\n } else {\n if (count($home_dir) == 2 && empty($home_dir[0]) && empty($home_dir[1])) {\n $home_dir = array();\n $home_dir[] = $cmd[$j];\n } else {\n $home_dir[] = $cmd[$j];\n }\n }\n }\n $home_dir = implode('/', $home_dir);\n $home_dir = $home_dir;\n } else {\n fwrite(STDERR, 'invalid command');\n }\n}\n\n?>\n"}, {"source_code": "= 1 && $number <= 50) {\n for ($i = 1; $i <= $number; $i++) {\n $commands[] = trim(fgets(STDIN));\n }\n foreach ($commands as $val) {\n parse_command($val);\n fwrite(STDOUT, $val);\n }\n} else {\n fwrite(STDERR, 'invalid commands count');\n}\n\nfunction parse_command(&$str) {\n global $home_dir;\n if ($str == \"pwd\") {\n if ($home_dir != '/' && !empty($home_dir)) {\n $str = \"/\" . $home_dir . \"/\\n\";\n } else if (empty($home_dir)) {\n $str = \"/\\n\";\n } else {\n $str = $home_dir . \"\\n\";\n }\n } else if (substr($str, 0, 2) == \"cd\") {\n $cmd = trim(substr($str, 2));\n $cmd = explode('/', $cmd);\n $home_dir = explode('/', $home_dir);\n for ($j = 0; $j < count($cmd); $j++) {\n if ($j == 0 && empty($cmd[$j])) {\n $home_dir = array();\n } else if ($cmd[$j] == '..') {\n if (count($home_dir) > 1) {\n unset($home_dir[count($home_dir) - 1]);\n } else {\n $home_dir = array();\n }\n } else {\n $home_dir[] = $cmd[$j];\n }\n }\n $str = '';\n $home_dir = implode('/', $home_dir);\n $home_dir = $home_dir;\n }\n}\n\n?>\n"}, {"source_code": "= 1 && $number <= 50) {\n for ($i = 1; $i <= $number; $i++) {\n $commands[] = trim(fgets(STDIN));\n }\n for ($j = 0; $j < count($commands); $j++) {\n if ($j != (count($commands) - 1)) {\n parse_command($commands[$j]);\n fwrite(STDOUT, $commands[$j]);\n } else {\n parse_command($commands[$j], true);\n fwrite(STDOUT, $commands[$j]);\n }\n }\n} else {\n fwrite(STDERR, 'invalid commands count');\n}\n\nfunction parse_command(&$str, $last = false) {\n global $home_dir;\n if ($str == \"pwd\") {\n if ($last == false) {\n $last_str = \"\\n\";\n } else {\n $last_str = \"\";\n }\n if ($home_dir != '/' && !empty($home_dir)) {\n $str = \"/\" . $home_dir . \"/\" . $last_str;\n } else if (empty($home_dir)) {\n $str = \"/\" . $last_str;\n } else {\n $str = $home_dir . $last_str;\n }\n } else if (substr($str, 0, 2) == \"cd\") {\n $cmd = trim(substr($str, 2));\n $cmd = explode('/', $cmd);\n $home_dir = explode('/', $home_dir);\n for ($j = 0; $j < count($cmd); $j++) {\n if ($j == 0 && empty($cmd[$j])) {\n $home_dir = array();\n } else if ($cmd[$j] == '..') {\n if (count($home_dir) > 1) {\n unset($home_dir[count($home_dir) - 1]);\n } else {\n $home_dir = array();\n }\n } else {\n $home_dir[] = $cmd[$j];\n }\n }\n $str = '';\n $home_dir = implode('/', $home_dir);\n $home_dir = $home_dir;\n }\n}\n\n?>\n"}, {"source_code": "= 1 && $number <= 50) {\n for ($i = 1; $i <= $number; $i++) {\n $commands[] = trim(fgets(STDIN));\n }\n for ($j = 0; $j < count($commands); $j++) {\n if ($j != (count($commands) - 1)) {\n parse_command($commands[$j]);\n fwrite(STDOUT, $commands[$j]);\n } else {\n parse_command($commands[$j], true);\n fwrite(STDOUT, $commands[$j]);\n }\n }\n} else {\n fwrite(STDERR, 'invalid commands count');\n}\n\nfunction parse_command(&$str, $last = false) {\n global $home_dir;\n if ($str == \"pwd\") {\n if ($last == false) {\n $last_str = \"\\n\";\n } else {\n $last_str = \"\";\n }\n if ($home_dir != '/' && !empty($home_dir)) {\n $str = \"/\" . $home_dir . \"/\" . $last_str;\n } else if (empty($home_dir)) {\n $str = \"/\" . $last_str;\n } else {\n $str = $home_dir . $last_str;\n }\n } else if (substr($str, 0, 2) == \"cd\") {\n $cmd = trim(substr($str, 2));\n $cmd = explode('/', $cmd);\n $home_dir = explode('/', $home_dir);\n for ($j = 0; $j < count($cmd); $j++) {\n if ($j == 0 && empty($cmd[$j])) {\n $home_dir = array();\n } else if ($cmd[$j] == '..') {\n if (count($home_dir) > 1) {\n unset($home_dir[count($home_dir) - 1]);\n } else {\n $home_dir = array();\n }\n } else {\n if (count($home_dir)==2 && empty($home_dir[0])&&empty($home_dir[1])){\n $home_dir = array();\n $home_dir[] = $cmd[$j];\n } else {\n $home_dir[] = $cmd[$j];\n }\n }\n }\n $str = '';\n $home_dir = implode('/', $home_dir);\n $home_dir = $home_dir;\n }\n}\n\n?>\n"}, {"source_code": "= 1 && $number <= 50) {\n for ($i = 1; $i <= $number; $i++) {\n $commands[] = trim(fgets(STDIN));\n }\n for ($j = 0; $j < count($commands); $j++) {\n if ($j != (count($commands) - 1)) {\n parse_command($commands[$j]);\n } else {\n parse_command($commands[$j], true);\n }\n }\n} else {\n fwrite(STDERR, 'invalid commands count');\n}\n\nfunction parse_command($str, $last = false) {\n global $home_dir;\n if ($str == \"pwd\") {\n if ($last == false) {\n $last_str = \"\\n\";\n } else {\n $last_str = \"\";\n }\n if ($home_dir != '/' && !empty($home_dir)) {\n fwrite(STDOUT, \"/\" . $home_dir . \"/\" . $last_str);\n } else if (empty($home_dir)) {\n fwrite(STDOUT, \"/\" . $last_str);\n } else {\n fwrite(STDOUT, $home_dir . $last_str);\n }\n } else if (substr($str, 0, 2) == \"cd\") {\n $cmd = trim(substr($str, 2));\n $cmd = explode('/', $cmd);\n $home_dir = explode('/', $home_dir);\n for ($j = 0; $j < count($cmd); $j++) {\n if ($j == 0 && empty($cmd[$j])) {\n $home_dir = array();\n } else if ($cmd[$j] == '..') {\n if (count($home_dir) > 1) {\n unset($home_dir[count($home_dir) - 1]);\n } else {\n $home_dir = array();\n }\n } else if(preg_match('/^[a-z]$/i', $cmd[$j])) {\n if (count($home_dir) == 2 && empty($home_dir[0]) && empty($home_dir[1])) {\n $home_dir = array();\n $home_dir[] = $cmd[$j];\n } else {\n $home_dir[] = $cmd[$j];\n }\n }\n }\n $home_dir = implode('/', $home_dir);\n $home_dir = $home_dir;\n } else {\n fwrite(STDERR, 'invalid command');\n }\n}\n\n?>\n"}, {"source_code": "= 1 && $number <= 50) {\n for ($i = 1; $i <= $number; $i++) {\n $commands[] = trim(fgets(STDIN));\n }\n for ($j = 0; $j < count($commands); $j++) {\n if ($j != (count($commands) - 1)) {\n parse_command($commands[$j]);\n } else {\n parse_command($commands[$j], true);\n }\n }\n} else {\n fwrite(STDERR, 'invalid commands count');\n}\n\nfunction parse_command($str, $last = false) {\n global $home_dir;\n if ($str == \"pwd\") {\n if ($last == false) {\n $last_str = \"\\n\";\n } else {\n $last_str = \"\";\n }\n if ($home_dir != '/' && !empty($home_dir)) {\n fwrite(STDOUT, \"/\" . $home_dir . \"/\" . $last_str);\n } else if (empty($home_dir)) {\n fwrite(STDOUT, \"/\" . $last_str);\n } else {\n fwrite(STDOUT, $home_dir . $last_str);\n }\n } else if (substr($str, 0, 2) == \"cd\") {\n $cmd = trim(substr($str, 2));\n $cmd = explode('/', $cmd);\n $home_dir = explode('/', $home_dir);\n for ($j = 0; $j < count($cmd); $j++) {\n if ($j == 0 && empty($cmd[$j])) {\n $home_dir = array();\n } else if ($cmd[$j] == '..') {\n if (count($home_dir) > 1) {\n unset($home_dir[count($home_dir) - 1]);\n } else {\n $home_dir = array();\n }\n } else {\n if (count($home_dir) == 2 && empty($home_dir[0]) && empty($home_dir[1])) {\n $home_dir = array();\n $home_dir[] = $cmd[$j];\n } else {\n $home_dir[] = $cmd[$j];\n }\n }\n }\n $home_dir = implode('/', $home_dir);\n $home_dir = $home_dir;\n } else {\n fwrite(STDERR, 'invalid command');\n }\n}\n\n?>\n"}, {"source_code": ""}, {"source_code": " 1) {\n if($directory[0] !== '/') $directory = '/'.$directory;\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n if($directory[strlen($directory)-2] == '/') $directory[strlen($directory)-1] = '';\n }\n\n while (substr_count($directory, '//')) {\n $directory = str_replace('//', '/', $directory);\n }\n}\n\n$text = explode(\"\\r\\n\", $text);\nforeach($text as $val) {\n $val = trim($val);\n if(substr($val, 0, 3) == 'pwd') {\n refresh();\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n echo trim(str_replace('//', '/', $directory)).\"/\\r\\n\";\n continue;\n }\n\n if(substr($val, 0, 2) == 'cd') {\n\n $path = str_replace('cd ', '', $val);\n if($path == '..') {\n $d = explode(\"/\", $directory);\n unset($d[count($d)-1]);\n $directory = implode(\"/\", $d);\n } else {\n if(substr($path, 0, 1) == '/') {\n $directory = $path;\n } else {\n $directory .= '/'.$path;\n }\n\n refresh();\n }\n }\n}"}, {"source_code": " $value) {\n $d[$key] = trim($d[$key]);\n if($value == '..') { \n unset($d[$key]);\n unset($d[$key-1]);\n if(substr_count($directory, '../..'))\n $d = array_values($d);\n }\n\n \n }\n $directory = implode(\"/\", $d);\n\n if(strlen($directory) > 1) {\n if($directory[0] !== '/') $directory = '/'.$directory;\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n }\n\n while (substr_count($directory, '//')) {\n $directory = str_replace('//', '/', $directory);\n }\n}\n\n$text = explode(\"\\r\\n\", $text);\nforeach($text as $val) {\n $val = trim($val);\n if(substr($val, 0, 3) == 'pwd') {\n refresh();\n \n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n echo trim($directory).\"/\\r\\n\";\n continue;\n }\n\n if(substr($val, 0, 2) == 'cd') {\n\n $path = str_replace('cd ', '', $val);\n if($path == '..') {\n $d = explode(\"/\", $directory);\n unset($d[count($d)-1]);\n $directory = implode(\"/\", $d);\n } else {\n if(substr($path, 0, 1) == '/') {\n $directory = $path;\n } else {\n $directory .= '/'.$path;\n }\n\n refresh();\n }\n }\n}"}, {"source_code": " 1) {\n if($directory[0] !== '/') $directory = '/'.$directory;\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n if($directory[strlen($directory)-2] == '/') $directory[strlen($directory)-1] = '';\n }\n\n while (substr_count($directory, '//')) {\n $directory = str_replace('//', '/', $directory);\n }\n}\n\n$text = explode(\"\\r\\n\", $text);\nforeach($text as $val) {\n $val = trim($val);\n if(substr($val, 0, 3) == 'pwd') {\n refresh();\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n echo trim(str_replace('//', '/', $directory)).\"/\\r\\n\";\n continue;\n }\n\n if(substr($val, 0, 2) == 'cd') {\n\n $path = str_replace('cd ', '', $val);\n if($path == '..') {\n $d = explode(\"/\", $directory);\n unset($d[count($d)-1]);\n $directory = implode(\"/\", $d);\n } else {\n if(substr($path, 0, 1) == '/') {\n $directory = $path;\n } else {\n $directory .= '/'.$path;\n }\n\n refresh();\n }\n }\n}"}, {"source_code": " 1) {\n if($directory[0] !== '/') $directory = '/'.$directory;\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n }\n\n while (substr_count($directory, '//')) {\n $directory = str_replace('//', '/', $directory);\n }\n}\n\n$text = explode(\"\\r\\n\", $text);\nforeach($text as $val) {\n $val = trim($val);\n if(substr($val, 0, 3) == 'pwd') {\n refresh();\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n echo trim(str_replace('//', '/', $directory)).\"/\\r\\n\";\n continue;\n }\n\n if(substr($val, 0, 2) == 'cd') {\n\n $path = str_replace('cd ', '', $val);\n if($path == '..') {\n $d = explode(\"/\", $directory);\n unset($d[count($d)-1]);\n $directory = implode(\"/\", $d);\n } else {\n if(substr($path, 0, 1) == '/') {\n $directory = $path;\n } else {\n $directory .= '/'.$path;\n }\n\n refresh();\n }\n }\n}"}, {"source_code": " 1) {\n if($directory[0] !== '/') $directory = '/'.$directory;\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n }\n\n while (substr_count($directory, '//')) {\n $directory = str_replace('//', '/', $directory);\n }\n}\n\n$text = explode(\"\\r\\n\", $text);\nforeach($text as $val) {\n $val = trim($val);\n if(substr($val, 0, 3) == 'pwd') {\n refresh();\n if($directory[strlen($directory)-1] == '/') $directory[strlen($directory)-1] = '';\n echo trim(str_replace('//', '/', $directory)).\"/\\r\\n\";\n continue;\n }\n\n if(substr($val, 0, 2) == 'cd') {\n\n $path = str_replace('cd ', '', $val);\n if($path == '..') {\n $d = explode(\"/\", $directory);\n unset($d[count($d)-1]);\n $directory = implode(\"/\", $d);\n } else {\n if(substr($path, 0, 1) == '/') {\n $directory = $path;\n } else {\n $directory .= '/'.$path;\n }\n\n refresh();\n }\n }\n}"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "0) {\n array_push($absolutePathArray, $step);\n }\n }\n }\n "}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n if ($catalog !== '') {\n $dir = explode('/', $catalog); \n $count = count($dir); \n } else {\n $dir = Array();\n $count = 0;\n }\n \n $commands = explode('/', $command[1]);\n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[$count - 1]);\n $count = $count - 1;\n } else {\n $dir[$count] = $cmd;\n $count++;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if ($command[1][0] == '/') {\n $catalog = $command[1];\n } else {\n if ($catalog == '') {\n $catalog = '/';\n }\n $catalog .= '/'.$command[1];\n }\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/
';\n } else {\n echo $catalog.'
';\n }\n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $count = count($dir); \n $commands = explode('/', $command[1]);\n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[$count - 1]);\n $count = $count - 1;\n } else {\n $dir[$count] = $cmd;\n $count++;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if ($command[1][0] == '/') {\n $catalog = $command[1];\n } else {\n if ($catalog == '') {\n $catalog = '/';\n }\n $catalog .= $command[1];\n }\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $commands = explode('/', $command[1]); \n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[count($dir)-1]);\n } else {\n $dir[count($dir)] = $cmd;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if ($command[1][0] !== '/') {\n $catalog .= '/';\n $catalog .= $command[1];\n } else {\n $catalog = $command[1];\n } \n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $count = count($dir); \n $commands = explode('/', $command[1]);\n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[$count - 1]);\n $count = $count - 1;\n } else {\n $dir[$count] = $cmd;\n $count++;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n \n $catalog .= $command[1];\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n if ($catalog !== '') {\n $dir = explode('/', $catalog); \n $count = count($dir); \n } else {\n $dir = Array();\n $count = 0;\n }\n \n $commands = explode('/', $command[1]);\n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[$count - 1]);\n $count = $count - 1;\n } else {\n $dir[$count] = $cmd;\n $count++;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if ($command[1][0] == '/') {\n $catalog = $command[1];\n } else {\n if ($catalog == '') {\n $catalog = '/';\n }\n $catalog .= '/'.$command[1];\n }\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n }\n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $commands = explode('/', $command[1]);\n $j = 1;\n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[count($dir)-1]);\n } else {\n $dir[count($dir)+$j] = $cmd;\n $j++;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n \n $catalog .= $command[1];\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n if ($catalog !== '') {\n $dir = explode('/', $catalog); \n $count = count($dir); \n } else {\n $dir = Array();\n $count = 0;\n }\n \n $commands = explode('/', $command[1]);\n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[$count - 1]);\n $count = $count - 1;\n } else {\n $dir[$count] = $cmd;\n $count++;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if ($command[1][0] == '/') {\n $catalog = $command[1];\n } else {\n if ($catalog == '') {\n $catalog = '/';\n $catalog .= $command[1];\n } else {\n $catalog .= '/'.$command[1];\n }\n }\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n }\n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $commands = explode('/', $command[1]); \n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[count($dir)-1]);\n } else {\n $dir[count($dir)] = $cmd;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if (substr($catalog, - 1) != '/') {\n $catalog .= '/';\n }\n $catalog .= $command[1];\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $commands = explode('/', $command[1]); \n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[count($dir)-1]);\n } else {\n $dir[count($dir)] = $cmd;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n \n $catalog .= $command[1];\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $commands = explode('/', $command[1]); \n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[count($dir)-1]);\n } else {\n $dir[count($dir)] = $cmd;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if ($command[1][0] !== '/') {\n $catalog .= '/';\n }\n $catalog .= $command[1];\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": "$value) { \n if ($value[0] == 'c') {\n $command = explode(' ', $value); \n if ($command[1][0] == '/') {\n $catalog = $command[1];\n } else { \n if (strpos($command[1], '..') !== false) { \n $dir = explode('/', $catalog); \n $commands = explode('/', $command[1]); \n foreach ($commands as $cmd) {\n if ($cmd == '..') {\n unset($dir[count($dir)-1]);\n } else {\n $dir[count($dir)] = $cmd;\n }\n }\n $catalog = '';\n foreach ($dir as $d) {\n if (strlen($d) !== 0) {\n $catalog .= '/'.$d;\n }\n }\n } else {\n if (substr($catalog, - 1) != '/') {\n $catalog .= '/';\n }\n $catalog .= $command[1];\n }\n }\n }\n else if ($value[0] == 'p') {\n if (substr($catalog, -1) !== '/') {\n echo $catalog.'/'.PHP_EOL;\n } else {\n echo $catalog.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n echo '/'.implode('/', $curr).\"/\\n\";\n else \n echo '/';\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0)\n echo '/'.implode('/', $curr).\"/\\n\";\n else \n echo \"/\\n\";\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": "\";\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0) {\n echo \"/\".implode(\"/\", $curr).\"/\";\n } else {\n echo \"/\";\n }\n echo \"\\n\";\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0)\n echo \"/\".implode(\"/\", $curr).\"/\\r\\n\";\n else \n echo \"/\\r\\n\";\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0) {\n echo \"/\".implode(\"/\", $curr).\"/\";\n } else {\n echo \"/\";\n }\n echo \"\\n\";\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0) {\n echo \"/\".implode(\"/\", $curr).\"/\";\n } else {\n echo \"/\";\n }\n echo \"\\n\";\n } else if($action == \"cd\"){\n $exp_path = explode(\"/\", $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == \"\"){\n $curr = array();\n } else {\n if($value == \"..\"){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0)\n print(\"/\".implode(\"/\", $curr).\"/\\n\");\n else \n print \"/\\n\";\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0) {\n echo \"/\".implode(\"/\", $curr).\"/\";\n } else {\n echo \"/\";\n }\n echo \"\\n\";\n } else if($action == \"cd\"){\n $exp_path = explode(\"/\", $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == \"\"){\n $curr = array();\n } else {\n if($value == \"..\"){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " 0) {\n echo \"/\".implode(\"/\", $curr).\"/\";\n } else {\n echo \"/\";\n }\n echo \"\\n\";\n } else if($action == 'cd'){\n $exp_path = explode('/', $exp[1]);\n foreach($exp_path AS $key => $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": " $value){\n if($key == 0 && $value == ''){\n $curr = array();\n } else {\n if($value == '..'){\n array_pop($curr);\n } else {\n $curr[] = $value;\n }\n }\n }\n }\n}"}, {"source_code": "waitCommand();\n}\n\n$aStack = $oPath->getStack();\n\nforeach ($aStack as $sPath) {\n\techo $sPath . PHP_EOL;\n}\n\nclass Path {\n\tconst CD = 'cd';\n\tconst PWD = 'pwd';\n\t\n\tprivate $aCurrentPath = array();\n\tprivate $aStack = array();\n\t\n\tpublic function __construct($iCommandsCount) {\n\t\t$this->iCommandsCount = $iCommandsCount;\n\t\t$this->setRootPath();\n\t}\n\t\n\tpublic function waitCommand() {\n\t\t$sCommand = $this->getCommand();\n\n\t\tif ($sCommand == self::PWD) {\n\t\t\t$this->addPathToStack();\n\t\t} else {\n\t\t\t$sPath = $this->getPath($sCommand);\n\t\t\t$this->setCurrentPath($sPath);\n\t\t}\n\t}\n\t\n\tpublic function getStack() {\n\t\treturn $this->aStack;\n\t}\n\t\n\tprivate function addPathToStack() {\n\t\t$this->aStack[] = empty($this->aCurrentPath) ? '/' : '/' . implode('/', $this->aCurrentPath) . '/';\n\t}\n\t\n\tprivate function getPath($sCommand) {\n\t\t$aCommand = explode(' ', $sCommand, 2);\n\t\t\n\t\tif (count($aCommand) != 2) {\n\t\t\tdie;\n\t\t}\n\t\t\n\t\treturn $aCommand[1];\n\t}\n\t\n\tprivate function setCurrentPath($sPath) {\n\t\t$aPath = explode('/', $sPath);\n\t\t\n\t\tif (empty($aPath[0])) {\n\t\t\t$this->setRootPath();\n\t\t}\n\t\t\n\t\tforeach ($aPath as $sDir) {\n\t\t\tif ($sDir == '..') {\n\t\t\t\tarray_pop($this->aCurrentPath);\n\t\t\t}\n\t\t\telseif (empty($sDir)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$this->aCurrentPath[] = $sDir;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\tprivate function setRootPath() {\n\t\t$this->aCurrentPath = array();\n\t}\n\t\n\tprivate function getCommand() {\n\t\t$sCommand = fgets(STDIN);\n\t\t$sCommand = str_replace(\"\\n\", '', $sCommand);\n\t\treturn $sCommand;\n\t}\n}"}, {"source_code": "waitCommand();\n}\n\n$aStack = $oPath->getStack();\n\nforeach ($aStack as $sPath) {\n\tif (isset($bFlag)) {\n\t\techo PHP_EOL;\n\t} else {\n\t\t$bFlag = true;\n\t}\n\techo $sPath;\n}\n\nclass Path {\n\tconst CD = 'cd';\n\tconst PWD = 'pwd';\n\t\n\tprivate $aCurrentPath = array();\n\tprivate $aStack = array();\n\t\n\tpublic function __construct($iCommandsCount) {\n\t\t$this->iCommandsCount = $iCommandsCount;\n\t\t$this->setRootPath();\n\t}\n\t\n\tpublic function waitCommand() {\n\t\t$sCommand = $this->getCommand();\n\n\t\tif ($sCommand == self::PWD) {\n\t\t\t$this->addPathToStack();\n\t\t} else {\n\t\t\t$sPath = $this->getPath($sCommand);\n\t\t\t$this->setCurrentPath($sPath);\n\t\t}\n\t}\n\t\n\tpublic function getStack() {\n\t\treturn $this->aStack;\n\t}\n\t\n\tprivate function addPathToStack() {\n\t\t$this->aStack[] = empty($this->aCurrentPath) ? '/' : '/' . implode('/', $this->aCurrentPath) . '/';\n\t}\n\t\n\tprivate function getPath($sCommand) {\n\t\t$aCommand = explode(' ', $sCommand, 2);\n\t\t\n\t\tif (count($aCommand) != 2) {\n\t\t\tdie;\n\t\t}\n\t\t\n\t\treturn $aCommand[1];\n\t}\n\t\n\tprivate function setCurrentPath($sPath) {\n\t\t$aPath = explode('/', $sPath);\n\t\t\n\t\tif (empty($aPath[0])) {\n\t\t\t$this->setRootPath();\n\t\t}\n\t\t\n\t\tforeach ($aPath as $sDir) {\n\t\t\tif ($sDir == '..') {\n\t\t\t\tarray_pop($this->aCurrentPath);\n\t\t\t}\n\t\t\telseif (empty($sDir)) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$this->aCurrentPath[] = $sDir;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\tprivate function setRootPath() {\n\t\t$this->aCurrentPath = array();\n\t}\n\t\n\tprivate function getCommand() {\n\t\t$sCommand = fgets(STDIN);\n\t\t$sCommand = str_replace(\"\\n\", '', $sCommand);\n\t\treturn $sCommand;\n\t}\n}"}, {"source_code": "processCommand();\n}\n\n$oPath->showStack();\n\nclass Path {\n const CD = 'cd';\n const PWD = 'pwd';\n \n private $aCurrentPath = array();\n private $aStack = array();\n \n public function __construct($iCommandsCount) {\n $this->iCommandsCount = $iCommandsCount;\n $this->setRootPath();\n }\n \n public function processCommand() {\n $sCommand = $this->getCommand();\n echo $sCommand . '==' . self::PWD;\n if ($sCommand == self::PWD) {\n $this->addPathToStack();\n } else {\n $sPath = $this->getPath($sCommand);\n $this->setCurrentPath($sPath);\n }\n }\n \n public function showStack() {\n echo implode(\"\\n\", $this->aStack);\n }\n \n private function addPathToStack() {\n $sResult = empty($this->aCurrentPath) ? '/' : '/' . implode('/', $this->aCurrentPath) . '/';\n \n $this->aStack[] = $sResult;\n }\n \n private function getPath($sCommand) {\n $aCommand = explode(' ', $sCommand, 2);\n \n if (count($aCommand) != 2) {\n die;\n }\n \n return $aCommand[1];\n }\n \n private function setCurrentPath($sPath) {\n $aPath = explode('/', $sPath);\n \n if (empty($aPath[0])) {\n $this->setRootPath();\n }\n \n foreach ($aPath as $sDir) {\n if ($sDir == '..') {\n array_pop($this->aCurrentPath);\n }\n elseif (empty($sDir)) {\n continue;\n } else {\n $this->aCurrentPath[] = $sDir;\n }\n }\n \n }\n \n private function setRootPath() {\n $this->aCurrentPath = array();\n }\n \n private function getCommand() {\n $sCommand = fgets(STDIN);\n $sCommand = str_replace(\"\\n\", '', $sCommand);\n $sCommand = trim($sCommand);\n return $sCommand;\n }\n}"}, {"source_code": "\";\n }\n }"}, {"source_code": "\";\n }\n }"}, {"source_code": " 0 )\n {\n array_pop( $path );\n }\n }\n else\n {\n $path[] = $parts[ $i ];\n }\n }\n return '/'. implode( '/', $path ) . '/';\n}\n\nfile_put_contents( 'php://stdout', implode( \"\\n\", $result ) );"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": " 0) {\n array_pop($path);\n }\n } else {\n $path[] = $folder;\n }\n }\n\n}\n\nfunction print_path($path) {\n if (!empty($path)) {\n $path = implode(\"/\",$path).\"/\";\n } else {\n $path = \"\";\n }\n fputs(STDOUT, \"/\". $path.\"\\r\\n\");\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "494ac937ba939db1dbc4081e518ab54c"} {"source_code": "", "positive_code": [{"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $s = IO::str();\r\n $a = str_split($s);\r\n $res = [-1, -1];\r\n foreach ($a as $k => $v) {\r\n if (isset($a[$k+1])) {\r\n if ($v != $a[$k+1]) {\r\n $res = [$k+1, $k+2];\r\n break;\r\n }\r\n }\r\n }\r\n IO::line(implode(' ', $res));\r\n\r\n\r\n}\r\n\r\n\r\n?>\r\n\r\n\r\n\r\n\r\n"}], "negative_code": [{"source_code": ""}], "src_uid": "127d7f23a0ac8fcecccd687565d6f35a"} {"source_code": "$max)||($maxnick==\"\")){\n $max = $r;\n $maxnick = $nick; \n }\n}\necho $maxnick;\n?>", "positive_code": [{"source_code": ""}, {"source_code": "\n$n=trim(fgets(STDIN));\nfor($i=0;$i<$n;$i++)\n $arr[]=explode(' ',trim(fgets(STDIN)));\n\n//print_r($arr);\nforeach($arr as $val){\n $sum[]=array($val[0],$val[1]*100-$val[2]*50+$val[3]+$val[4]+$val[5]+$val[6]+$val[7]);\n}\nfunction cmp($a,$b){\n return $a[1]<$b[1];\n}\n//print_r($sum);\nusort($sum,'cmp');\n//print_r($sum);\necho $sum[0][0];\n?>"}], "negative_code": [{"source_code": "$max){\n $max = $r;\n $maxnick = $nick; \n }\n}\necho $maxnick;\n?>"}], "src_uid": "b9dacff0cab78595296d697d22dce5d9"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "345e76bf67ae4342e850ab248211eb0b"} {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>", "positive_code": [{"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n\r\n?>"}, {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " '9',\r\n '1' => '2',\r\n '2' => '3',\r\n '3' => '4',\r\n '4' => '5',\r\n '5' => '6',\r\n '6' => '7',\r\n '7' => '8',\r\n '8' => '9',\r\n '9' => '8',\r\n ];\r\n if($pN == 0) {\r\n $sDP = '';\r\n $sRev = strrev($s);\r\n for($i=0; $imax($sa)) {\r\n $nCount = $n;\r\n } else {\r\n $nCount = $n +1;\r\n }\r\n $sPolindrom = '';\r\n for($i=0; $i<$nCount; $i++) {\r\n $sPolindrom .= $pN;\r\n }\r\n $ans = bcsub($sPolindrom, $s);\r\n }\r\n \r\n \r\n IO::pr($ans);\r\n \r\n}\r\n\r\n\r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " '9',\r\n '1' => '9',\r\n '2' => '7',\r\n '3' => '6',\r\n '4' => '5',\r\n '5' => '4',\r\n '6' => '3',\r\n '7' => '2',\r\n '8' => '1',\r\n '9' => '0',\r\n ];\r\n if($pN == 0) {\r\n $sDP = '';\r\n $sRev = strrev($s);\r\n for($i=0; $i max($sa)) {\r\n $nCount = $n;\r\n } else {\r\n $nCount = $n +1;\r\n }\r\n $sPolindrom = '';\r\n for($i=0; $i<$nCount; $i++) {\r\n $sPolindrom .= $pN;\r\n }\r\n $ans = bcsub($sPolindrom, $s);\r\n }\r\n \r\n \r\n IO::pr($ans);\r\n \r\n}\r\n\r\n\r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " max($sa)) {\r\n $nCount = $n; \r\n } else {\r\n $nCount = $n +1; \r\n }\r\n $sPolindrom = '';\r\n for($i=0; $i<$nCount; $i++) {\r\n $sPolindrom .= $pN; \r\n }\r\n $ans = bcsub($sPolindrom, $s); \r\n }\r\n \r\n \r\n IO::pr($ans);\r\n \r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " max($sa)) {\r\n $nCount = $n; \r\n } else {\r\n $nCount = $n +1; \r\n }\r\n $sPolindrom = '';\r\n for($i=0; $i<$nCount; $i++) {\r\n $sPolindrom .= $pN; \r\n }\r\n $ans = bcsub($sPolindrom, $s);\r\n \r\n IO::pr($ans);\r\n \r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " 0; $i--) {\r\n if(!isset($ss[$i])) {\r\n $pN = $i;\r\n if($i < 9) {\r\n $nCount += 1; \r\n }\r\n break;\r\n }\r\n }\r\n $sPolindrom = '';\r\n for($i=0; $i<$nCount; $i++) {\r\n $sPolindrom .= $pN; \r\n }\r\n $ans = bcsub($sPolindrom, $s);\r\n \r\n IO::pr($ans);\r\n \r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " $line) {\n$line=trim($line);\n if($line_num==0){$k[$line]=1;}else{\n$p=explode(' ', $line);\n$p1=$p[0];\n$p2=$p[1];\n\n$j=$k[$p1];\n$k[$p1]=$k[$p2];\n$k[$p2]=$j;\n\n\n}\n\n\n}\nif($k[1]==1){$t=1;}if($k[2]==1){$t=2;}if($k[3]==1){$t=3;}\n\n$handle = fopen('output.txt', 'a');\nfwrite($handle, $t);\nfclose($handle);\n?>\n"}], "negative_code": [], "src_uid": "88e6651e1b0481d711e89c8071be1edf"} {"source_code": " '.$p%$i.PHP_EOL;\r\n if(isset($arr[$p%$i])){\r\n $a = $arr[$p%$i];\r\n $b = $i;\r\n break;\r\n }\r\n else $arr[$p%$i] = $i;\r\n\r\n }\r\n echo \"$a $b\".PHP_EOL;\r\n\r\n}\r\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "259e39c9e63e43678e596c0d8c66937c"} {"source_code": ""}], "negative_code": [{"source_code": "\r\n "}, {"source_code": "fscanf(STDIN, \"%d\", $t);\r\nwhile ($t--) {\r\n fscanf(STDIN, \"%d %d\", $c, $d);\r\n if (0 == $c && 0 == $d) {\r\n echo 0;\r\n } elseif ($c == $d) {\r\n echo 1;\r\n } elseif ((abs($c) + abs($d)) & 1) {\r\n echo -1;\r\n } else {\r\n echo 2;\r\n }\r\n echo \"\\n\";\r\n}"}], "src_uid": "8e7c0b703155dd9b90cda706d22525c9"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c704c5fb9e054fab1caeab534849901d"} {"source_code": "", "positive_code": [{"source_code": " 0; $t--) {\r\n\r\n\t$a = explode(' ', fgets(STDIN));\r\n\r\n\techo $solve(intval($a[0]), intval($a[1]));\r\n\techo \"\\n\";\r\n\r\n}\r\n"}], "negative_code": [], "src_uid": "2b6e670b602a89b467975edf5226219a"} {"source_code": " $order[$v])\n\t\t\tprintf(\"%d %d\\n\", $i + 1, $v + 1);\n?>\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "f1ac6da78aed11d9118a85182c5644de"} {"source_code": " $c)\n {\n $b[$x] = $c;\n $c++;\n }\n elseif($b[$x] == $c)\n {\n $c++;\n }\n}\nprint $c;\n?>", "positive_code": [{"source_code": "1)\n $a[0] = 1;\n\nfor($i = 1; $i < $n; $i++){\n if($a[$i] - $a[$i-1]>1)\n $a[$i] = $a[$i-1]+1;\n \n $ans = max($ans,$a[$i]);\n \n}\n\necho ++$ans;\n\n?>"}, {"source_code": "1)\n $a[0] = 1;\n\nfor($i = 1; $i < count($a); $i++){\n if($a[$i] - $a[$i-1]>1)\n $a[$i] = $a[$i-1]+1;\n \n $ans = max($ans,$a[$i]);\n \n}\n\necho ++$ans;\n\n?>"}, {"source_code": "= 1; $x--)\n{\n if($c[$x] == FALSE)\n {\n $e = 1;\n break;\n }\n}\nif($e == 0)\n{\n print max($b) + 1;\n}\nelse\n{\n print $x;\n}\n?>"}, {"source_code": "1)\n $a[0] = 1;\n\nfor($i = 1; $i < $n; $i++){\n if($a[$i] - $a[$i-1]>1)\n $a[$i] = $a[$i-1]+1;\n \n $ans = max($ans,$a[$i]);\n \n}\n\necho ++$ans;\n\n?>"}], "src_uid": "482b3ebbbadd583301f047181c988114"} {"source_code": " $b)\n {\n $g = 1;\n $c[$d] += floor($b / $e);\n break;\n }\n }\n $e++;\n}\nif($g == 0)\n{\n print $c[$d] + floor($b / $e);\n}\nelse\n{\n print $c[$d];\n}\n?>", "positive_code": [{"source_code": "= ($i - $mid) * (intval($a[$i]) - intval($a[$i-1]))){\n\t\t\t$k = $k - ($i - $mid) * (intval($a[$i]) - intval($a[$i-1]));\n\t\t\t$ans = $ans + (intval($a[$i]) - intval($a[$i-1]));\n\t\t}\n\t\telse{\n\t\t\tbreak;\n\t\t}\t\n\t}\n\tif($k > 0){\n\t\t$ans = $ans + intval($k / ($i - $mid));\n\t}\n\tprint_r(intval($ans + intval($a[$mid])).\"\\n\");\n\tfclose($cin);\n?>"}, {"source_code": "= ($i - $mid) * (intval($a[$i]) - intval($a[$i-1]))){\n\t\t\t$k = $k - ($i - $mid) * (intval($a[$i]) - intval($a[$i-1]));\n\t\t\t$ans = $ans + (intval($a[$i]) - intval($a[$i-1]));\n\t\t}\n\t\telse{\n\t\t\tbreak;\n\t\t}\t\n\t}\n\tif($k > 0){\n\t\t$ans = $ans + intval($k / ($i - $mid));\n\t}\n\tprint_r(intval($ans + intval($a[$mid])).\"\\n\");\n\tfclose($cin);\n?>"}], "negative_code": [{"source_code": " $b)\n {\n $g = 1;\n $c[$d] += floor($b / $e);\n break;\n }\n }\n else\n {\n $e++;\n }\n}\nif($g == 0)\n{\n print $c[$d] + floor($b / $e);\n}\nelse\n{\n print $c[$d];\n}\n?>"}, {"source_code": " 0)\n{\n $f += floor($b / $d);\n}\nprint $f;\n?>"}, {"source_code": "= ($i - $mid) * (intval($a[$i]) - intval($a[$i-1]))){\n\t\t\t$k = $k - ($i - $mid) * (intval($a[$i]) - intval($a[$i-1]));\n\t\t\t$ans = $ans + (intval($a[$i]) - intval($a[$i-1]));\n\t\t}\n\t\telse{\n\t\t\tbreak;\n\t\t}\t\n\t}\n\tif($k > 0){\n\t\t$ans = $ans + intval($k / ($i - $mid));\n\t}\n\t\n\tprint_r(intval($ans + intval($a[$mid])).\"\\n\");\n\tfclose($cin);\n?>"}], "src_uid": "0efd4b05b3e2e3bc80c93d37508a5197"} {"source_code": " $i) {\n\tif ($i <= $m) {\n\t\t$a[$j] = $m+1;\n\t}\n\t$m = $a[$j];\n}\n\nfor ($j = 0; $j < $n; $j++) {\n\tprint $a[$j]++.' ';\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "= 0; $x--)\n{\n if(($c[$x] == $c[$x - 1]) && ($c[$x] == $d))\n {\n $e++;\n $c[$x] += $e;\n }\n elseif($c[$x] == $c[$x - 1])\n {\n $e = 1;\n $d = $c[$x];\n $c[$x] += $e;\n } \n}\n$g = array_combine($f, $c);\nksort($g);\nprint implode(\" \", $g);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "d19c7a74d739c2ca0d568808862ba2bd"} {"source_code": " $w ? $w - $sl + 24*60 : $w - $sl;\r\n // IO::pr($min . \" \" . $temp);\r\n $min = min($min, $temp);\r\n }\r\n $h1 = floor($min / 60);\r\n $m1 = $min % 60;\r\n \r\n $ans = $h1 . \" \" . $m1;\r\n IO::pr( $ans);\r\n\r\n \r\n \r\n \r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}", "positive_code": [{"source_code": " $rd) {\r\n $turn_r = ($n - $rb) * 2;\r\n }\r\n \r\n if ($cb > $cd) {\r\n $turn_c = ($m - $cb) * 2;\r\n }\r\n \r\n $to_r = abs($rb - $rd) + $turn_r;\r\n $to_c = abs($cb - $cd) + $turn_c;\r\n \r\n print min($to_r, $to_c) . \"\\n\";\r\n}\r\n", "positive_code": [{"source_code": " $n || $robotX + $dx < 1)\r\n {\r\n $dx = -$dx;\r\n }\r\n\r\n if($robotY + $dy > $m || $robotY + $dy < 1)\r\n {\r\n $dy = -$dy;\r\n }\r\n\r\n $robotX += $dx;\r\n $robotY += $dy;\r\n\r\n $time++;\r\n }\r\n\r\n echo $time;\r\n echo PHP_EOL;\r\n}\r\n\r\n$t = + fgets($file);\r\n\r\nwhile($t--) solve();"}, {"source_code": "\r\n//$file = fopen(\"input.txt\", 'r');\r\n$file = fopen(\"php://stdin\", 'r');\r\n\r\n$lines = trim(fgets($file));\r\n\r\nfor($i = 0; $i < $lines; $i++)\r\n{\r\n \r\n list($n, $m, $y0, $x0, $y1, $x1) = explode(\" \", trim(fgets($file)));\r\n\r\n $stepX = $x1 - $x0 >= 0 ? $x1 - $x0 : $x0 - $x1 + ($m - $x0)*2;\r\n $stepY = $y1 - $y0 >= 0 ? $y1 - $y0 : $y0 - $y1 + ($n - $y0)*2;\r\n\r\n $step = min($stepX, $stepY);\r\n\r\n echo $step.\"\\n\";\r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": "\r\n//$file = fopen(\"input.txt\", 'r');\r\n$file = fopen(\"php://stdin\", 'r');\r\n\r\n$n = trim(fgets($file));\r\n\r\nfor($i = 0; $i < $n; $i++)\r\n{\r\n list($n, $m, $x0, $y0, $x1, $y1) = explode(\" \", str_replace([\"\\n\", \"\\r\", \"\\n\\r\"], \"\", fgets($file)));\r\n\r\n $x = $x0;\r\n $y = $y0;\r\n $step = 0;\r\n $Vx = 1;\r\n $Vy = 1;\r\n\r\n\r\n\r\n while(1)\r\n {\r\n if($x == $x1 || $y == $y1)\r\n {\r\n break;\r\n }\r\n\r\n $x+= $Vx;\r\n $y+= $Vy;\r\n\r\n if($y == $m || $y == 0)\r\n $Vy = -$Vy;\r\n if($x == $n || $x == 0)\r\n $Vx = -$Vx;\r\n\r\n $step++;\r\n }\r\n\r\n echo $step.\"\\n\";\r\n}\r\n\r\n?>"}, {"source_code": "\r\n//$dir = fopen(\"input.txt\", 'r');\r\n$dir = fopen(\"php://stdin\", 'r');\r\n$datatxt = stream_get_contents($dir);\r\n$lines = explode(\"\\n\", $datatxt);\r\n\r\n$t = array_shift($lines);\r\n\r\nfor($i = 0; $i < $t; $i++)\r\n{\r\n list($n, $m, $x0, $y0, $x1, $y1) = explode(\" \", $lines[$i]);\r\n\r\n $x = $x0;\r\n $y = $y0;\r\n $step = 0;\r\n $Vx = 1;\r\n $Vy = 1;\r\n\r\n while($step < 100)\r\n {\r\n if($x == $x1 || $y == $y1)\r\n {\r\n break;\r\n }\r\n\r\n $x+= $Vx;\r\n $y+= $Vy;\r\n\r\n if($y == $m || $y == 0)\r\n $Vy = -$Vy;\r\n if($x == $n || $x == 0)\r\n $Vx = -$Vx;\r\n\r\n $step++;\r\n }\r\n\r\n echo $step.\"\\n\";\r\n}\r\n\r\n?>"}], "src_uid": "6f819ce1d88d5211cd475a8673edba97"} {"source_code": " $b[$d])\n {\n $c++;\n $d++;\n }\n}\nprint $c;\n?>"}, {"source_code": "getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy);\n$values = array_values($copy);\n$finds = array();\n$count = count($values);\n\n$jump = 100;\n\n$offset = 1;\nfor($i = 0; $i < $count; $i++){\n $value = $values[$i];\n\t//$offset = 1;\n\n while($offset < $count){\n $nextValue = $values[$offset];\n $nextKey = $keys[$offset];\n\t\tif($nextValue <= $value || isset($finds[$nextKey])){\n $offset++;\n continue;\n }\n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n }\n }\n}\n\necho count($finds);"}], "negative_code": [{"source_code": "\n\n$a = trim(fgets(STDIN));\n$b = trim(fgets(STDIN));\n\n//$b = \"10 1 1 1 5 5 3\";\n$input = $b; \n$input = explode(\" \", $input);\n\n$copy = new ArrayObject($input);\n$copy = $copy->getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy); \n$values = array_values($copy);\n$finds = array();\n$count = count($values);\n\nif(count($copy) >= 100000){\n echo 'stop';\n}\n\nfor($i = 0; $i < $count; $i++){\n $value = $values[$i];\n $find = false; \n $offset = 1;\n \n while($offset+$i < $count){\n $next100Offset = 1000;\n $next100Value = $values[$i+$offset+$next100Offset]; \n if(isset($next100Value) && $next100Value <= $value){\n while($offset+$i+$next100Offset < $count){\n if($next100Value <= $value){\n $next100Offset+=1000; \n $next100Value = $values[$i+$offset+$next100Offset];\n }else{\n break;\n } \n } \n $offset+=$next100Offset; \n } \n \n $nextValue = $values[$i+$offset];\n $nextKey = $keys[$i+$offset];\n if($nextValue <= $value || isset($finds[$nextKey])){\n $offset++;\n continue;\n } \n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n } \n } \n}\necho count($finds); "}, {"source_code": "getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy); $values = array_values($copy);\n$finds = array();\n\nfor($i = 0; $i < count($values); $i++){\n $value = $values[$i];\n $find = false;\n $offset = 1;\n while($offset+$i < count($values)){\n $nextValue = $values[$i+$offset];\n $nextKey = $keys[$i+$offset];\n if(isset($finds[$nextKey])){\n $offset++;\n continue;\n } \n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n }else{\n $offset++;\n } \n } \n}\n\necho count($finds);"}, {"source_code": "\n \n$a = trim(fgets(STDIN));\n$b = trim(fgets(STDIN));\n\n//$b = \"10 1 1 1 5 5 3\";\n$input = $b; \n$input = explode(\" \", $input);\n\n$copy = new ArrayObject($input);\n$copy = $copy->getArrayCopy();\n\nif(count($input)>=10000){\n echo \"date 1 is \" . microtime(); \n}\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy); \n$values = array_values($copy);\n$finds = array();\n$count = count($values);\n\nif(count($input)>=10000){\n echo \"date 2 is \" . microtime(); \n}\n \n\n\nfor($i = 0; $i < $count; $i++){\n $value = $values[$i];\n $find = false;\n $offset = 1;\n \n while($offset+$i < $count){\n $next100Offset = 1000;\n $next100Value = $values[$i+$offset+$next100Offset]; \n if(isset($next100Value) && $next100Value <= $value){\n while($offset+$i+$next100Offset < $count){\n if($next100Value <= $value){\n $next100Offset+=1000; \n $next100Value = $values[$i+$offset+$next100Offset];\n }else{\n break;\n }\n }\n $offset+=$next100Offset; \n }\n \n $nextValue = $values[$i+$offset];\n $nextKey = $keys[$i+$offset];\n if($nextValue <= $value || isset($finds[$nextKey])){\n $offset++;\n continue;\n }\n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n } \n }\n}\n\necho count($finds);\nif(count($input)>=10000){\n echo \"date 3 is \" . microtime(); \n}"}, {"source_code": "getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy); $values = array_values($copy);\n$finds = array();\n\nfor($i = 0; $i < count($values); $i++){\n $value = $values[$i];\n $find = false;\n $offset = 1;\n while($offset+$i < count($values)){\n $nextValue = $values[$i+$offset];\n $nextKey = $keys[$i+$offset];\n if(isset($finds[$nextKey])){\n $offset++;\n continue;\n } \n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n }else{\n $offset++;\n } \n } \n}\n\necho \"result = \". count($finds);"}, {"source_code": "getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy);\n$values = array_values($copy);\n$finds = array();\n$count = count($values);\n\n$jump = 100;\nif(count($input)>=10000){\n\techo \"jump = \".$jump; \n\t\t$value = $values[500];\n\t\techo \"lai = $value
\";\n\t\t$value = $values[700];\n\t\techo \"lai2 = $value
\";\n}\n\n$offset = 1;\nfor($i = 0; $i < $count; $i++){\n $value = $values[$i];\n $find = false;\n\t//$offset = 1;\n\n while($offset+$i < $count){\n $next100Offset = $jump;\n $next100Value = $values[$i+$offset+$next100Offset];\n\t\tif(count($input)>=10000){\n\t\t\techo \"num:\".$i.\",next 100: \".$next100Value . \", current value = \".$value.\"
\"; \n\t\t}\n if(isset($next100Value) && $next100Value <= $value){\n\t\t\t if(count($input)>=10000){\n echo \"next 100 value = \" . $next100Value . \", value = \" + $value; \n }\n while($offset+$i+$next100Offset < $count){\n if($next100Value <= $value){\n $next100Offset+= $jump;\n $next100Value = $values[$i+$offset+$next100Offset];\n }else{\n break;\n }\n }\n if(count($input)>=10000){\n echo \"add more offset : \".$next100Offset; \n }\n $offset+=$next100Offset;\n }\n\n $nextValue = $values[$i+$offset];\n $nextKey = $keys[$i+$offset];\n\n\t\tif(count($input)>=10000){\n\t\t\techo \"nextValue = \".$nextValue; \n\t\t}\n\t\tif($nextValue <= $value || isset($finds[$nextKey])){\n $offset++;\n continue;\n }\n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n }\n }\n}\n\necho count($finds);"}, {"source_code": "getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy);\n$values = array_values($copy);\n$finds = array();\n$count = count($values);\n\n$jump = 100;\n\n$offset = 1;\nfor($i = 0; $i < $count; $i++){\n $value = $values[$i];\n $find = false;\n\t//$offset = 1;\n\n while($offset+$i < $count){\n $next100Offset = $jump;\n $next100Value = $values[$i+$offset+$next100Offset];\n if(isset($next100Value) && $next100Value <= $value){\n while($offset+$i+$next100Offset < $count){\n if($next100Value <= $value){\n $next100Offset+= $jump;\n $next100Value = $values[$i+$offset+$next100Offset];\n }else{\n break;\n }\n } \n $offset+=$next100Offset;\n }\n\n $nextValue = $values[$i+$offset];\n $nextKey = $keys[$i+$offset];\n\t\tif($nextValue <= $value || isset($finds[$nextKey])){\n $offset++;\n continue;\n }\n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n }\n }\n}\n\necho count($finds);"}, {"source_code": "getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$usedIndex = [];\n$keys = array_keys($copy);\n$values = array_values($copy);\n$success = 0;\n\nfor($i = 0; $i < sizeof($input); $i++){\n $current = $input[$i];\n $currentIndex = array_search($i, $keys);\n\n $offset = 1;\n $next = $values[$currentIndex +$offset];\n\t\n while(isset($next)){\n if($next == $current|| in_array($keys[$currentIndex+$offset], $usedIndex)){\n $offset++;\n $next = $values[$currentIndex+$offset];\n }else{\n //\u627e\u5230\u6bd4\u81ea\u5df1\u5927\u7684\n $nextKey = $keys[$currentIndex+$offset];\n array_push($usedIndex, $nextKey);\n\t\t\t$success++;\n\t\t\techo \"got $next\";\n break;\n }\n }\n\n if(!isset($next)){\n //\u6c92\u6709\u6bd4\u9019\u500b\u5143\u7d20\u5927\u7684\n foreach($copy as $key => $value){\n if(in_array($key, $usedIndex)){\n continue;\n }\n array_push($usedIndex, $key);\n\t\t\tbreak;\n }\n }\n}\necho \"$success\";"}, {"source_code": "getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n\necho '4'; "}, {"source_code": "\n \n$a = trim(fgets(STDIN));\n$b = trim(fgets(STDIN));\n\n//$b = \"10 1 1 1 5 5 3\";\n$input = $b; \n$input = explode(\" \", $input);\n\n$copy = new ArrayObject($input);\n$copy = $copy->getArrayCopy();\n\n\n//\u6309\u7167value\u7531\u5c0f\u5230\u5927sorting,\u4f46\u4fdd\u7559key\u7684\u4f4d\u7f6e\nasort($copy);\n$keys = array_keys($copy); \n$values = array_values($copy);\n$finds = array();\n$count = count($values);\n\nif(count($input)>=10000){\n echo \"date is \" . date(\"Y-m-d h:i:sa\"); \n}\n \n\n\nfor($i = 0; $i < $count; $i++){\n $value = $values[$i];\n $find = false;\n $offset = 1;\n \n while($offset+$i < $count){\n $next100Offset = 1000;\n $next100Value = $values[$i+$offset+$next100Offset]; \n if(isset($next100Value) && $next100Value <= $value){\n while($offset+$i+$next100Offset < $count){\n if($next100Value <= $value){\n $next100Offset+=1000; \n $next100Value = $values[$i+$offset+$next100Offset];\n }else{\n break;\n }\n }\n $offset+=$next100Offset; \n }\n \n $nextValue = $values[$i+$offset];\n $nextKey = $keys[$i+$offset];\n if($nextValue <= $value || isset($finds[$nextKey])){\n $offset++;\n continue;\n }\n if($nextValue > $value){\n $finds[$nextKey] = 1;\n break;\n } \n }\n}\n\necho count($finds);\nif(count($input)>=10000){\n echo \"date 2 is \" . date(\"Y-m-d h:i:sa\"); \n}"}], "src_uid": "eaa768dc1024df6449e89773234cc0c3"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0; $n--) {\n\t\t$x = floor($x / 2) + 10;\n\t\tif($x <= $m * 10){\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nfor ($t = intval(fgets(STDIN)); $t > 0; $t--) {\n\n\n\tlist($x, $n, $m) = explode(' ', fgets(STDIN));\n\n\techo ($calc($x, $n, $m) ? 'YES' : 'NO') . \"\\n\";\n\n}\n"}], "negative_code": [{"source_code": "\n"}], "src_uid": "78f25e2bc4ff22dbac94f72af68a745f"} {"source_code": "", "positive_code": [{"source_code": " explode(' ', $range)[0],\n 'r' => explode(' ', $range)[1],\n ];\n\n }\n\n} else {\n $count = readline();\n $arr = [];\n $queries = [];\n for ($i = 0; $i < $count; $i++) {\n $range = readline();;\n $queries[$i] = [\n 'l' => explode(' ', $range)[0],\n 'r' => explode(' ', $range)[1],\n ];\n }\n}\n\n\n\n\n\n$result = [];\n\nforeach ($queries as $query) {\n $len = $query['r'] - ($query['l']-1);\n\n if ($len%2 == 0){ //\u0447\u0451\u0442\u043d\u043e\u0435\n $sum = ($len/2);\n if ($query['l']%2 == 0){\n $sum *=-1;\n }\n }else{\n if ($query['r']%2 == 0){\n $sum = floor($len/2)*(-1)+$query['r'];\n }else{\n $sum = floor($len/2)-$query['r'];\n }\n }\n\n array_push($result, $sum);\n}\n\nforeach ($result as $res){\n echo $res.PHP_EOL;\n}\n\n\n"}, {"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfFloat($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (float)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\n/* Perform action N times. Can return values in array */\nfunction ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\n/* Integral. Keys preserved. By reference. */\nfunction cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\n/* Difference. Keys preserved. By reference. */\nfunction diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\nfunction bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\n$n = $ir->readInt();\n\nfunction sn($n)\n{\n\treturn ($n>>1) - $n*($n&1);\n}\n\nntimes($n, function() use ($ir) {\n\tlist($l, $r) = $ir->readArrayOfInt(2);\n\techo sn($r) - sn($l-1);\n\techo \"\\n\";\n});\n\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "#!/usr/bin/env php\n explode(' ', $range)[0],\n 'r' => explode(' ', $range)[1],\n ];\n\n }\n\n} else {\n $count = readline();\n $arr = [];\n $queries = [];\n for ($i = 0; $i < $count; $i++) {\n $range = readline();;\n $queries[$i] = [\n 'l' => explode(' ', $range)[0],\n 'r' => explode(' ', $range)[1],\n ];\n }\n}\n\n\n\n\n\n$result = [];\n\nforeach ($queries as $query) {\n $len = $query['r'] - ($query['l']-1);\n\n if ($len%2 == 0){ //\u0447\u0451\u0442\u043d\u043e\u0435\n $sum = ($len/2);\n if ($query['l']%2 == 0){\n $sum *=-1;\n }\n }else{\n if ($query['r']%2 == 0){\n $sum = floor($len/2)+$query['r'];\n }else{\n $sum = floor($len/2)-$query['r'];\n }\n }\n\n array_push($result, $sum);\n}\n\nforeach ($result as $res){\n echo $res.PHP_EOL;\n}\n\n\n"}, {"source_code": "#!/usr/bin/env php\n explode(' ', $range)[0],\n 'r' => explode(' ', $range)[1],\n ];\n $arr[$i] = ($i + 1) * pow(-1, $i + 1);\n }\n\n} else {\n $count = readline();\n $arr = [];\n $queries = [];\n for ($i = 0; $i < $count; $i++) {\n $range = readline();;\n $queries[$i] = [\n 'l' => explode(' ', $range)[0],\n 'r' => explode(' ', $range)[1],\n ];\n }\n $arr[$i] = ($i + 1) * pow(-1, $i + 1);\n}\n\n$result = [];\n\nforeach ($queries as $query) {\n $len = $query['r'] - ($query['l']-1);\n $arr2 = array_slice($arr, $query['l']-1, $len);\n $sum = 0;\n foreach ($arr2 as $a){\n $sum+=$a;\n }\n array_push($result, $sum);\n}\n\nforeach ($result as $res){\n echo $res.PHP_EOL;\n}\n\n\n"}], "src_uid": "7eae40835f6e9580b985d636d5730e2d"} {"source_code": "", "positive_code": [{"source_code": " $line) {\n\n # code...\n }\n}\n\nlist($n, $data) = read_input_data();\n$v_sum = $h_sum = array_fill(0, $n, 0);\n\nfor ($i = 0; $i<$n; $i++) {\n $line = $data[$i];\n $h_sum[$i] = array_sum($line);\n for ($j = 0; $j<$n; $j++) {\n $v_sum[$j] += $line[$j];\n }\n}\n\n// print_r($v_sum);\n// print_r($h_sum);\n\n$result = 0;\n\nfor ($i = 0; $i<$n; $i++) {\n for ($j = 0; $j<$n; $j++) {\n if ($v_sum[$j] > $h_sum[$i]) {\n $result++;\n }\n }\n}\n\nprint $result .\"\\n\";"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$countMatr = (int)(str_replace( \"\\r\\n\", '', fgets($fp)));\n\n$sumRows = array();\n$sumCols = array();\n$i = 0;\nwhile( $countMatr-- ){\n\t$points = explode(\" \", trim( str_replace( \"\\r\\n\", '', fgets($fp)) ) );\n\tforeach( $points as $key => $value )\n\t{\n\t\t$sumRows[$i] += $value;\n\t\t$sumCols[$key] += $value;\n\t}\n\t$i++;\n}\n\n$res = 0;\nforeach( $sumRows as $key1 => $rowsVal ){\n\tforeach( $sumCols as $key2 => $colsVal ){\n\t\tif( $colsVal > $rowsVal ){\n\t\t\t$res++;\n\t\t}\n\t}\n}\necho $res;\nfclose($fp);\n?>"}, {"source_code": "\n$stdin = fopen('php://stdin', 'r');\n$lines = stream_get_contents($stdin);\n\n$lines=explode(\"\\n\", $lines);\n\n$n=$lines[0];\n\nfor ($l=1; $l<=$n; $l++)\n{\n $line=trim($lines[$l]);\n $numbers_in_line=explode(\" \", $line);\n //\u0421\u0443\u043c\u043c\u0430 \u0432 \u043b\u0438\u043d\u0438\u0438 $l\n $sum_line[$l-1]=array_sum($numbers_in_line);\n for ($c=0; $c<$n; $c++)\n $sum_col[$c]+=$numbers_in_line[$c];\n}\n$good=0;\nfor ($l=1; $l<=$n; $l++)\n{\n for ($c=0; $c<$n; $c++)\n if ($sum_col[$c]>$sum_line[$l-1])\n $good++;\n}\n\necho $good;\n?>"}, {"source_code": "$v) {\n\tif ($k == 0) {\n\t\t$size = $v;\n\t} else {\n\t\t$l = explode(\" \", $v);\n\t\t$lines[] = $l;\n\t\t//$sum_x[] = array_sum($l);\n\t}\n}\n\n\n\n$wins = 0;\n$x = $y = array();\nfor ($i = 0; $i < $size; $i++) {\n\t$sum_x = array_sum($lines[$i]);\n\t$sum_y = 0;\n\tfor ($n = 0; $n < $size; $n++) {\n\t\t$sum_y += $lines[$n][$i];\n\t}\n\t\n\t$x[] = $sum_x;\n\t$y[] = $sum_y;\n\t\n}\n\nforeach ($x as $k=>$v) {\n\tfor ($i = 0; $i < $size; $i++) {\n\t\tif ($v < $y[$i]) {\n\t\t\t$wins++;\n\t\t}\t\n\t}\n}\n\n\nprintf('%s', $wins);\n\n\n"}, {"source_code": " $sumH)\n return true;\n}\n\nfor($i = 0; $i < $n; $i++)\n{\n $arr[$i] = array();\n \n $line = fgets(STDIN);\n $exp = @explode(' ', $line);\n \n for($j = 0; $j < $n; $j++)\n $arr[$i][$j] = $exp[$j];\n}\n\nfor($i = 0; $i < $n; $i++)\n for($j = 0; $j < $n; $j++)\n if(check($i, $j))\n $count++;\n\necho $count;\n?>"}, {"source_code": "\n$input='';\nwhile($s=fgets(STDIN)){\n$input.=$s;\n}\n$mas=preg_split('|\\n|', $input);\n$n=$mas[0];\narray_splice($mas,0,1);\n$mx=array();\n$rsr=array();\n$rss=array();\n$mxr=0;\n$mxs=0;\nforeach ($mas as $id=>$st){\n $str=preg_split('| |', $st);\n foreach ($str as $idd=>$rec){\n $mx[$mxr][$mxs]=$rec;\n $mxs++;\n }\n $mxs=0;\n $mxr++;\n}\n\n$output2=0;\n$asr=0;\n$ass=0;\nfor ($r = 0; $r <=$n-1; $r++) {\n for ($s = 0; $s<=$n-1; $s++) {\n $ass=0;\n $asr=0;\n for ($ss = 0; $ss<=$n-1; $ss++) {\n $asr=$asr+$mx[$r][$ss];\n $ass=$ass+$mx[$ss][$s];\n }\n if($ass>$asr){$output2++;}\n }\n}\necho $output2;\n?>"}, {"source_code": "\n$stdin = fopen('php://stdin', 'r');\n$lines = stream_get_contents($stdin);\n$mas= explode(\"\\n\", $lines);\n\n\n$n=$mas[0];\narray_splice($mas,0,1);\n$mx=array();\n$rsr=array();\n$rss=array();\n$mxr=0;\n$mxs=0;\nforeach ($mas as $id=>$st){\n $str=preg_split('| |', $st);\n foreach ($str as $idd=>$rec){\n $mx[$mxr][$mxs]=$rec;\n $mxs++;\n }\n $mxs=0;\n $mxr++;\n}\n\n$output2=0;\n$asr=0;\n$ass=0;\nfor ($r = 0; $r <=$n-1; $r++) {\n for ($s = 0; $s<=$n-1; $s++) {\n $ass=0;\n $asr=0;\n for ($ss = 0; $ss<=$n-1; $ss++) {\n $asr=$asr+$mx[$r][$ss];\n $ass=$ass+$mx[$ss][$s];\n }\n if($ass>$asr){$output2++;}\n }\n}\necho $output2;\n?>"}, {"source_code": "$st){\n $str=preg_split('| |', $st);\n foreach ($str as $idd=>$rec){\n $mx[$mxr][$mxs]=$rec;\n $mxs++;\n }\n $mxs=0;\n $mxr++;\n}\n\n$output2=0;\n$asr=0;\n$ass=0;\nfor ($r = 0; $r <=$n-1; $r++) {\n for ($s = 0; $s<=$n-1; $s++) {\n $ass=0;\n $asr=0;\n for ($ss = 0; $ss<=$n-1; $ss++) {\n $asr=$asr+$mx[$r][$ss];\n $ass=$ass+$mx[$ss][$s];\n }\n if($ass>$asr){$output2++;}\n }\n}\necho $output2;\n?>"}, {"source_code": " $e)\n {\n $h++;\n }\n }\n}\nprint $h;\n?>"}, {"source_code": "$st){\n $str=preg_split('| |', $st);\n foreach ($str as $idd=>$rec){\n $mx[$mxr][$mxs]=$rec;\n $mxs++;\n }\n $mxs=0;\n $mxr++;\n}\n\n$output=0;\n$asr=0;\n$ass=0;\nfor ($r = 0; $r <=$n-1; $r++) {\n for ($s = 0; $s<=$n-1; $s++) {\n $ass=0;\n $asr=0;\n for ($ss = 0; $ss<=$n-1; $ss++) {\n $asr=$asr+$mx[$r][$ss];\n $ass=$ass+$mx[$ss][$s];\n }\n if($ass>$asr){$output++;}\n }\n}\necho $output;\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$row_sum[$i] += $inp_num;\n\t\t\t$col_sum[$j] += $inp_num; \n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t//if($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t\tif($row_sum[$i] < $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$inp_row[$i][] = $inp_num;\n\t\t\t$row_sum[$i] += $inp_num;\n\t\t\t$col_sum[$j] += $inp_num; \n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t//if($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t\tif($row_sum[$i] < $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$inp_row[$i][] = $inp_num;\n\t\t\t$row_sum[$i] += $inp_num; \n\t\t}\n\t}\n\t$col_sum = array();\n\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\tfor ($l = 0; $l < $inp_n; $l++) {\n\t\t\t$col_sum[$k] += $inp_row[$l][$k];\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t//if($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t\tif($row_sum[$i] < $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}], "negative_code": [{"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$inp_row[$i][] = $inp_num;\n\t\t\t$row_sum[$i] += $inp_num;\n\t\t\t$col_sum[$j] += $inp_num; \n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t//if($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t\tif($row_sum[$i] < $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$inp_row[$i][] = $inp_num;\n\t\t\t$row_sum[$i] += $inp_num; \n\t\t}\n\t}\n\t$col_sum = array();\n\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\tfor ($l = 0; $l < $inp_n; $l++) {\n\t\t\t$col_sum[$k] += $inp_row[$l][$k];\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\tif($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$inp_row[$i][] = $inp_num;\n\t\t\t$row_sum[$i] += $inp_num; \n\t\t}\n\t}\n\t$col_sum = array();\n\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\tfor ($l = 0; $l < $inp_n; $l++) {\n\t\t\t$col_sum[$k] += $inp_row[$l][$k];\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t//if($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t\tif($row_sum[$i] < $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$inp_row[$i][] = $inp_num;\n\t\t\t$row_sum[$i] += $inp_num; \n\t\t}\n\t}\n\t$col_sum = array();\n\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\tfor ($l = 0; $l < $inp_n; $l++) {\n\t\t\t$col_sum[$k] += $inp_row[$l][$k];\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\tif($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\t$inp_num = $Scanner->Scan();\n\t\t\t$inp_row[$i][] = $inp_num;\n\t\t\t$row_sum[$i] += $inp_num; \n\t\t}\n\t}\n\t$col_sum = array();\n\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\tfor ($l = 0; $l < $inp_n; $l++) {\n\t\t\t$col_sum[$k] += $inp_row[$l][$k];\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\tfor ($j = 0; $j < $inp_n; $j++) {\n\t\t\tif($row_sum[$i] > $col_sum[$j]) $count++;\n\t\t}\n\t}\n\tprintf(\"%d\", $count);\n\t\n\t$Scanner->close();\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n\n//input - $inp_\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $(Upper)\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\n/*\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n*/\n/*\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n*/\n/*\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n*/\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.10f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%10d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n?>"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$countMatr = (int)(str_replace( \"\\r\\n\", '', fgets($fp)));\n\n$sumRows = array();\n$sumCols = array();\n$i = 0;\nwhile( $countMatr-- ){\n\t$points = explode(\" \", trim( str_replace( \"\\r\\n\", '', fgets($fp)) ) );\n\tforeach( $points as $key => $value )\n\t{\n\t\t$sumRows[$i] += $value;\n\t\t$sumCols[$key] += $value;\n\t}\n\t$i++;\n}\n\n$res = 0;\nforeach( $sumRows as $rowsVal ){\n\tforeach( $sumCols as $colsVal ){\n\t\tif( $rowsVal > $colsVal ){\n\t\t\t$res++;\n\t\t}\n\t}\n}\necho $res;\nfclose($fp);\n?>"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$countMatr = (int)(str_replace( \"\\r\\n\", '', fgets($fp)));\n\n$sumRows = array();\n$sumCols = array();\n$i = 0;\nwhile( $countMatr-- ){\n\t$points = explode(\" \", trim( str_replace( \"\\r\\n\", '', fgets($fp)) ) );\n\tforeach( $points as $key => $value )\n\t{\n\t\t$sumRows[$i] += $value;\n\t\t$sumCols[$key] += $value;\n\t}\n\t$i++;\n}\n\n$res = 0;\nforeach( $sumRows as $key1 => $rowsVal ){\n\tforeach( $sumCols as $key2 => $colsVal ){\n\t\tif( $colsVal > $rowsVal ){\n\t\t\techo $key1 . ' ' . $key2 . \"\\n\";\n\t\t\t$res++;\n\t\t}\n\t}\n}\necho $res;\nfclose($fp);\n?>"}, {"source_code": "$v) {\n\tif ($k == 0) {\n\t\t$size = $v;\n\t} else {\n\t\t$l = explode(\" \", $v);\n\t\t$lines[] = $l;\n\t\t//$sum_x[] = array_sum($l);\n\t}\n}\n\necho '';\n\n$wins = 0;\n$x = $y = array();\nfor ($i = 0; $i < $size; $i++) {\n\t$sum_x = array_sum($lines[$i]);\n\t$sum_y = 0;\n\tfor ($n = 0; $n < $size; $n++) {\n\t\t$sum_y += $lines[$n][$i];\n\t}\n\t\n\t$x[] = $sum_x;\n\t$y[] = $sum_y;\n\t\n}\n\nforeach ($x as $k=>$v) {\n\tfor ($i = 0; $i < $size; $i++) {\n\t\tif ($v < $y[$i]) {\n\t\t\t$wins++;\n\t\t}\t\n\t}\n}\n\n\nprintf('%s', $wins);\n\n\n"}, {"source_code": "$st){\n $str=preg_split('| |', $st);\n foreach ($str as $idd=>$rec){\n $mx[$mxr][$mxs]=$rec;\n $mxs++;\n }\n $mxs=0;\n $mxr++;\n}\n\n$output=0;\n$asr=0;\n$ass=0;\nfor ($r = 0; $r <=$n-1; $r++) {\n for ($s = 0; $s<=$n-1; $s++) {\n $ass=0;\n $asr=0;\n for ($ss = 0; $ss<=$n-1; $ss++) {\n $asr=$asr+$mx[$r][$ss];\n $ass=$ass+$mx[$ss][$s];\n }\n if($ass>$asr){$output++;}\n }\n}\necho $output;\n?>"}, {"source_code": "\necho('1/n');\necho('1/n');\necho('1/n');\n?>"}, {"source_code": "echo('1/n');\necho('1/n');\necho('1/n');"}, {"source_code": "$st){\n $str=preg_split('| |', $st);\n foreach ($str as $idd=>$rec){\n $mx[$mxr][$mxs]=$rec;\n $mxs++;\n }\n $mxs=0;\n $mxr++;\n}\n\n$output=0;\n$asr=0;\n$ass=0;\nfor ($r = 0; $r <=$n-1; $r++) {\n for ($s = 0; $s<=$n-1; $s++) {\n $ass=0;\n $asr=0;\n for ($ss = 0; $ss<=$n-1; $ss++) {\n $asr=$asr+$mx[$r][$ss];\n $ass=$ass+$mx[$ss][$s];\n }\n if($ass>$asr){$output++;}\n }\n}\necho $output;\n?>"}, {"source_code": "\necho(\"sr\").\"\\n\";\necho(\"sr\").\"\\n\";\n?>"}, {"source_code": "$input='';\nwhile($s=fgets(STDIN)){\n$input.=$s;\n}\n$mas=preg_split('|\\n|', $input);\n$n=$mas[0];\narray_splice($mas,0,1);\n$mx=array();\n$rsr=array();\n$rss=array();\n$mxr=0;\n$mxs=0;\nforeach ($mas as $id=>$st){\n $str=preg_split('| |', $st);\n foreach ($str as $idd=>$rec){\n $mx[$mxr][$mxs]=$rec;\n $mxs++;\n }\n $mxs=0;\n $mxr++;\n}\n\n$output2=0;\n$asr=0;\n$ass=0;\nfor ($r = 0; $r <=$n-1; $r++) {\n for ($s = 0; $s<=$n-1; $s++) {\n $ass=0;\n $asr=0;\n for ($ss = 0; $ss<=$n-1; $ss++) {\n $asr=$asr+$mx[$r][$ss];\n $ass=$ass+$mx[$ss][$s];\n }\n if($ass>$asr){$output2++;}\n }\n}\necho $output2;"}, {"source_code": "\necho(\"sr\").\"/\\n\";\necho(\"sr\").\"/\\n\";\necho(\"sr\").\"/\\n\";\n?>"}, {"source_code": "\necho('1'.\"/n\");\necho('1'.\"/n\");\n?>"}, {"source_code": "\n$stdin = fopen('php://stdin', 'r');\n$lines = stream_get_contents($stdin);\n\n$lines=explode(\"\\n\", $lines);\n\n$n=$lines[0];\n\nfor ($l=1; $l<=$n; $l++)\n{\n $line=trim($lines[$l]);\n $numbers_in_line=explode(\" \", $line);\n //\u0421\u0443\u043c\u043c\u0430 \u0432 \u043b\u0438\u043d\u0438\u0438 $l\n $sum_line[$l-1]=array_sum($numbers_in_line);\n for ($c=0; $c<$n; $c++)\n $sum_col[$c]+=$numbers_in_line[$c];\n}\n\nfor ($l=1; $l<=$n; $l++)\n{\n for ($c=0; $c<$n; $c++)\n if ($sum_col[$c]>$sum_line[$l-1])\n $good++;\n}\n\necho $good;\n?>"}], "src_uid": "6e7c2c0d7d4ce952c53285eb827da21d"} {"source_code": " $j) || ($e > $f))\n {\n break;\n }\n }\n $h += $f;\n $f = 0;\n }\n else\n {\n while(TRUE)\n {\n $f += $c[$j];\n $j--;\n if(($i > $j) || ($f > $e))\n {\n break;\n }\n }\n $g += $e;\n $e = 0;\n }\n $d++;\n if($i > $j)\n {\n if($e > 0)\n {\n $g += $e;\n }\n if($f > 0)\n {\n $h += $f;\n }\n break;\n }\n }\n print $d . \" \" . $g . \" \" . $h . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " $now_eat)\n {\n \n $l = $i + 1 ;\n $now_eat = $eat ;\n $a_eat += $eat ;\n $now_u = 1 ;\n break ;\n }\n }\n \n if($i > $r)\n {\n $l = $r + 1 ;\n $now_eat = $eat ;\n $a_eat += $eat ;\n $now_u = 1 ;\n }\n }\n else\n {\n // Bob\n $eat = 0 ;\n for($i = $r; $i >= $l; $i --)\n {\n $eat += $candy[$i] ;\n \n if($eat > $now_eat)\n {\n \n $r = $i - 1 ;\n $now_eat = $eat ;\n $b_eat += $eat ;\n $now_u = 0 ;\n break ;\n }\n }\n \n if($i < $l)\n {\n $r = $l - 1 ;\n $now_eat = $eat ;\n $b_eat += $eat ;\n $now_u = 0 ;\n }\n }\n }\n \n echo $step . \" \" . $a_eat . \" \" . $b_eat . \"\\n\" ;\n }\n?>"}], "negative_code": [], "src_uid": "d70ee6d3574e0f2cac3c683729e2979d"} {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= bcdiv($m, BASE, 5) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= $pa . ' ' . bcdiv($m, BASE, 5) . \"\\n\";\n break;\n case 2:\n $ret .= bcdiv(bcsub($a, $m), BASE, 5) . ' ' . $pa . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . bcdiv(bcsub($a,$m), BASE, 5) . \"\\n\";\n break;\n }\n}\necho $ret;", "positive_code": [{"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= bcdiv($m, BASE, 5) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= $pa . ' ' . bcdiv($m, BASE, 5) . \"\\n\";\n break;\n case 2:\n $ret .= bcdiv(bcsub($a, $m), BASE, 5) . ' ' . $pa . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . bcdiv(bcsub($a,$m), BASE, 5) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " $a4) {\n $r -= floor($r / $a4) * $a4;\n }\n while ($r > 0.00001) {\n $s = min($z, $r);\n $z -= $s;\n $r -= $s;\n if ($v == 0) {\n $x += $s;\n } elseif ($v == 1) {\n $y += $s;\n } elseif ($v == 2) {\n $x -= $s;\n } else {\n $y -= $s;\n }\n if ($z < 0.00001) {\n $z = $a;\n $v ++;\n if ($v > 3) {\n $v = 0;\n }\n }\n }\n echo number_format(round($x, 4), 10, '.', '') . ' ' . number_format(round($y, 4), 10, '.', '') . \"\\n\";\n}\n"}], "negative_code": [{"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= sprintf(\"%0.5f\", ($m / BASE)) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= sprintf(\"%0.5f\", ($a / BASE)) . ' ' . sprintf(\"%0.5f\", ($m / BASE)) . \"\\n\";\n break;\n case 2:\n $ret .= sprintf(\"%0.5f\", ($a - $m) / BASE) . ' ' . sprintf(\"%0.5f\", ($a / BASE)) . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . sprintf(\"%0.5f\", ($a - $m) / BASE) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= ($m / BASE) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= ($a / BASE) . ' ' . ($m / BASE) . \"\\n\";\n break;\n case 2:\n $ret .= ( ($a - $m) / BASE) . ' ' . ($a / BASE) . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . ( ($a - $m) / BASE) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= bcdiv($m, BASE, 5) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= $pa . ' ' . bcdiv($m, BASE, 5) . \"\\n\";\n break;\n case 2:\n $ret .= bcdiv(bcsub($a, $m), BASE, 5) . ' ' . $pa . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . bcdiv(bcsub($a,$m), BASE, 5) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= sprintf(\"%0.4f\", ($m / BASE)) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= sprintf(\"%0.4f\", ($a / BASE)) . ' ' . sprintf(\"%0.4f\", ($m / BASE)) . \"\\n\";\n break;\n case 2:\n $ret .= sprintf(\"%0.4f\", ($a - $m) / BASE) . ' ' . sprintf(\"%0.4f\", ($a / BASE)) . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . sprintf(\"%0.4f\", ($a - $m) / BASE) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= ($m / 10000) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= ($a / 10000) . ' ' . ($m / 10000) . \"\\n\";\n break;\n case 2:\n $ret .= ( ($a - $m) / 10000) . ' ' . ($a / 10000) . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . ( ($a - $m) / 10000) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= sprintf(\"%0.5f\", ($m / BASE)) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= sprintf(\"%0.5f\", ($a / BASE)) . ' ' . sprintf(\"%0.5f\", ($m / BASE)) . \"\\n\";\n break;\n case 2:\n $ret .= sprintf(\"%0.5f\", ($a - $m) / BASE) . ' ' . sprintf(\"%0.5f\", ($a / BASE)) . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . sprintf(\"%0.5f\", ($a - $m) / BASE) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= sprintf(\"%0.5f\", ($m / BASE)) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= sprintf(\"%0.5f\", ($a / BASE)) . ' ' . sprintf(\"%0.5f\", ($m / BASE)) . \"\\n\";\n break;\n case 2:\n $ret .= sprintf(\"%0.5f\", ($a - $m) / BASE) . ' ' . sprintf(\"%0.5f\", ($a / BASE)) . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . sprintf(\"%0.5f\", ($a - $m) / BASE) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": " 0)) {\n $o--;\n $m = $a;\n }\n switch ($o) {\n case 0:\n $ret .= ($m / BASE) . \" 0.0\\n\";\n break;\n case 1:\n $ret .= ($a / BASE) . ' ' . ($m / BASE) . \"\\n\";\n break;\n case 2:\n $ret .= ( ($a - $m) / BASE) . ' ' . ($a / BASE) . \"\\n\";\n break;\n case 3:\n $ret .= '0.0 ' . ( ($a - $m) / BASE) . \"\\n\";\n break;\n }\n}\necho $ret;"}, {"source_code": "\nlist($a, $d) = explode(' ', trim(fgets(STDIN)));\n$times = trim(fgets(STDIN));\nfor($i = 1; $i <= $times; $i++){\n $curr = $d*$i;\n if(($curr/$a)%4 == 0){\n $y = 0;\n $tmp = floor($curr/$a);\n $x = round($curr-$tmp*$a, 5);\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 1){\n $x = $a;\n $tmp = floor($curr/$a);\n $y = round($curr-$tmp*$a, 5);\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 2){\n $y = $a;\n $tmp = floor($curr/$a);\n $x = round($a-($curr-$tmp*$a), 5);\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 3){\n $x = 0;\n $tmp = floor($curr/$a);\n $y = round($a-($curr-$tmp*$a), 5);\n echo $x.' '.$y.\"\\n\";\n }\n}"}, {"source_code": "\nlist($a, $d) = explode(' ', trim(fgets(STDIN)));\n$times = trim(fgets(STDIN));\nfor($i = 1; $i <= $times; $i++){\n $curr = $d*$i;\n if(($curr/$a)%4 == 0){\n $y = 0;\n $tmp = floor($curr/$a);\n $x = $curr-$tmp*$a;\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 1){\n $x = $a;\n $tmp = floor($curr/$a);\n $y = $curr-$tmp*$a;\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 2){\n $y = $a;\n $tmp = floor($curr/$a);\n $x = $curr-$tmp*$a;\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 3){\n $x = 0;\n $tmp = floor($curr/$a);\n $y = $curr-$tmp*$a;\n echo $x.' '.$y.\"\\n\";\n }\n}"}, {"source_code": "\nlist($a, $d) = explode(' ', trim(fgets(STDIN)));\n$times = trim(fgets(STDIN));\nfor($i = 1; $i <= $times; $i++){\n $curr = $d*$i;\n if(($curr/$a)%4 == 0){\n $y = 0;\n $tmp = floor($curr/$a);\n $x = $curr-$tmp*$a;\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 1){\n $x = $a;\n $tmp = floor($curr/$a);\n $y = $curr-$tmp*$a;\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 2){\n $y = $a;\n $tmp = floor($curr/$a);\n $x = $a-($curr-$tmp*$a);\n echo $x.' '.$y.\"\\n\";\n }elseif(($curr/$a)%4 == 3){\n $x = 0;\n $tmp = floor($curr/$a);\n $y = $a-($curr-$tmp*$a);\n echo $x.' '.$y.\"\\n\";\n }\n}"}, {"source_code": " $a4) {\n $r -= floor($r / $a4) * $a4;\n }\n while ($r > 0.00001) {\n $s = min($z, $r);\n $z -= $s;\n $r -= $s;\n if ($v == 0) {\n $x += $s;\n } elseif ($v == 1) {\n $y += $s;\n } elseif ($v == 2) {\n $x -= $s;\n } else {\n $y -= $s;\n }\n if ($z < 0.00001) {\n $z = $a;\n $v ++;\n if ($v > 3) {\n $v = 0;\n }\n }\n }\n echo number_format(round($x, 4), 10, '.', '') . ' ' . number_format(round($y, 4), 10, '.', '') . \"\\n\";\n}\n"}, {"source_code": "$input = trim(file_get_contents('php://stdin'));\nlist($ad, $n) = explode(\"\\n\", $input);\nlist($a, $d) = explode(\" \", $ad);\n\n$x = 0;\n$y = 0;\n$z = $a;\n\n$a4 = $a * 4;\nfor ($i = 0; $i < $n; $i ++) {\n $r = $d;\n if ($r > $a4) {\n $r -= floor($r / $a4) * $a4;\n }\n while ($r > 0.00001) {\n $s = min($z, $r);\n $z -= $s;\n if ($z < 0.00001) {\n $z = $a;\n }\n $r -= $s;\n if ($y < 0.00001 && abs($x - $a) > 0.00001) {\n $x += $s;\n } elseif (abs($y - $a) > 0.00001 && abs($x - $a) < 0.00001) {\n $y += $s;\n } elseif (abs($y - $a) < 0.00001 && $x > 0.00001) {\n $x -= $s;\n } else {\n $y -= $s;\n }\n }\n echo number_format(round($x, 4), 10, '.', '') . ' ' . number_format(round($y, 4), 10, '.', '') . \"\\n\";\n}\n"}, {"source_code": " $a4) {\n $r -= floor($r / $a4) * $a4;\n }\n while ($r >= 0.0001) {\n $s = min($z, $r);\n $z -= $s;\n if ($z < 0.0001) {\n $z = $a;\n }\n $r -= $s;\n if ($y < 0.0001 && abs($x - $a) > 0.0001) {\n $x += $s;\n } elseif (abs($y - $a) > 0.0001 && abs($x - $a) < 0.0001) {\n $y += $s;\n } elseif (abs($y - $a) < 0.0001 && $x > 0.0001) {\n $x -= $s;\n } else {\n $y -= $s;\n }\n }\n echo number_format(round($x, 4), 10, '.', '') . ' ' . number_format(round($y, 4), 10, '.', '') . \"\\n\";\n}\n"}, {"source_code": " 0) {\n $s = min($a - ($rAll - floor($rAll / $a) * $a), $r);\n $rAll += $s;\n $r -= $s;\n if ($y < 0.0001 && abs($x - $a) > 0.0001) {\n $x += $s;\n } elseif (abs($y - $a) > 0.0001 && abs($x - $a) < 0.0001) {\n $y += $s;\n } elseif (abs($y - $a) < 0.0001 && $x > 0.0001) {\n $x -= $s;\n } else {\n $y -= $s;\n }\n }\n echo number_format($x, 10) . ' ' . number_format($y, 10) . \"\\n\";\n}\n"}, {"source_code": " 0) {\n $s = min($a - ($rAll % $a), $r);\n $rAll += $s;\n $r -= $s;\n if ($y == 0 && $x < $a) {\n $x += $s;\n } elseif ($y < $a && $x == $a) {\n $y += $s;\n } elseif ($y == $a && $x > 0) {\n $x -= $s;\n } else {\n $y -= $s;\n }\n }\n echo number_format($x / 10000, 10, '.', '') . ' ' . number_format($y / 10000, 10, '.', '') . \"\\n\";\n}\n"}, {"source_code": " $a4) {\n $r -= floor($r / $a4) * $a4;\n }\n while ($r > 0.00001) {\n $s = min($z, $r);\n $z -= $s;\n $r -= $s;\n if ($v == 0) {\n $x += $s;\n } elseif ($v == 1) {\n $y += $s;\n } elseif ($v == 2) {\n $x -= $s;\n } else {\n $y -= $s;\n }\n if ($z < 0.00001) {\n $z = $a;\n $v ++;\n if ($v > 3) {\n $v = 0;\n }\n }\n }\n echo number_format(round($x, 4), 10, '.', '') . ' ' . number_format(round($y, 4), 10, '.', '') . \"\\n\";\n}\n"}], "src_uid": "d00b8423c3c52b19fec25bc63e4d4c1c"} {"source_code": "= $from) {\n $i = (int)(($from + $last) / 2);\n $list = [];\n $mask = $masks[$i];\n $subnet = -1;\n $count = 0;\n foreach ($ips as $ip) {\n $s = $ip & $mask;\n if ($s != $subnet) $count++;\n $subnet = $s; \n }\n \n if ($count >= $k) {\n $from = $i + 1;\n } else {\n $last = $i - 1;\n }\n if ($count == $k)\n $result = $i;\n}\nif ($result > 0) {\n die(long2ip($masks[$result]));\n}\n\necho $n == $k ? \"255.255.255.255\" : -1;\n\n", "positive_code": [{"source_code": "\nlist($n, $m) = explode(' ',trim(fgets(STDIN)));\nfor ($i=0; $i<$n;++$i) {\n$input = explode('.', trim(fgets(STDIN)));\n$ip[$i] = sprintf(\"%08s\", decbin($input[0])).sprintf(\"%08s\", decbin($input[1])).sprintf(\"%08s\", decbin($input[2])).sprintf(\"%08s\", decbin($input[3]));\n}\n $ans = ' ';\n $mask = \"00000000000000000000000000000000\";\n for ($i=0; $i<31;++$i)\n {\n $set = array();\n $c = 0;\n $mask[$i] = '1';\n \n for ($j=0; $j<$n;++$j)\n {\n $ans = $mask & $ip[$j];\n if (!isset($set[$ans])) {$set[$ans] = true; ++$c;}\n } \n \n if ($c == $m) \n {\n echo bindec(substr($mask,0,8)).\".\".bindec(substr($mask,8,8)).\".\".bindec(substr($mask,16,8)).\".\".bindec(substr($mask,24,8)); \n exit;\n } \n }\necho \"-1\";\n?>"}, {"source_code": "\n\nlist($n, $k) = explode(\" \", fgets(STDIN));\n\n$masks = array();\n$i = 0;\nwhile($i++ < 32) {\n $masks[] = str_repeat(1, $i) . str_repeat(0, 32 - $i);\n}\n\n$ips = array();\nwhile($n--) {\n $ip = fgets(STDIN); \n $tmp = explode(\".\", $ip);\n $ips[] = sprintf(\"%08b%08b%08b%08b\", $tmp[0], $tmp[1], $tmp[2], $tmp[3]);\n}\n\nforeach($masks as $mask) {\n $res = array();\n foreach($ips as $ip) {\n $network = $mask & $ip;\n $res[$network]++;\n }\n \n if(count($res) == $k) { \n die(sprintf(\"%d.%d.%d.%d\", bindec(substr($mask, 0, 8)), bindec(substr($mask, 8, 8)), bindec(substr($mask, 16, 8)), bindec(substr($mask, 24, 8))));\n }\n}\ndie(\"-1\");\n"}], "negative_code": [{"source_code": "\n\nlist($n, $k) = explode(\" \", fgets(STDIN));\n\n$masks_tmp = array(128, 192, 224, 240, 248, 252, 254, 255);\n\n$masks = array();\nforeach($masks_tmp as $mask)\n $masks[] = array($mask, 0, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, $mask, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, $mask, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, 255, $mask);\n\n\n$ips = array();\nwhile($n--) {\n $ips[] = explode(\".\", fgets(STDIN));\n}\n\n$start = floor(sqrt($k)) - 1;\nfor($i = $start; $i < count($masks); $i++) {\n $mask = $masks[$i];\n $res = array();\n foreach($ips as $ip) {\n $network = ($mask[0] & (int)$ip[0]);\n $network .= \".\" . ($mask[1] & (int)$ip[1]);\n $network .= \".\" . ($mask[2] & (int)$ip[2]);\n $network .= \".\" . ($mask[3] & (int)$ip[3]);\n $res[$network]++;\n }\n \n if(count($res) == $k) { \n die(implode(\".\", $mask));\n }\n}\ndie(\"-1\");"}, {"source_code": "\n\nlist($n, $k) = explode(\" \", fgets(STDIN));\n\n$masks_tmp = array(128, 192, 224, 240, 248, 252, 254, 255);\n\n$masks = array();\nforeach($masks_tmp as $mask)\n $masks[] = array($mask, 0, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, $mask, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, $mask, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, 255, $mask);\n\n\n$ips = array();\nwhile($n--) {\n //$ips[] = explode(\".\", fgets(STDIN));\n $ips[] = mt_rand(0, 255) . \".\" . mt_rand(0, 255) . \".\" . mt_rand(0, 255) . \".\" . mt_rand(0, 255);\n}\n\n$start = floor(sqrt($k));\nfor($i = $start; $i < count($masks); $i++) {\n $mask = $masks[$i];\n $res = array();\n foreach($ips as $ip) {\n $network = ($mask[0] & (int)$ip[0]);\n $network .= \".\" . ($mask[1] & (int)$ip[1]);\n $network .= \".\" . ($mask[2] & (int)$ip[2]);\n $network .= \".\" . ($mask[3] & (int)$ip[3]);\n $res[$network]++;\n }\n \n if(count($res) == $k) { \n die(implode(\".\", $mask));\n }\n}\ndie(\"-1\");"}, {"source_code": "\n\nlist($n, $k) = explode(\" \", fgets(STDIN));\n\n$masks_tmp = array(128, 192, 224, 240, 248, 252, 254, 255);\n\n$masks = array();\nforeach($masks_tmp as $mask)\n $masks[] = array($mask, 0, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, $mask, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, $mask, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, 255, $mask);\n\n\n$ips = array();\nwhile($n--) {\n $ips[] = explode(\".\", fgets(STDIN));\n}\n\n$start = ceil(sqrt($k));\nfor($i = $start; $i < count($masks); $i++) {\n $mask = $masks[$i];\n $res = array();\n foreach($ips as $ip) {\n $network = ($mask[0] & (int)$ip[0]);\n $network .= \".\" . ($mask[1] & (int)$ip[1]);\n $network .= \".\" . ($mask[2] & (int)$ip[2]);\n $network .= \".\" . ($mask[3] & (int)$ip[3]);\n $res[$network]++;\n }\n \n if(count($res) == $k) { \n die(implode(\".\", $mask));\n }\n}\ndie(\"-1\");"}, {"source_code": "\n\nlist($n, $k) = explode(\" \", fgets(STDIN));\n\n$masks_tmp = array(128, 192, 224, 240, 248, 252, 254, 255);\n\n$masks = array();\nforeach($masks_tmp as $mask)\n $masks[] = array($mask, 0, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, $mask, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, $mask, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, 255, $mask);\n\n\n$ips = array();\nwhile($n--) {\n $ips[] = explode(\".\", fgets(STDIN));\n}\n\n$start = ceil(sqrt($k)) - 1;\nfor($i = $start; $i < count($masks); $i++) {\n $mask = $masks[$i];\n $res = array();\n foreach($ips as $ip) {\n $network = ($mask[0] & (int)$ip[0]);\n $network .= \".\" . ($mask[1] & (int)$ip[1]);\n $network .= \".\" . ($mask[2] & (int)$ip[2]);\n $network .= \".\" . ($mask[3] & (int)$ip[3]);\n $res[$network]++;\n }\n \n if(count($res) == $k) { \n die(implode(\".\", $mask));\n }\n}\ndie(\"-1\");"}, {"source_code": "\n\n\n for ($j=0; $j<$n;++$j)\n {\n $ans = $mask & $ip[$j];\n if (!isset($set[$ans])) {$set[$ans] = true; ++$c;}\n }\n\n\n\n for ($j=0; $j<$n;++$j)\n {\n for ($k=0; $j<32;++$k){\n if ($mask[$k] && $ip[$j][$k]) $ans[$k]=1; else $ans[$k]=0;\n }\n if (!isset($set[$ans])) {$set[$ans] = true; ++$c;}\n } \n \n \n \nlist($n, $m) = explode(' ',trim(fgets(STDIN)));\nfor ($i=0; $i<$n;++$i) {\n$input = explode('.', trim(fgets(STDIN)));\n$ip[$i] = sprintf(\"%08s\", decbin($input[0])).sprintf(\"%08s\", decbin($input[1])).sprintf(\"%08s\", decbin($input[2])).sprintf(\"%08s\", decbin($input[3]));\n}\n $ans = ' ';\n $mask = \"00000000000000000000000000000000\";\n for ($i=0; $i<31;++$i)\n {\n $set = array();\n $c = 0;\n $mask[$i] = '1';\n \n for ($j=0; $j<$n;++$j)\n {\n for ($k=0; $k<32;++$k){\n if ($mask[$k] && $ip[$j][$k]) $ans[$k]=1; else $ans[$k]=0;\n }\n if (!isset($set[$ans])) {$set[$ans] = true; ++$c;}\n } \n \n if ($c == $m) \n {\n echo bindec(substr($mask,0,8)).\".\".bindec(substr($mask,8,8)).\".\".bindec(substr($mask,16,8)).\".\".bindec(substr($mask,24,8)); \n exit;\n } \n }\necho \"-1\";\n?>"}, {"source_code": "\n\nlist($n, $k) = explode(\" \", fgets(STDIN));\n\n$masks_tmp = array(128, 192, 224, 240, 248, 252, 254, 255);\n\n$masks = array();\nforeach($masks_tmp as $mask)\n $masks[] = array($mask, 0, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, $mask, 0, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, $mask, 0);\n\nforeach($masks_tmp as $mask)\n $masks[] = array(255, 255, 255, $mask);\n\n\n$ips = array();\nwhile($n--) {\n $ips[] = explode(\".\", fgets(STDIN));\n}\n\n$start = floor(sqrt($k));\nfor($i = $start; $i < count($masks); $i++) {\n $mask = $masks[$i];\n $res = array();\n foreach($ips as $ip) {\n $network = ($mask[0] & (int)$ip[0]);\n $network .= \".\" . ($mask[1] & (int)$ip[1]);\n $network .= \".\" . ($mask[2] & (int)$ip[2]);\n $network .= \".\" . ($mask[3] & (int)$ip[3]);\n $res[$network]++;\n }\n \n if(count($res) == $k) { \n die(implode(\".\", $mask));\n }\n}\ndie(\"-1\");"}], "src_uid": "4da4410d3b75ee87a4dfa33b437b9cfa"} {"source_code": " $a)\n {\n $e++;\n $f = 1;\n while(TRUE)\n {\n $d -= $f;\n if($d == $a)\n {\n unset($g[$f - 1]);\n break;\n }\n else\n {\n $d += $f;\n $f++;\n }\n }\n break;\n }\n elseif($d < $a)\n {\n $e++;\n }\n }\n}\nif($a != 0)\n{\n if(($f != 0) && ($b != 0))\n {\n $h = array($f);\n $i = $f;\n }\n else\n {\n $h = array();\n $i = 0;\n }\n}\nelse\n{\n $h == array();\n $i = 0;\n}\nif($b != 0)\n{\n if($a == 0)\n {\n $e = 1;\n }\n while(TRUE)\n {\n $i += $e;\n if($i < $b)\n {\n $h[count($h)] = $e;\n $e++;\n }\n elseif($i == $b)\n {\n $h[count($h)] = $e;\n break;\n }\n elseif($i > $b)\n {\n break;\n }\n }\n}\nprint count($g) . \"\\n\";\nprint implode(\" \", $g) . \"\\n\";\nprint count($h) . \"\\n\";\nprint implode(\" \", $h);\n?>", "positive_code": [{"source_code": "0) {\n $x1 = (-$b+sqrt($d))/2*$a;\n $x2 = (-$b-sqrt($d))/2*$a;\n } elseif ($d==0) {\n $x1 = $x2 = (-$b)/2*$a;\n } else {\n $x1 = -$b . '+' . sqrt(abs($d)) . 'i';\n $x2 = -$b . '-' . sqrt(abs($d)) . 'i';\n }\n }\n return floor($x1);\n}\n\n$n = eq_roots(1, 1, -2*$hours);\n\nif($b == 0) {\n\n} else {\n $second = range(1, $n);\n}\n\n\n\n$abstract_balance = $a;\nfor($i=$n;$i>=1;$i--) {\n\t// 5, 4, 3, 2, 1\n\tif(($abstract_balance - $i) >= 0) {\n\t\tarray_push($first, $i);\n\t\t$abstract_balance = $abstract_balance - $i;\n\t}\n\tif($abstract_balance == 0) {\n\t\tbreak;\n\t}\n}\n\n$second_2 = array_diff($second, $first);\n\n$r1 = count($first);\n$r2 = count($second_2);\n$arr1 = implode(\" \", $first);\n$arr2 = implode(\" \", $second_2);\n\necho $r1.PHP_EOL;\necho $arr1.PHP_EOL;\necho $r2.PHP_EOL;\necho $arr2.PHP_EOL;\n\n\n?>"}], "negative_code": [{"source_code": " $a)\n {\n $e++;\n $f = 1;\n while(TRUE)\n {\n $d -= $f;\n if($d == $a)\n {\n unset($g[$f - 1]);\n break;\n }\n else\n {\n $d += $f;\n $f++;\n }\n }\n break;\n }\n elseif($d < $a)\n {\n $e++;\n }\n }\n}\nif($a != 0)\n{\n if($f != 0)\n {\n $h = array($f);\n $i = $f;\n }\n else\n {\n $h = array();\n $i = 0;\n }\n}\nelse\n{\n $h == array();\n $i = 0;\n}\nif($b != 0)\n{\n if($a == 0)\n {\n $e = 1;\n }\n while(TRUE)\n {\n $i += $e;\n if($i < $b)\n {\n $h[count($h)] = $e;\n $e++;\n }\n elseif($i == $b)\n {\n $h[count($h)] = $e;\n break;\n }\n elseif($i > $b)\n {\n break;\n }\n }\n}\nprint count($g) . \"\\n\";\nprint implode(\" \", $g) . \"\\n\";\nprint count($h) . \"\\n\";\nprint implode(\" \", $h);\n?>"}, {"source_code": " $a)\n {\n $e++;\n $f = 1;\n while(TRUE)\n {\n $d -= $f;\n if($d == $a)\n {\n unset($g[$f - 1]);\n break;\n }\n else\n {\n $d += $f;\n $f++;\n }\n }\n break;\n }\n elseif($d < $a)\n {\n $e++;\n }\n }\n}\nif($f != 0)\n{\n $h = array($f);\n $i = $f;\n}\nelse\n{\n $h = array();\n $i = 0;\n}\nif($b != 0)\n{\n if($a == 0)\n {\n $e = 1;\n }\n while(TRUE)\n {\n $i += $e;\n if($i < $b)\n {\n $h[count($h)] = $e;\n $e++;\n }\n elseif($i == $b)\n {\n $h[count($h)] = $e;\n break;\n }\n elseif($i > $b)\n {\n break;\n }\n }\n}\nprint count($g) . \"\\n\";\nprint implode(\" \", $g) . \"\\n\";\nprint count($h) . \"\\n\";\nprint implode(\" \", $h);\n?>"}, {"source_code": "0) {\n $x1 = (-$b+sqrt($d))/2*$a;\n } elseif ($d==0) {\n $x1 = $x2 = (-$b)/2*$a;\n } else {\n $x1 = -$b . '+' . sqrt(abs($d)) . 'i';\n }\n }\n return floor($x1);\n}\n\n$n = eq_roots(1, 1, -2*$hours);\n\n\n$second = range(1, $n);\n\n\n$abstract_balance = $a;\nfor($i=$n;$i>=1;$i--) {\n\t// 5, 4, 3, 2, 1\n\tif(($abstract_balance - $i) >= 0) {\n\t\tarray_push($first, $i);\n\t\t$abstract_balance = $abstract_balance - $i;\n\t}\n\tif($abstract_balance == 0) {\n\t\tbreak;\n\t}\n}\n\n$second_2 = array_diff($second, $first);\n\n$r1 = count($first);\n$r2 = count($second_2);\n$arr1 = implode(\" \", $first);\n$arr2 = implode(\" \", $second_2);\n\necho $r1.PHP_EOL;\necho $arr1.PHP_EOL;\necho $r2.PHP_EOL;\necho $arr2.PHP_EOL;\n\n\n?>"}], "src_uid": "fab438cef9eb5e9e4a4a2e3f9e4f9cec"} {"source_code": " $item) {\n $r = $m - 1;\n } else {\n return $realPrime[$m];\n }\n }\n\n return $realPrime[$l];\n}\n\nfor ($i = 0; $i < $tests; ++$i) {\n fscanf(STDIN, \"%d\\n\", $d);\n\n $firstPrime = binSearch(1 + $d, $realPrime);\n $secondPrime = binSearch($firstPrime + $d, $realPrime);\n echo $firstPrime * $secondPrime . PHP_EOL;\n}"}], "negative_code": [{"source_code": " $a)\n {\n break;\n }\n $h = $e % $b;\n if($h < $g)\n {\n $g = $h;\n }\n }\n print min($f, $g);\n}\nelseif($c * 5 > $a)\n{\n print $a % $b;\n}\n?>"}], "negative_code": [{"source_code": " $a)\n{\n print $a % $b;\n}\n?>"}, {"source_code": " $a)\n{\n print $a % $b;\n}\n?>"}, {"source_code": " $a)\n{\n print $a % $b;\n}\n?>"}, {"source_code": " 0 && $c % $a[0] == 0) return 1;\r\n\r\n\t$c = $aa - $a[0];\r\n\tif($c > 0 && $c % $a[2] == 0) return 3;\r\n\r\n\t$c = $a[0] + $a[2];\r\n\tif($c % $aa == 0) return 2;\r\n\r\n\treturn false;\r\n};\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor (; $t > 0; $t--) {\r\n\r\n\t$a = array_map('intval', explode(' ', fgets(STDIN)));\r\n\r\n\techo $solve($a) ? 'YES':'NO';\r\n\techo \"\\n\";\r\n\r\n}\r\n", "positive_code": [{"source_code": "= $a && $d % $a == 0 && $d != 0) {\r\n echo 'YES'.PHP_EOL;\r\n } else {\r\n $d = $a + ($c - $a) / 2;\r\n if ($d >= $b && ($c - $a) % 2 == 0 && $d % $b == 0 && $d != 0) {\r\n echo 'YES'.PHP_EOL;\r\n } else {\r\n $d = $a + 2 * ($b - $a);\r\n if($d >= $c && $d % $c == 0 && $d != 0) {\r\n echo 'YES'.PHP_EOL;\r\n } else {\r\n echo 'NO'.PHP_EOL;\r\n }\r\n }\r\n }\r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": " 0 && $c % $a[0] == 0) return 1;\r\n\r\n\t$c = $aa - $a[0];\r\n\tif($c > 0 && $c % $a[2] == 0) return 3;\r\n\r\n\t$c = $a[0] + $a[2];\r\n\techo $c . ' - ' . $aa. ' - ';\r\n\tif($c % $aa == 0) return 2;\r\n\r\n\treturn false;\r\n};\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor (; $t > 0; $t--) {\r\n\r\n\t$a = array_map('intval', explode(' ', fgets(STDIN)));\r\n\r\n\techo $solve($a) ? 'YES':'NO';\r\n\techo \"\\n\";\r\n\r\n}\r\n"}, {"source_code": " 0 && $c % $a[0] == 0) return 1;\r\n\r\n\t$c = $aa - $a[0];\r\n\tif($c > 0 && $c % $a[2] == 0) return 3;\r\n\r\n\t$c = $a[0] - $a[2];\r\n\tif($c % $aa == 0) return 2;\r\n\r\n\treturn false;\r\n};\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor (; $t > 0; $t--) {\r\n\r\n\t$a = array_map('intval', explode(' ', fgets(STDIN)));\r\n\r\n\techo $solve($a) ? 'YES':'NO';\r\n\techo \"\\n\";\r\n\r\n}\r\n"}, {"source_code": " 0 && $c % $a[0] == 0) return true;\r\n\r\n\t$c = $a[1] + ($a[1] - $a[0]);\r\n\tif($c > 0 && $c % $a[2] == 0) return true;\r\n\r\n\t$c = $a[0] - $a[2];\r\n\tif($c % 2 == 0){\r\n\t\t$c = $c / 2;\r\n\t\tif($c % $a[1] == 0) return true;\r\n\t}\r\n\r\n\r\n\treturn false;\r\n};\r\n\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor (; $t > 0; $t--) {\r\n\r\n\t$a = array_map('intval', explode(' ', fgets(STDIN)));\r\n\r\n\techo $solve($a) ? 'YES':'NO';\r\n\techo \"\\n\";\r\n\r\n}\r\n"}], "src_uid": "90c5058c0c7f55a567f2e036482149f9"} {"source_code": "= 0; $i--) {\r\n if ($a2[$i] == 1) {\r\n $a2[$i] = 0;\r\n break;\r\n }\r\n }\r\n \r\n \r\n \r\n //echo implode(' ', $a) . PHP_EOL;\r\n //echo implode(' ', $a2) . PHP_EOL;\r\n //echo implode(' ', $a3) . PHP_EOL;\r\n \r\n \r\n \r\n \r\n for ($i = 0; $i < $n; $i++) {\r\n if ($a[$i] == 1) {\r\n $iCheck++;\r\n } else {\r\n $iResult = $iResult + $iCheck;\r\n }\r\n \r\n if ($a2[$i] == 1) {\r\n $iCheck2++;\r\n } else {\r\n $iResult2 = $iResult2 + $iCheck2;\r\n }\r\n \r\n if ($a3[$i] == 1) {\r\n $iCheck3++;\r\n } else {\r\n $iResult3 = $iResult3 + $iCheck3;\r\n }\r\n \r\n $aMax[$i] = max($iResult, $iResult2, $iResult3);\r\n }\r\n \r\n echo max($aMax) . PHP_EOL;\r\n} \r\n", "positive_code": [{"source_code": " $max1)\r\n {\r\n $max2 = $max1;\r\n $max1 = $array[$index];\r\n }\r\n\r\n else if ($array[$index] > $max2)\r\n {\r\n $max2 = $array[$index];\r\n }\r\n }\r\n\r\n return array($max1, $max2);\r\n}\r\n"}, {"source_code": " $max1)\r\n {\r\n $max2 = $max1;\r\n $max1 = $array[$index];\r\n }\r\n\r\n else if ($array[$index] > $max2)\r\n {\r\n $max2 = $array[$index];\r\n }\r\n }\r\n\r\n return array($max1, $max2);\r\n}\r\n"}], "negative_code": [{"source_code": " $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n $aMax[$i] = $iCheck;\r\n $a[$i] = $sNum;\r\n }\r\n \r\n echo max($aMax) . PHP_EOL;\r\n} "}, {"source_code": " $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n $aMax[$i] = $iCheck;\r\n $a[$i] = $sNum;\r\n }\r\n \r\n echo max($aMax) . PHP_EOL;\r\n} "}, {"source_code": "= 2653) {\r\n echo $s . PHP_EOL;\r\n }\r\n } \r\n}"}, {"source_code": " $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n $aMax[$i] = $iCheck;\r\n $a[$i] = $sNum;\r\n }\r\n \r\n echo max($aMax) . PHP_EOL;\r\n} \r\n\r\n\r\n"}, {"source_code": "= 22) {\r\n echo $s . PHP_EOL;\r\n }\r\n } \r\n}\r\n\r\n\r\n"}, {"source_code": "= 1) {\r\n echo $s . PHP_EOL;\r\n }\r\n } \r\n}\r\n\r\n\r\n"}, {"source_code": "= 29) {\r\n echo $s . PHP_EOL;\r\n }\r\n } \r\n}\r\n\r\n\r\n"}, {"source_code": "= 29) {\r\n echo $s;\r\n }\r\n } \r\n}\r\n\r\n\r\n"}, {"source_code": " 0) {\r\n $bCheck = 1;\r\n $sNum = $a[$i];\r\n if ($sNum == 1) {\r\n $a[$i] = 0;\r\n } else {\r\n $a[$i] = 1;\r\n }\r\n // }\r\n \r\n $iCheck2 = 0;\r\n for ($q = 0; $q < $n-1; $q++) {\r\n for ($j = $q+1; $j < $n; $j++) {\r\n if ($a[$q] > $a[$j]) {\r\n $iCheck2++;\r\n }\r\n }\r\n }\r\n $aMax[$i] = $iCheck2;\r\n \r\n if ($bCheck) {\r\n $a[$i] = $sNum;\r\n }\r\n }\r\n \r\n echo max($aMax) . PHP_EOL;\r\n}"}, {"source_code": " $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n \r\n echo $iCheck . PHP_EOL;\r\n } else {\r\n $bCheck = 0;\r\n $aMax = [];\r\n for ($i = 0; $i < $n-1; $i++) {\r\n \r\n $bCheck = 1;\r\n $sNum = $a[$i];\r\n if ($sNum == 1) {\r\n $a[$i] = 0;\r\n } else {\r\n $a[$i] = 1;\r\n }\r\n \r\n \r\n $iCheck = 0;\r\n for ($q = 0; $q < $n-1; $q++) {\r\n for ($j = $q+1; $j < $n; $j++) {\r\n if ($a[$q] > $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n $aMax[$i] = $iCheck;\r\n \r\n if ($bCheck) {\r\n $a[$i] = $sNum;\r\n }\r\n }\r\n \r\n echo max($aMax) . PHP_EOL;\r\n }\r\n}"}, {"source_code": " $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n \r\n echo $iCheck . PHP_EOL;\r\n } else {\r\n $bCheck = 0;\r\n $aMax = [];\r\n for ($i = 0; $i < $n-1; $i++) {\r\n if ($i > 0) {\r\n $bCheck = 1;\r\n $sNum = $a[$i];\r\n if ($sNum == 1) {\r\n $a[$i] = 0;\r\n } else {\r\n $a[$i] = 1;\r\n }\r\n }\r\n \r\n $iCheck = 0;\r\n for ($q = 0; $q < $n-1; $q++) {\r\n for ($j = $q+1; $j < $n; $j++) {\r\n if ($a[$q] > $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n $aMax[$i] = $iCheck;\r\n \r\n if ($bCheck) {\r\n $a[$i] = $sNum;\r\n }\r\n }\r\n \r\n echo max($aMax) . PHP_EOL;\r\n }\r\n}"}, {"source_code": " $a[$j]) {\r\n $iCheck++;\r\n }\r\n }\r\n }\r\n \r\n echo $iCheck . PHP_EOL;\r\n}"}, {"source_code": " $max1)\r\n {\r\n $max2 = $max1;\r\n $max1 = $array[$index];\r\n }\r\n\r\n else if ($array[$index] > $max2)\r\n {\r\n $max2 = $array[$index];\r\n }\r\n }\r\n\r\n return array($max1, $max2);\r\n}\r\n"}], "src_uid": "0657ce4ce00addefc8469381c57294fc"} {"source_code": "1 && $a[$last-1]==$a[$last-2]) {\n \t$a[$last-2]++;\n \t$last--;\n }\n}\nprintf(\"%d\\n\",$last);\nfor($i=0;$i<$last;$i++)\n{\n printf(\"%d \",$a[$i]);\n}\n?>", "positive_code": [{"source_code": "1 && $a[$last-1]==$a[$last-2]) {\n \t$a[$last-2]++;\n \t$last--;\n }\n}\nprintf(\"%d\\n\",$last);\nfor($i=0;$i<$last;$i++)\n{\n printf(\"%d \",$a[$i]);\n}\n?>"}, {"source_code": "1 && $a[$last-1]==$a[$last-2]) {\n \t$a[$last-2]++;\n \t$last--;\n }\n}\nprintf(\"%d\\n\",$last);\nfor($i=0;$i<$last;$i++)\n{\n printf(\"%d \",$a[$i]);\n}\n?>"}], "negative_code": [], "src_uid": "8c715616c8fa373c95368cf4795a2e6a"} {"source_code": " 0) {\r\n $count = $count + $karakter;\r\n if ($i > 0) $count ++;\r\n }\r\n $i--;\r\n }\r\n echo $count;\r\n echo \"\\n\";\r\n // var_dump($result);\r\n}", "positive_code": [{"source_code": "';\r\n \r\n $res = 0;\r\n for ($i=0; $i';\n}\n\nfunction stdin() {\n $stdin = @fopen('data.txt', 'r');\n if (!$stdin) {\n $stdin = fopen('php://stdin', 'r');\n }\n\n return $stdin;\n}\n\nfunction g() {\n global $stdin;\n return trim(fgets($stdin));\n}\n\n$stdin = stdin();\n/****************************************************** Solving block *****************************************************/\n$n = g();\n\n$stat = explode(' ', g());\n$stat = array_unique($stat);\nsort($stat);\n\necho isset($stat[1]) ? $stat[1] : 'NO';\n\n?>", "positive_code": [{"source_code": ""}, {"source_code": " $min) {\n echo $number;\n break;\n }\n }\n }\n}"}, {"source_code": "\n$n=trim(fgets(STDIN));\n$arr=explode(' ',trim(fgets(STDIN)));\nsort($arr);\nfunction stat2(&$arr){\n for($i=1,$n=sizeof($arr);$i<$n;$i++){\n if($arr[0]!=$arr[$i])\n return $arr[$i];\n }\n}\n$res = stat2($arr);\n$r=($res!=null) ? $res : \"NO\";\necho $r;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0) {print $r;} else {print $l;};\n?>"}, {"source_code": ""}, {"source_code": "0) {print $r;} else {print \"NO\";};\n?>"}, {"source_code": " $min) {\n echo $number;\n break;\n }\n }\n }\n}"}, {"source_code": " $min)\n {\n echo $number;\n break;\n }\n}"}, {"source_code": "\n$n=trim(fgets(STDIN));\n$arr=explode(' ',trim(fgets(STDIN)));\nsort($arr);\nfunction stat2(&$arr){\n for($i=1,$n=sizeof($arr);$i<$n;$i++){\n if($arr[0]!=$arr[$i])\n return $arr[$i];\n }\n}\n$res = stat2($arr);\n$res=(!null) ? $res : \"NO\";\necho $res;\n?>"}, {"source_code": "\n$n=trim(fgets(STDIN));\n$arr=explode(' ',trim(fgets(STDIN)));\nsort($arr);\nfunction stat2(&$arr){\n for($i=1,$n=sizeof($arr);$i<$n;$i++){\n if($arr[0]!=$arr[$i])\n return $arr[$i];\n }\n}\necho stat2($arr);\n?>"}], "src_uid": "930be5ec102fbe062062aa23eac75187"} {"source_code": " 0, \"A\" => 0, \"F\" => 0);\n $in = 0;\n $all = 0;\n\n for ($i = 0; $i < $n; ++$i) {\n if ($str[$i] == \"I\")\n ++$in;\n if ($str[$i] == \"A\")\n ++$all;\n }\n\n if ($in > 1)\n print(0);\n else if ($in == 1)\n print(1);\n else\n print($all);\n?>", "positive_code": [{"source_code": " 0, F => 0, I => 0);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\nif($c[I] == 0)\n{\n print $c[A];\n}\nelseif($c[I] == 1)\n{\n if(($c[A] > 0) || ($c[F] > 0))\n {\n print \"1\";\n }\n else\n {\n print \"0\";\n }\n}\nelseif($c[I] > 1)\n{\n print \"0\";\n}\n?>"}, {"source_code": "\n\tfgets(STDIN);\n\t$d = trim(fgets(STDIN));\n\t$a = substr_count($d, 'I');\n\tprint ($a<1 ? substr_count($d, 'A') : ($a>1 ? 0 : 1));\n ?>"}, {"source_code": "\n\tfgets(STDIN);\n\t$d = trim(fgets(STDIN));\n\t$a = substr_count($d, 'I');\n\techo ($a<1 ? substr_count($d, 'A') : ($a>1 ? 0 : 1));\n ?>"}, {"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $a = substr_count($data, 'I');\n if ($a == 1) print 1;\n elseif ($a > 1) print 0;\n else print substr_count($data, 'A');\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $a = substr_count($data, 'I');\n if ($a == 1){\n \tprint 1;\n }elseif ($a > 1){\n \tprint 1;\n }else print substr_count($data, 'A');\n ?>"}, {"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $arr = array();\n for ($i=0;$i0){\r\n $res += $d;\r\n if ($i!=(strlen($s)-1)) $res++;\r\n }\r\n \r\n// echo 'res = '.$res.'
';\r\n }\r\n \r\n echo $res.\"\\r\\n\";\r\n}\r\n\r\n $n = trim(fgets(STDIN));\r\n for ($i=0; $i<$n; $i++){\r\n $l = trim(fgets(STDIN));\r\n $s = trim(fgets(STDIN));\r\n clock($s);\r\n }\r\n\r\n/* \r\n clock('007');\r\n clock('1000');\r\n clock('00000');\r\n clock('103');\r\n clock('2020');\r\n clock('123456789');\r\n clock('001678294039710047203946100020');\r\n*/\r\n?>"}], "negative_code": [], "src_uid": "6571fdd506a858d7620c2faa0fe46cc1"} {"source_code": "0&&$c_25>0) {\n\t\t\t$c_50--;\n\t\t\t$c_25--;\n\t\t}\n\t\telse if($c_25>=3) $c_25-=3;\n\t\telse die(\"NO\\n\");\n\t}\n}\n\necho \"YES\\n\";\n\n?>", "positive_code": [{"source_code": " 0)\n {\n $c[0]--;\n $c[1]--;\n $c[2]++;\n if(($c[0] < 0) || ($c[1] < 0))\n {\n $d = 1;\n break;\n }\n }\n else\n {\n $c[0] -= 3;\n $c[2]++;\n if(($c[0] < 0) || ($c[1] < 0))\n {\n $d = 1;\n break;\n }\n }\n }\n}\nif($d == \"1\")\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>"}, {"source_code": "\n\n$n = (int)fgets(STDIN);\n\n$data = explode(\" \", fgets(STDIN));\n\n$bill25 = 0;\n$bill50 = 0;\n\nforeach($data as $current_bill) {\n \n if($current_bill == 25) {\n $bill25++;\n continue;\n }\n \n if($current_bill == 50) {\n if($bill25 > 0) {\n $bill25--;\n $bill50++;\n continue;\n } else {\n die(\"NO\");\n }\n }\n \n if($current_bill == 100) {\n if($bill50 > 0 && $bill25 > 0) {\n $bill50--;\n $bill25--;\n continue;\n } elseif($bill25 >= 3) {\n $bill25 -= 3;\n continue;\n } else {\n die(\"NO\");\n }\n }\n}\n\ndie(\"YES\");"}, {"source_code": " 0) {\n\t\t\t$t1 --;\n\t\t\t$t2 ++;\n\t\t}\n\t\telse {\n\t\t\t$ok = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\telse {\n\t\tif($t1 > 0 && $t2 >0) {\n\t\t\t$t1 --;\n\t\t\t$t2 --;\n\t\t}\n\t\telse if($t1 > 2) {\n\t\t\t\t$t1 -= 3;\n\t\t}\n\t\telse {\n\t\t\t$ok = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n} \necho ($ok == 1)? \"YES\" : \"NO\";\n\n?>"}, {"source_code": "\n\nerror_reporting(false);\n\n$handle = fopen('php://stdin', 'r');\n\nif (file_exists(\"in.txt\")) {\n $handle = fopen('in.txt', 'r');\n set_time_limit(1);\n};\n\nfgets($handle);\n$arr = array(\"25\"=>0, \"50\"=>0, \"100\"=>0);\n$list = explode(\" \", fgets($handle));\n\nforeach($list as $price) {\n if ($price == 25) $arr[\"25\"]++;\n else {\n\n if ($price == 50) {\n if ($arr[\"25\"] < 1) die(\"NO\");\n else {\n $arr[\"25\"]--;\n $arr[\"50\"]++;\n }\n }\n\n if ($price == 100) {\n\n if ($arr[\"25\"] < 1) die(\"NO\");\n if ($arr[\"50\"] > 0) {\n $arr[\"25\"]--;\n $arr[\"50\"]--;\n } else {\n if ($arr[\"25\"] < 3) die(\"NO\");\n $arr[\"25\"] -= 3;\n }\n }\n }\n}\n\ndie(\"YES\");\n?>\n\n"}, {"source_code": " 0) {\n $c25 --;\n $c50 ++;\n } else {\n $isYes = false;\n break;\n }\n } else if ($a[$i] == 100) {\n if ($c50 > 0 && $c25 > 0) {\n $c50 --;\n $c25 --;\n } else if ($c25 > 2) {\n $c25 -= 3;\n } else {\n $isYes = false;\n break;\n }\n }\n}\n\nprint ($isYes ? 'YES' : 'NO');\n\nfunction getLine() {\n return trim(fgets(STDIN));\n}\n"}], "negative_code": [{"source_code": ""}, {"source_code": "$pre+25) $flag=false; \n\t$pre+=25;\n}\n\nif($flag) echo \"YES\\n\";\nelse echo \"NO\\n\";\n\n?>"}, {"source_code": "$pre+25) $flag=false; \n\t$pre+=$input[$i];\n}\n\nif($flag) echo \"YES\\n\";\nelse echo \"NO\\n\";\n\n?>"}, {"source_code": "\n\n$n = (int)fgets(STDIN);\n\n$data = explode(\" \", fgets(STDIN));\n\n$bill25 = 0;\n$bill50 = 0;\n\nforeach($data as $current_bill) {\n \n if($current_bill == 25) {\n $bill25++;\n continue;\n }\n \n if($current_bill == 50) {\n if($bill25 > 0) {\n $bill25--;\n continue;\n } else {\n die(\"NO\");\n }\n }\n \n if($current_bill == 100) {\n if($bill50 > 0 && $bill25 > 0) {\n $bill50--;\n $bill25--;\n continue;\n } elseif($bill25 >= 3) {\n $bill25 -= 3;\n continue;\n } else {\n die(\"NO\");\n }\n }\n}\n\ndie(\"YES\");"}, {"source_code": "\n\nerror_reporting(false);\n\n$handle = fopen('php://stdin', 'r');\n\nif (file_exists(\"in.txt\")) {\n $handle = fopen('in.txt', 'r');\n set_time_limit(1);\n};\n\nfgets($handle);\n$arr = array(\"25\"=>0, \"50\"=>0, \"100\"=>0);\n$list = explode(\" \", fgets($handle));\n\nforeach($list as $price) {\n if ($price == 25) $arr[\"25\"]++;\n else {\n\n if ($price == 50 && $arr[\"25\"] < 1) die(\"NO\");\n else {\n $arr[\"25\"]--;\n $arr[\"50\"]++;\n }\n\n if ($price == 100) {\n\n if ($arr[\"25\"] == 0) die(\"NO\");\n if ($arr[\"50\"] > 0) {\n $arr[\"25\"]--;\n $arr[\"50\"]--;\n $arr[\"100\"]++;\n } else {\n if ($arr[\"25\"] < 3) die(\"NO\");\n $arr[\"25\"]-=3;\n $arr[\"100\"]++;\n }\n\n\n\n }\n\n\n }\n}\n\ndie(\"YES\");\n\n\n\n\n\n?>\n\n"}], "src_uid": "63b20ab2993fddf2cc469c4c4e8027df"} {"source_code": "\n$n=trim(fgets(STDIN));\n$z=0;\nfor($i=0;$i<$n;$i++)\n {\n $p=explode(\" \",trim(fgets(STDIN)));\n if($p[1]-$p[0]>=2)++$z;\n }\n echo $z;\n?>", "positive_code": [{"source_code": "=2)\n{\n $m++;\n \n}\n\n}\necho $m;\n\n?>\n\n"}, {"source_code": "= 2) $move++;\n\t}\n\techo $move;\n?>"}, {"source_code": "= 2)\n {\n $d++;\n }\n}\nprint $d;\n?>"}, {"source_code": "1?1:0);\n\t\t$i=$i+1;\n\t}\n\techo $availability;\n?>"}, {"source_code": "= 2) $total++;\n\t}\n\techo $total;"}, {"source_code": "=2) {\n $count++;\n }\n unset($room);\n}\necho $count;"}, {"source_code": "= 2) ++$sum;\n}\n\nprintf(\"%d\", $sum);\n"}, {"source_code": " 1) \n\t $res += 1;\n}\n \necho $res;"}, {"source_code": "\n$rooms = 0;\n$data = file('php://stdin');\nif (!empty($data))\n{\n\t$roomsCnt = intval($data[0]);\n\tif ($roomsCnt > 100) $roomsCnt = 100;\n\tif ($roomsCnt > 0 && count($data) > 1){\t\t\n\t\tfor($i = 1; $i <= $roomsCnt; $i++){\n\t\t\t$room = explode(\" \", $data[$i]);\n\t\t\tif ($room[0] <= $room[1] - 2) $rooms++;\n\t\t}\n\t}\n}\necho $rooms;\n?>"}, {"source_code": "= 0){\n $k += +1;\n \n }\n }\n echo $k;\n?>"}, {"source_code": "=2 ) {\n ++$room;\n }\n\n if (++$COUNT > $n) {\n echo $room;\n break;\n }\n}\n"}, {"source_code": " 1);\n\t}\n\techo $c;\n?>"}, {"source_code": "= 2) $counter++;\n}\nprintf(\"%d\",$counter);\n?>"}, {"source_code": "= 2 ){\n $p++;\n }\n}\necho $p;"}, {"source_code": "1)$summ++;\n}\necho $summ;"}, {"source_code": "= 2) {\n $room++;\n }\n}\necho $room;\n\n"}, {"source_code": "=2)\n\t{\n\t\t$count++;\n\t}\n}\necho \"$count\";"}, {"source_code": "=2) {\n $summa +=1;\n}\n}\n echo $summa;"}, {"source_code": "1){\n $count++;\n }\n }\n\n echo $count;\n\n\n"}, {"source_code": " 1)\n $ans++; \n}\n\necho $ans;\n\n?>"}, {"source_code": " $val) {\n if ($val[1] - $val[0] >= 2) {\n $res++;\n }\n}\necho $res;\n\n?>"}, {"source_code": "= 2) $answer++; \n\t}\n\techo $answer;\n?>"}, {"source_code": "= 2) {\n $result++;\n }\n}\n\necho $result;\n"}, {"source_code": "=2) $ans++;\n}\necho $ans;\n?>"}, {"source_code": "=2){$ok++;}}print $ok;\n?>"}, {"source_code": "= 2)\n\t\t$spaces++;\n}\necho $spaces;\n?>"}, {"source_code": "= 2) {\n\t\t$hitung++;\n\t}\n\t$i++;\n}\necho $hitung;\n\n?>"}, {"source_code": "= 0) {\n\t\t$hitung++;\n\t}\n\t$i++;\n}\necho $hitung;\n\n?>"}, {"source_code": "= 2)$c++;\n}\n\necho $c;\n"}, {"source_code": " 1) {\n $col ++;\n }\n}\n\necho $col;\n\n?>\n"}, {"source_code": "= $pCount) {\n $sCount++;\n }\n}\n\necho $sCount;\n\n?>"}, {"source_code": " 1);\n}\n\nprint $output;\n"}, {"source_code": " 1) {\n $answer++;\n }\n}\n\necho $answer . PHP_EOL;\n"}, {"source_code": "= 2){\n\t\t\t$result++;\n\t\t\t//print_r($result);\n\t\t\n\t}\n\n\n\n}\nprint_r($result);"}, {"source_code": "= 2) $c++;\n}\n\necho $c;\n"}, {"source_code": "= 2) {\n $room_remain++;\n }\n}\necho $room_remain.\"\\n\";\n"}, {"source_code": " 1) {\n $j++; \n }\n }\n \n\n \n echo $j;\n \n?>"}, {"source_code": "=2){\n $c++;\n }\n}\n\necho $c.\"\\n\";\n\n\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "\n$data = file('php://stdin');\n$roomsCnt = intval($data[0]);\nif ($roomsCnt > 100) $roomsCnt = 100;\nif ($roomsCnt > 0 && count($data) > 1){\n\t$rooms = 0;\n\tfor($i = 1; $i <= $roomsCnt; $i++){\n\t\t$room = explode(\" \", $data[$i]);\n\t\tif ($room[0] < $room[1] - 2) $rooms++;\n\t}\n\techo $rooms;\n}\n?>"}, {"source_code": "\n$data = file('php://stdin');\n$roomsCnt = intval($data[0]);\nif ($roomsCnt > 100) $roomsCnt = 100;\n$rooms = 0;\nif ($roomsCnt > 0 && count($data) > 1){\t\t\n\tfor($i = 1; $i <= $roomsCnt; $i++){\n\t\t$room = explode(\" \", $data[$i]);\n\t\tif ($room[0] < $room[1] - 2) $rooms++;\n\t}\n}\necho $rooms;\n?>"}, {"source_code": "\nif (file_exists('php://stdin'))\n{\n\t$data = file('php://stdin');\n\t$roomsCnt = intval($data[0]);\n\tif ($roomsCnt > 100) $roomsCnt = 100;\n\t$rooms = 0;\n\tif ($roomsCnt > 0 && count($data) > 1){\t\t\n\t\tfor($i = 1; $i <= $roomsCnt; $i++){\n\t\t\t$room = explode(\" \", $data[$i]);\n\t\t\tif ($room[0] < $room[1] - 2) $rooms++;\n\t\t}\n\t}\n\techo $rooms;\n}\n?>"}, {"source_code": "\n\t\n\t\t\n\t\n\t\n\t\n\t\n\tif(!empty($living)):?>\n\t\n\t\t\n\t\n\t\n"}, {"source_code": "\n$data = file('php://stdin');\n$roomsCnt = intval($data[0]);\nif ($roomsCnt > 100) $roomsCnt = 100;\nif ($roomsCnt > 0){\n\t$rooms = 0;\n\tfor($i = 1; $i <= $roomsCnt; $i++){\n\t\t$room = explode(\" \", $data[$i]);\n\t\tif ($room[0] < $room[1] - 2) $rooms++;\n\t}\n\techo $rooms;\n}\n?>"}, {"source_code": "=2 ) {\n ++$room;\n }\n\n if (++$COUNT >= $n) {\n echo $room;\n break;\n }\n}\n"}, {"source_code": " 2) $counter++;\n}\nprintf(\"%d\",$counter);\n?>"}, {"source_code": "1)$summ++;\n}\necho $summ;"}, {"source_code": " $array[$i]['person'] ) {\n $room++;\n }\n}\necho $room;\n\n"}, {"source_code": " $array[$i]['person'] ) {\n $room++;\n }\n}\necho $room;\n\n"}, {"source_code": "$a = (int)trim(fgets(STDIN));\n$b = '';\n$c = 0;\n\nfor($i = 0; $i < $a; $i++){\n $b = explode(\" \", trim(fgets(STDIN)));\n if(((int)$b[1] - (int)$b[0]) > 2)$c++;\n}\n\necho $c;"}, {"source_code": " 2)$c++;\n}\n\necho $c;"}, {"source_code": " 1) {\n $col ++;\n }\n}\n\necho $col;\n\n?>\n"}, {"source_code": " 1) {\n $col ++;\n }\n}\n\necho $col;\n\n?>\n"}, {"source_code": " 1) {\n $col++;\n }\n}\n\necho $col;\n\n?>\n"}, {"source_code": " 1) {\n $j++; \n }\n }\n \n\n \n echo $j;\n \n?>"}, {"source_code": " 0) $move++;\n\t}\n\techo $move;\n?>"}, {"source_code": "= 0) $move++;\n\t}\n\techo $move;\n?>"}, {"source_code": " 0) $move++;\n\t}\n\techo $move;\n?>"}, {"source_code": ""}], "src_uid": "2a6c457012f7ceb589b3dea6b889f7cb"} {"source_code": " $v)\n{\n if (($sum - $v) % 2 == 0)\n {\n $c++;\n }\n}\necho $c;\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $v)\n {\n if ($k % 2 == 0)\n $c += $v;\n }\n}\nelse\n{\n foreach ($mas_count as $k => $v)\n {\n if ($k % 2 != 0)\n $c += $v;\n }\n}\necho $c;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "4c59b4d43b59c8659bf274f3e29d01fe"} {"source_code": "9) {\n $g = $ans;\n while ($g > 9) {\n $mod1 = ((int)($g / 10))*10;\n // var_dump($mod1);die();\n $base+=$mod1;\n $g=((int)($g / 10))+($g%10);\n }\n $base+=$g;\n echo $base.\"\\n\";\n }else\n {\n echo ($ans+$base).\"\\n\";\n }\n\n\n\n}\n\n\n?>", "positive_code": [{"source_code": "\n"}, {"source_code": ""}, {"source_code": "= 10) {\n \n $d = $n % 10;\n $s = floor($n / 10);\n \n $n = $d + $s;\n $total += $s * 10 ;\n }\n $total += $n;\n \n echo $total .\"\\n\";\n \n \n \n }\n "}, {"source_code": "\n\n$n = intval(fgets(STDIN));\nfor ($i = 0; $i < $n; $i++) {\n $money = intval(fgets(STDIN));\n $cashback = 0;\n $total = 0;\n while($money > 9) {\n $cashback = intdiv($money, 10);\n $total += 10 * $cashback;\n $money = $money - 9 * $cashback;\n }\n $total += $money;\n echo $total.\"\\n\";\n}\n?>"}], "negative_code": [{"source_code": "\n"}], "src_uid": "0beecbd62aa072a2f3aab542eeb56373"} {"source_code": "= 0; $x--)\n{\n if($c[$x] == \"L\")\n {\n $g = $a - $x - 1;\n $f = 1;\n break;\n }\n elseif($c[$x] == \"R\")\n {\n $f = 2;\n break;\n }\n}\n$h = 0;\n$i = 0;\n$j = array();\nfor($x = 0; $x < $a; $x++)\n{\n if($c[$x] == \"L\")\n {\n $h = 1;\n $i = $x;\n }\n if(($c[$x] == \"R\") && ($h == 1))\n {\n array_push($j, $x - $i - 1);\n $h = 0;\n }\n}\n$k = 0;\n$l = 0;\n$m = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($c[$x] == \"R\")\n {\n $k = 1;\n $l = $x;\n }\n if(($c[$x] == \"L\") && ($k == 1))\n {\n $n = $x - $l - 1;\n $o = $n % 2;\n if($o != 0)\n {\n $m++;\n }\n $k = 0;\n }\n}\n$p = array_unique($c);\nif((count($p) == 1) && ($p[0] == \".\"))\n{\n print $a;\n}\nelse\n{\n print $e + $g + array_sum($j) + $m;\n}\n?>", "positive_code": [{"source_code": "= 0; $i--) {\n \tif($stat == 0 && $S[$i] == 'L') {\n \t\t$S[$i] = 'L';\n \t\t$stat = 1;\n \t}\n \telseif($stat == 1 && $S[$i] == '.') {\n \t\t$S[$i] = 'L';\n \t}\n \telseif($stat == 1 && $S[$i] == 'R') \n \t\t$stat = 0;\n \telseif($stat == 0 && $S[$i] == '.')\n \t\t$ans++;\n }\n //echo \"{$S}\";//}\n echo \"{$ans}\\n\";\n?>"}], "negative_code": [{"source_code": "= 0; $i--) {\n \tif($stat == 0 && $S[$i] == 'L') {\n \t\t$S[$i] = 'L';\n \t\t$stat = 1;\n \t}\n \telseif($stat == 1 && $S[$i] == '.') {\n \t\t$S[$i] = 'L';\n \t}\n \telseif($stat == 1) \n \t\t$stat = 0;\n \telseif($stat == 0)\n \t\t$ans++;\n }\n echo \"{$ans}\\n\";\n?>"}, {"source_code": "= 0; $i--) {\n \tif($stat == 0 && $S[$i] == 'L') {\n \t\t$S[$i] = 'L';\n \t\t$stat = 1;\n \t}\n \telseif($stat == 1 && $S[$i] == '.') {\n \t\t$S[$i] = 'L';\n \t}\n \telseif($stat == 1) \n \t\t$stat = 0;\n \telseif($stat == 0 && $S[$i] == '.')\n \t\t$ans++;\n }\n //echo \"{$S}\";//}\n echo \"{$ans}\\n\";\n?>"}, {"source_code": "= 0; $i--) {\n \tif($stat == 0 && $S[$i] == 'L') {\n \t\t$S[$i] = 'L';\n \t\t$stat = 1;\n \t}\n \telseif($stat == 1 && $S[$i] == '.') {\n \t\t$S[$i] = 'L';\n \t}\n \telseif($stat == 1) \n \t\t$stat = 0;\n \telseif($stat == 0 && $S[$i] == '.')\n \t\t$ans++;\n }\n //echo \"{$S}\";//}\n echo \"{$ans}\\n\";\n?>"}], "src_uid": "54c748dd983b6a0ea1af1153d08f1c01"} {"source_code": "", "positive_code": [{"source_code": "= $n) {\n echo ($n -1) . \"\\n\";\n } else {\n echo (abs($a - $b) + $m) . \"\\n\";\n }\n}\n"}, {"source_code": " $f[$i][3]) {\n while ($x < $f[$i][1] && $f[$i][2] < $f[$i][0]) {\n $x += 1;\n $f[$i][2] += 1;\n }\n while ($x < $f[$i][1] && $f[$i][3] > 1) {\n $x += 1;\n $f[$i][3] -= 1; \n }\n echo abs($f[$i][3] - $f[$i][2]).PHP_EOL;\n } else {\n while ($x < $f[$i][1] && $f[$i][3] < $f[$i][0]) {\n $x += 1;\n $f[$i][3] += 1; \n }\n while ($x < $f[$i][1] && $f[$i][2] > 1) {\n $x += 1;\n $f[$i][2] -= 1; \n }\n echo abs($f[$i][3] - $f[$i][2]).PHP_EOL;\n }\n\n}\n\n\n?>"}, {"source_code": "=$value[0]){echo $value[0]-1;}\n else{echo abs($value[2]-$value[3])+$value[1];}\n if($i!= $arr[0]+1) echo \"\\n\";\n}\n?>"}, {"source_code": "=$str1[0])\n {\n echo ($str1[0]-$ans-1)+$ans.\"\\n\";\n }else{\n echo $ans+$str1[1].\"\\n\";\n }\n \n }\n\n\n}\n\nsolve();\n?>"}], "negative_code": [{"source_code": " $f[$i][3]) {\n while ($x < $f[$i][1] && $f[$i][2] < $f[$i][0]) {\n $x += 1;\n $f[$i][2] += 1;\n }\n while ($x < $f[$i][1] && $f[$i][3] > 1) {\n $x += 1;\n $f[$i][3] -= 1; \n }\n echo abs($f[$i][3] - $f[$i][2]).PHP_EOL;\n } else {\n while ($x < $f[$i][1] && $f[$i][3] < $f[$i][0]) {\n $x += 1;\n $f[$i][3] += 1; \n }\n while ($x < $f[$i][1] && $f[$i][2] > 1) {\n $x += 1;\n $f[$i][2] -= 1; \n }\n echo abs($f[$i][3] - $f[$i][2]).PHP_EOL;\n }\n\n}\n\n\n?>"}, {"source_code": "$value[0]){echo $value[0]-1;}\n else{echo abs($value[2]-$value[3])+$value[1];}\n if($i!= $arr[0]+1) echo \"\\n\";\n}\n?>"}, {"source_code": "=$value[2]+$value[1]){echo abs($value[2]+$value[1]-$value[3]);}\n elseif($value[0]<$value[2]+$value[1] && $value[3]-$value[1]>=1){echo abs($value[0]-($value[0]-$value[1]+$value[3]));}\n elseif($value[0]<$value[2]+$value[1] && $value[3]-$value[1]<1){echo abs($value[0]-1);}\n if($i!= $arr[0]+1) echo \"\\n\";\n}\n\n?>"}, {"source_code": "$str1[0])\n {\n echo ($str1[0]-$ans-1)+$ans.\"\\n\";\n }else{\n echo $ans+$str1[1].\"\\n\";\n }\n \n }\n\n\n}\n\nsolve();\n?>"}], "src_uid": "1fd2619aabf4557093a59da804fd0e7b"} {"source_code": "", "positive_code": [{"source_code": " $res) {\n $res = $i * $a[$i];\n }\n }\n echo \"{$res}\\n\";"}], "negative_code": [{"source_code": ""}], "src_uid": "991516fa6f3ed5a71c547a3a50ea1a2b"} {"source_code": " 1) {\n \techo '2 ';\n \techo $x.' '.$y;\n\n \tif ($y==$ogran) {\n \t\t$counter = ($counter+1)%2;\n \t\t\t$iter = $swit[$counter][0];\n \t\t$ogran = $swit[$counter][1];\n \t\t$x++;\n \t}\n \telse {\n \t\t$y+=$iter;\n \t}\n\n \techo ' '.$x.' '.$y.PHP_EOL;\n \t$k--;\n\n \tif ($y==$ogran) {\n \t\t$counter = ($counter+1)%2;\n \t\t\t$iter = $swit[$counter][0];\n \t\t$ogran = $swit[$counter][1];\n \t\t$x++;\n \t}\n \telse {\n \t\t$y+=$iter;\n \t}\n }\n echo ($n*$m-2*$copyK);\n\n while ($x<=$n) {\n \techo ' '.$x.' '.$y;\n\n \tif ($y==$ogran) {\n \t\t$counter = ($counter+1)%2;\n \t\t\t$iter = $swit[$counter][0];\n \t\t$ogran = $swit[$counter][1];\n \t\t$x++;\n \t}\n \telse {\n \t\t$y+=$iter;\n \t}\n }\n\n\n?>", "positive_code": [{"source_code": "= 1; $y--)\n {\n $h[$k] = $x;\n $k++;\n $h[$k] = $y;\n $k++;\n $m = $k - $l;\n if(($m % 4 == 0) && ($l < count($f)))\n {\n $h[$k] = $f[$l];\n $k++;\n $l++;\n }\n }\n }\n}\n$p = 0;\n$n = 0;\nfor($x = 0; $x < count($f) - 1; $x++)\n{\n $n += $f[$x] * 2 + 1;\n $r = \"\";\n for($y = $p; $y < $n; $y++)\n {\n $r .= $h[$y] . \" \";\n }\n print trim($r) . \"\\n\";\n $p = $n;\n}\n$n += $f[$x] * 2 + 1;\n$r = \"\";\nfor($y = $p; $y < $n; $y++)\n{\n $r .= $h[$y] . \" \";\n}\nprint trim($r);\n$p = $n;\n?>"}], "negative_code": [], "src_uid": "779e73c2f5eba950a20e6af9b53a643a"} {"source_code": "", "positive_code": [{"source_code": "= 0 && $i+$plen <= $strlen-1 && ($center || $offset)){\n\t\t$center = ($center && ($i-$plen >= 0) && $string[$i-$plen] == $string[$i+$plen]);\n\t\tif ($center) {\n\t\t\t#$palyndrom[$i-$plen][] = $plen+$plen+1;\n\t\t\tif (!isset($arEndPoints[$i+$plen+1])) $arEndPoints[$i+$plen+1] = 1;\n\t\t\telse ++$arEndPoints[$i+$plen+1];\n\n\t\t\tif (!isset($palCount[$i-$plen])) $palCount[$i-$plen] = 1;\n\t\t\telse ++$palCount[$i-$plen];\n\n\t\t\t#echo substr($string, $i-$plen, $plen+$plen+1).\"\\n\";\n\t\t\t$result += $strlen - ($plen+$plen+1);\n\t\t}\n\n\t\t$offset = $offset && ($string[$i-$plen+1] == $string[$i+$plen]);\n\t\tif ($offset) {\n\t\t\t#$palyndrom[$i-$plen+1][] = $plen+$plen;\n\t\t\tif (!isset($arEndPoints[$i+$plen+1])) $arEndPoints[$i+$plen+1] = 1;\n\t\t\telse ++$arEndPoints[$i+$plen+1];\n\n\t\t\tif (!isset($palCount[$i-$plen+1])) $palCount[$i-$plen+1] = 1;\n\t\t\telse ++$palCount[$i-$plen+1];\n\n\n\t\t\t#echo substr($string, $i-$plen+1, $plen+$plen).\"\\n\";\n\t\t\t$result += $strlen - ($plen+$plen);\n\t\t}\n\n\t\t\n\t\t++$plen;\n\t}\n}\n\n$sumPalCount = array();\n$count = max(array_keys($palCount));#count($palCount);\n$last = $count;\n$sumPalCount[$last] = $palCount[$last];\nfor($i=$count-1; $i>=0; --$i){\n\tif (isset($palCount[$i])){\n\t\t$sumPalCount[$i] = $palCount[$i] + $sumPalCount[$last];\n\t\t$last = $i;\n\t}\n}\n\n\n$pairCount = 0;\n$endPoints = array_keys($arEndPoints);\n$endPointsCount = count($endPoints);\n\nfor($i=0; $i<$endPointsCount; ++$i){\n\tfor($k=$endPoints[$i]; $k<=$count; ++$k){\n\t\tif (isset($palCount[$k])){\n\t\t\t#$pairCount += $palCount[$k];\n\t\t\t$pairCount += $sumPalCount[$k] * $arEndPoints[$endPoints[$i]];\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n$resultSingle /= 2;\n$result += $resultSingle + $pairCount;\necho $result;\n\n?>"}, {"source_code": "= 0 && $i2 < $n && $a[$i1] === $a[$i2])\n {\n if (!isset($p1[$i1])) $p1[$i1] = 0;\n $p1[$i1]++;\n if (!isset($p2[$i2])) $p2[$i2] = 0;\n $p2[$i2]++;\n $i1--;\n $i2++;\n }\n\n $i1 = $i;\n $i2 = $i + 1;\n while ($i1 >= 0 && $i2 < $n && $a[$i1] === $a[$i2])\n {\n if (!isset($p1[$i1])) $p1[$i1] = 0;\n $p1[$i1]++;\n if (!isset($p2[$i2])) $p2[$i2] = 0;\n $p2[$i2]++;\n $i1--;\n $i2++;\n }\n}\nksort($p2);\n$sum = '0';\nforeach ($p2 as $k => $v)\n{\n $sum = bcadd($sum, $v, 0);\n $p2[$k] = array($v, $sum);\n}\n$n = '0';\n$n2 = count($p2);\n$ks = array_keys($p2);\nforeach ($p1 as $k => $cnt)\n{\n $a = 0;\n $b = $n2 - 1;\n while ($a !== $b)\n {\n $c = ($a + $b) >> 1;\n if ($ks[$c] < $k)\n {\n if ($a === $c) break;\n $a = $c;\n }\n else\n {\n $b = $c;\n }\n }\n while ($a < $n2 && $ks[$a] < $k) $a++;\n $a--;\n if ($a >= 0) $n = bcadd($n, bcmul($cnt, $p2[$ks[$a]][1], 0), 0);\n}\nfprintf(STDOUT, \"%s\\n\", $n);\n"}], "negative_code": [], "src_uid": "1708818cf66de9fa03439f608c897a90"} {"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n$vals = $ir->readArrayOfInt($n);\n$vals[] = 0;\n$s = $ir->readString() . ' ';\n\n$dmg = '0';\n\n$groupSymbol = '';\n\n$group = [];\nfor($i=0; $i<=$n; $i++) {\n\tif ($s[$i] == $groupSymbol) {\n\t\t$group[] = $vals[$i];\n\t} else {\n\t\t$cnt = count($group);\n\t\tforeach ($group as $gg) {\n\t\t\t$dmg = bcadd($dmg, $gg);\n\t\t}\n\t\t$j = $cnt - $k;\n\t\tif ($j>0) {\n\t\t\tsort($group);\n\t\t\twhile ($j--) {\n\t\t\t\t$dmg = bcsub($dmg, $group[$j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$groupSymbol = $s[$i];\n\t\t$group = [$vals[$i]];\n\t}\n}\n\necho $dmg;\n", "positive_code": [{"source_code": " insert($c[0]);\nfor($x = 0; $x < $a; $x++)\n{\n if($d[$x] == $d[$x + 1])\n {\n $f -> insert($c[$x + 1]);\n }\n else\n {\n for($y = 0; $y < $b; $y++)\n {\n $e += $f -> extract();\n if($f -> isEmpty() == TRUE)\n {\n break;\n }\n }\n $f = new SplMaxHeap();\n $f -> insert($c[$x + 1]);\n }\n}\nprintf(\"%.0f\", $e);\n?>"}], "negative_code": [{"source_code": " insert($c[0]);\nfor($x = 0; $x < $a; $x++)\n{\n if($d[$x] == $d[$x + 1])\n {\n $f -> insert($c[$x + 1]);\n }\n else\n {\n for($y = 0; $y < $b; $y++)\n {\n $e += $f -> extract();\n if($f -> isEmpty() == TRUE)\n {\n break;\n }\n }\n $f = new SplMaxHeap();\n $f -> insert($c[$x + 1]);\n }\n}\nprint $e;\n?>"}, {"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n$vals = $ir->readArrayOfInt($n);\n$vals[] = 0;\n$s = $ir->readString() . ' ';\n\n$dmg = 0;\n\n$groupSymbol = '';\n\n$group = [];\nfor($i=0; $i<=$n; $i++) {\n\tif ($s[$i] == $groupSymbol) {\n\t\t$group[] = $vals[$i];\n\t} else {\n\t\t//var_dump($group);\n\t\t$cnt = count($group);\n\t\t$dmg += array_sum($group);\n\t\t$j = $cnt - $k;\n\t\tif ($j>0) {\n\t\t\tsort($group);\n\t\t\twhile ($j--) {\n\t\t\t\t$dmg -= $group[$j];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$groupSymbol = $s[$i];\n\t\t$group = [$vals[$i]];\n\t}\n}\n\necho $dmg;\n"}, {"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n$vals = $ir->readArrayOfInt($n);\n$vals[] = 0;\n$s = $ir->readString() . ' ';\n\n$dmg = '0';\n\n$groupSymbol = '';\n\n$group = [];\nfor($i=0; $i<=$n; $i++) {\n\tif ($s[$i] == $groupSymbol) {\n\t\t$group[] = $vals[$i];\n\t} else {\n\t\t//var_dump($group);\n\t\t$cnt = count($group);\n\t\t$dmg = bcadd($dmg, array_sum($group));\n\t\t$j = $cnt - $k;\n\t\tif ($j>0) {\n\t\t\tsort($group);\n\t\t\twhile ($j--) {\n\t\t\t\t$dmg = bcsub($dmg, $group[$j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$groupSymbol = $s[$i];\n\t\t$group = [$vals[$i]];\n\t}\n}\n\necho $dmg;\n"}], "src_uid": "aa3b5895046ed34e89d5fcc3264b3944"} {"source_code": " $a)\n {\n break;\n }\n }\n while(TRUE)\n {\n if(($i < 0) || ($j < 0) || ($k < 0))\n { \n break;\n }\n if($i < $a)\n {\n $i += $g;\n $k++;\n }\n elseif($i == $a)\n {\n $l = 1;\n break;\n }\n elseif($i > $a)\n {\n $i -= $h;\n $j--;\n }\n }\n if($l == 0)\n {\n $g = max($b, $c);\n $h = min($b, $c);\n $i = 0;\n $j = 0;\n $k = 0;\n $l = 0;\n while(TRUE)\n {\n $i += $h;\n $j++;\n if($i > $a)\n {\n break;\n }\n }\n while(TRUE)\n {\n if(($i < 0) || ($j < 0) || ($k < 0))\n {\n break;\n }\n if($i < $a)\n {\n $i += $g;\n $k++;\n }\n elseif($i == $a)\n {\n $l = 1;\n break;\n }\n elseif($i > $a)\n {\n $i -= $h;\n $j--;\n }\n }\n if($l == 0)\n {\n print \"-1\";\n }\n else\n {\n $m = array();\n $n = 0;\n for($x = 1; $x <= $j; $x++)\n {\n $o = substr($d, $n, $h);\n $n += $h;\n array_push($m, $o);\n }\n for($x = 1; $x <= $k; $x++)\n {\n $o = substr($d, $n, $g);\n $n += $g;\n array_push($m, $o);\n }\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \"\\n\";\n }\n print $m[$x];\n }\n }\n else\n {\n $m = array();\n $n = 0;\n for($x = 1; $x <= $j; $x++)\n {\n $o = substr($d, $n, $h);\n $n += $h;\n array_push($m, $o);\n }\n for($x = 1; $x <= $k; $x++)\n {\n $o = substr($d, $n, $g);\n $n += $g;\n array_push($m, $o);\n }\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \"\\n\";\n }\n print $m[$x];\n }\n }\n}\n?>", "positive_code": [{"source_code": " $a)\n {\n break;\n }\n }\n while(TRUE)\n {\n if(($i < 0) || ($j < 0) || ($k < 0))\n { \n break;\n }\n if($i < $a)\n {\n $i += $g;\n $k++;\n }\n elseif($i == $a)\n {\n $l = 1;\n break;\n }\n elseif($i > $a)\n {\n $i -= $h;\n $j--;\n }\n }\n if($l == 0)\n {\n $g = max($b, $c);\n $h = min($b, $c);\n $i = 0;\n $j = 0;\n $k = 0;\n $l = 0;\n while(TRUE)\n {\n $i += $h;\n $j++;\n if($i > $a)\n {\n break;\n }\n }\n while(TRUE)\n {\n if(($i < 0) || ($j < 0) || ($k < 0))\n {\n break;\n }\n if($i < $a)\n {\n $i += $g;\n $k++;\n }\n elseif($i == $a)\n {\n $l = 1;\n break;\n }\n elseif($i > $a)\n {\n $i -= $h;\n $j--;\n }\n }\n if($l == 0)\n {\n print \"-1\";\n }\n else\n {\n $m = array();\n $n = 0;\n for($x = 1; $x <= $j; $x++)\n {\n $o = substr($d, $n, $h);\n $n += $h;\n array_push($m, $o);\n }\n for($x = 1; $x <= $k; $x++)\n {\n $o = substr($d, $n, $g);\n $n += $g;\n array_push($m, $o);\n }\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \"\\n\";\n }\n print $m[$x];\n }\n }\n else\n {\n $m = array();\n $n = 0;\n for($x = 1; $x <= $j; $x++)\n {\n $o = substr($d, $n, $h);\n $n += $h;\n array_push($m, $o);\n }\n for($x = 1; $x <= $k; $x++)\n {\n $o = substr($d, $n, $g);\n $n += $g;\n array_push($m, $o);\n }\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \"\\n\";\n }\n print $m[$x];\n }\n }\n}\n?>"}], "negative_code": [{"source_code": "=1;$i--)\n{\n if($i*$p==$n)\n {\n $ans1=$i;\n $ans2=$p;\n $k=1;\n $i=0;\n }\n else if($i*$q==$n)\n {\n $ans1=$i;\n $ans2=$q;\n $k=1;\n $i=0;\n }\n else if($p+$q==$n)\n {\n echo \"2\\n\";\n echo substr($s,0,$p).\"\\n\";\n echo substr($s,$p).\"\\n\";\n $k=1;\n $i=0; \n }\n}\n$c=0;\necho $ans1.\"\\n\";\nfor($j=1;$j<=$ans1;$j++)\n{\n echo substr($s,$c,$ans2).\"\\n\";\n $c=$c+$ans2;\n}\nif($k==0) \n echo \"-1\";\n\n\n\n?>"}, {"source_code": "=1;$i--)\n{\n if($i*$p==$n)\n {\n $ans1=$i;\n $ans2=$p;\n $k=1;\n $i=0;\n }\n else if($i*$q==$n)\n {\n $ans1=$i;\n $ans2=$q;\n $k=1;\n $i=0;\n }\n else if($p+$q==$n)\n {\n echo \"2\";\n echo substr($s,0,$p);\n echo substr($s,$p);\n $k=1;\n $i=0; \n }\n}\n$c=0;\necho $ans1;\nfor($j=1;$j<=$ans1;$j++)\n{\n $c=$c+ans1;\n echo substr($s,$c,$ans2);\n}\nif($k==0) \n echo \"-1\";\n\n\n?>"}, {"source_code": "=1;$i--)\n{\n if($i*$p==$n)\n {\n $ans1=$i;\n $ans2=$p;\n $k=1;\n $i=0;\n }\n else if($i*$q==$n)\n {\n $ans1=$i;\n $ans2=$q;\n $k=1;\n $i=0;\n }\n else if($p+$q==$n)\n {\n echo \"2\\n\";\n echo substr($s,0,$p).\"\\n\";\n echo substr($s,$p).\"\\n\";\n $k=1;\n $i=0; \n }\n}\n$c=0;\necho $ans1.\"\\n\";\nfor($j=1;$j<=$ans1;$j++)\n{\n echo substr($s,$c,$ans2).\"\\n\";\n $c=$c+$ans2;\n}\nif($k==0) \n echo \"-1\";\n\n\n\n?>"}, {"source_code": "=1;$i--)\n{\n if($i*$p==$n)\n {\n $ans1=$i;\n $ans2=$p;\n $k=1;\n $i=0;\n }\n else if($i*$q==$n)\n {\n $ans1=$i;\n $ans2=$q;\n $k=1;\n $i=0;\n }\n else if($p+$q==$n)\n {\n echo \"2\\n\";\n echo substr($s,0,$p).\"\\n\";\n echo substr($s,$p).\"\\n\";\n $k=1;\n $i=0; \n }\n}\n$c=0;\necho $ans1.\"\\n\";\nfor($j=1;$j<=$ans1;$j++)\n{\n echo substr($s,$c,$ans2).\"\\n\";\n $c=$c+$ans2;\n}\nif($k==0) \n echo \"-1\";\n\n\n\n?>"}, {"source_code": "=1;$i--)\n{\n\tif($i*$p==$n)\n\t{\n\t\t$ans1=$i;\n\t\t$ans2=$p;\n\t\t$k=1;\n\t\t$i=0;\n\t}\n\telse if($i*$q==$n)\n\t{\n\t\t$ans1=$i;\n\t\t$ans2=$q;\n\t\t$k=1;\n\t\t$i=0;\n\t}\n\telse if($p+$q==$n)\n\t{\n\t\techo \"2\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:
\n\t\t\n\t\t$rooms = 0;\n\t\tfor($i = 0; $i < $roomsCnt; $i++){\n\t\t\tif ($living[$i] < $maxLiving[$i] - 1) $rooms++;\n\t\t}\n\t\techo $rooms;\n\t\t?>\n\t
\";\n\t\techo substr($s,0,$p).\"
\";\n\t\techo substr($s,$p).\"
\";\n\t\t$k=1;\n\t\t$i=0;\t\t\n\t}\n}\n$c=0;\necho $ans1.\"
\";\nfor($j=1;$j<=$ans1;$j++)\n{\n\t$c=$c+ans1;\n\techo substr($s,$c,$ans2).\"
\";\n}\nif($k==0)\t\n\techo \"-1\";\n\n\n?>"}, {"source_code": ""}, {"source_code": "=1;$i--)\n{\n if($i*$p==$n)\n {\n $ans1=$i;\n $ans2=$p;\n $k=1;\n $i=0;\n }\n else if($i*$q==$n)\n {\n $ans1=$i;\n $ans2=$q;\n $k=1;\n $i=0;\n }\n else if($p+$q==$n)\n {\n echo \"2\\n\";\n echo substr($s,0,$p).\"\\n\";\n echo substr($s,$p).\"\\n\";\n $k=1;\n $i=0; \n }\n}\n$c=0;\necho $ans1.\"\\n\";\nfor($j=1;$j<=$ans1;$j++)\n{\n echo substr($s,($ans2*($j-1)),($ans2*$j)).\"\\n\";\n}\nif($k==0) \n echo \"-1\";\n\n\n?>"}, {"source_code": "=1;$i--)\n{\n if($i*$p==$n)\n {\n $ans1=$i;\n $ans2=$p;\n $k=1;\n $i=0;\n }\n else if($i*$q==$n)\n {\n $ans1=$i;\n $ans2=$q;\n $k=1;\n $i=0;\n }\n else if($p+$q==$n)\n {\n echo \"2\\n\";\n echo substr($s,0,$p).\"\\n\";\n echo substr($s,$p).\"\\n\";\n $k=1;\n $i=0; \n }\n}\n$c=0;\necho $ans1.\"\\n\";\nfor($j=1;$j<=$ans1;$j++)\n{\n echo substr($s,$c,$ans2).\"\\n\";\n $c=$c+$ans2;\n}\nif($k==0) \n echo \"-1\";\n\n\n\n?>"}], "src_uid": "c4da69789d875853beb4f92147825ebf"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $time) {\n $freeTime = 86400 - $time;\n\n $timeRequired -= $freeTime;\n\n if($timeRequired <= 0) {\n echo $day + 1;\n break;\n }\n}\n"}, {"source_code": "\n"}, {"source_code": "=$requiredTime){echo$minRequiredTime;break;}\n}"}, {"source_code": "=$requiredTime){\n echo$minRequiredDay;\n break;\n }\n}"}, {"source_code": "= $requiredTime) {\n echo $minRequiredDay;\n break;\n }\n}"}, {"source_code": "=$b){echo$e;break;}}"}, {"source_code": "=$a){echo$d;break;}}"}, {"source_code": "=$b){echo$e;break;}}"}], "negative_code": [{"source_code": "^/XfK_'\"Fe\\~G(Kg9D!^!=b&PBR66_4WS_hc6_td>sMD/{Wx/vYy_\".gZ8Dc"}], "src_uid": "8e423e4bec2d113612a4dc445c4b86a9"} {"source_code": "= 2) {\n $m=(int)($n/2);\n if ($m >= $b) {\n $result[]=$b;\n continue;\n }\n $i+=$m;\n $b-=$m;\n $a-=$m*3;\n }\n $i += (int)(min($a,$b) / 2);\n $result[] = $i;\n}\necho implode(\"\\n\", $result);\n\n\t\t \t\t\t\t \t \t \t\t\t\t \t \t\t\t \t\t", "positive_code": [{"source_code": ""}, {"source_code": "= 2) {\n $m=(int)($n/2);\n if ($m >= $b) {\n $result[]=$b;\n continue;\n }\n $i+=$m;\n $b-=$m;\n $a-=$m*3;\n }\n $i += (int)(min($a,$b) / 2);\n $result[] = $i;\n}\necho implode(\"\\n\", $result);\n"}], "negative_code": [{"source_code": " 2) {\n $m=(int)($n/2);\n if ($m >= $b) {\n $result[]=$b;\n continue;\n }\n $i+=$m;\n $b-=$m;\n }\n $i += (int)($b / 2);\n $result[] = $i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": " 2) {\n $m=(int)(($n-2)/2);\n if ($m >= $b) {\n $result[]=$b;\n continue;\n }\n $i+=$m;\n $b-=$m;\n }\n $i += (int)($b / 2);\n $result[] = $i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": " 2) {\n $m=(int)(($n-2)/2);\n if ($m >= $b) {\n $result[]=$b;\n continue;\n }\n $i+=$m;\n $a-=3*$m;\n }\n $i += (int)($a / 2);\n $result[] = $i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": "= 4 && min($a, $b) > 0) {\n $k=false;\n while ($a % $n === 0 && $b % $n === 0) {\n $n *= 10;\n $k=true;\n }\n if($k){\n $n = max($n / 100, 1);\n $a /= $n;\n $b /= $n;\n }\n if ($a > $b) {\n $a -= 3;\n --$b;\n } elseif ($b > $a) {\n $b -= 3;\n --$a;\n } else {\n $b -= 2;\n $a -= 2;\n }\n if (max($a, $b) < 0) {\n break;\n }\n $i+=$n;\n }\n $result[] = $i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": "100000 && $b>100000) {\n $a-=100000;\n $b-=100000;\n $i+=50000;\n }\n while ($a + $b >= 4 && min($a,$b)>0) {\n if ($a > $b) {\n $a-=3;\n --$b;\n }elseif ($b > $a) {\n $b-=3;\n --$a;\n } else {\n $b-=2;\n $a-=2;\n }\n if (max($a,$b)<0) {\n break;\n }\n ++$i;\n }\n if ($i === 250000500) {\n $i=375000000;\n }\n if ($i === 166666833) {\n $i=333333333;\n }\n $result[]=$i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": "1000 && $b>1000) {\n $a-=1000;\n $b-=1000;\n $i+=500;\n }\n while ($a + $b >= 4 && min($a,$b)>0) {\n if ($a > $b) {\n $a-=3;\n --$b;\n }elseif ($b > $a) {\n $b-=3;\n --$a;\n } else {\n $b-=2;\n $a-=2;\n }\n if (max($a,$b)<0) {\n break;\n }\n ++$i;\n }\n if ($i === 250000500) {\n $i=375000000;\n }\n $result[]=$i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": "1000 && $b>1000) {\n $a-=1000;\n $b-=1000;\n $i+=500;\n }\n while ($a + $b >= 4 && min($a,$b)>0) {\n if ($a > $b) {\n $a-=3;\n --$b;\n }elseif ($b > $a) {\n $b-=3;\n --$a;\n } else {\n $b-=2;\n $a-=2;\n }\n if (max($a,$b)<0) {\n break;\n }\n ++$i;\n }\n $result[]=$i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": "1000 && $b>1000) {\n $a-=1000;\n $b-=1000;\n $i+=500;\n }\n while ($a + $b >= 4 && min($a,$b)>0) {\n if ($a > $b) {\n $a-=3;\n --$b;\n }elseif ($b > $a) {\n $b-=3;\n --$a;\n } else {\n $b-=2;\n $a-=2;\n }\n if (max($a,$b)<0) {\n break;\n }\n ++$i;\n }\n $result[]=$i;\n}\necho implode(\"\\n\", $result);\n"}, {"source_code": "1000 && $b>1000) {\n $a-=1000;\n $b-=1000;\n $i+=500;\n }\n while ($a + $b >= 4 && min($a,$b)>0) {\n if ($a > $b) {\n $a-=3;\n --$b;\n }elseif ($b > $a) {\n $b-=3;\n --$a;\n } else {\n $b-=2;\n $a-=2;\n }\n if (max($a,$b)<0) {\n break;\n }\n ++$i;\n }\n $result[]=$i;\n}\necho implode(\"\\n\", $result);"}, {"source_code": "1000 && $b>1000) {\n $a-=1000;\n $b-=1000;\n $i+=500;\n }\n while ($a + $b >= 4 && min($a,$b)>0) {\n if ($a > $b) {\n $a-=3;\n --$b;\n }elseif ($b > $a) {\n $b-=3;\n --$a;\n } else {\n $b-=2;\n $a-=2;\n }\n if (max($a,$b)<0) {\n break;\n }\n ++$i;\n }\n $result[]=$i;\n}\necho implode(\"\\n\", $result);\n"}], "src_uid": "8a1ceac1440f7cb406f12d9fc2ca0e20"} {"source_code": "> 1;\n if ($dp[$m] >= $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n \n $n = fgets(STDIN);\n $a = explode(\" \", trim(fgets(STDIN)));\n $dp = array_fill(0, $n, 0);\n $dp[0] = $a[0];\n $ans = 1;\n for ($i = 1; $i < $n; $i++) {\n if ($a[$i] > $dp[$ans - 1]) $dp[$ans++] = $a[$i];\n elseif ($a[$i] < $dp[0]) $dp[0] = $a[$i];\n else $dp[lowerBound($dp, 0, $ans, $a[$i])] = $a[$i];\n }\n\n echo $ans;\n \n \n", "positive_code": [{"source_code": " n = $n + 10;\n $this -> count = array_fill(1, $this -> n , 0);\n }\n\n public function update($i, $val) {\n for (; $i <= $this -> n; $i += $i & -$i) $this -> count[$i] = max($this -> count[$i], $val);\n }\n \n public function get($i) {\n $max = 0;\n for (; $i > 0; $i -= $i & -$i) $max = max($max, $this -> count[$i]);\n return $max;\n }\n }\n \n $n = fgets(STDIN);\n $a = explode(\" \", trim(fgets(STDIN)));\n $fw = new Fenwick($n);\n $ans = 0;\n for ($i = 0; $i < $n; $i++) {\n $cur = $fw -> get($a[$i]) + 1;\n $fw -> update($a[$i], $cur);\n $ans = max($ans, $cur);\n }\n\n echo $ans;\n \n \n"}], "negative_code": [{"source_code": " n = $n + 10;\n $this -> count = array_fill(1, $GLOBALS['n'] , 0);\n }\n\n public function update($i, $val) {\n for (; $i <= $GLOBALS['n']; $i += $i & -$i) $GLOBALS['count'][$i] = max($GLOBALS['count'][$i], $val);\n }\n \n public function get($i) {\n $max = 0;\n for (; $i > 0; $i -= $i & -$i) $max = max($max, $GLOBALS['count'][$i]);\n return $max;\n }\n }\n \n $n = fgets(STDIN);\n $a = explode(\" \", trim(fgets(STDIN)));\n $fw = new Fenwick($n);\n $ans = 0;\n for ($i = 0; $i < $n; $i++) {\n $cur = $fw -> get($a[$i]) + 1;\n $fw -> update($a[$i], $cur);\n $ans = max($ans, $cur);\n }\n\n echo $ans;\n \n \n"}, {"source_code": " n = $n;\n $this -> count = array_fill(1, $n, 0);\n }\n\n public function update($i, $val) {\n for (; $i <= $this -> n; $i += $i & -$i) $this -> count[$i] = max($this -> count[$i], $val);\n }\n \n public function get($i) {\n $max = 0;\n for (; $i > 0; $i -= $i & -$i) $max = max($max, $this -> count[$i]);\n return $max;\n }\n }\n \n $n = fgets(STDIN);\n $a = explode(\" \", trim(fgets(STDIN)));\n $fw = new Fenwick($n);\n $ans = 0;\n for ($i = 0; $i < $n; $i++) {\n $cur = $fw -> get($a[$i]) + 1;\n $fw -> update($a[$i], $cur);\n $ans = max($ans, $cur);\n }\n\n echo $ans;\n \n \n"}, {"source_code": "> 1;\n if ($dp[$m] >= $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n \n $n = fgets(STDIN);\n $a = array_reverse(explode(\" \", trim(fgets(STDIN))));\n $dp = array_fill(0, $n, 0);\n $dp[0] = $a[0];\n $ans = 1;\n for ($i = 1; $i < $n; $i++) {\n if ($a[$i] > $dp[$ans - 1]) $dp[$ans++] = $a[$i];\n elseif ($a[$i] < $dp[0]) $dp[0] = $a[$i];\n else $dp[lowerBound($dp, 0, $ans, $a[$i])] = $a[$i];\n }\n\n echo $ans;\n \n \n"}], "src_uid": "e132767dd89801a237b998a410b22a44"} {"source_code": "", "positive_code": [{"source_code": "$c) {\r\n //Each test case\r\n $result_1=[];\r\n for ($j = 0; $j < 3; $j++) {\r\n $ct=$c;unset($ct[$j]);shuffle($ct);\r\n// die(json_encode($c));\r\n $c1=$ct[0];$c2=$ct[1];$c0=$c[$j];\r\n //Retrieved $c1,$c2 and $c0 as now value\r\n $diff1=($c0>$c1)?0:($c1-$c0+1);\r\n $diff2=($c0>$c2)?0:($c2-$c0+1);\r\n $result_1[]=max($diff1,$diff2);\r\n }\r\n $results[]=$result_1;\r\n}\r\n//print_r($results);\r\nforeach ($results as $caseNo =>$r) {\r\n printf(\"%d %d %d\",$r[0],$r[1],$r[2]);\r\n if($caseNo !=($caseCount-1)){print(\"\\n\");}\r\n}"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($a,$b,$c) = IO::arr();\r\n $votes = array();\r\n if ($a == $b && $a == $c) {\r\n $votes[] = 1;\r\n $votes[] = 1;\r\n $votes[] = 1;\r\n $res[] = $votes;\r\n continue;\r\n }\r\n\r\n $max = max($a, $b);\r\n $max = max($c, $max);\r\n\r\n $fa = false;\r\n $fb = false;\r\n $fc = false;\r\n if ($a == $b || $a == $c) {\r\n $fa = true;\r\n }\r\n\r\n if ($b == $a || $b == $c) {\r\n $fb = true;\r\n }\r\n\r\n if ($c == $a || $c == $b) {\r\n $fc = true;\r\n }\r\n $win = $max + 1;\r\n\r\n if ($a == $max) {\r\n if ($fa) {\r\n $a = 1;\r\n } else {\r\n $a = 0;\r\n }\r\n } else {\r\n $a = $win - $a;\r\n }\r\n\r\n if ($b == $max) {\r\n if ($fb) {\r\n $b = 1;\r\n } else {\r\n $b = 0;\r\n }\r\n } else {\r\n $b = $win - $b;\r\n }\r\n\r\n if ($c == $max) {\r\n if ($fc) {\r\n $c = 1;\r\n } else {\r\n $c = 0;\r\n }\r\n } else {\r\n $c = $win - $c;\r\n }\r\n\r\n $votes = [$a, $b, $c];\r\n\r\n $res[] = $votes;\r\n}\r\n\r\nfunction setValue($a, $b, $c, $max) {\r\n if ($max == 0);\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $f) {\r\n echo $f . ' ';\r\n }\r\n echo PHP_EOL;\r\n}"}, {"source_code": " $sV) {\r\n if ($k == $sV) {\r\n $iCount++;\r\n }\r\n }\r\n foreach ($aArray as $sK => $sV) {\r\n if ($k == $sV) {\r\n if ($k == 0) {\r\n $aAnswer[] = 1;\r\n } else {\r\n if ($iCount > 1) {\r\n $aAnswer[] = 1;\r\n } else {\r\n $aAnswer[] = 0;\r\n }\r\n }\r\n } else {\r\n $aAnswer[] = ($k - $sV) + 1;\r\n }\r\n }\r\n echo implode(\" \", $aAnswer). \"\\n\";\r\n}"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($a,$b,$c) = IO::arr();\r\n $votes = array();\r\n if ($a == $b && $a == $c) {\r\n $votes[] = $a+1;\r\n $votes[] = $a+1;\r\n $votes[] = $a+1;\r\n $res[] = $votes;\r\n continue;\r\n }\r\n\r\n $max = max($a, $b);\r\n $max = max($c, $max);\r\n\r\n $fa = false;\r\n $fb = false;\r\n $fc = false;\r\n if ($a == $b || $a == $c) {\r\n $fa = true;\r\n }\r\n\r\n if ($b == $a || $b == $c) {\r\n $fb = true;\r\n }\r\n\r\n if ($c == $a || $c == $b) {\r\n $fc = true;\r\n }\r\n $win = $max + 1;\r\n\r\n if ($a == $max) {\r\n if ($fa) {\r\n $a = 1;\r\n } else {\r\n $a = 0;\r\n }\r\n } else {\r\n $a = $win - $a;\r\n }\r\n\r\n if ($b == $max) {\r\n if ($fb) {\r\n $b = 1;\r\n } else {\r\n $b = 0;\r\n }\r\n } else {\r\n $b = $win - $b;\r\n }\r\n\r\n if ($c == $max) {\r\n if ($fc) {\r\n $c = 1;\r\n } else {\r\n $c = 0;\r\n }\r\n } else {\r\n $c = $win - $c;\r\n }\r\n\r\n $votes = [$a, $b, $c];\r\n\r\n $res[] = $votes;\r\n}\r\n\r\nfunction setValue($a, $b, $c, $max) {\r\n if ($max == 0);\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $f) {\r\n echo $f . ' ';\r\n }\r\n echo PHP_EOL;\r\n}"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($a,$b,$c) = IO::arr();\r\n $votes = array();\r\n if ($a == $b && $a == $c) {\r\n $votes[] = $a+1;\r\n $votes[] = $a+1;\r\n $votes[] = $a+1;\r\n $res[] = $votes;\r\n continue;\r\n }\r\n\r\n $max = max($a, $b);\r\n $max = max($c, $max);\r\n\r\n if ($a - $max == 0) {\r\n $votes[] = 0;\r\n $votes[] = $max - $b + 1;\r\n $votes[] = $max - $c + 1;\r\n } else if ($b - $max == 0) {\r\n $votes[] = $max - $a + 1;\r\n $votes[] = 0;\r\n $votes[] = $max - $c + 1;\r\n } else if ($c - $max == 0) {\r\n $votes[] = $max - $a + 1;\r\n $votes[] = $max - $b + 1;\r\n $votes[] = 0;\r\n }\r\n\r\n $res[] = $votes;\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $f) {\r\n echo $f . ' ';\r\n }\r\n echo PHP_EOL;\r\n}"}, {"source_code": " $sV) {\r\n if ($k == $sV) {\r\n if ($k == 0) {\r\n $aAnswer[] = 1;\r\n } else {\r\n $aAnswer[] = 0;\r\n }\r\n } else {\r\n $aAnswer[] = ($k - $sV) + 1;\r\n }\r\n }\r\n echo implode(\" \", $aAnswer). \"\\n\";\r\n}"}, {"source_code": " $sV) {\r\n if ($k == $sV) {\r\n $aAnswer[] = 0;\r\n } else {\r\n $aAnswer[] = $k - $sV + 1;\r\n }\r\n }\r\n echo implode(\" \", $aAnswer). \"\\n\";\r\n }\r\n}"}, {"source_code": "$c) {\r\n //Each test case\r\n $result_1=[];\r\n for ($j = 0; $j < 3; $j++) {\r\n $ct=$c;unset($ct[$j]);shuffle($ct);\r\n// die(json_encode($c));\r\n $c1=$ct[0];$c2=$ct[1];$c0=$c[$j];\r\n //Retrieved $c1,$c2 and $c0 as now value\r\n $diff1=($c0>$c1)?0:($c1-$c0+1);\r\n $diff2=($c0>$c2)?0:($c2-$c0+1);\r\n $result_1[]=max($diff1,$diff2);\r\n }\r\n $results[]=$result_1;\r\n}\r\n//print_r($results);\r\nforeach ($results as $caseNo =>$r) {\r\n printf(\"%d %d %d\",$r[0],$r[1],$r[2]);\r\n if($caseNo !=($caseCount-1)){print(\"\\n\");}\r\n}"}], "src_uid": "f80dea1e07dba355bfbefa4ff65ff45a"} {"source_code": "= $c[$x][$y + 1])\n {\n $e = 1;\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n}\nfor($x = 0; $x < $b; $x++)\n{\n for($y = 0; $y < $a - 1; $y++)\n {\n if($c[$y][$x] >= $c[$y + 1][$x])\n {\n $e = 1;\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n}\nfor($x = 0; $x < $a; $x++)\n{\n for($y = 0; $y < $b - 1; $y++)\n {\n if($d[$x][$y] >= $d[$x][$y + 1])\n {\n $e = 1;\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n}\nfor($x = 0; $x < $b; $x++)\n{\n for($y = 0; $y < $a - 1; $y++)\n {\n if($d[$y][$x] >= $d[$y + 1][$x])\n {\n $e = 1;\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n}\nif($e == 0)\n{\n print \"Possible\";\n}\nelse\n{\n print \"Impossible\";\n}\n?>", "positive_code": [{"source_code": " 0 && ($a[$i][$j] <= $a[$i-1][$j] || $b[$i][$j] <= $b[$i-1][$j]))\n || ($j > 0 && ($a[$i][$j] <= $a[$i][$j-1] || $b[$i][$j] <= $b[$i][$j-1]))\n ) {\n die('Impossible');\n }\n }\n}\necho 'Possible';\n"}], "negative_code": [], "src_uid": "53e061fe3fbe3695d69854c621ab6037"} {"source_code": "\n\n$n = trim(fgets(STDIN));\n$arr = [];\nfor($i=0;$i<$n;$i++){\n\t$arr[$i]=str_split(trim(fgets(STDIN)));\n}\n$cnt = 0;\n\n\n\nfor($i=0;$i<$n;$i++){\n\tfor($j=0;$j<$n;$j++){\n\t\tif($arr[$i][$j]==\"X\"&&$i!=0&&$j!=0&&$i!=$n-1&&$j!=$n-1){\n\t\t\t\n\t\t\tif($arr[$i-1][$j-1]==\"X\"&&$arr[$i-1][$j+1]==\"X\"&&$arr[$i+1][$j-1]==\"X\"&$arr[$i+1][$j+1]==\"X\"){\n\t\t\t\t$cnt++;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $cnt;\n", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "3270260030fc56dda3e375af4dad9330"} {"source_code": "handleCommand($command);\r\n}\r\n\r\necho $zingerTower->getColor();\r\n\r\nclass Zinger\r\n{\r\n const LOCK_COMMAND = 'lock';\r\n const UNLOCK_COMMAND = 'unlock';\r\n static $colorCommands = [\r\n 'red',\r\n 'orange',\r\n 'yellow',\r\n 'green',\r\n 'blue',\r\n 'indigo',\r\n 'violet',\r\n ];\r\n\r\n private $isLocked = false;\r\n private $color = 'blue';\r\n\r\n public function handleCommand(string $command): void\r\n {\r\n switch ($command) {\r\n case self::LOCK_COMMAND: $this->lock(); break;\r\n case self::UNLOCK_COMMAND: $this->unlock(); break;\r\n case in_array($command, self::$colorCommands): $this->changeColor($command);break;\r\n default: echo 'command undefined';\r\n }\r\n }\r\n\r\n public function getColor(): string\r\n {\r\n return $this->color;\r\n }\r\n\r\n private function lock(): void\r\n {\r\n if ($this->isLocked) {\r\n return;\r\n }\r\n\r\n $this->isLocked = true;\r\n }\r\n\r\n private function unlock(): void\r\n {\r\n if (!$this->isLocked) {\r\n return;\r\n }\r\n\r\n $this->isLocked = false;\r\n }\r\n\r\n private function changeColor(string $color): void\r\n {\r\n if ($this->isLocked) {\r\n return;\r\n }\r\n\r\n $this->color = $color;\r\n }\r\n}\r\n\r\nfunction readInput()\r\n{\r\n $commandsCount = trim(fgets(STDIN));\r\n if (empty($commandsCount)) {\r\n return [];\r\n }\r\n\r\n $result = [];\r\n\r\n for ($i = 0; $i < $commandsCount; $i++) {\r\n $result[] = trim(fgets(STDIN));\r\n }\r\n\r\n return $result;\r\n}\r\n", "positive_code": [{"source_code": " 100){\r\n echo $lastColor; \r\n }else{\r\n \r\n foreach ($actions as $i => $action){\r\n \r\n if($i==0) continue;\r\n \r\n\t if($action == 'lock'){\r\n\t $lock = true;\r\n\t }\r\n\t if($action == 'unlock'){\r\n\t $lock = false;\r\n\t }\r\n\t if($action != 'unlock' && $action != 'lock' && !$lock){\r\n\t $lastColor = $action;\r\n\t }\r\n\t \r\n }\r\n \r\n echo $lastColor; \r\n }\r\n?>"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "handleCommand($command);\r\n}\r\n\r\necho $zingerTower->getColor();\r\n\r\nclass Zinger\r\n{\r\n const LOCK_COMMAND = 'lock';\r\n const UNLOCK_COMMAND = 'unlock';\r\n static $colorCommands = [\r\n 'red',\r\n 'orange',\r\n 'yellow',\r\n 'green',\r\n 'blue',\r\n 'indigo',\r\n 'violet',\r\n ];\r\n\r\n private $isLocked = false;\r\n private $color = 'blue';\r\n\r\n public function handleCommand(string $command): void\r\n {\r\n switch ($command) {\r\n case self::LOCK_COMMAND: $this->lock(); break;\r\n case self::UNLOCK_COMMAND: $this->unlock(); break;\r\n case in_array($command, self::$colorCommands): $this->changeColor($command);break;\r\n default: echo 'command undefined';\r\n }\r\n }\r\n\r\n public function getColor(): string\r\n {\r\n return $this->color;\r\n }\r\n\r\n private function lock(): void\r\n {\r\n if ($this->isLocked) {\r\n return;\r\n }\r\n\r\n $this->isLocked = true;\r\n }\r\n\r\n private function unlock(): void\r\n {\r\n if (!$this->isLocked) {\r\n return;\r\n }\r\n\r\n $this->isLocked = true;\r\n }\r\n\r\n private function changeColor(string $color): void\r\n {\r\n if ($this->isLocked) {\r\n return;\r\n }\r\n\r\n $this->color = $color;\r\n }\r\n}\r\n\r\nfunction readInput()\r\n{\r\n $commandsCount = trim(fgets(STDIN));\r\n if (empty($commandsCount)) {\r\n return [];\r\n }\r\n\r\n $result = [];\r\n\r\n for ($i = 0; $i < $commandsCount; $i++) {\r\n $result[] = trim(fgets(STDIN));\r\n }\r\n\r\n return $result;\r\n}\r\n"}], "src_uid": "6215233349b0f682a238a476e9153ac4"} {"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($xa, $ya) = $ir->readArrayOfInt(2);\nlist($xb, $yb) = $ir->readArrayOfInt(2);\nlist($xc, $yc) = $ir->readArrayOfInt(2);\n\n$xs = [$xa, $xb, $xc]; \n$ys = [$ya, $yb, $yc]; \nsort($ys);\nsort($xs);\n\n$ymid = $ys[1];\n\n$trace = [];\nfor ($i=$xs[0]; $i<=$xs[2]; $i++) {\n\t$trace[$i.\" \".$ys[1]] = true;\n}\n\nfor ($i=min([$ya,$ys[1]]); $i<=max([$ya,$ys[1]]); $i++) {\n\t$trace[$xa.\" \".$i] = true;\n}\n\nfor ($i=min([$yb,$ys[1]]); $i<=max([$yb,$ys[1]]); $i++) {\n\t$trace[$xb.\" \".$i] = true;\n}\n\nfor ($i=min([$yc,$ys[1]]); $i<=max([$yc,$ys[1]]); $i++) {\n\t$trace[$xc.\" \".$i] = true;\n}\n\necho count($trace).\"\\n\";\nforeach ($trace as $k=>$v) {\n\techo $k.\"\\n\";\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "1a358e492dfd7e226138ea64e432c180"} {"source_code": " floor($b/($i))) {\n $iCount = floor($b/($i));\n } else {\n $iCount = $aArray[$i];\n }\n $iAnswer += $iCount;\n $b = $b - $iCount * $i;\n }\n $iAnswer += $aArray[0];\n echo $iAnswer . \"\\n\";\n}", "positive_code": [{"source_code": " 0) {\n $ar[$t+1] -=1;\n $ar[$t] +=1;\n break;\n } \n } \n echo $ar[0] . \"\\n\";\n }\n \n }\n \n\n "}, {"source_code": "= $i){\n $d -= $i;\n $arr[$i]--;\n $arr[0]++;\n } \n else{\n print($arr[0]);\n echo \"\\n\";\n return;\n } \n\n } \n } \n\n print($arr[0]);\n echo \"\\n\";\n return;\n\n}"}, {"source_code": " $v){\n for($i = 1; $i <= $v && $boo; $i++){\n if($c >= $k){\n $d++;\n $c-= $k;\n } else {\n $boo = false;\n }\n }\n if(!$boo){\n break;\n }\n }\n \n echo $d.\"\\n\";\n}\n "}, {"source_code": " 0)\n {\n $e++;\n $c -= $y;\n $d[$y]--;\n if($c < 0)\n {\n $e--;\n break;\n }\n elseif($c == 0)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($c <= 0)\n {\n break;\n }\n }\n print $e . \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": "= $i) {\n $iCount += $i;\n }\n }\n echo $iCount + $aArray[0] . \"\\n\";\n}"}], "src_uid": "7bbb4b9f5eccfe13741445c815a4b1ca"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "bcf75978c9ef6202293773cf533afadf"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " 0; $i--) {\r\n $str = readline();\r\n if ($str[0] + $str[1] + $str[2] == $str[3] + $str[4] + $str[5]) {\r\n echo 'YES' . \"\\n\";\r\n } else {\r\n echo 'NO' . \"\\n\";\r\n }\r\n\r\n\r\n}\r\n\r\n?>"}, {"source_code": " $y ? $y : $x;\r\n }\r\n function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n \r\n function getMaxValueBc($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n function getRotate($a, $s, $e, $ind) {\r\n \t\t$ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n \t$ar[$i] = $a[$i];\r\n \t$j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n \t// echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\"; \r\n \t$a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n } \r\n function pr($s) {\r\n if(is_array($s)) {\r\n echo implode( ' ', $s), PHP_EOL;\r\n } else {\r\n echo $s, PHP_EOL;\r\n }\r\n }\r\n function fab2($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n \r\n return $a[$n];\r\n }"}, {"source_code": " 1) {\r\n $tamanho = 0;\r\n $soma_esquerda = 0;\r\n $soma_direita = 0;\r\n while ($tamanho < 6) {\r\n if ($tamanho < 3) {\r\n $soma_esquerda += $linha[$tamanho];\r\n } else {\r\n $soma_direita += $linha[$tamanho];\r\n }\r\n $tamanho++;\r\n }\r\n\r\n if ($soma_esquerda == $soma_direita) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n $primeira++;\r\n}\r\n"}], "negative_code": [{"source_code": " 1) {\r\n $tamanho = 0;\r\n $soma_esquerda = 0;\r\n $soma_direita = 0;\r\n while ($tamanho < 6) {\r\n if ($tamanho < 3) {\r\n $soma_esquerda += $linha[$tamanho];\r\n } else {\r\n $soma_direita += $linha[$tamanho];\r\n }\r\n $tamanho++;\r\n }\r\n\r\n if ($soma_esquerda == $soma_direita) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n $primeira++;\r\n}\r\n"}, {"source_code": " 1) {\r\n $linha = fgets($input);\r\n $tamanho = 0;\r\n $soma_esquerda = 0;\r\n $soma_direita = 0;\r\n while ($tamanho < 6) {\r\n if ($tamanho < 3) {\r\n $soma_esquerda += $linha[$tamanho];\r\n } else {\r\n $soma_direita += $linha[$tamanho];\r\n }\r\n $tamanho++;\r\n }\r\n\r\n if ($soma_esquerda == $soma_direita) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n $primeira++;\r\n}\r\n"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c7a5b4a015e28dd3759569bbdc130e93"} {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "6d5ecac49fe1320eef1391b6d5cf5f0d"} {"source_code": "\n\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "// I am Varun Das from Jadavpur University\n#include\n#pragma GCC target (\"avx2\")\n#pragma GCC optimization (\"O3\")\n#pragma GCC optimization (\"unroll-loops\")\n#define mod 1000000007\n#define ll long long\n#define dbg(x) cerr << #x << \" = \" << x << endl\n#define INF LLONG_MAX\n#define loop(i,a,b) for(int i=a;i=b;i--)\n#define nax 503405\nusing namespace std;\n\nint main() {\n#ifdef _DEBUG\n\tfreopen(\"input.txt\", \"r\", stdin);\n//\tfreopen(\"output.txt\", \"w\", stdout);\n#endif\nios_base::sync_with_stdio(false);\ncin.tie(NULL);\n//cout< >n;\nll k,s=0;\nloop(i,0,n) cin>>k,s+=k%2;\ncout< "}, {"source_code": ""}, {"source_code": "\n"}], "negative_code": [], "src_uid": "ac77e2e6c86b5528b401debe9f68fc8e"} {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n\r\n$t = IO::str();\r\n\r\n\r\nwhile ($t--) {\r\n $s = strtolower(IO::str());\r\n\r\n $asci = array();\r\n $arr = str_split($s);\r\n $min = 200;\r\n for ($i = 0; $i < strlen($s); $i++) {\r\n $k = ord($arr[$i]);\r\n if ($k < $min) {\r\n $min = $k;\r\n $idx = $i;\r\n }\r\n }\r\n\r\n $s1 = $arr[$idx];\r\n unset($arr[$idx]);\r\n\r\n $s2 = implode($arr);\r\n\r\n echo $s1 . ' ' . $s2 . PHP_EOL;\r\n}", "positive_code": [{"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function factorial($number)\r\n {\r\n $factorial = 1;\r\n for ($i = 1; $i <= $number; $i++){\r\n $factorial = $factorial * $i;\r\n }\r\n return $factorial;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $s = IO::str();\r\n $a = str_split($s);\r\n $min = 'z';\r\n $mink = 99;\r\n foreach ($a as $k => $v) {\r\n if ($v <= $min) {\r\n $min = $v;\r\n $mink = $k;\r\n }\r\n }\r\n unset($a[$mink]);\r\n $s1 = $min;\r\n $s2 = implode('', $a);\r\n IO::line($s1 . ' ' . $s2);\r\n}\r\n\r\n\r\n?>\r\n\r\n\r\n\r\n\r\n"}], "negative_code": [], "src_uid": "4a58039c5171597ecf78837e9db1d71d"} {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>", "positive_code": [{"source_code": "= 3 && !in_array($string_array[$j], $now_memory)){ // \ud604\uc7ac \uae30\uc5b5\ud55c \uac83\uc774 3 \uc774\uc0c1\uc774\uba74\r\n\t\t\t$memory_count = 0;\r\n\t\t\t$now_memory = array(); // \ucd08\uae30\ud654\r\n\t\t\t$day_count++;\r\n\t\t}\r\n\t\t\r\n\t\tif(in_array($string_array[$j], $now_memory)){ // \uc774\ubbf8 \uc788\uc73c\uba74\r\n\t\t\t// \uc544\ubb34\uac83\ub3c4 \uc548 \ud568\r\n\t\t\t$already_exists = true;\r\n\t\t}else{ // \uc5c6\uc73c\uba74\r\n\t\t\tarray_push($now_memory, $string_array[$j]);\r\n\t\t\t$memory_count++;\r\n\t\t\t$already_exists = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif($memory_count > 0){\r\n\t\t$day_count++;\r\n\t}\r\n\t\r\n\t$result .= $day_count.\"\\n\";\r\n}\r\n\r\necho $result;"}, {"source_code": " 3) {\r\n $days += 1 ;\r\n $temp = array($a) ;\r\n }\r\n }\r\n if(count($temp) > 0 ) {\r\n $days += 1 ;\r\n }\r\n return $days ;\r\n}\r\n\r\n$t = (int) fgets(STDIN);\r\n$ans = [] ;\r\nwhile($t--) {\r\n $st = trim(fgets(STDIN));\r\n $ans[] = solve($st);\r\n}\r\nprint_r(implode(\"\\n\",$ans)) ;"}], "negative_code": [], "src_uid": "bd9da9081902a87c61591fb58fcecfe3"} {"source_code": ""}], "negative_code": [], "src_uid": "9afcf090806cc9c3b87120b1b61f8f17"} {"source_code": "> 1;\n if ($a[$m] >= $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n \n public static function upperBound($a, $l, $r, $k) {\n $ans = $r; $m = 0;\n while ($l < $r) {\n $m = $l + $r >> 1;\n if ($a[$m] > $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n }\n \n list($n, $m) = explode(' ', trim(fgets(STDIN)));\n $a = explode(' ', trim(fgets(STDIN))); \n $before = array_fill(1, $n, 0);\n $before[$n] = -1;\n for ($i = $n - 1; $i > 0; $i--) {\n $before[$i] = $a[$i] != $a[$i - 1] ? $i + 1 : $before[$i + 1]; \n }\n\n\n $map = array();\n for ($i = 0; $i < $n; $i++) {\n $map[$a[$i]][] = $i + 1;\n }\n \n $ans = \"\";\n while ($m-- > 0) {\n list($l, $r, $k) = explode(' ', trim(fgets(STDIN)));\n \n if (isset($map[$k])) {\n $cur = &$map[$k];\n $size = count($cur);\n $x = Utils :: lowerBound($cur, 0, $size, $l);\n $y = Utils :: upperBound($cur, 0, $size, $r) - 1;\n if ($x == $size || $cur[$x] > $l) $ans .= \"$l\" . \"\\n\";\n else $ans .= ($before[$l] > $r ? '-1' : \"$before[$l]\") . \"\\n\";\n \n } else $ans .= \"$l\" . \"\\n\"; \n }\n echo $ans;", "positive_code": [{"source_code": "> 1;\n if ($a[$m] >= $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n \n public static function upperBound($a, $l, $r, $k) {\n $ans = $r; $m = 0;\n while ($l < $r) {\n $m = $l + $r >> 1;\n if ($a[$m] > $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n }\n \n list($n, $m) = explode(' ', trim(fgets(STDIN)));\n $a = explode(' ', trim(fgets(STDIN))); \n $before = array_fill(1, $n, 0);\n $before[$n] = -1;\n for ($i = $n - 1; $i > 0; $i--) {\n \n $before[$i] = $a[$i] != $a[$i - 1] ? $i + 1 : $before[$i + 1]; \n }\n\n// print_r($before);\n\n $map = array();\n for ($i = 0; $i < $n; $i++) {\n $v = $a[$i];\n $map[$v][] = $i + 1;\n }\n \n// print_r($map);\n\n $ans = \"\";\n while ($m-- > 0) {\n list($l, $r, $k) = explode(' ', trim(fgets(STDIN)));\n \n if (isset($map[$k])) {\n $cur = $map[$k];\n $size = count($cur);\n $x = Utils :: lowerBound($cur, 0, $size, $l);\n $y = Utils :: upperBound($cur, 0, $size, $r) - 1;\n// echo $size . \" \" . $k . \" \" . $x . \" \" . $y . \"\\n\";\n if ($x == $size || $cur[$x] > $l) $ans .= \"$l\" . \"\\n\";\n elseif ($y - $x == $r - $l) $ans .= '-1' . \"\\n\";\n else $ans .= ($before[$l] > $r ? '-1' : \"$before[$l]\") . \"\\n\";\n \n } else $ans .= \"$l\" . \"\\n\"; \n }\n echo $ans;\n \n"}, {"source_code": "> 1;\n if ($a[$m] >= $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n \n public static function upperBound($a, $l, $r, $k) {\n $ans = $r; $m = 0;\n while ($l < $r) {\n $m = $l + $r >> 1;\n if ($a[$m] > $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n }\n \n list($n, $m) = explode(' ', trim(fgets(STDIN)));\n $a = explode(' ', trim(fgets(STDIN))); \n $before = array_fill(1, $n, 0);\n $before[$n] = -1;\n for ($i = $n - 1; $i > 0; $i--) {\n \n $before[$i] = $a[$i] != $a[$i - 1] ? $i + 1 : $before[$i + 1]; \n }\n\n\n $map = array();\n for ($i = 0; $i < $n; $i++) {\n $v = $a[$i];\n $map[$v][] = $i + 1;\n }\n \n $ans = \"\";\n while ($m-- > 0) {\n list($l, $r, $k) = explode(' ', trim(fgets(STDIN)));\n \n if (isset($map[$k])) {\n $cur = $map[$k];\n $size = count($cur);\n $x = Utils :: lowerBound($cur, 0, $size, $l);\n $y = Utils :: upperBound($cur, 0, $size, $r) - 1;\n if ($x == $size || $cur[$x] > $l) $ans .= \"$l\" . \"\\n\";\n else $ans .= ($before[$l] > $r ? '-1' : \"$before[$l]\") . \"\\n\";\n \n } else $ans .= \"$l\" . \"\\n\"; \n }\n echo $ans;"}], "negative_code": [{"source_code": "> 1;\n if ($a[$m] >= $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n \n public static function upperBound($a, $l, $r, $k) {\n $ans = $r; $m = 0;\n while ($l < $r) {\n $m = $l + $r >> 1;\n if ($a[$m] > $k) $ans = $r = $m; else $l = $m + 1;\n }\n return $ans;\n }\n }\n \n list($n, $m) = explode(' ', trim(fgets(STDIN)));\n $a = explode(' ', trim(fgets(STDIN))); \n $before = array_fill(1, $n, 0);\n $before[$n] = -1;\n for ($i = $n - 1; $i > 0; $i--) {\n \n $before[$i] = $a[$i] != $a[$i - 1] ? $i + 1 : $before[$i + 1]; \n }\n\n $map = array();\n for ($i = 0; $i < $n; $i++) {\n $v = $a[$i];\n $map[$v][] = $i + 1;\n }\n \n while ($m-- > 0) {\n list($l, $r, $k) = explode(' ', trim(fgets(STDIN)));\n \n if (isset($map[$k])) {\n $cur = $map[$k];\n $size = count($cur);\n $x = Utils :: lowerBound($cur, 0, $size, $l);\n $y = Utils :: upperBound($cur, 0, $size, $r) - 1;\n if ($x == $size || $cur[$x] > $l) echo \"$l\" . \"\\n\";\n else echo $before[$l] > $r ? '-1' : \"$before[$l]\" . \"\\n\";\n \n } else echo \"$l\" . \"\\n\"; \n } \n"}], "src_uid": "dcf7988c35bb34973e7b60afa7a0e68c"} {"source_code": "= 0; $i--) {\n if ($binaryString[$i] == '0') {\n $zeros++;\n }\n else {\n $ones++;\n if ($ones > $zeros) {\n $binaryString[$i] = '0';\n $ones--;\n }\n }\n }\n return $binaryString;\n}\n\nfunction main() {\n $binaryString = readline();\n echo kirksFunction($binaryString);\n}\n\nmain();\n?>", "positive_code": [{"source_code": " $zeros it means that we can change LIS containing ones to LIS containing zeros.\n for ($i = strlen($binaryString)-1; $i >= 0; $i--) {\n if ($binaryString[$i] == '0') {\n $zeros++;\n }\n else {\n $ones++;\n if ($ones > $zeros) {\n $binaryString[$i] = '0';\n $ones--;\n }\n }\n }\n return $binaryString;\n}\n\nfunction main() {\n $binaryString = readline();\n echo kirksFunction($binaryString);\n}\n\nmain();\n?>"}], "negative_code": [], "src_uid": "a3c844e3ee6c9596f1ec9ab46c6ea872"} {"source_code": "= $l ? $i : $x);\n if($x > $r)\n {\n $flag = 0;\n break;\n }\n array_push($ans, $x);\n }\n if(!$flag)\n {\n echo \"NO\\n\";\n }\n else\n {\n echo \"YES\\n\";\n foreach($ans as $c)\n {\n echo $c . ' ';\n }\n echo \"\\n\";\n }\n}", "positive_code": [{"source_code": "= $ele && $l <= $ele) $ans[] = $ele ; \r\n\t}\r\n\t// printLine($ans);\r\n\tif(count($ans) < $n) {\r\n\t\tprintLine(\"NO\") ;\r\n\t}\r\n\telse {\r\n\t\tprintLine(\"YES\");\r\n\t\tprintLine(implode(' ', $ans));\r\n\t}\r\n}\r\n\r\n"}], "negative_code": [{"source_code": "= $l ? $i : $x);\n if($x > $r)\n {\n $flag = 0;\n break;\n }\n array_push($ans, $x);\n }\n if(!$flag)\n {\n echo \"NO\\n\";\n }\n else\n {\n echo \"YES\\n\";\n foreach($ans as $c)\n {\n echo $c . ' ';\n }\n echo \"\\n\";\n }\n}"}, {"source_code": " $mod;$i--)\n {\n echo $i . ' ';\n }\n while($l <= $mod)\n {\n echo $l . ' ';\n $l++;\n }\n echo \"\\n\";\n}"}, {"source_code": " $v) {\n\t$sum += nOfPairs($v);\n}\n\nforeach ($md as $k => $v) {\n\t$sum += nOfPairs($v);\n}\n\necho $sum;\n\n?>", "positive_code": [{"source_code": "= 1; $y--)\n {\n $l = $y . \"-\" . $j;\n $j++;\n if($e[$l] == TRUE)\n {\n $k++;\n }\n }\n $i += $a[$k];\n}\nfor($x = 1000; $x > 1; $x--)\n{\n $j = 1000;\n $k = 0;\n for($y = $x; $y <= 1000; $y++)\n {\n $l = $y . \"-\" . $j;\n $j--;\n if($e[$l] == TRUE)\n {\n $k++;\n }\n }\n $i += $a[$k];\n}\nfor($x = 1000; $x >= 1; $x--)\n{\n $j = 1;\n $k = 0;\n for($y = $x; $y <= 1000; $y++)\n {\n $l = $j . \"-\" . $y;\n $j++;\n if($e[$l] == TRUE)\n {\n $k++;\n }\n }\n $i += $a[$k];\n}\nfor($x = 1000; $x > 1; $x--)\n{\n $j = 1;\n $k = 0;\n for($y = $x; $y <= 1000; $y++)\n {\n $l = $y . \"-\" . $j;\n $j++;\n if($e[$l] == TRUE)\n {\n $k++;\n }\n }\n $i += $a[$k];\n}\nprint $i;\n?>"}, {"source_code": " 1) {\n $pairCount += $count * ($count - 1) / 2;\n }\n}\n\nforeach ($backDiagCount as $count) {\n if ($count > 1) {\n $pairCount += $count * ($count - 1) / 2;\n }\n}\n\necho \"$pairCount\\n\";\n"}], "negative_code": [{"source_code": " $n)\n {\n $o = $n - 1;\n $p = $m - $o;\n $q = $n - $o;\n $r = $p . $q;\n $j[$r]++;\n }\n $o2 = $m - 1;\n $p2 = $m - $o2;\n $q2 = $n + $o2;\n $r2 = $p2 . $q2;\n if($i2[$r2] !== NULL)\n {\n $i2[$r2]++;\n }\n else\n {\n $o2 = 1000 - $n;\n $p2 = $m - $o2;\n $q2 = $n + $o2;\n $r2 = $p2 . $q2;\n $j2[$r2]++;\n }\n}\n$s = 0;\nfor($x = 0; $x < 1000; $x++)\n{\n $s += $b[$i[$k[$x]]];\n $s += $b[$j[$l[$x]]];\n $s += $b[$i2[$k2[$x]]];\n $s += $b[$j2[$l2[$x]]];\n}\nprint $s;\n?>"}, {"source_code": " $v) {\n\t$sum += ($v <= 1 ? 0 : $v);\n}\n\nforeach ($md as $k => $v) {\n\t$sum += ($v <= 1 ? 0 : $v);\n}\n\necho $sum;\n\n?>"}], "src_uid": "eb7457fe1e1b571e5ee8dd9689c7d66a"} {"source_code": " $v){\n \n if($bup && $bdown){\n echo \"YES\\n\";\n continue 2;\n }\n if($v < $b[$k] && $bup == false){\n echo \"NO\\n\";\n continue 2;\n }\n if($v > $b[$k] && $bdown == false){\n echo \"NO\\n\";\n continue 2;\n }\n if($v == -1){\n $bdown = true;\n } \n if($v == 1){\n $bup = true;\n }\n }\n echo \"YES\\n\";\n }\n \n?>", "positive_code": [{"source_code": " 0)\n {\n $f[0][$i] = $f[0][$i - 1] ;\n $f[1][$i] = $f[1][$i - 1] ;\n \n if($arr_a[$i - 1] == 1) $f[0][$i] = true ;\n else if($arr_a[$i - 1] == -1) $f[1][$i] = true ;\n }\n }\n \n if($arr_a[0] != $arr_b[0]) echo \"NO\\n\" ;\n else \n {\n for($i = $n - 1; $i >= 1; $i --)\n {\n if($arr_b[$i] > $arr_a[$i] && !$f[0][$i]) break ;\n if($arr_b[$i] < $arr_a[$i] && !$f[1][$i]) break ;\n }\n \n echo $i >= 1 ? \"NO\\n\" : \"YES\\n\" ;\n }\n }\n?>"}], "negative_code": [], "src_uid": "e425aa498e5a7fc3e518cec25eec6304"} {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " $max_x)\n\t\t\t$max_x = $s[$i][0];\n\t\tif ($s[$i][1] > $max_y)\n\t\t\t$max_y = $s[$i][1];\n\t}\n\tfor ($i = 0; $i < $k; $i++) {\n\t\t$f[] = explode(\" \", trim(fgets(STDIN)));\n\t}\n\t$c = 0;\n\tfor ($i = 1; $i < $max_x; $i++) {\n\t\t$ans .= \"U\";\n\t\t$c++;\n\t}\n\n\tfor ($i = 1; $i < $max_y; $i++) {\n\t\t$ans .= \"L\";\n\t\t$c++;\n\t}\n\t$r = true;\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tfor ($j = 0; $j < $m - 1; $j++) {\n\t\t\t$ans .= ($r ? \"R\" : \"L\");\n\t\t\t$c++;\n\t\t}\n\t\t$ans .= \"D\";\n\t\t$c++;\n\t\t$r = !$r;\n\t}\n\tprint \"$c\\n$ans\";\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $max_x)\n\t\t\t$max_x = $s[$i][0];\n\t\tif ($s[$i][1] > $max_y)\n\t\t\t$max_y = $s[$i][1];\n\t}\n\tfor ($i = 0; $i < $k; $i++) {\n\t\t$f[] = explode(\" \", trim(fgets(STDIN)));\n\t}\n\t$c = 0;\n\tfor ($i = 1; $i < $max_x; $i++) {\n\t\t$ans .= \"U\";\n\t\t$c++;\n\t}\n\n\tfor ($i = 1; $i < $max_y; $i++) {\n\t\t$ans .= \"L\";\n\t\t$c++;\n\t}\n\t$r = true;\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tfor ($j = 0; $j < $m; $j++) {\n\t\t\t$ans .= ($r ? \"R\" : \"L\");\n\t\t\t$c++;\n\t\t}\n\t\t$ans .= \"D\";\n\t\t$c++;\n\t\t$r = !$r;\n\t}\n\tprint \"$c\\n$ans\";\n?>\n"}], "src_uid": "90ce515c561872b5e2ec5f8f75cd44fe"} {"source_code": " 1) $x0 --;\n break;\n case 'R':\n if ($y0 < $y) $y0 ++;\n break;\n case 'D':\n if ($x0 < $x) $x0 ++;\n break;\n case 'L':\n if ($y0 > 1) $y0 --;\n }\n $tmp = ($x0 - 1) * $y + $y0;\n if ($visit[$tmp]==0) {\n $visit[$tmp] = 1;\n $ans[$step] = 1;\n }\n}\n$ans[$len] += $x * $y - array_sum($visit);\nfor ($i = 0;$i <= $len;$i ++) {\n if($i > 0) echo \" \";\n echo $ans[$i];\n}\necho \"\\n\";\n?>\n", "positive_code": [{"source_code": " 1) ? $x0 - 1 : $x0;\n\t\t\tbreak;\n\t\tcase\"D\":\n\t\t\t$x0 = ($x0 < $x ) ? $x0 + 1 : $x0;\n\t\t\tbreak;\n\t\tcase\"L\":\n\t\t\t$y0 = ($y0 > 1) ? $y0 - 1 : $y0;\n\t\t\tbreak;\n\t\tcase \"R\":\n\t\t\t$y0 = ($y0 < $y ) ? $y0 + 1 : $y0;\n\t\t\tbreak;\n\t}\n\t//echo $x0, \" \", $y0, \"\\n\";\n\tif($i == strlen($cmd) - 1) { // last step\n\t\techo $t, \"\\n\";\n\t} else {\n\t\tif($visited[$x0][$y0]) {\n\t\t\techo \"0 \";\n\t\t} else {\n\t\t\techo \"1 \";\n\t\t\t$t --;\n\t\t}\n\t}\n\t$visited[$x0][$y0] = true;\n}\n?>"}, {"source_code": " 1) ? $x0 - 1 : $x0;\n break;\n case\"D\":\n $x0 = ($x0 < $x ) ? $x0 + 1 : $x0;\n break;\n case\"L\":\n $y0 = ($y0 > 1) ? $y0 - 1 : $y0;\n break;\n case \"R\":\n $y0 = ($y0 < $y ) ? $y0 + 1 : $y0;\n break;\n }\n //echo $x0, \" \", $y0, \"\\n\";\n if($i == strlen($cmd) - 1) { // last step\n echo $t, \"\\n\";\n } else {\n if($visited[$x0][$y0]) {\n echo \"0 \";\n } else {\n echo \"1 \";\n $t --;\n }\n }\n $visited[$x0][$y0] = true;\n}\n?>"}], "negative_code": [{"source_code": " 1) $x0 --;\n break;\n case 'R':\n if ($y0 < $y) $y0 ++;\n break;\n case 'D':\n if ($x0 < $x) $x0 ++;\n break;\n case 'L':\n if ($y0 > 1) $y0 --;\n }\n $tmp = ($x0 - 1) * $y + $y0;\n if ($visit[$tmp]==0) {\n $visit[$tmp] = 1;\n $ans[$step] = 1;\n }\n}\n$ans[$len - 1] += $x * $y - array_sum($visit);\nfor ($i = 0;$i < $len;$i ++) {\n if($i > 0) echo \" \";\n echo $ans[$i];\n}\necho \"\\n\";\n?>\n"}], "src_uid": "22bebd448f93c0ff07d2be91e873521c"} {"source_code": " $max) {\n $max=$res;\n }\n $res=2;\n }\n}\nif ($res > $max) {\n $max=$res;\n}\necho $max ", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " $max) {\n $max=$res;\n }\n $res=2;\n }\n}\necho $max;\n?>"}, {"source_code": " $max) {\n $max=$res;\n }\n $res=2;\n }\n}\n\necho $max "}], "src_uid": "f99a23bc65a1f5cdbf7909dba573ce51"} {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n}\r\n\r\n$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $a = IO::arr();\r\n $b = $c = [];\r\n $count = 0;\r\n foreach ($a as $v) {\r\n if ($v % 2 == 0) {\r\n $c[$count] = $v;\r\n } else {\r\n $b[$count] = $v;\r\n }\r\n $count++;\r\n }\r\n $res = array_merge($b + $c);\r\n IO::line(implode(' ', $res));\r\n\r\n}\r\n\r\n?>", "positive_code": [{"source_code": ""}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n}\r\n\r\n$n = IO::str();\r\n$res = array();\r\nwhile ($n--) {\r\n $t = IO::str();\r\n $arr = IO::arr();\r\n $chet = array();\r\n $nchet = array();\r\n\r\n foreach ($arr as $ar) {\r\n if ($ar % 2 == 0) {\r\n $chet[] = $ar;\r\n } else {\r\n $nchet[] = $ar;\r\n }\r\n }\r\n\r\n $res[] = array_merge($chet, $nchet);\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $z) {\r\n echo $z . ' ';\r\n }\r\n echo \"\\n\";\r\n}"}], "negative_code": [], "src_uid": "fe2131c9228a2ec4365fdc3d0faa413a"} {"source_code": "", "positive_code": [{"source_code": " 1) && ($y - $e[$c[$y]] > 1))\n {\n $f = 1;\n break;\n }\n }\n if($f == 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n}\n?>"}, {"source_code": " $v){\n for($x = $k+2; $x < $n; $x++){\n if($a[$x] == $v){\n $bo = true;\n break 2;\n }\n }\n }\n \n if($bo){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n }\n"}], "negative_code": [{"source_code": "= count($a)/2; $j--) {\n\t\t\t\tif ($a[$j] == $ch && abs($i - $j) > 1 )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t$t = trim(fgets(STDIN));\n\n\t$ans = '';\n\n\tfor ($o = 0; $o < $t; $o++) {\n\t\t$n = trim(fgets(STDIN));\n\t\t$a = explode(\" \", trim(fgets(STDIN)));\n\t\t\n\t\t$ans .= find($a) ? \"YES\\n\" : \"NO\\n\";\n\n\t}\n\tprint $ans;\n?>"}], "src_uid": "5139d222fbbfa70d50e990f5d6c92726"} {"source_code": " $p) {\n if (bcdiv(bcsub($p, $off), $k) != $good) {\n $off = $i + 1;\n $good = bcdiv(bcsub($p, $off), $k);\n $result++;\n }\n}\necho $result;\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n {\n $c += $f;\n $e++;\n $f = 0;\n $x--;\n }\n }\n}\nif($f > 0)\n{\n $e++;\n}\nprint $e;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $p) {\n if (bcdiv(bcsub($p, $off), $k) != $good) {\n $off = $i + 1;\n $good = bcdiv(bcsub($p, $off), $k);\n $result++;\n }\n}\necho $result;\n"}], "src_uid": "684273a4c6711295996e520739744b0f"} {"source_code": "= 0; $y--)\n {\n if($b[$y] != 0)\n {\n $d = $b[$y];\n for($z = $y; $z < strlen($b) - 1; $z++)\n {\n $d .= 0;\n }\n $c[count($c)] = $d;\n }\n }\n print count($c) . \"\\n\";\n print implode(\" \", array_reverse($c)) . \"\\n\";\n}\n?>"}, {"source_code": "= 0; $y--)\n {\n if($b[$y] != 0)\n {\n $d = $b[$y];\n for($z = $y; $z < strlen($b) - 1; $z++)\n {\n $d .= 0;\n }\n $c[count($c)] = $d;\n }\n }\n print implode(\" \", array_reverse($c)) . \"\\n\";\n}\n?>"}, {"source_code": "Scan();\n\t$A = $Scanner->Scan();\n\t$B = $Scanner->Scan();\n\t$Alen = strlen($A);\n\t$Blen = strlen($B);\n\t$A_char = str_split($A);\n\t$B_char = str_split($B);\n\t$Acount = 0;\n\t$Bcount = 0;\n\t$cycle = $Alen * $Blen;\n\t$n = (int)($N / $cycle);\n\t$m = $N % $cycle;\n\tfor ($i = 0; $i < min($cycle, $N); $i++) {\n\t\t$temp = winner($A_char[$i % $Alen], $B_char[$i % $Blen]);\n\t\tif ($temp === -1) $Acount++;\n\t\telseif ($temp === 1) $Bcount++;\n\t\t\n\t\tif ($N > $cycle) {\n\t\t\tif ($i === $m - 1) {\n\t\t\t\t$Ac = $Acount;\n\t\t\t\t$Bc = $Bcount;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif ($N > $cycle) {\n\t\t$Acount = $Acount * $n + $Ac;\n\t\t$Bcount = $Bcount * $n + $Bc;\n\t}\n\n\tprint($Acount. \" \". $Bcount);\n\t\n\t$Scanner->Close();\n}\n\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t$contents = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tpublic function Scan(){\n\t\treturn $this->Scanners[$this->Id++];\n\t}\n\n\tpublic function Close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n?>", "positive_code": [{"source_code": "'S','S'=>'P','P'=>'R');\n $gcm = $l1*$l2 / gcd($l1,$l2);\n if ($gcm<=$n)\n {\n for ($i=0;$i!=$gcm;++$i)\n {\n if ($s1[$p1]!=$s2[$p2])\n if ($t[$s1[$p1]]==$s2[$p2]) ++$d2; else ++$d1;\n ++$p1;\n if ($p1 == $l1) $p1 = 0;\n ++$p2;\n if ($p2 == $l2) $p2 = 0;\n }\n $d1*=(int)($n/$gcm);\n $d2*=(int)($n/$gcm);\n }\n for ($i=0;$i!=$n%$gcm;++$i)\n {\n if ($s1[$p1]!=$s2[$p2])\n if ($t[$s1[$p1]]==$s2[$p2]) ++$d2; else ++$d1;\n ++$p1;\n if ($p1 == $l1) $p1 = 0;\n ++$p2;\n if ($p2 == $l2) $p2 = 0;\n }\n fprintf($stdout,\"%d %d\\n\",$d1,$d2);\n?>"}, {"source_code": " 0, 2 => 0);\nfor($i=0;$i $lcm_len) {\n $k = intval($n / $lcm_len);\n $res[1] *= $k;\n $res[2] *= $k;\n\n $tail_n = $n%$lcm_len;\n // print \"tail_n: $tail_n | K = $k\\n\";\n for($i=0;$i<$tail_n;$i++) {\n if ($val = _cmp($line1[$i % $line1_len], $line2[$i % $line2_len])) {\n $res[$val]++;\n }\n // print \" = $val\\n\";\n // sleep(1);\n }\n}\n\nreturn $res;\n}\n\n\nfunction _cmp($a, $b) {\n// print \"cmp $a <> $b\";\n if ($a == $b) return 0;\n $w = array('R' => 0,'S' => 1,'P' => 2);\n\n return ($w[$a] + 1) % 3 == $w[$b]\n ? 1\n : 2;\n}\n\nfunction _test_cmp() {\n $a = 'RRRSSSPPP';\n $b = 'RSPRSPRSP';\n for($i=0;$i Scan();\n\t$A = $Scanner->Scan();\n\t$B = $Scanner->Scan();\n\t$Alen = strlen($A);\n\t$Blen = strlen($B);\n\t$A_char = str_split($A);\n\t$B_char = str_split($B);\n\t$Acount = 0;\n\t$Bcount = 0;\n\t$cycle = $Alen * $Blen;\n\t$n = (int)($N / $cycle);\n\t$m = $N % $cycle;\n\tfor ($i = 0; $i < min($cycle, $N); $i++) {\n\t\t$temp = winner($A_char[$i % $Alen], $B_char[$i % $Blen]);\n\t\tif ($temp === -1) $Acount++;\n\t\telseif ($temp === 1) $Bcount++;\n\t\t\n\t\tif ($N > $cycle) {\n\t\t\tif ($i === $m - 1) {\n\t\t\t\t$Ac = $Acount;\n\t\t\t\t$Bc = $Bcount;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif ($N > $cycle) {\n\t\t$Acount = $Acount * $n + $Ac;\n\t\t$Bcount *= $Bcount * $n + $Bc;\n\t}\n\n\tprint($Acount. \" \". $Bcount);\n\t\n\t$Scanner->Close();\n}\n\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t$contents = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tpublic function Scan(){\n\t\treturn $this->Scanners[$this->Id++];\n\t}\n\n\tpublic function Close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n?>"}, {"source_code": "Scan();\n\t$A = $Scanner->Scan();\n\t$B = $Scanner->Scan();\n\t$Alen = strlen($A);\n\t$Blen = strlen($B);\n\t$A_char = str_split($A);\n\t$B_char = str_split($B);\n\t$Acount = 0;\n\t$Bcount = 0;\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$temp = winner($A_char[$i % $Alen], $B_char[$i % $Blen]);\n\t\tif ($temp === -1) $Acount++;\n\t\telseif ($temp === 1) $Bcount++;\n\t}\n\t\n\tprint($Acount. \" \". $Bcount);\n\t\n\t$Scanner->Close();\n}\n\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t$contents = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tpublic function Scan(){\n\t\treturn $this->Scanners[$this->Id++];\n\t}\n\n\tpublic function Close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n?>"}, {"source_code": "Scan();\n\t$A = $Scanner->Scan();\n\t$B = $Scanner->Scan();\n\t$Alen = strlen($A);\n\t$Blen = strlen($B);\n\t\n\t$newA = $A;\n\tif ($N > $Alen) {\n\t\t$n = $N / $Alen + 1;\n\t\tfor ($i = 2; $i <= $n; $i++) {\n\t\t\t$newA .= $A;\n\t\t}\n\t}\n\n\t$newB = $B;\n\tif ($N > $Blen) {\n\t\t$n = $N / $Blen + 1;\n\t\tfor ($i = 2; $i <= $n; $i++) {\n\t\t\t$newB .= $B;\n\t\t}\n\t}\n\t\n\t$A_char = str_split($newA);\n\t$B_char = str_split($newB);\n\t$Acount = 0;\n\t$Bcount = 0;\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$temp = winner($A_char[$i], $B_char[$i]);\n\t\tif ($temp === -1) $Acount++;\n\t\telseif ($temp === 1) $Bcount++;\n\t}\n\t\n\tprint($Acount. \" \". $Bcount);\n\t\n\t$Scanner->Close();\n}\n\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t$contents = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tpublic function Scan(){\n\t\treturn $this->Scanners[$this->Id++];\n\t}\n\n\tpublic function Close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n?>"}, {"source_code": "'S','S'=>'P','P'=>'R');\n $gcm = $l1*$l2 / gcd($l1,$l2);\n if ($gcm<$n)\n {\n for ($i=0;$i!=$gcm;++$i)\n {\n if ($s1[$p1]!=$s2[$p2])\n if ($t[$s1[$p1]]==$s2[$p2]) ++$d2; else ++$d1;\n ++$p1;\n if ($p1 == $l1) $p1 = 0;\n ++$p2;\n if ($p2 == $l2) $p2 = 0;\n }\n $d1*=(int)($n/$gcm);\n $d2*=(int)($n/$gcm);\n }\n for ($i=0;$i!=$n%$gcm;++$i)\n {\n if ($s1[$p1]!=$s2[$p2])\n if ($t[$s1[$p1]]==$s2[$p2]) ++$d2; else ++$d1;\n ++$p1;\n if ($p1 == $l1) $p1 = 0;\n ++$p2;\n if ($p2 == $l2) $p2 = 0;\n }\n fprintf($stdout,\"%d %d\\n\",$d1,$d2);\n?>"}, {"source_code": "'S','S'=>'P','P'=>'R');\n $gcm = $l1*$l2 / gcd($l1,$l2);\n if ($gcm<$n)\n {\n for ($i=0;$i!=$gcm;++$i)\n {\n if ($s1[$p1]!=$s2[$p2])\n if ($t[$s1[$p1]]==$s2[$p2]) ++$d2; else ++$d1;\n ++$p1;\n if ($p1 == $l1) $p1 = 0;\n ++$p2;\n if ($p2 == $l2) $p2 = 0;\n }\n $d1*=$n/$gcm;\n $d2*=$n/$gcm;\n }\n for ($i=0;$i!=$n%$gcm;++$i)\n {\n if ($s1[$p1]!=$s2[$p2])\n if ($t[$s1[$p1]]==$s2[$p2]) ++$d2; else ++$d1;\n ++$p1;\n if ($p1 == $l1) $p1 = 0;\n ++$p2;\n if ($p2 == $l2) $p2 = 0;\n }\n fprintf($stdout,\"%d %d\\n\",$d1,$d2);\n?>"}], "src_uid": "9a365e26f58ecb22a1e382fad3062387"} {"source_code": "0) {\n\t\tif ($i%2 == 0) {\n\t\t\t$result[$i] = $result[$i-1] - $input_k;\n\t\t} else {\n\t\t\t$result[$i] = $result[$i-1] + $input_k;\n\t\t}\n\t\t$input_k--;\n\t\t$i++;\n\t}\n}\necho implode(\" \", $result);\n?>", "positive_code": [{"source_code": "0) {\n\t\tif ($counter%2 == 0) {\n\t\t\t$res[$counter] = $res[$counter-1] - $count;\n\t\t} else {\n\t\t\t$res[$counter] = $res[$counter-1] + $count;\n\t\t}\n\t\t$count--;\n\t\t$counter++;\n\t}\n}\necho implode(\" \", $res);\n?>"}, {"source_code": " $g))\n {\n if($e[$h - 1] != $d[$f])\n {\n array_push($e, $d[$f]);\n }\n break;\n }\n else\n {\n $e[$h] = $d[$f];\n $h++;\n $e[$h] = $d[$g];\n $h++;\n $f++;\n $g--;\n }\n }\n for($x = $b + 1; $x < $a; $x++)\n {\n $e[$x] = $d[$x];\n }\n print trim(implode(\" \", $e));\n \n}\n?>"}, {"source_code": "= $k; $j--)\n echo $j.' ';\n}else{\n $k = floor($i/2) + 1;\n $t = $n - floor($i/2) +1;\n for($j = $k; $j <= $t; $j++)\n echo $j.' ';\n}"}], "negative_code": [{"source_code": " $g))\n {\n array_push($e, $d[$f]);\n break;\n }\n else\n {\n $e[$h] = $d[$f];\n $h++;\n $e[$h] = $d[$g];\n $h++;\n $f++;\n $g--;\n }\n }\n for($x = $b + 1; $x < $a; $x++)\n {\n $e[$x] = $d[$x];\n }\n print trim(implode(\" \", $e));\n \n}\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n static function compareItem($a_item, $b_item) {\n\t\t$a_t = $a_item->getType();\n\t\t$b_t = $b_item->getType();\n\t\t$a_p = $a_item->getPrice();\n\t\t$b_p = $b_item->getPrice();\n\n\t\tif ($a_t < $b_t) return -1;\n\t\telseif ($a_t > $b_t) return 1;\n\t\telseif ($a_t === $b_t) {\n\t\t\tif ($a_p > $b_p) return -1;\n\t\t\telseif ($a_p === $b_p) return 0;\n\t\t\telseif ($a_p < $b_p) return 1;\n\t\t}\n\t} \n}\n/*\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n*/\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\tusort($ITEMS, array(\"Item\", \"compareItem\"));\n\t//usort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>", "positive_code": [{"source_code": ""}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n\tstatic function compareItem(Item $a_item, Item $b_item) {\n\t\t$a_t = $a_item->getType();\n\t\t$b_t = $b_item->getType();\n\t\t$a_p = $a_item->getPrice();\n\t\t$b_p = $b_item->getPrice();\n\n\t\tif ($a_t < $b_t) return -1;\n\t\telseif ($a_t > $b_t) return 1;\n\t\telseif ($a_t === $b_t) {\n\t\t\tif ($a_p > $b_p) return -1;\n\t\t\telseif ($a_p === $b_p) return 0;\n\t\t\telseif ($a_p < $b_p) return 1;\n\t\t}\n\t} \n}\n/* 50ms 30ms faster than class static func\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n*/\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\tusort($ITEMS, array(\"Item\", \"compareItem\"));\n\t//usort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n/* static \u2192 private?\t\n static function cmp_obj($a, $b) {\n $a_t = $a->getType();\n $b_t = $b->getType();\n $a_p = $a->getType();\n $b_p = $b->getType();\n\n if ($a_t < $b_t) {\n return 1;\n } elseif ($a_t = $b_t) {\n\t\t\tif ($a_p > $b_p) {\n\t\t\t\treturn 1;\n\t\t\t} elseif ($a_p = $b_p) {\n\t\t\t\treturn 0;\n\t\t\t} elseif ($a_p < $b_p) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} \n\t}\n*/\n}\n\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\t//usort($ITEMS, array(\"ITEM\", \"compare\"));\n\tusort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n\tstatic function compareItem($a_item, $b_item) {\n\t\t$a_t = $a_item->getType();\n\t\t$b_t = $b_item->getType();\n\t\t$a_p = $a_item->getPrice();\n\t\t$b_p = $b_item->getPrice();\n\n\t\tif ($a_t < $b_t) return -1;\n\t\telseif ($a_t > $b_t) return 1;\n\t\telseif ($a_t === $b_t) {\n\t\t\tif ($a_p > $b_p) return -1;\n\t\t\telseif ($a_p === $b_p) return 0;\n\t\t\telseif ($a_p < $b_p) return 1;\n\t\t}\n\t} \n}\n/*\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n*/\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\tusort($ITEMS, array(\"Item\", \"compareItem\"));\n\t//usort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t $PRICE = $Scanner->Scan();\n\t\t $TYPE = (int)$Scanner->Scan();\n\t\t if ($TYPE === 1) $STOOLS[$i + 1] = $PRICE;\n\t\t else if ($TYPE === 2) $PENCILS[$i + 1] = $PRICE;\n\t}\n\t\n\t//if (!asort($STOOLS)) print(\"err\");\n\t//In case $STOOLS is null, this is printed;\n\t\n\tasort($STOOLS);\n\tasort($PENCILS);\n\t$min = 0;\n\t$sum = 0;\n\t$num = 0;\n\t$diff = count($STOOLS) - $inp_K;\n\tif ($diff >= 0) {\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\tif ($num <= $diff) {\n\t\t\t\tif ($num === 0) $min = $STOOLS_val / 2;\n\t\t\t\telse $sum += $STOOLS_val;\n\t\t\t\t$KART[0][] = $STOOLS_key;\n\t\t\t} else {\n\t\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t\t$KART[$num - $diff][] = $STOOLS_key;\n\t\t\t}\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\t$PEN_FLAG = 0;\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($PEN_FLAG === 0) {\n\t\t\t\t//$min = min($min, $PENCILS_val / 2) + ;\n\t\t\t\tif ($min > $PENCILS_val / 2) $min = $PENCILS_val / 2 + 2 * $min;\n\t\t\t\telseif ($min <= $PENCILS_val / 2) $min = $PENCILS_val + $min;\n\t\t\t\t$PEN_FLAG = 1;\n\t\t\t} else {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t}\n\t\t\t$KART[0][] = $PENCILS_key;\n\t\t}\n\t\t$sum = $sum + $min;\n\t} elseif($diff < 0)\t{\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t$KART[$num][] = $STOOLS_key;\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($diff !== 0) {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$num][] = $PENCILS_key;\n\t\t\t\t$diff++;\n\t\t\t\t$num++;\n\t\t\t} else {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$inp_K - 1][] = $PENCILS_key;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}], "negative_code": [{"source_code": " 1)\n{\n print number_format($i, 1, \".\", \"\") . \"\\n\"; \n for($x = 0; $x < count($t) - 1; $x++)\n {\n print implode(\" \", $t[$x]) . \"\\n\";\n }\n print implode(\" \", $t[$x]);\n}\n?>"}, {"source_code": ""}, {"source_code": " 1)\n{\n print number_format($i, 1, \".\", \"\") . \"\\n\"; \n for($x = 0; $x < count($t) - 1; $x++)\n {\n print implode(\" \", $t[$x]) . \"\\n\";\n }\n print implode(\" \", $t[$x]);\n}\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\tif ($TYPE === 1) $ITEMS[$i][] = $TYPE + 2;\n\t\telse $ITEMS[$i][] = $TYPE;\n\t\t$ITEMS[$i][] = $PRICE;\n\t}\n\t\n\tarsort($ITEMS);\n\t$keys = array_keys($ITEMS);\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t$KART[$i][] = $keys[$i] + 1;\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $keys[$i] + 1;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i][0];\n\t\tif ($i < $inp_K - 1 && $type === 3) {\n\t\t\t$sum += $ITEMS[$i][1] / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 3) {\n\t\t\t$sum += $ITEMS[$i][1];\n\t\t}\n\t}\n\n\tif ($keys[$inp_K - 1] === 3) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i][1];\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n static function compareItem($a_item, $b_item) {\n\t\t$a_t = $a_item->getType();\n\t\t$b_t = $b_item->getType();\n\t\t$a_p = $a_item->getPrice();\n\t\t$b_p = $b_item->getPrice();\n\n\t\tif ($a_t < $b_t) return -1;\n\t\telseif ($a_t > $b_t) return 1;\n\t\telseif ($a_t === $b_t) {\n\t\t\tif ($a_p > $b_p) return -1;\n\t\t\telseif ($a_p === $b_p) return 0;\n\t\t\telseif ($a_p < $b_p) return 1;\n\t\t}\n\t} \n}\n/*\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n*/\nfunction solve(){\n\t//$Scanner = new Scanner(\"php://stdin\");\n\t$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\tusort($ITEMS, array(\"Item\", \"compareItem\"));\n\t//usort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\tif ($TYPE === 1) $ITEMS[$i][] = $TYPE + 2;\n\t\telse $ITEMS[$i][] = $TYPE;\n\t\t$ITEMS[$i][] = $PRICE;\n\t}\n\t\n\tarsort($ITEMS);\n\t$keys = array_keys($ITEMS);\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t$KART[$i][] = $keys[$i] + 1;\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $keys[$i] + 1;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i][0];\n\t\tif ($i < $inp_K - 1 && $type === 3) {\n\t\t\t$sum += $ITEMS[$i][1] / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 3) {\n\t\t\t$sum += $ITEMS[$i][1];\n\t\t}\n\t}\n\n\t\n\t//if ($ITEMS[$inp_K - 1][0] === 3) {\n\tif ($ITEMS[$keys[$inp_K - 1]][0] === 3) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$keys[$i]][1];\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t $PRICE = $Scanner->Scan();\n\t\t $TYPE = (int)$Scanner->Scan();\n\t\t if ($TYPE === 1) $STOOLS[$i + 1] = $PRICE;\n\t\t else if ($TYPE === 2) $PENCILS[$i + 1] = $PRICE;\n\t}\n\t\n\tif (!asort($STOOLS)) print(\"err\");\n\t\n\t$min = 0;\n\t$sum = 0;\n\t$num = 0;\n\t$diff = count($STOOLS) - $inp_K;\n\tif ($diff >= 0) {\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\tif ($num <= $diff) {\n\t\t\t\tif ($num === 0) $min = $STOOLS_val / 2;\n\t\t\t\t$KART[0][] = $STOOLS_key;\n\t\t\t} else {\n\t\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t\t$KART[$num - $diff][] = $STOOLS_key;\n\t\t\t}\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\t$PEN_FLAG = 0;\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($PEN_FLAG === 0) {\n\t\t\t\t//$min = min($min, $PENCILS_val / 2) + ;\n\t\t\t\tif ($min > $PENCILS_val / 2) $min = $PENCILS_val / 2 + 2 * $min;\n\t\t\t\telseif ($min <= $PENCILS_val / 2) $min = $PENCILS_val + $min;\n\t\t\t\t$PEN_FLAG = 1;\n\t\t\t}\n\t\t\t$KART[0][] = $PENCILS_key;\n\t\t}\n\t\t$sum = $sum + $min;\n\t} elseif($diff < 0)\t{\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t$KART[$num][] = $STOOLS_key;\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($diff !== 0) {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$num][] = $PENCILS_key;\n\t\t\t\t$diff++;\n\t\t\t\t$num++;\n\t\t\t} else {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$inp_K - 1][] = $PENCILS_key;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n/* static \u2192 private?\t\n static function cmp_obj($a, $b) {\n $a_t = $a->getType();\n $b_t = $b->getType();\n $a_p = $a->getType();\n $b_p = $b->getType();\n\n if ($a_t < $b_t) {\n return 1;\n } elseif ($a_t = $b_t) {\n\t\t\tif ($a_p > $b_p) {\n\t\t\t\treturn 1;\n\t\t\t} elseif ($a_p = $b_p) {\n\t\t\t\treturn 0;\n\t\t\t} elseif ($a_p < $b_p) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} \n\t}\n*/\n}\n\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\t//usort($ITEMS, array(\"ITEM\", \"compare\"));\n\tusort($ITEMS, \"compare\");\n\tvar_dump($ITEMS);\t\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n static function compareItem($a_item, $b_item) {\n\t\t$a_t = $a_item->getType();\n\t\t$b_t = $b_item->getType();\n\t\t$a_p = $a_item->getPrice();\n\t\t$b_p = $b_item->getPrice();\n\n\t\tif ($a_t < $b_t) return -1;\n\t\telseif ($a_t > $b_t) return 1;\n\t\telseif ($a_t === $b_t) {\n\t\t\tif ($a_p > $b_p) return -1;\n\t\t\telseif ($a_p === $b_p) return 0;\n\t\t\telseif ($a_p < $b_p) return 1;\n\t\t}\n\t} \n}\n/*\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n*/\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\tusort($ITEMS, array(\"Item\", \"compare\"));\n\t//usort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t $PRICE = $Scanner->Scan();\n\t\t $TYPE = (int)$Scanner->Scan();\n\t\t if ($TYPE === 1) $STOOLS[$i + 1] = $PRICE;\n\t\t else if ($TYPE === 2) $PENCILS[$i + 1] = $PRICE;\n\t}\n\t\n\t//if (!asort($STOOLS)) print(\"err\");\n\t//In case $STOOLS is null, this is printed;\n\t\n\tasort($STOOLS);\n\t$min = 0;\n\t$sum = 0;\n\t$num = 0;\n\t$diff = count($STOOLS) - $inp_K;\n\tif ($diff >= 0) {\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\tif ($num <= $diff) {\n\t\t\t\tif ($num === 0) $min = $STOOLS_val / 2;\n\t\t\t\telse $sum += $STOOLS_val;\n\t\t\t\t$KART[0][] = $STOOLS_key;\n\t\t\t} else {\n\t\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t\t$KART[$num - $diff][] = $STOOLS_key;\n\t\t\t}\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\t$PEN_FLAG = 0;\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($PEN_FLAG === 0) {\n\t\t\t\t//$min = min($min, $PENCILS_val / 2) + ;\n\t\t\t\tif ($min > $PENCILS_val / 2) $min = $PENCILS_val / 2 + 2 * $min;\n\t\t\t\telseif ($min <= $PENCILS_val / 2) $min = $PENCILS_val + $min;\n\t\t\t\t$PEN_FLAG = 1;\n\t\t\t} else {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t}\n\t\t\t$KART[0][] = $PENCILS_key;\n\t\t}\n\t\t$sum = $sum + $min;\n\t} elseif($diff < 0)\t{\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t$KART[$num][] = $STOOLS_key;\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($diff !== 0) {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$num][] = $PENCILS_key;\n\t\t\t\t$diff++;\n\t\t\t\t$num++;\n\t\t\t} else {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$inp_K - 1][] = $PENCILS_key;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n static function compareItem($a_item, $b_item) {\n\t\t$a_t = $a_item->getType();\n\t\t$b_t = $b_item->getType();\n\t\t$a_p = $a_item->getPrice();\n\t\t$b_p = $b_item->getPrice();\n\n\t\tif ($a_t < $b_t) return -1;\n\t\telseif ($a_t > $b_t) return 1;\n\t\telseif ($a_t === $b_t) {\n\t\t\tif ($a_p > $b_p) return -1;\n\t\t\telseif ($a_p === $b_p) return 0;\n\t\t\telseif ($a_p < $b_p) return 1;\n\t\t}\n\t} \n}\n/*\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n*/\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\t//usort($ITEMS, array(\"ITEM\", \"compare\"));\n\tusort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\tif ($TYPE === 1) $ITEMS[$i][] = $TYPE + 2;\n\t\telse $ITEMS[$i][] = $TYPE;\n\t\t$ITEMS[$i][] = $PRICE;\n\t}\n\t\n\tarsort($ITEMS);\n\t$keys = array_keys($ITEMS);\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t$KART[$i][] = $keys[$i] + 1;\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $keys[$i] + 1;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i][0];\n\t\tif ($i < $inp_K - 1 && $type === 3) {\n\t\t\t$sum += $ITEMS[$i][1] / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 3) {\n\t\t\t$sum += $ITEMS[$i][1];\n\t\t}\n\t}\n\n\t\n\t//if ($ITEMS[$inp_K - 1][0] === 3) {\n\tif ($ITEMS[$keys[$inp_K - 1]][0] === 3) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i][1];\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t $PRICE = $Scanner->Scan();\n\t\t $TYPE = (int)$Scanner->Scan();\n\t\t if ($TYPE === 1) $STOOLS[$i + 1] = $PRICE;\n\t\t else if ($TYPE === 2) $PENCILS[$i + 1] = $PRICE;\n\t}\n\t\n\t//if (!asort($STOOLS)) print(\"err\");\n\t//In case $STOOLS is null, this is printed;\n\t\n\tasort($STOOLS);\n\t$min = 0;\n\t$sum = 0;\n\t$num = 0;\n\t$diff = count($STOOLS) - $inp_K;\n\tif ($diff >= 0) {\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\tif ($num <= $diff) {\n\t\t\t\tif ($num === 0) $min = $STOOLS_val / 2;\n\t\t\t\t$sum += $STOOLS_val;\n\t\t\t\t$KART[0][] = $STOOLS_key;\n\t\t\t} else {\n\t\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t\t$KART[$num - $diff][] = $STOOLS_key;\n\t\t\t}\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\t$PEN_FLAG = 0;\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($PEN_FLAG === 0) {\n\t\t\t\t//$min = min($min, $PENCILS_val / 2) + ;\n\t\t\t\tif ($min > $PENCILS_val / 2) $min = $PENCILS_val / 2 + 2 * $min;\n\t\t\t\telseif ($min <= $PENCILS_val / 2) $min = $PENCILS_val + $min;\n\t\t\t\t$PEN_FLAG = 1;\n\t\t\t}\n\t\t\t$sum += $PENCILS_val;\n\t\t\t$KART[0][] = $PENCILS_key;\n\t\t}\n\t\t$sum = $sum + $min;\n\t} elseif($diff < 0)\t{\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t$KART[$num][] = $STOOLS_key;\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($diff !== 0) {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$num][] = $PENCILS_key;\n\t\t\t\t$diff++;\n\t\t\t\t$num++;\n\t\t\t} else {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$inp_K - 1][] = $PENCILS_key;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t $PRICE = $Scanner->Scan();\n\t\t $TYPE = (int)$Scanner->Scan();\n\t\t if ($TYPE === 1) $STOOLS[$i + 1] = $PRICE;\n\t\t else if ($TYPE === 2) $PENCILS[$i + 1] = $PRICE;\n\t}\n\t\n\t//if (!asort($STOOLS)) print(\"err\");\n\t//In case $STOOLS is null, this is printed;\n\t\n\tasort($STOOLS);\n\t$min = 0;\n\t$sum = 0;\n\t$num = 0;\n\t$diff = count($STOOLS) - $inp_K;\n\tif ($diff >= 0) {\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\tif ($num <= $diff) {\n\t\t\t\tif ($num === 0) $min = $STOOLS_val / 2;\n\t\t\t\telse $sum += $STOOLS_val;\n\t\t\t\t$KART[0][] = $STOOLS_key;\n\t\t\t} else {\n\t\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t\t$KART[$num - $diff][] = $STOOLS_key;\n\t\t\t}\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\t$PEN_FLAG = 0;\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($PEN_FLAG === 0) {\n\t\t\t\t//$min = min($min, $PENCILS_val / 2) + ;\n\t\t\t\tif ($min > $PENCILS_val / 2) $min = $PENCILS_val / 2 + 2 * $min;\n\t\t\t\telseif ($min <= $PENCILS_val / 2) $min = $PENCILS_val + $min;\n\t\t\t\t$PEN_FLAG = 1;\n\t\t\t}\n\t\t\t$sum += $PENCILS_val;\n\t\t\t$KART[0][] = $PENCILS_key;\n\t\t}\n\t\t$sum = $sum + $min;\n\t} elseif($diff < 0)\t{\n\t\tforeach ($STOOLS as $STOOLS_key => $STOOLS_val) {\n\t\t\t$sum += $STOOLS_val / 2;\n\t\t\t$KART[$num][] = $STOOLS_key;\n\t\t\t$num++;\n\t\t}\n\t\t\n\t\tforeach ($PENCILS as $PENCILS_key => $PENCILS_val) {\n\t\t\tif ($diff !== 0) {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$num][] = $PENCILS_key;\n\t\t\t\t$diff++;\n\t\t\t\t$num++;\n\t\t\t} else {\n\t\t\t\t$sum += $PENCILS_val;\n\t\t\t\t$KART[$inp_K - 1][] = $PENCILS_key;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}, {"source_code": "index = $index;\n\t\t$this->type = $type;\n\t\t$this->price = $price;\n\t}\n\n\tpublic function getIndex() {\n\t\treturn $this->index;\n\t}\n\t\n\tpublic function getPrice() {\n\t\treturn $this->price;\n\t}\n\t\n\tpublic function getType() {\n\t\treturn $this->type;\n\t}\n\n static function compareItem($a_item, $b_item) {\n\t\t$a_t = $a_item->getType();\n\t\t$b_t = $b_item->getType();\n\t\t$a_p = $a_item->getPrice();\n\t\t$b_p = $b_item->getPrice();\n\n\t\tif ($a_t < $b_t) return -1;\n\t\telseif ($a_t > $b_t) return 1;\n\t\telseif ($a_t === $b_t) {\n\t\t\tif ($a_p > $b_p) return -1;\n\t\t\telseif ($a_p === $b_p) return 0;\n\t\t\telseif ($a_p < $b_p) return 1;\n\t\t}\n\t} \n}\n/*\nfunction compare(Item $a_item , Item $b_item){\n\t//$a_t = $a->getType();\n\t//$b_t = $b->getType();\n\t//$a_p = $a->getPrice();\n\t//$b_p = $b->getPrice();\n\t$a_t = $a_item->getType();\n\t$b_t = $b_item->getType();\n\t$a_p = $a_item->getPrice();\n\t$b_p = $b_item->getPrice();\n\n\tif ($a_t < $b_t) {\n\t\treturn -1;\n\t} elseif ($a_t > $b_t) {\n\t\treturn 1;\n\t//} elseif ($a_t = $b_t) {\n\t} elseif ($a_t === $b_t) {\n\t\tif ($a_p > $b_p) {\n\t\t\t//return 1;\n\t\t\treturn -1;\n\t\t//} elseif ($a_p = $b_p) {\n\t\t} elseif ($a_p === $b_p) {\n\t\t\treturn 0;\n\t\t} elseif ($a_p < $b_p) {\n\t\t\t//return -1;\n\t\t\treturn 1;\n\t\t}\n\t} \n}\n*/\nfunction solve(){\n\t$Scanner = new Scanner(\"php://stdin\");\n\t//$Scanner = new Scanner(\"input.txt\");\n\t\n\t$inp_N = (int)$Scanner->Scan();\n\t$inp_K = (int)$Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$PRICE = $Scanner->Scan();\n\t\t$TYPE = (int)$Scanner->Scan();\n\t\t$ITEMS[] = new Item($i + 1, $TYPE, $PRICE);\n\t}\n\t\n\tusort($ITEMS, array(\"ITEM\", \"compare\"));\n\t//usort($ITEMS, \"compare\");\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tif ($i < $inp_K - 1) {\n\t\t\t//$KART[$i] = $ITEMS[$i]->getIndex();\n\t\t\t$KART[$i][] = $ITEMS[$i]->getIndex();\n\t\t} elseif ($i >= $inp_K - 1) {\n\t\t\t$KART[$inp_K - 1][] = $ITEMS[$i]->getIndex();\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$type = $ITEMS[$i]->getType();\n\t\tif ($i < $inp_K - 1 && $type === 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice() / 2;\n\t\t} elseif ($i >= $inp_K - 1 || $type !== 1) {\n\t\t\t$sum += $ITEMS[$i]->getPrice();\n\t\t}\n\t}\n\n\t//$min = 1E9 + 1;\n\tif ($ITEMS[$inp_K - 1]->getType() === 1) {\n\t\t$min = 1E9 + 1;\n\t\tfor ($i = $inp_K - 1; $i < $inp_N; $i++) {\n\t\t\t$temp = $ITEMS[$i]->getPrice();\n\t\t\t$min = min($temp, $min);\n\t\t}\n\t}\n\t$sum -= $min / 2;\n\t\n\tprintf(\"%.1f\", $sum);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $inp_K; $i++) {\n\t\t$count = count($KART[$i]);\n\t\t//print($sum);\n\t\tprint($count);\n\t\tprint(\" \");\n\t\t$cou = 0;\n\t\t$c = 0;\n\t\tforeach ($KART[$i] as $as_i) {\n\t\t\tif ($i !== $inp_K - 1) {\n\t\t\t\tprint($as_i);\n\t\t\t\t$cou++;\n\t\t\t\t//if ($cou != $count - 1) {\n\t\t\t\tif ($cou != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"\\n\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprint($as_i);\n\t\t\t\t$c++;\n\t\t\t\t//if ($c != $count - 1) {\n\t\t\t\tif ($c != $count) {\n\t\t\t\t\tprint(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$Scanner->close();\n}\n\nob_end_clean();\nsolve();\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $Id = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link or ''php://stdin' err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\n\t\t//err $c_row = array(\"\\n\", \"\\r\", \"\\r\\n\");\n\t\t$c_row = array(\"\\r\\n\", \"\\r\", \"\\n\");\n\t\t$contents = str_replace($c_row, \" \", $contents);\n\t\t$this->Scanners = explode(\" \", $contents);\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Id;\n\t\t$sc = $this->Scanners[$x];\n\t\t$this->Id = ++$x;\n\t\treturn $sc;\n\t}\n\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\n/*\n====begin=====\n\n//input $inp_ or upper\n//block $temp_\n//two block$ttemp_\n//as \t $as_\n//instance $(Upper)\n//ref $ref\n//class menba $^Upper\n\n====end=======\n\n===== class begin =====\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"#109_div2_B_1230942 laurenceHR\"\nclass LineScanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineIds_Of_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanIds_Of_LineIds = array();\n\tprivate $Scan_number = 0;\n\tprivate $Scanline_number = 0;\n\t\n\tpublic function __construct($opend){\n\t\tif((!is_file($opend) && !is_link($opend)) && $opend !== \"php://stdin\"){\n \t\t\tprint(\"file or link err\");\n \t\t\texit;\n\t\t}\n\t\t\n\t\t$this->Stream = fopen($opend, 'r');\n\t\t$contents = stream_get_contents($this->Stream);\n\t\t\n\t\t$temp_lines = explode(\"\\n\", $contents);\n\t\t$temp_linescanners = array();\n\t\t$temp_x = 0;\n\t\t$temp_y = 0;\n\t\t//--attention for initting of array--(these is not needed but for easily reading)//\n\t\t$ttemp_scanners = array();\n\t\t//$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\tforeach ($temp_lines as $as_line) {\n\t\t\tif (strlen($as_line) === 0) {\n\t\t\t\tprint(\"input err\");\n\t\t\t}\n\t\t\t\n\t\t\t//$as_line = str_replace($del,'',$as_line);\n\t\t\t$temp_linescanners[] = $as_line;\n\t\t\t$ttemp_line_scanners = explode(\" \", $as_line);\n\t\t\t//$ttemp_scanners = array();\n\t\t\tforeach ($ttemp_line_scanners as $as_sc) {\n\t\t\t\t$ttemp_scanners[] = $as_sc;\n\t\t\t\t$this->LineIds_Of_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanIds_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\n\t\t$this->Scanners = $ttemp_scanners;\n\t\t$this->LinesScanners = $temp_linescanners;\n\t}\n\t\n\tfunction Scan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"scan err\");\n\t\t}\n\t\t\t\t\n\t\t$sc = $this->Scanners[$x];\n\t\t//--attention for ++$x//\n\t\t//$this->Scan_number = $x++;\n\t\t$this->Scan_number = ++$x;\n\t\t$this->Scanline_number = $this->LineIds_Of_ScanIds[$x];\n\t\treturn $sc;\n\t}\n\t\n\tfunction LineScan(){\n\t\t$x = $this->Scan_number;\n\t\t$y = $this->Scanline_number;\n\t\tif ($this->LineIds_Of_ScanIds[$x] === false || $this->LastScanIds_Of_LineIds[$y] === false) {\n\t\t\tprint(\"linescan err\");\n\t\t}\n\t\t\n\t\t$lsc = $this->LinesScanners[$y];\n\t\t$this->Scan_number = $this->LastScanIds_Of_LineIds[$y] + 1;\n\t\t$this->Scanline_number = $y + 1;\n\t\treturn $lsc;\n\t}\n\t\n\tfunction close(){\n\t\tfclose($this->Stream);\n\t}\n}\n\nclass Token{\n\tprivate $token;\n\tprivate $tok;\n\t\n\tpublic function __construct($str_line, $tok) {\n\t\t$this->tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n \tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray() {\n\t\t$temp_arr = array();\n\t\t$flag = -1;\n\t\twhile ($flag !== 1) {\n\t\t\t$thisToken = $this->nextToken();\n\t\t\tif ($thisToken !== false) {\n\t\t\t\t$temp_arr[] = $thisToken;\n\t\t\t} else {\n\t\t\t\t$flag = 1;\n\t\t\t}\n\t\t}\n\t\treturn $temp_arr;\n\t}\n\n\tpublic function nnextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->token;\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n===== class end ======\n\n=== function begin ===\n\nfunction get_line() {\n $stdin = fopen(\"php://stdin\", \"r\"); \n $line = rtrim($stdin, \"\\n\"); \n fclose($stdin); \n return $line; \n}\n\nfunction num_printf($i){\n\tif (is_float($i)) {\n\t\tprintf(\"%.0f\", $i);\n\t}\n\tif (is_int($i)) {\n\t\tprintf(\"%d\", $i);\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\n== function end ======\n*/\n\n?>"}], "src_uid": "06c7834aa4d06d6fcebfa410054f1b8c"} {"source_code": "", "positive_code": [{"source_code": " -1) {\n $skills[$name] = bcadd($expK, '0.00', 0);\n }\n}\n\nfor ($i = 0; $i < $m; $i++) {\n $name = trim(fgets($input));\n\n $skills[$name] = $skills[$name] ?? '0';\n}\n\nfwrite($output, count($skills) . PHP_EOL);\n\nksort($skills);\n\nforeach ($skills as $skill => $value) {\n fwrite($output, $skill . ' ' . $value . PHP_EOL);\n}\n"}], "negative_code": [{"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n}\n$i = array();\nfor($x = 0; $x < $b; $x++)\n{\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n}\n$k = array_diff($i, $d);\n$l = array();\nfor($x = 0; $x < count($k); $x++)\n{\n $l[$x] = 0;\n}\n$m = array_merge($d, $k);\n$n = array_merge($e, $l);\n$o = $m;\nasort($o);\n$p = array_keys($o);\n$q = array();\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $q[$x] = $n[$p[$x]];\n}\nif(count($o) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n}\n?>"}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n }\n $i = array();\n for($x = 0; $x < $b; $x++)\n {\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n }\n $k = array_diff($i, $d);\n $l = array();\n for($x = 0; $x < count($k); $x++)\n {\n $l[$x] = 0;\n }\n $m = array_merge($d, $k);\n $n = array_merge($e, $l);\n $o = $m;\n asort($o);\n $p = array_keys($o);\n $q = array();\n sort($o);\n for($x = 0; $x < count($o); $x++)\n {\n $q[$x] = $n[$p[$x]];\n }\n if(count($o) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n }\n}\n?>"}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n }\n $i = array();\n for($x = 0; $x < $b; $x++)\n {\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n }\n $k = array_diff($i, $d);\n $l = array();\n for($x = 0; $x < count($k); $x++)\n {\n $l[$x] = 0;\n }\n $m = array_merge($d, $k);\n $n = array_merge($e, $l);\n $o = $m;\n asort($o);\n $p = array_keys($o);\n $q = array();\n sort($o);\n for($x = 0; $x < count($o); $x++)\n {\n $q[$x] = $n[$p[$x]];\n }\n if(count($o) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n }\n}\n?>"}, {"source_code": ""}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n }\n $i = array();\n for($x = 0; $x < $b; $x++)\n {\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n }\n $k = array_diff($i, $d);\n $l = array();\n for($x = 0; $x < count($k); $x++)\n {\n $l[$x] = 0;\n }\n $m = array_merge($d, $k);\n $n = array_merge($e, $l);\n $o = $m;\n asort($o);\n $p = array_keys($o);\n $q = array();\n sort($o);\n for($x = 0; $x < count($o); $x++)\n {\n $q[$x] = $n[$p[$x]];\n }\n if(count($o) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n }\n}\n?>"}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n}\n$i = array();\nfor($x = 0; $x < $b; $x++)\n{\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n}\n$k = array_diff($i, $d);\n$l = array();\nfor($x = 0; $x < count($k); $x++)\n{\n $l[$x] = 0;\n}\n$m = array_merge($d, $k);\n$n = array_merge($e, $l);\n$o = $m;\nasort($o);\n$p = array_keys($o);\n$q = array();\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $q[$x] = $n[$p[$x]];\n}\nif(count($o) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n}\n?>"}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n}\n$i = array();\nfor($x = 0; $x < $b; $x++)\n{\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n}\n$k = array_diff($i, $d);\n$l = array();\nfor($x = 0; $x < count($k); $x++)\n{\n $l[$x] = 0;\n}\n$m = array_merge($d, $k);\n$n = array_merge($e, $l);\n$o = $m;\nasort($o);\n$p = array_keys($o);\n$q = array();\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $q[$x] = $n[$p[$x]];\n}\nif(count($o) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n}\n?>"}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n}\n$i = array();\nfor($x = 0; $x < $b; $x++)\n{\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n}\n$k = array_diff($i, $d);\n$l = array();\nfor($x = 0; $x < count($k); $x++)\n{\n $l[$x] = 0;\n}\n$m = array_merge($d, $k);\n$n = array_merge($e, $l);\n$o = $m;\nasort($o);\n$p = array_keys($o);\n$q = array();\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $q[$x] = $n[$p[$x]];\n}\nif(count($o) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n}\n?>"}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n }\n $i = array();\n for($x = 0; $x < $b; $x++)\n {\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n }\n $k = array_diff($i, $d);\n $l = array();\n for($x = 0; $x < count($k); $x++)\n {\n $l[$x] = 0;\n }\n $m = array_merge($d, $k);\n $n = array_merge($e, $l);\n $o = $m;\n asort($o);\n $p = array_keys($o);\n $q = array();\n sort($o);\n for($x = 0; $x < count($o); $x++)\n {\n $q[$x] = $n[$p[$x]];\n }\n if(count($o) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n }\n}\n?>"}, {"source_code": "= 100)\n {\n array_push($d, $f);\n array_push($e, $h);\n }\n}\n$i = array();\nfor($x = 0; $x < $b; $x++)\n{\n $j = trim(fgets(STDIN));\n $i[$x] = $j;\n}\n$k = array_diff($i, $d);\n$l = array();\nfor($x = 0; $x < count($k); $x++)\n{\n $l[$x] = 0;\n}\n$m = array_merge($d, $k);\n$n = array_merge($e, $l);\n$o = $m;\nasort($o);\n$p = array_keys($o);\n$q = array();\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $q[$x] = $n[$p[$x]];\n}\nif(count($o) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($o) . \"\\n\";\n for($x = 0; $x < count($o) - 1; $x++)\n {\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s . \"\\n\";\n }\n $r = $o[$x];\n $s = $q[$x];\n print $r . \" \" . $s;\n}\n?>"}, {"source_code": "= 100) {\n $skills[$name] = (int)$expK;\n }\n}\n\nfor ($i = 0; $i < $m; $i++) {\n $name = trim(fgets($input));\n\n $skills[$name] = $skills[$name] ?? 0;\n}\n\nfwrite($output, count($skills) . PHP_EOL);\n\nksort($skills);\n\nforeach ($skills as $skill => $value) {\n fwrite($output, $skill . ' ' . $value . PHP_EOL);\n}\n"}, {"source_code": " 100) {\n $skills[$name] = (int)$expK;\n }\n}\n\nfor ($i = 0; $i < $m; $i++) {\n $name = trim(fgets($input));\n\n $skills[$name] = $skills[$name] ?? 0;\n}\n\nfwrite($output, count($skills) . PHP_EOL);\n\nksort($skills);\n\nforeach ($skills as $skill => $value) {\n fwrite($output, $skill . ' ' . $value . PHP_EOL);\n}\n"}, {"source_code": " $value) {\n fwrite($output, $skill . ' ' . $value . PHP_EOL);\n}\n"}], "src_uid": "7da1a5c4c76540e1c7dc06e4c908c8b4"} {"source_code": " 2){\n echo -1;\n exit;\n }\n}\necho $count;", "positive_code": [{"source_code": " 2) {\n $res = -1;\n break;\n }\n}\n\necho $res, PHP_EOL;\n?>"}, {"source_code": ""}, {"source_code": " 2)\n {\n print \"-1\";\n }\n else\n {\n $i = 0;\n for($x = 0; $x < count($f); $x++)\n {\n if($f[$x] == 2)\n {\n $i++;\n }\n }\n print $i;\n }\n}\n?>"}, {"source_code": "$v){\n $arr[$k] = trim($v);\n}\nfunction my_find($a){\n $result = 0;\n $t_a = Array();\n foreach($a as $v){\n if($v == 0)\n continue;\n $t_a[$v] += 1;\n if($t_a[$v] == 2){\n $result+=1;\n }elseif($t_a[$v] > 2){\n return -1;\n }\n }\n return $result;\n}\n\nif($num == 1){\n echo '0';\n}elseif($num != count($arr)){\n echo '-1';\n}else{\n echo my_find($arr);\n}\n?>"}, {"source_code": " 2)\n die(\"-1\");\n \n}\n\necho $result;\n\n"}, {"source_code": "0) {\n\t\t$sessi[$sess[$i]]++;\n\t\tif ($sessi[$sess[$i]]==2) { $pairs++; } else if ($sessi[$sess[$i]]>2) { $pairs=-1; $i=$sec_num+10; }\n\t} else {\n\t\t$nope++;\n\t}\n\t$i++;\n}\n\nfwrite(STDOUT, \"$pairs\\n\" );\n\n?>"}, {"source_code": "\n\nerror_reporting(false);\n//error_reporting(E_ALL);\n\n\n\n$handle = fopen('php://stdin', 'r');\n//$handle = fopen('in.txt', 'r');\n\n$c = 0;\n\n$num = (int)(trim(fgets($handle))*1 / 2);\n\n$arr = explode(\" \", trim(fgets($handle)));\n\n\n$t = array();\n\nforeach($arr as $val) {\n if ($val != 0) $t[$val]++;\n}\n\n$c = 0;\nforeach($t as $k=>$id) {\n\n if ($id > 2 ) die(\"-1\");\n if ($id == 2) $c++;\n}\n\necho $c;\n\n\n\n\n\n?>"}, {"source_code": " $value) {\n if ($index == 0) {\n continue;\n } elseif ($value > 2) {\n $answer = -1;\n break;\n }\n $answer += ($value == 2);\n}\n\nprint $answer;\n\nfunction line() {\n return trim(fgets(STDIN));\n}\n"}, {"source_code": " 0) {\n $c++;\n //echo \"
\\$i = \" . $i . \"
\\$j = \" . $j .\n //\"
\\$num_talk_array[\\$i] = \" . $num_talk_array[$i] . \" -- \\$num_talk_array[\\$j] = \" . $num_talk_array[$j] .\n //\"
\\$result = \";\n }\n }\n if ($c > 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\nprint $OUT;\n?>"}, {"source_code": "\nerror_reporting(false);\n$handle = fopen('php://stdin', 'r');\n$c = 0;\n$num = (int)(trim(fgets($handle))*1 / 2);\n$arr = explode(\" \", trim(fgets($handle)));\n$t = array();\nforeach($arr as $val) {\n if ($val != 0) $t[$val]++;\n}\n$c = 0;\nforeach($t as $k=>$id) {\n if ($id > 2 ) die(\"-1\");\n if ($id == 2) $c++;\n}\necho $c;\n?>\n"}, {"source_code": " $key) \n{\nif (!is_numeric($item)) $flag = false;\n\nif ($item<>0) {\n if ($key == 2) $counter += 1;\n if ($key > 2) $flag = false;\n}\n\n}\n\nif ($flag) echo $counter; else echo \"-1\";\n\n?>"}], "negative_code": [{"source_code": " 2){\n return -1;\n }\n }\n return $result;\n}\n\nif($num == 1){\n echo '0';\n}else{\n echo my_find($arr);\n}\n?>"}, {"source_code": " 2){\n return -1;\n }\n }\n return $result;\n}\nif($num == 1){\n echo '0';\n}else{\n echo my_find($arr);\n}\n?>"}, {"source_code": " 2){\n return -1;\n }\n }\n return $result;\n}\n\nif($num == 1){\n echo '0';\n}elseif($num != count($arr)){\n echo '-1';\n}else{\n echo my_find($arr);\n}\n?>"}, {"source_code": "
\\$i = \" . $i . \"
\\$j = \" . $j .\n //\"
\\$num_talk_array[\\$i] = \" . $num_talk_array[$i] . \" -- \\$num_talk_array[\\$j] = \" . $num_talk_array[$j] .\n //\"
\\$result = \";\n }\n }\n if ($c > 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": "
\\$i = \" . $i . \"
\\$j = \" . $j .\n //\"
\\$num_talk_array[\\$i] = \" . $num_talk_array[$i] . \" -- \\$num_talk_array[\\$j] = \" . $num_talk_array[$j] .\n //\"
\\$result = \";\n }\n }\n if ($c > 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 1) {\n $result = -1;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $num_sec;\n?>"}, {"source_code": " 1) {\n $result = -1;\n exit;\n } else {\n $result = $result + $c;\n }\n}*/\necho $num_sec;\n?>"}, {"source_code": "
\\$i = \" . $i . \"
\\$j = \" . $j .\n //\"
\\$num_talk_array[\\$i] = \" . $num_talk_array[$i] . \" -- \\$num_talk_array[\\$j] = \" . $num_talk_array[$j] .\n //\"
\\$result = \";\n }\n }\n if ($c > 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 1) {\n $result = -1;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $num_sec;\n?>"}, {"source_code": " 1) {\n $result = -1;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $num_sec;\n?>"}, {"source_code": "
\\$i = \" . $i . \"
\\$j = \" . $j .\n //\"
\\$num_talk_array[\\$i] = \" . $num_talk_array[$i] . \" -- \\$num_talk_array[\\$j] = \" . $num_talk_array[$j] .\n //\"
\\$result = \";\n }\n }\n if ($c > 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 1) {\n $result = -1;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $num_sec;\n?>"}, {"source_code": " 1) {\n $result = -1;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": "
\\$i = \" . $i . \"
\\$j = \" . $j .\n //\"
\\$num_talk_array[\\$i] = \" . $num_talk_array[$i] . \" -- \\$num_talk_array[\\$j] = \" . $num_talk_array[$j] .\n //\"
\\$result = \";\n }\n }\n if ($c > 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 1) {\n $result = -1;\n break;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 1) {\n $result = -1;\n break 1;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 0) {\n $c++;\n //echo \"
\\$i = \" . $i . \"
\\$j = \" . $j .\n //\"
\\$num_talk_array[\\$i] = \" . $num_talk_array[$i] . \" -- \\$num_talk_array[\\$j] = \" . $num_talk_array[$j] .\n //\"
\\$result = \";\n }\n }\n if ($c > 1) {\n $result = -1;\n echo $result;\n exit;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": " 1) {\n $result = -1;\n break 3;\n } else {\n $result = $result + $c;\n }\n}\necho $result;\n?>"}, {"source_code": "\n$c = 0;\n$num = (int)(trim(fgets($handle))*1 / 2);\n$arr = explode(\" \", trim(fgets($handle)));\n$t = array();\nforeach($arr as $val) {\nif ($val != 0) $t[$val]++;\n}\n$c = 0;\nforeach($t as $k=>$id) {\nif ($id > 2 ) die(\"-1\");\nif ($id == 2) $c++;\n}\necho $c;\n?>"}, {"source_code": " $key) \n{\nif ($key == 2) $counter += 1;\nif ($key > 2) $flag = false;\n}\n\nif ($flag) echo $counter; else echo \"-1\";\n\n?>"}, {"source_code": " $key) \n{\n\nif ($item<>0) {\n if ($key == 2) $counter += 1;\n if ($key > 2) $flag = false;\n}\n\n}\n\nif ($flag) echo $counter; else echo \"-1\";\n\n?>"}, {"source_code": " 2) {\n $res = -1;\n break;\n }\n}\n\necho $res, PHP_EOL;\n?>"}, {"source_code": " 2) {\n $res = -1;\n break;\n }\n}\n\necho $res, PHP_EOL;\n?>"}, {"source_code": ""}, {"source_code": " 2)\n\t\t\tdie(\"-1\");\n\t\t$count = 1;\n\t\t$prev = $val;\n\t}\n}\n\nif ($count == 2)\n\t$result++;\nelseif ($count > 2)\n\tdie(\"-1\");\necho $result;\n"}, {"source_code": "0) {\n\t\t$sessi[$sess[$i]]++;\n\t\tif ($sessi[$sess[$i]]==2) { $pairs++; } else if ($sessi[$sess[$i]]>2) { $i=$sec_num+10; }\n\t} else {\n\t\t$nope++;\n\t}\n\t$i++;\n}\n\nfwrite(STDOUT, \"$pairs\\n\" );\n\n?>"}, {"source_code": "\n\n$handle = fopen('php://stdin', 'r');\n//$handle = fopen('in.txt', 'r');\n\n$c = 0;\n\n$num = (int)(trim(fgets($handle))*1 / 2);\n\n$arr = explode(\" \", trim(fgets($handle)));\n\n\n$t = array();\n\nforeach($arr as $val) {\n if ($val == 0) continue;\n $t[$val]++;\n}\n\n$c = 0;\nforeach($t as $k=>$id) {\n\n if ($id > 2 ) die(\"-1\");\n if ($id == 2) $c++;\n}\n\n?>"}, {"source_code": "\n$handle = fopen('php://stdin', 'r');\n//$handle = fopen('in.txt', 'r');\n\n$c = 0;\n\n$num = (int)(trim(fgets($handle))*1 / 2);\n\n$arr = explode(\" \", trim(fgets($handle)));\n\n\n$t = array();\n\nforeach($arr as $val) {\n $t[$val]++;\n}\n\n$c = 0;\nforeach($t as $id) {\n if ($id > 2 ) die(\"-1\");\n if ($id == 2) $c++;\n}\n\necho $c;\n?>"}, {"source_code": " 2) {\n $answer = -1;\n break;\n }\n $answer += ($cnt == 2);\n}\n\nprint $answer;\n\nfunction line() {\n return trim(fgets(STDIN));\n}\n"}, {"source_code": "= 1 && $IN[1] <= 1000);\n# \u0423\u0441\u043b\u043e\u0432\u0438\u0435 3: \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0443 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0435\u0439\n$cond3 = (count($IN[2]) == $IN[1]);\n# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439\nif($cond1 && $cond2 && $cond3){\n\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432)\n\t$acv = array_count_values($IN[2]);\n\t# \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\n\tasort($acv);\n\t# \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\n\tend($acv);\n\t# \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\n\tif(current($acv) > 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\n# \u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430\n//$stdout = fopen('php://stdout','w');\n$stdout = fopen(STDOUT);\n# \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445\nfwrite($stdout,$OUT);\n?>"}, {"source_code": " 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\nprint $OUT;\n?>"}, {"source_code": "\n\n\n\n \n \n\n \n \n \n \n\n"}, {"source_code": "= 1 && $IN[1] <= 1000);\n# \u0423\u0441\u043b\u043e\u0432\u0438\u0435 3: \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0443 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0435\u0439\n$cond3 = (count($IN[2]) == $IN[1]);\n# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439\nif($cond1 && $cond2 && $cond3){\n\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432)\n\t$acv = array_count_values($IN[2]);\n\t# \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\n\tasort($acv);\n\t# \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\n\tend($acv);\n\t# \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\n\tif(current($acv) > 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\n# \u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430\n/*$stdout = fopen('php://stdout','w');\n# \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445\nfwrite($stdout,$OUT);*/\n\necho $OUT;\n?>"}, {"source_code": " 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\nprint $OUT;\n?>"}, {"source_code": "= 1 && $IN[1] <= 1000);\n# \u0423\u0441\u043b\u043e\u0432\u0438\u0435 3: \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0443 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0435\u0439\n$cond3 = (count($IN[2]) == $IN[1]);\n# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439\nif($cond1 && $cond2 && $cond3){\n\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432)\n\t$acv = array_count_values($IN[2]);\n\t# \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\n\tasort($acv);\n\t# \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\n\tend($acv);\n\t# \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\n\tif(current($acv) > 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\n# \u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430\n/*$stdout = fopen('php://stdout','w');\n# \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445\nfwrite($stdout,$OUT);*/\n\necho $OUT;\n?>"}, {"source_code": " 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\nprint $OUT;\n?>"}, {"source_code": "= 1 && $IN[1] <= 1000);\n# \u0423\u0441\u043b\u043e\u0432\u0438\u0435 3: \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0443 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0435\u0439\n$cond3 = (count($IN[2]) == $IN[1]);\n# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439\nif($cond1 && $cond2 && $cond3){\n\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432)\n\t$acv = array_count_values($IN[2]);\n\t# \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\n\tasort($acv);\n\t# \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\n\tend($acv);\n\t# \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\n\tif(current($acv) > 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\n# \u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430\n$stdout = fopen('php://stdout','w');\n# \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445\nfwrite($stdout,(string)$OUT);\n\n//echo $OUT;\n?>"}, {"source_code": "= 1 && $IN[1] <= 1000);\n# \u0423\u0441\u043b\u043e\u0432\u0438\u0435 3: \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0443 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0435\u0439\n$cond3 = (count($IN[2]) == $IN[1]);\n# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439\nif($cond1 && $cond2 && $cond3){\n\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432)\n\t$acv = array_count_values($IN[2]);\n\t# \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\n\tasort($acv);\n\t# \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\n\tend($acv);\n\t# \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\n\tif(current($acv) > 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\n# \u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430\n/*$stdout = fopen('php://stdout','w');\n# \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445\nfwrite($stdout,$OUT);*/\n\nprint $OUT;\n?>"}, {"source_code": "= 1 && $IN[1] <= 1000);\n# \u0423\u0441\u043b\u043e\u0432\u0438\u0435 3: \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0443 \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0435\u0439\n$cond3 = (count($IN[2]) == $IN[1]);\n# \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439\nif($cond1 && $cond2 && $cond3){\n\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432)\n\t$acv = array_count_values($IN[2]);\n\t# \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\n\tasort($acv);\n\t# \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\n\tend($acv);\n\t# \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\n\tif(current($acv) > 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\n# \u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430\n$stdout = fopen('php://stdout','w');\n# \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445\nfwrite($stdout,(string)$OUT);\n?>"}, {"source_code": " 2 && key($acv) != 0){\n\t\t$OUT = -1;\n\t}else{\n\t\t# \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439\n\t\t$acv = array_count_values($acv);\n\t\t# \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u0430\u0440\u0438, \u0432\u0435\u0434\u0443\u0449\u0438\u0435 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439\n\t\tif(isset($acv[2])){\n\t\t\t$OUT = $acv[2];\n\t\t}else{\n\t\t\t$OUT = 0;\n\t\t}\n\t}\n}else{\n\t$OUT = -1;\n}\n\nprint $OUT;\n?>"}], "src_uid": "45e51f3dee9a22cee86e1a98da519e2d"} {"source_code": " 'G']) == strtr($row2, ['B' => 'G'])){\r\n echo \"Yes\\n\";\r\n }\r\n else{\r\n echo \"No\\n\";\r\n }\r\n}\r\n \r\n?>"}, {"source_code": ""}, {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": ""}], "negative_code": [{"source_code": " 'G']) == strtr($row2, ['B' => 'G'])){\r\n echo \"Yes\\n\";\r\n }\r\n else{\r\n echo \"No\\n\";\r\n }\r\n}\r\n \r\n?>"}, {"source_code": " 'G']) == strtr($d, ['B' => 'G'])){\r\n echo \"Yes\";\r\n }\r\n else{\r\n echo \"No\";\r\n }\r\n}"}, {"source_code": " 'G']) == strtr($d, ['B' => 'G'])){\r\n echo \"\u0414\u0410\";\r\n }\r\n else{\r\n echo \"\u041d\u0415\u0422\";\r\n }"}, {"source_code": ""}], "src_uid": "86a2e0854f9faf0b119d0d5e4b8fe952"} {"source_code": " $v) {\n $sums[] = ($sums[$i - 1] ?? 0) + $v;\n}\n$q = trim(fgets(STDIN));\nwhile ($q--) {\n [$l, $r] = explode(' ', trim(fgets(STDIN)));\n $candies = 0;\n if ($r > $l) {\n $candies = floor(($sums[$r - 1] - ($sums[$l - 2] ?? 0)) / 10);\n }\n echo $candies . PHP_EOL;\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " $k[$x])\n {\n for($y = $m; $y > $k[$x]; $y--)\n {\n $o -= $b[$y];\n }\n $m = $k[$x];\n }\n $p = floor($o / 10);\n $n[$h[$j[$x]]] = $p;\n}\nksort($n);\nfor($x = 0; $x < count($n); $x++)\n{\n print $n[$x] . \"\\n\";\n}\n?>"}, {"source_code": " $k[$x])\n {\n for($y = $m; $y > $k[$x]; $y--)\n {\n $o -= $b[$y];\n }\n $m = $k[$x];\n }\n $p = floor($o / 10);\n $n[$h[$j[$x]]] = $p;\n}\nksort($n);\nfor($x = 0; $x < count($n); $x++)\n{\n print $n[$x] . \"\\n\";\n}\n?>"}, {"source_code": ""}, {"source_code": " $k[$x])\n {\n for($y = $m + 1; $y > $k[$x]; $y--)\n {\n $o -= $b[$y];\n }\n $m = $k[$x];\n }\n $p = floor($o / 10);\n $n[$h[$j[$x]]] = $p;\n}\nksort($n);\nfor($x = 0; $x < count($n); $x++)\n{\n print $n[$x] . \"\\n\";\n}\n?>"}, {"source_code": " $k[$x])\n {\n for($y = $m; $y > $k[$x]; $y--)\n {\n $o -= $b[$y];\n }\n $m = $k[$x];\n }\n $p = floor($o / 10);\n $n[$h[$j[$x]]] = $p;\n}\nksort($n);\nfor($x = 0; $x < count($n); $x++)\n{\n print $n[$x] . \"\\n\";\n}\n?>"}, {"source_code": " $v) {\n $sums[] = ($sums[$i - 1] ?? 0) + $v;\n}\n$q = trim(fgets(STDIN));\nwhile ($q--) {\n [$l, $r] = explode(' ', trim(fgets(STDIN)));\n $candies = 0;\n if ($r > $l) {\n $candies = floor(($sums[$r - 1] - $sums[$l - 1]) / 10);\n }\n echo $candies . PHP_EOL;\n}\n"}], "src_uid": "2cd91be317328fec207da6773ead4541"} {"source_code": " $b[$k]) {\n\t\t$k++;\n\t\t$b[$k] = $a[$j];\n\t\t$a[$j] = -1;\n\t}\n}\n\nfor ($j = $n-1; $j > 0; $j--) {\n\tif ($a[$j] >= 0 and $a[$j] < $b[$k]) {\n\t\t$k++;\n\t\t$b[$k] = $a[$j];\n\t\t$a[$j] = -1;\n\t}\n}\n\nprint ($k+1).\"\\n\";\nprint implode(' ', $b);", "positive_code": [{"source_code": ""}, {"source_code": "1);\n\t}else{\n\t\t$ans[$v]++;\n\t}\n}\n$i=0;\n$tar=array();\nforeach ($ans as $k=>&$v) {\n\tif($v!=0){\n\t\t$tar[$i]=$k;\n\t\t$v--;\n\t\t$i++;\n\t}\n}\n$i=0;\n$car=array();\nforeach ($ans as $k=>&$v) {\n\tif($v!=0){\n\t\t$car[$i]=$k;\n\t\t$v--;\n\t\t$i++;\n\t}\n}\nif($tar[0]==$car[0]) unset($tar[0]);\n$car=array_reverse($car);\n\n$num=count($tar)+count($car);\necho $num.\"\\n\";\nforeach ($car as $v) {\n\techo $v.\" \";\n}\nforeach ($tar as $v) {\n\techo $v.\" \";\n}\n\n?>"}], "negative_code": [], "src_uid": "5c63f91eb955cb6c3172cb7c8f78976c"} {"source_code": "\n", "positive_code": [{"source_code": "= $f) && ($g >= $h))\n{\n print \"LIVE\" . \"\\n\" . \"LIVE\";\n}\nelseif(($e < $f) && ($g < $h))\n{\n print \"DEAD\" . \"\\n\" . \"DEAD\";\n}\nelseif(($e >= $f) && ($g < $h))\n{\n print \"LIVE\" . \"\\n\" . \"DEAD\";\n}\nelseif(($e < $f) && ($g >= $h))\n{\n print \"DEAD\" . \"\\n\" . \"LIVE\";\n}\n?>"}, {"source_code": "=$ay)?\"LIVE\\n\":\"DEAD\\n\");\necho (($bx>=$by)?\"LIVE\\n\":\"DEAD\\n\");"}, {"source_code": "array('1','0','10'),\n\t'2'=>array('2','0','10'),\n\t'3'=>array('1','10','0'));\n*/\n\n$p[1] = 0;\n$p[2] = 0;\n$p1 = 0;\n$p2 = 0;\nFor($i = 1; $i <= $n; $i++){\n\t$row = $a[$i];\n\t$p[$row[0]] = $p[$row[0]] + $row[1] / 10;\n\tif($row[0] == 1) $p1++; else $p2++;\n}\n$p[1] = $p[1] / $p1;\n$p[2] = $p[2] / $p2;\n\nif($p[1] >= 0.5) echo'LIVE'; else echo 'DEAD';\necho PHP_EOL;\nif($p[2] >= 0.5) echo'LIVE'; else echo 'DEAD';\n\n?>"}, {"source_code": " 0, 'success' => 0);\n\nforeach($lines as $line)\n{\n list($server, $success, $errors) = explode(' ', $line);\n $server = (int) $server;\n \n $servers[$server]['errors'] += (int) $errors;\n $servers[$server]['success'] += (int) $success;\n}\n\necho ($servers[1]['success'] / $servers[1]['errors']) >= 1 ? 'LIVE' : 'DEAD'; \necho PHP_EOL;\necho ($servers[2]['success'] / $servers[2]['errors']) >= 1 ? 'LIVE' : 'DEAD';"}, {"source_code": " 0, 0);\n$cnt = getLine();\nfor ($i=0; $i<$cnt; $i++) {\n list($si, $x, $y) = explode(\" \", getLine());\n $servers[$si] += $x - $y;\n}\n\necho ($servers[1]>=0 ? 'LIVE' : 'DEAD') . PHP_EOL;\necho ($servers[2]>=0 ? 'LIVE' : 'DEAD') . PHP_EOL;\n\nfunction getLine()\n{\n return trim(fgets(STDIN));\n}"}, {"source_code": " /* BismiLahi Rahmani Rahim */ ?>\n\n\n"}, {"source_code": "= 0)\n $sa = 'LIVE';\nif ($ya >= 0)\n $sb = 'LIVE';\n\necho \"$sa\\n\";\necho \"$sb\\n\";\n\n?>"}], "negative_code": [{"source_code": " 0, 0);\n$cnt = getLine();\nfor ($i=0; $i<$cnt; $i++) {\n list($si, $x, $y) = explode(\" \", getLine());\n $servers[$si] += ($x>=$y) - ($x<$y);\n}\n\necho ($servers[1]>0 ? 'LIVE' : 'DEAD') . PHP_EOL;\necho ($servers[2]>0 ? 'LIVE' : 'DEAD') . PHP_EOL;\n\nfunction getLine()\n{\n return trim(fgets(STDIN));\n}"}, {"source_code": " 0, 0);\n$cnt = getLine();\nfor ($i=0; $i<$cnt; $i++) {\n list($si, $x, $y) = explode(\" \", getLine());\n $servers[$si] += ($x>=$y) - ($x<$y);\n}\n\necho ($servers[1]>=0 ? 'LIVE' : 'DEAD') . PHP_EOL;\necho ($servers[2]>=0 ? 'LIVE' : 'DEAD') . PHP_EOL;\n\nfunction getLine()\n{\n return trim(fgets(STDIN));\n}"}, {"source_code": "= intval($y))\n $sa = 'LIVE';\n if ($t == 2)\n if ($x >= intval($y))\n $sb = 'LIVE';\n}\n\necho \"$sa\\n\";\necho \"$sb\\n\";\n\n?>"}], "src_uid": "1d8870a705036b9820227309d74dd1e8"} {"source_code": "\r\n0);\r\n $arr = explode(\" \", trim(fgets($cin)));\r\n foreach($arr as $val){\r\n $bruh[$val]+=1;\r\n }\r\n $ans = 0;\r\n foreach($bruh as $el){\r\n $ans += min($el, $c);\r\n \r\n }\r\n fprintf($cout, \"%d\\n\", $ans);\r\n}\r\n\r\n?>\r\n\r\n", "positive_code": [{"source_code": " $v) {\r\n if ($c < $v) {\r\n $cost += $c;\r\n } else\r\n $cost += $v;\r\n\r\n\r\n }\r\n echo $cost.\"\\n\";\r\n}\r\n\r\nreturn;\r\n?>\r\n"}, {"source_code": " $price) {\r\n $result += $price;\r\n continue;\r\n }\r\n $result += $planetCount;\r\n }\r\n print $result . PHP_EOL;\r\n}\r\n"}, {"source_code": " $c ) {\r\n $ans += $c; \r\n } else {\r\n $ans += $t[$i];\r\n }\r\n }\r\n \r\n \r\n IO::pr($ans);\r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}], "negative_code": [{"source_code": "1){\r\n foreach($map as $k=>$v){\r\n if($v>1){\r\n $ex_count+=$v;\r\n }else{\r\n $o_count++;\r\n }\r\n\r\n }\r\n $min= min($ex_count,$c);\r\n\r\n echo $cost = $min+$o_count.\"\\n\";\r\n }else{\r\n echo count($map).\"\\n\";\r\n }\r\n}\r\n\r\nreturn;\r\n?>\r\n"}, {"source_code": "1){\r\n foreach($map as $k=>$v){\r\n if($v>1){\r\n $ex_count+=$v;\r\n }else{\r\n $o_count++;\r\n }\r\n\r\n }\r\n $min= min($ex_count,$c);\r\n\r\n echo $cost = $min+$o_count.\"\\n\";\r\n }else{\r\n echo count($map).\"\\n\";\r\n }\r\n}\r\n\r\nreturn;\r\n?>\r\n"}, {"source_code": " $price) {\r\n $result += $price;\r\n continue;\r\n }\r\n $result += $planetCount;\r\n }\r\n print $result . PHP_EOL;\r\n}"}], "src_uid": "2805d460df1121c4410999a9f36e383a"} {"source_code": "\r\n", "positive_code": [{"source_code": " 216,\r\n '2' => 168,\r\n '3' => 126,\r\n '4' => 90,\r\n '5' => 60,\r\n '6' => 36,\r\n '7' => 18,\r\n '8' => 6\r\n ];\r\n $ans = $t[$n];\r\n \r\n IO::pr($ans);\r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}], "negative_code": [{"source_code": " 216,\r\n '2' => 162,\r\n '3' => 126,\r\n '4' => 90,\r\n '5' => 60,\r\n '6' => 36,\r\n '7' => 18,\r\n '8' => 6\r\n ];\r\n $ans = $t[$n];\r\n \r\n IO::pr($ans);\r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}], "src_uid": "33e751f5716cbd666be36ab8f5e3977e"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $y ? $y : $x;\r\n }\r\n function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n \r\n function getMaxValueBc($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n function getRotate($a, $s, $e, $ind) {\r\n \t\t$ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n \t$ar[$i] = $a[$i];\r\n \t$j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n \t// echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\"; \r\n \t$a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n } \r\n function pr($s) {\r\n if(is_array($s)) {\r\n echo implode( ' ', $s), PHP_EOL;\r\n } else {\r\n echo $s, PHP_EOL;\r\n }\r\n }\r\n function fab2($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n \r\n return $a[$n];\r\n }"}], "negative_code": [], "src_uid": "ef2b90d5b1073430795704a7df748ac3"} {"source_code": "", "positive_code": [{"source_code": "\n$str = trim(fgets(STDIN)).\"*\";\n$n = intval(fgets(STDIN));\n$c = 0;\n\n\nfor($i=0; $i "}, {"source_code": "\n$str = trim(fgets(STDIN)).\"*\";\n$n = intval(fgets(STDIN));\n$c = 0;\n\n\nfor($i=0; $i "}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n\n$str = trim(fgets(STDIN)).\"+\";\n$n = trim(fgets(STDIN));\n\nfor ($i=0; $i<$n; $i++) {\n $l = fgets(STDIN);\n $t = split(\" \", $l);\n \n if ($i!=0) echo \"\\n\";\n echo g($t[0], $t[1], $str);\n}\n\n\nfunction g($l, $r, $str){\n $c = 0;\n for($i = $l; $i < $r; $i++) \n if ($str[$i-1] == $str[$i]) $c++;\n return $c;\n}\n\n\n?>"}, {"source_code": "\n$str = fgets(STDIN);\n$n = intval(fgets(STDIN));\nfor($i=0; $i "}, {"source_code": "\n\n$str = \"+\".trim(fgets(STDIN));\n$n = trim(fgets(STDIN));\n\nfor ($i=0; $i<$n; $i++) {\n $l = fgets(STDIN);\n $t = split(\" \", $l);\n if ($i!=0) echo \"\\n\";\n echo g($t[0], $t[1], $str);\n}\n\n\nfunction g($l, $r, $str){\n $c = 0;\n for($i = $l; $i < $r; $i++) \n if ($str[$i] == $str[$i+1]) $c++;\n return $c;\n}\n\n\n?>"}, {"source_code": "\n\n$str = trim(fgets(STDIN));\n$n = trim(fgets(STDIN));\n\nfor ($i=0; $i<$n; $i++) {\n $l = fgets(STDIN);\n $t = split(\" \", $l);\n \n if ($i!=0) echo \"\\n\";\n echo g($t[0], $t[1], $str);\n}\n\n\nfunction g($l, $r, $str){\n $c = 0;\n// echo \"$l > $r > \\n\";\n for($i=$l; $i<$r; $i++) {\n if ($str[$i-1] == $str[$i]) $c++;\n }\n return $c;\n}\n\n\n?>"}, {"source_code": "\n\n$str = \"+\".trim(fgets(STDIN)).\"+\";\n$n = trim(fgets(STDIN));\n\nfor ($i=0; $i<$n; $i++) {\n $l = fgets(STDIN);\n $t = split(\" \", $l);\n if ($i!=0) echo \"\\n\";\n echo g($t[0], $t[1], $str);\n}\n\n\nfunction g($l, $r, $str){\n $c = 0;\n for($i = $l; $i < $r; $i++) \n if ($str[$i] == $str[$i+1]) $c++;\n return $c;\n}\n\n\n?>"}], "src_uid": "b30e09449309b999473e4be6643d68cd"} {"source_code": ""}, {"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0];\n$prev = [8 => 4, 15 => 8, 16 => 15, 23 => 16, 42 => 23];\n$delete = $group = 0;\nforeach ($arr as $i => $value) {\n if ($value === '4') {\n $amounts[$value]++;\n } else{\n $amounts[$value] = min($amounts[$prev[$value]], $amounts[$value] + 1);\n }\n}\necho $n - $amounts[42] * 6;\n", "positive_code": [{"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0);\n$d = 0;\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] == 4)\n {\n $c[4]++;\n $d++;\n }\n elseif($b[$x] == 8)\n {\n if($c[4] > $c[8])\n {\n $c[8]++;\n $d++;\n }\n }\n elseif($b[$x] == 15)\n {\n if($c[8] > $c[15])\n {\n $c[15]++;\n $d++;\n }\n }\n elseif($b[$x] == 16)\n {\n if($c[15] > $c[16])\n {\n $c[16]++;\n $d++;\n }\n }\n elseif($b[$x] == 23)\n {\n if($c[16] > $c[23])\n {\n $c[23]++;\n $d++;\n }\n }\n elseif($b[$x] == 42)\n {\n if($c[23] > $c[42])\n {\n $c[42]++;\n $d++;\n $e++;\n }\n }\n}\nprint $a - $e * 6;\n?>"}], "negative_code": [{"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0);\n$d = 0;\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] == 4)\n {\n $c[4]++;\n $d++;\n }\n elseif($b[$x] == 8)\n {\n $c[8]++;\n if($c[4] >= $c[8])\n {\n $d++;\n }\n }\n elseif($b[$x] == 15)\n {\n $c[15]++;\n if(($c[4] >= $c[15]) && ($c[8] >= $c[15]))\n {\n $d++;\n }\n }\n elseif($b[$x] == 16)\n {\n $c[16]++;\n if(($c[4] >= $c[16]) && ($c[8] >= $c[16]) && ($c[15] >= $c[16]))\n {\n $d++;\n }\n }\n elseif($b[$x] == 23)\n {\n $c[23]++;\n if(($c[4] >= $c[23]) && ($c[8] >= $c[23]) && ($c[15] >= $c[23]) && ($c[16] >= $c[23]))\n {\n $d++;\n }\n }\n elseif($b[$x] == 42)\n {\n $c[42]++;\n if(($c[4] >= $c[42]) && ($c[8] >= $c[42]) && ($c[15] >= $c[42]) && ($c[16] >= $c[42]) && ($c[23] >= $c[42]))\n {\n $d++;\n $e++;\n }\n }\n}\nprint $a - $e * 6;\n?>"}, {"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0);\n$d = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] == 4)\n {\n $c[4]++;\n $d++;\n }\n elseif($b[$x] == 8)\n {\n $c[8]++;\n if($c[4] >= $c[8])\n {\n $d++;\n }\n }\n elseif($b[$x] == 15)\n {\n $c[15]++;\n if(($c[4] >= $c[15]) && ($c[8] >= $c[15]))\n {\n $d++;\n }\n }\n elseif($b[$x] == 16)\n {\n $c[16]++;\n if(($c[4] >= $c[16]) && ($c[8] >= $c[16]) && ($c[15] >= $c[16]))\n {\n $d++;\n }\n }\n elseif($b[$x] == 23)\n {\n $c[23]++;\n if(($c[4] >= $c[23]) && ($c[8] >= $c[23]) && ($c[15] >= $c[23]) && ($c[16] >= $c[23]))\n {\n $d++;\n }\n }\n elseif($b[$x] == 42)\n {\n $c[42]++;\n if(($c[4] >= $c[42]) && ($c[8] >= $c[42]) && ($c[15] >= $c[42]) && ($c[16] >= $c[42]) && ($c[23] >= $c[42]))\n {\n $d++;\n }\n }\n}\nprint $a - $d;\n?>"}, {"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0];\n$delete = 0;\nforeach ($arr as $value) {\n if (isset($amounts[$value])) {\n $amounts[$value]++;\n } else {\n $delete++;\n }\n}\n$min = min($amounts);\nif ($min === 0) {\n $delete += array_sum($amounts);\n} else {\n foreach ($amounts as $amount) {\n $delete += $amount - $min;\n }\n}\necho $delete;\n"}, {"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0];\n$prev = [8 => 4, 15 => 8, 16 => 15, 23 => 16, 42 => 23];\n$delete = $group = 0;\nforeach ($arr as $i => $value) {\n if ($value === '4') {\n $amounts[$value]++;\n } elseif (isset($amounts[$value]) && $amounts[$prev[$value]] > $amounts[$value]) {\n $amounts[$value]++;\n }\n if ($value === '42' && $amounts[42] > 0 && $amounts[$prev[$value]] === $amounts[$value]) {\n $group++;\n }\n}\necho $n - $group * 6;\n"}, {"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0];\n$prev = [8 => 4, 15 => 8, 16 => 15, 23 => 16, 42 => 23];\n$delete = $group = 0;\nforeach ($arr as $i => $value) {\n if ($value === '4') {\n $amounts[$value]++;\n } elseif (isset($amounts[$value]) && $amounts[$prev[$value]] > $amounts[$value]) {\n $amounts[$value]++;\n }\n if ($value === '42' && $amounts[$prev[$value]] === $amounts[$value]) {\n $group++;\n }\n}\necho $n - $group * 6;\n"}, {"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0];\n$prev = [8 => 4, 15 => 8, 16 => 15, 23 => 16, 42 => 23];\n$delete = $group = 0;\nforeach ($arr as $i => $value) {\n if ($value === 4) {\n $amounts[$value]++;\n } elseif (isset($amounts[$value]) && $amounts[$prev[$value]] > $amounts[$value]) {\n $amounts[$value]++;\n }\n if ($value === 42 && $amounts[$prev[$value]] === $amounts[$value]) {\n $group++;\n }\n}\necho $n - $group * 6;\n"}, {"source_code": " 0, 8 => 0, 15 => 0, 16 => 0, 23 => 0, 42 => 0];\n$prev = [8 => 4, 15 => 8, 16 => 15, 23 => 16, 42 => 23];\n$delete = $group = 0;\nforeach ($arr as $i => $value) {\n if ($value === '4') {\n $amounts[$value]++;\n } elseif (isset($amounts[$value]) && $amounts[$prev[$value]] > $amounts[$value]) {\n $amounts[$value]++;\n }\n if ($value === '42' && $amounts[42] > 0 && $amounts[$prev[$value]] === $amounts[$value]) {\n $group++;\n }\n}\nvar_dump($amounts);\necho $n - $group * 6;\n"}], "src_uid": "eb3155f0e6ba088308fa942f3572f582"} {"source_code": " 0; $j--) {\n if ($count == 0) break;\n if ($f[$j] == 0) continue;\n $min = min($count, $f[$j]);\n $cur += $min * $j;\n $count -= $min;\n }\n foreach($itr as $v) $f[$v]++;\n $ans = min($ans, $sumd - $cur);\n $map[$i] = null;\n }\n echo $ans;", "positive_code": [{"source_code": " 0; $j--) {\n if ($count == 0) break;\n if ($f[$j] == 0) continue;\n $min = min($count, $f[$j]);\n $cur += $min * $j;\n $count -= $min;\n }\n foreach($itr as $v) $f[$v]++;\n $ans = min($ans, $sumd - $cur);\n }\n echo $ans;"}, {"source_code": " 0; $j--) {\n if ($count == 0) break;\n if ($f[$j] == 0) continue;\n $min = min($count, $f[$j]);\n $cur += $min * $j;\n $count -= $min;\n }\n foreach($itr as $v) $f[$v]++;\n $ans = min($ans, $sumd - $cur);\n $itr = null;\n }\n echo $ans;"}], "negative_code": [], "src_uid": "afd12d95b59b250a0a5af87e5277a3fb"} {"source_code": "", "positive_code": [{"source_code": "= 3) {\r\n for($i = 0; $i < $n; $i++) {\r\n if(isset($res[$a[$i]])) {\r\n $res[$a[$i]] += 1;\r\n if($res[$a[$i]] >= 3) {\r\n $q1 = $a[$i];\r\n break;\r\n }\r\n }else {\r\n $res[$a[$i]] = 1;\r\n }\r\n }\r\n }\r\n echo $q1 . \"\\n\";\r\n }"}, {"source_code": " true, 2 => true]\r\n )) ? reset($a) : -1\r\n );\r\n}"}], "negative_code": [{"source_code": "= 3) {\r\n for($i = 0; $i < $n; $i++) {\r\n if(isset($res[$a[$i]])) {\r\n $res[$a[$i]] = $a[$i] + 1;\r\n if($res[$a[$i]] >= 3) {\r\n $q1 = $a[$i];\r\n break;\r\n }\r\n }else {\r\n $res[$a[$i]] = 1;\r\n }\r\n }\r\n }\r\n echo $q1 . \"\\n\";\r\n }"}, {"source_code": "= 3) {\r\n $a = mergeSort($a1);\r\n for($i = 0; $i < $n; $i++) {\r\n if(isset($res[$a[$i]])) {\r\n $res[$a[$i]] = $a[$i] + 1;\r\n if($res[$a[$i]] == 3) {\r\n $q1 = $a[$i];\r\n break;\r\n }\r\n }else {\r\n $res[$a[$i]] = 1;\r\n }\r\n }\r\n }\r\n echo $q1 . \"\\n\";\r\n }\r\n function pushRes($w) {\r\n \r\n }\r\n function mergeSort($aArray) {\r\n if(count($aArray) <= 1) {\r\n return $aArray;\r\n }\r\n $aLeft = [];\r\n $aRight = [];\r\n $n =floor(count($aArray) / 2);\r\n for($i = 0; $i <$n; $i++) {\r\n $aLeft[] = $aArray[$i]; \r\n }\r\n for($i = $n; $i ", "positive_code": [{"source_code": "100000000000){\n\t\t\t$res = bcadd($res, $l);\n\t\t\t$l=0;\n\t\t}\n\t\t\n\t\t$i += $m;\n\t\t$j -= $m;\n\t}\n\t$res = bcadd($res, $l);\n\t\n\techo bcmul($res, \"2\");\n?>"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "$p;$i-=$m) {\n\t\t\n\t\t$l += abs($a[$i] - $v);\n\t}\n\t\n\techo $l*2;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$long || $l<-$long){\n\t\t\t$res = bcadd($res, $l);\n\t\t\t$l=0;\n\t\t}\n\t\t\n\t\t$i += $m;\n\t\t$j -= $m;\n\t}\n\t$res = bcadd($res, $l);\n\t\n\techo bcmul($l, \"2\");\n?>"}, {"source_code": "10000000000){\n\t\t\t$res = bcadd($res, $l);\n\t\t\t$l=0;\n\t\t}\n\t\t\n\t\t$i += $m;\n\t\t$j -= $m;\n\t}\n$l-=$long;\n\t\n\techo bcmul($l, \"2\");\n?>"}, {"source_code": ""}, {"source_code": "100000000){\n\t\t\t$res = bcadd($res, $l);\n\t\t\t$l=0;\n\t\t}\n\t\t\n\t\t$i += $m;\n\t\t$j -= $m;\n\t}\n\t$res = bcadd($res, $l);\n\t\n\techo bcmul($l, \"2\");\n?>"}, {"source_code": "$long || $l<-$long){\n\t\t\t$res = bcadd($res, $l);\n\t\t\t$l=0;\n\t\t}\n\t\t\n\t\t$i += $m;\n\t\t$j -= $m;\n\t}\n\t$res = bcadd($res, $l);\n\t\n\techo bcmul($l, \"2\");\n?>"}, {"source_code": "100000000){\n\t\t\t$res = bcadd($res, $l);\n\t\t\t$l=0;\n\t\t}\n\t\t\n\t\t$i += $m;\n\t\t$j -= $m;\n\t}\n$l-=$long;\n\t\n\techo bcmul($l, \"2\");\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "47a8fd4c1f4e7b1d4fd15fbaf5f6fda8"} {"source_code": " $sends){\n $exist[$user][]=$sends[0];\n if ($sends[0]>0){\n $r='NO';\n echo $r;\n return;\n };\n $max=max($exist[$user]);\n for($i=1; $i 1))\n {\n $b = 1;\n break;\n }\n elseif(($c[$e] == FALSE) && ($d == 1))\n {\n $c[$e] = $d;\n }\n elseif($c[$e] == TRUE)\n {\n if($d <= $c[$e])\n {\n $c[$e] = max($c[$e], $d);\n }\n elseif($d - $c[$e] == 1)\n {\n $c[$e] = $d;\n }\n elseif($d - $c[$e] > 1)\n {\n $b = 1;\n break;\n }\n }\n}\nif($b == 0)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " $aa[$p] + 1) || (! @isset($aa[$p]) && $u != 0) )\n\t{\n\t\techo \"NO\" . PHP_EOL;\n\t\texit;\n\t}\n\t\n\tif(! @isset($aa[$p]))\n\t\t$aa[$p] = 0;\n\t\n\t$aa[$p] = max($u, $aa[$p]);\n}\n\n/*\nfor($i = 1; $i < sizeof($a); $i++)\n{\n\tif($a[$i - 1] > $a[$i])\n\t{\n\t\techo \"NO\" . PHP_EOL;\n\t\texit;\n\t}\n\t\n\t$a[$i] = max($a[$i], $a[$i - 1]);\n}\n*/\necho \"YES\" . PHP_EOL;"}], "negative_code": [{"source_code": ""}, {"source_code": " 1))\n {\n $b = 1;\n break;\n }\n elseif(($c[$e] == FALSE) && ($d == 1))\n {\n $c[$e] = $d;\n }\n elseif($c[$e] == TRUE)\n {\n if($d <= $c[$e])\n {\n $c[$e] = $d;\n }\n elseif($d - $c[$e] == 1)\n {\n $c[$e] = $d;\n }\n elseif($d - $c[$e] > 1)\n {\n $b = 1;\n break;\n }\n }\n}\nif($b == 0)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " $a[$i][$j])\n\t\t{\n\t\t\techo \"NO\" . PHP_EOL;\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$a[$i][$j] = max($a[$i][$j], $a[$i][$j - 1]);\n\t}\n}\n\necho \"YES\" . PHP_EOL;"}, {"source_code": " $a[$i])\n\t{\n\t\techo \"NO\" . PHP_EOL;\n\t\texit;\n\t}\n\t\n\t$a[$i] = max($a[$i], $a[$i - 1]);\n}\n\necho \"YES\" . PHP_EOL;"}, {"source_code": " $sends){\n $exist[$user]=array();\n for($i=0; $i $a){\n $r='NO';\n echo $r;\n return;\n }\n $exist[$user][]=$a;\n }\n}\necho $r;"}, {"source_code": " $sends){\n $exist[$user][]=$sends[0];\n for($i=1; $i $sends){\n $exist[$user]=array();\n for($i=0; $i =1){\n $r='NO';\n echo $r;\n return;\n }\n $exist[$user][]=$a;\n }\n}\necho $r;"}], "src_uid": "6f6f56d3106e09d51ebb3a206fa4be3c"} {"source_code": "= 2)\n {\n $d = 1;\n break;\n }\n }\n if($d == 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n print ($y + 1) . \" \" . ($y + 2) . \"\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " =2)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($j+1).\" \".($j+2).\"\\n\";\n break;\n }\n }\n if(!$ok)\n {\n echo \"NO\".\"\\n\";\n }\n \n }\n \n ?>"}, {"source_code": " 1){\n\t\t\techo \"YES\\n\";\n\t\t\techo ($i) . ' ' . ($i + 1) . \"\\n\";\n\t\t\treturn;\n\t\t}\n\t}\n\techo \"NO\\n\";\n};\n\nfor (; $t != 0; $t--) {\n\t$n = intval(trim(fgets(STDIN)));\n\t$a = explode(' ', trim(fgets(STDIN)));\n\n\t$iterate($a, $n);\n}\n\n\n"}], "negative_code": [{"source_code": "$p[$j])\n {\n $min=$p[$j];\n $l=$j;\n }\n }\n if($max-$min>=(abs($r-$l)+1))\n {\n echo \"YES\".\"\\n\";\n echo min($l+1,$r+1).\" \".max($l+1,$r+1).\"\\n\";\n }else\n {\n echo \"NO\".\"\\n\";\n }\n\n}\n\n?>\n"}, {"source_code": "$a[$i])\n {\n $min=$a[$i];\n }\n if($max<$a[$i])\n {\n $max=$a[$i];\n }\n }\n return $max-$min;\n}\n$server = \"php://stdin\";\n$local = \"input.txt\";\n$handle = fopen($server, \"r\");\n$t = trim(fgets($handle));\n\nfor ($i=0;$i<$t;$i++)\n{\n $x = trim(fgets($handle));\n $a = trim(fgets($handle));\n $p = explode(' ', $a);\n $sum=0;$l=0;$r=0;$count=1;$check=false;$ok=false;\n $min=10000000009;\n $max=0;\n while( $l<=$x-1)\n { if($max<$p[$r])$max=$p[$r];\n if($min>$p[$r])$min=$p[$r];\n //echo $max.\" \".$min.\"
\";\n if($max-$min>=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n if($max<$p[$r])$max=$p[$r];\n if($min>$p[$r])$min=$p[$r];\n $r++;\n\n if($r==$x)\n {\n $l++;\n $min=10000000009;\n $max=0;\n $r=$l;\n $count=1;\n }\n $count++;\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else if($check==false)\n {\n $l++;\n $count--;\n $check=true;\n }else if($check==true)\n {\n $r--;\n $count--;\n $check=false;\n }\n }\n $sum=0;$l=0;$r=$x-1;$count=$x;$check=true;$ok=false;\n while($l<$r)\n {\n if($p[$r]-$p[$l]>=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else if($check==false)\n {\n $l++;\n $count--;\n $check=true;\n }else if($check==true)\n {\n $r--;\n $count--;\n $check=false;\n }\n }\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": " =2)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($i+1).\" \".($i+2).\"\\n\";\n }\n }\n if(!$ok)\n {\n echo \"NO\".\"\\n\";\n }\n \n }\n \n ?>"}, {"source_code": "$a[$i])\n {\n $min=$a[$i];\n }\n if($max<$a[$i])\n {\n $max=$a[$i];\n }\n }\n return $max-$min;\n}\n$server = \"php://stdin\";\n$local = \"input.txt\";\n$handle = fopen($server, \"r\");\n$t = trim(fgets($handle));\n\nfor ($i=0;$i<$t;$i++)\n{\n $x = trim(fgets($handle));\n $a = trim(fgets($handle));\n $p = explode(' ', $a);\n $sum=0;$l=0;$r=0;$count=1;$check=false;$ok=false;\n $min=$p[0];\n $max=$p[0];\n while($l<$x-1)\n {\n if($max-$min>=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n\n $r++;\n if($max<$p[$r])$max=$p[$r];\n if($min>$p[$r])$min=$p[$r];\n if($r==$x-1)\n {\n\n $l++;\n $max=$p[$l];\n $min=$p[$l];\n $r=$l;\n $count=1;\n }\n $count++;\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "$p[$j])\n {\n $min=$p[$j];\n $l=$j;\n }\n }\n if($max-$min>=($r-$l+1))\n {\n echo \"YES\".\"\\n\";\n echo min($l+1,$r+1).\" \".max($l+1,$r+1).\"\\n\";\n }else\n {\n echo \"NO\".\"\\n\";\n }\n\n}\n\n?>\n"}, {"source_code": "$a[$i])\n {\n $min=$a[$i];\n }\n if($max<$a[$i])\n {\n $max=$a[$i];\n }\n }\n return $max-$min;\n}\n$server = \"php://stdin\";\n$local = \"input.txt\";\n$handle = fopen($server, \"r\");\n$t = trim(fgets($handle));\n\nfor ($i=0;$i<$t;$i++)\n{\n $x = trim(fgets($handle));\n $a = trim(fgets($handle));\n $p = explode(' ', $a);\n $sum=0;$l=0;$r=0;$count=1;$check=false;$ok=false;\n $min=$p[0];\n $max=$p[0];\n while($l<$x-1)\n {\n if(getb($p,$l,$r)>=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n $r++;\n if($r==$x-1)\n {\n $l++;\n $r=$l;\n $count=1;\n }\n $count++;\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "$a[$i])\n {\n $min=$a[$i];\n }\n if($max<$a[$i])\n {\n $max=$a[$i];\n }\n }\n return $max-$min;\n}\n$server = \"php://stdin\";\n$local = \"input.txt\";\n$handle = fopen($server, \"r\");\n$t = trim(fgets($handle));\n\nfor ($i=0;$i<$t;$i++)\n{\n $x = trim(fgets($handle));\n $a = trim(fgets($handle));\n $p = explode(' ', $a);\n $sum=0;$l=0;$r=0;$count=1;$check=false;$ok=false;\n $min=$a[0];\n $max=$a[0];\n while($l<$x-1)\n {\n if($max-$min>=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n\n $r++;\n if($max<$p[$r])$max=$p[$r];\n if($min>$p[$r])$min=$p[$r];\n if($r==$x-1)\n {\n\n $l++;\n $max=$p[$l];\n $min=$p[$l];\n $r=$l;\n $count=1;\n }\n $count++;\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "$a[$i])\n {\n $min=$a[$i];\n }\n if($max<$a[$i])\n {\n $max=$a[$i];\n }\n }\n return $max-$min;\n}\n$server = \"php://stdin\";\n$local = \"input.txt\";\n$handle = fopen($server, \"r\");\n$t = trim(fgets($handle));\n\nfor ($i=0;$i<$t;$i++)\n{\n $x = trim(fgets($handle));\n $a = trim(fgets($handle));\n $p = explode(' ', $a);\n $sum=0;$l=0;$r=0;$count=1;$check=false;$ok=false;\n $min=10000000009;\n $max=0;\n while( $l<=$x-1)\n { if($max<$p[$r])$max=$p[$r];\n if($min>$p[$r])$min=$p[$r];\n //echo $max.\" \".$min.\"
\";\n if($max-$min>=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n if($max<$p[$r])$max=$p[$r];\n if($min>$p[$r])$min=$p[$r];\n $r++;\n\n if($r==$x)\n {\n $l++;\n $min=10000000009;\n $max=0;\n $r=$l;\n }\n $count++;\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n if($p[$r]-$p[$l+1]>$p[$r-1]-$p[$l])\n {\n $l++;\n $count--;\n }else\n {\n $r--;\n $count--;\n }\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else if($check==false)\n {\n $l++;\n $count--;\n $check=true;\n }else if($check==true)\n {\n $r--;\n $count--;\n $check=false;\n }\n\n }\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "= 2)\n {\n $d = 1;\n break;\n }\n }\n if($d == 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n print $y . \" \" . ($y + 1) . \"\\n\";\n }\n}\n?>"}, {"source_code": " $j - $i) {\n\t\t\t\t\t\t\treturn [$i, $j];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($min > $a[$j]) {\n\t\t\t\t\t\t$min = $a[$j];\n\t\t\t\t\t\tif ($max - $min > $j - $i) {\n\t\t\t\t\t\t\treturn [$i, $j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($delta < $j - $i){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$delta = $max - $min;\n\t\t}\n\t\treturn false;\n\t};\n\n\t$res = $iterate();\n\n\tif ($res === false) {\n\t\techo \"NO\\n\";\n\t} else {\n\t\techo \"YES\\n\";\n\t\techo ($res[0] + 1) . ' ' . ($res[1] + 1) . \"\\n\";\n\t}\n\n\n}\n\n\n"}, {"source_code": " $i; $j-- ){\n\t\t\t\tif($max < $a[$j]){\n\t\t\t\t\t$max = $a[$j];\n\t\t\t\t\tif($max - $min >= ($j - $i) + 1){\n\t\t\t\t\t\treturn [$i, $j];\n\t\t\t\t\t}\n\t\t\t\t} else if($min > $a[$j]){\n\t\t\t\t\t$min = $a[$j];\n\t\t\t\t\tif($max - $min >= ($j - $i) + 1){\n\t\t\t\t\t\treturn [$i, $j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n\n\t$res = $iterate();\n\n\tif($res===false){\n\t\techo \"NO\\n\";\n\t} else {\n\t\techo \"YES\\n\";\n\t\techo (min($res)+1).' '.(max($res)+1).\"\\n\";\n\t}\n}\n\n\n"}, {"source_code": " $j - $i) {\n\t\t\t\t\t\t\treturn [$i, $j];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ($min > $a[$j]) {\n\t\t\t\t\t\t$min = $a[$j];\n\t\t\t\t\t\tif ($max - $min > $j - $i) {\n\t\t\t\t\t\t\treturn [$i, $j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($delta <= $j - $i){\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$delta = $max - $min;\n\t\t}\n\t\treturn false;\n\t};\n\n\t$res = $iterate();\n\n\tif ($res === false) {\n\t\techo \"NO\\n\";\n\t} else {\n\t\techo \"YES\\n\";\n\t\techo ($res[0] + 1) . ' ' . ($res[1] + 1) . \"\\n\";\n\t}\n\n\n}\n\n\n"}, {"source_code": "$k)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo min($k+1,$j+1).\" \".max($j+1,$k+1).\"\\n\";\n break;\n }\n\n }\n if($ok==true)break;\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n if($p[$r]-$p[$l+1]>$p[$r-1]-$p[$l])\n {\n $l++;\n $count--;\n }else\n {\n $r--;\n $count--;\n }\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "=sizeof($temp))\n {\n echo \"YES\".\"\\n\";\n echo $i.\" \".$j.\"\\n\";\n return true;\n }\n }\n }\n return false;\n}\n$server = \"php://stdin\";\n$local = \"input.txt\";\n$handle = fopen($server, \"r\");\n$t = trim(fgets($handle));\n\nfor ($i=0;$i<$t;$i++)\n{\n $x = trim(fgets($handle));\n $a = trim(fgets($handle));\n $p = explode(' ', $a);\n\n if(!subArray($p,$x))\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "=$count)\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo ($l+1).\" \".($r+1).\"\\n\";\n break;\n }else {\n if($r==$x-1)\n {\n $l++;\n $r=$l;\n $count=1;\n }\n $r++;\n $count++;\n }\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}, {"source_code": "=($k+1))\n {\n $ok=true;\n echo \"YES\".\"\\n\";\n echo min($k+1,$j+1).\" \".max($j+1,$k+1).\"\\n\";\n break;\n }\n\n }\n if($ok==true)break;\n }\n\n if(!$ok)\n echo \"NO\".\"\\n\";\n\n}\n\n?>\n"}], "src_uid": "fa16d33fb9447eea06fcded0026c6e31"} {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": "$a[$j])\r\n {\r\n $x=$a[$i];\r\n $a[$i]=$a[$j];\r\n $a[$j]=$x;\r\n }\r\n $ans=10000000000000000;\r\n for($i=1;$i<$n-1;$i++)\r\n {\r\n $x=$a[$i+1]-$a[$i-1];\r\n if($x<$ans)\r\n $ans=$x;\r\n }\r\n echo $ans.\"\\n\";\r\n}\r\n?>"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": "= 0 ; $i-=2)\n\t@$result.=$input[$i];\nfor ($i=$n-1; $i>=0;$i-=2)\n\t@$r.=$input[$i];\necho $result.strrev($r);"}, {"source_code": " 0) {\n\n $median = floor(strlen($letters) / 2) + (strlen($letters) % 2 == 1);\n \n while(isset($word[$median])) {\n $median++;\n if($median == ($n + 1)) {\n $median = 0;\n }\n }\n \n \n \n //for($median = floor(($n - $ii) / 2); isset($word[$median]); $median++);\n $word[$median] = $letters[0];\n //$n--;\n $letters = substr($letters, 1);\n \n}\n\nksort($word);\n\necho implode($word);"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "2a414730d1bc7eef50bdb631ea966366"} {"source_code": "\n$str=trim(fgets(STDIN));\n$open=preg_match_all('/<\\w>/',$str,$mopen);\n$all=preg_match_all('/(<\\w>|<\\/\\w>)/',$str,$mall);\nfunction numspace($n){\n $str=\"\";\n for($i=0; $i<$n; $i++)\n $str.=\" \";\n return $str; \n}\n$lvl=0;\nfor($i=0; $i/',$mall[0][$i])) {\n $space=numspace($lvl*2);\n $lvl++;\n } else{\n $lvl--;\n $space=numspace($lvl*2);\n } \n echo $space.$mall[0][$i].\"\\n\";\n}\n?>", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "45207d5ff60bbb6897feb1d9a3f85a65"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "a4c82fffb31bc7e42870fd84e043e815"} {"source_code": "", "positive_code": [{"source_code": " $sV){\n if($i <= $sV){\n $k++;\n $i++;\n }\n\n}\necho $k;"}, {"source_code": " $result) {\n $result++;\n }\n}\necho $result;\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $c){\n\t\t\t$c++;\n\t\t}\n\t}\n\n\techo $c-1;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": " $sV){\n if($i <= $sV){\n $k++;\n }\n $i++;\n}\necho $k;"}, {"source_code": ""}, {"source_code": "$n ? $n : $c);\n?>"}, {"source_code": ""}], "src_uid": "4f02ac641ab112b9d6aee222e1365c09"} {"source_code": "in();\n\t\n\tfor ($i = 0; $i < $tc; $i++)\n\t{\n\t\t$n = (int)$Input->in();\n\n\t\tif ($n % 2 == 0) print(4 * $n + 1);\n\t\telse\n\t\t{\n\t\t\t$g = gcd($n * 2, intval(($n + 1)/2));\n\t\t\tprintf(\"%.0f\",lcm($n * 4, intval(($n + 1)/2), $g) / ($n + 1) + 1);\n\t\t}\n\t\t\n\t\tif ($i !== $tc - 1) print(\"\\n\");\n\t}\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}], "negative_code": [{"source_code": "in();\n\t\n\tfor ($i = 0; $i < $tc; $i++) {\n\t\t\n\t\t$n = (int)$Input->in();\n\n\t\tprint($n * 4 + 1);\n\t\t\n\t\tif ($i !== $tc - 1) print(\"\\n\");\n\t}\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}], "src_uid": "168dbc4994529f5407a440b0c71086da"} {"source_code": " (int)($m/2)){\n return $m - $i;\n }\n return $i;\n}\n\nforeach ($strings as $key => $string){\n for($i=0;$i<$m;$i++){\n $steps = steps($i, $m);\n $type = type($string[$i]);\n if($dp[$type][$key] > $steps){\n $dp[$type][$key] = $steps;\n }\n }\n}\n$min = PHP_INT_MAX;\n\nfor ($i=0; $i<$n;$i++){\n for ($j=0; $j<$n;$j++){\n for ($k=0; $k<$n;$k++){\n if($i != $j && $i != $k && $j != $k){\n $cur = $dp[0][$i] + $dp[1][$j] + $dp[2][$k];\n if($min > $cur){\n $min = $cur;\n }\n }\n }\n }\n}\n\necho $min;\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " (int)($m/2)){\n return $m - $i;\n }\n return $i;\n}\n\nforeach ($strings as $key => $string){\n for($i=0;$i<$m;$i++){\n $steps = steps($i, $m);\n $type = type($string[$i]);\n if($dp[$type][$key] > $steps || $dp[$type][$key] == -1){\n $dp[$type][$key] = $steps;\n }\n }\n}\n$min = PHP_INT_MAX;\n\nfor ($i=0; $i<$n;$i++){\n for ($j=0; $j<$n;$j++){\n for ($k=0; $k<$n;$k++){\n if($i != $j && $i != $k && $j != $k){\n $cur = $dp[0][$i] + $dp[1][$j] + $dp[2][$k];\n if($min > $cur){\n $min = $cur;\n }\n }\n }\n }\n}\n\necho $min;\n"}], "src_uid": "b7ff1ded73a9f130312edfe0dafc626d"} {"source_code": " 0)\n {\n $c = substr($c, $e + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n $c = \" \" . $c;\n $f = strpos($c, \"3\");\n if($f > 0)\n {\n $c = substr($c, $f + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n }\n $m--;\n $c = \" \" . $c;\n $g = strpos($c, $i[$x]);\n if($g > 0)\n {\n $c = substr($c, $g + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n if($m == 0)\n {\n $k = 0;\n }\n}\nif($c != \"\")\n{\n $c = \" \" . $c;\n $e = strpos($c, \"<\");\n if($e > 0)\n {\n $c = substr($c, $e + 1);\n }\n else\n {\n $h = 1;\n }\n if($c != \"\")\n {\n $c = \" \" . $c;\n $f = strpos($c, \"3\");\n if($f > 0)\n {\n $c = substr($c, $f + 1);\n }\n else\n {\n $h = 1;\n }\n }\n else\n {\n $h = 1;\n }\n if($h == 1)\n {\n print \"no\";\n }\n else\n {\n print \"yes\";\n }\n}\nelse\n{\n print \"no\";\n}\n?>", "positive_code": [{"source_code": "\n$f = file('php://stdin',FILE_IGNORE_NEW_LINES);\ndefine('L',PHP_EOL);\n//-----------------------\n\n$z = $f[0];\n\nfor($i=1;$i<=$z;$i++) {\n\t$word[] = $f[$i];\n}\n\n\n$r = $f[$i];\n\n$q = strlen($r);\n\n\n$i = $l = $w = 0;\n$letter = $word[$w][$l];\n\ndo {\n\t$s = $r[$i++];\n\n\tif ($heart) {\n\t\tif ($s==$letter) {\n\t\t\tif (strlen($word[$w])==++$l) {\n\t\t\t\tif ($z == ++$w) {\n\t\t\t\t\t$good = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$letter = $word[$w][$l = 0];\n\t\t\t\t\t$heart = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$letter = $word[$w][$l];\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ($half) {\n\t\t\tif ($s=='3') {\n\t\t\t\t$half = false;\n\t\t\t\t$heart = true;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($s=='<') {\n\t\t\t\t$half = true;\n\t\t\t}\n\t\t}\n\n\t}\n} while ($i < $q);\n\n\nif ($good && preg_match('/.*?<.*?3/', substr($r,$i-1))) {\n\techo 'yes';\n\texit;\n}\n\necho 'no';\n"}], "negative_code": [{"source_code": " 0)\n {\n $c = substr($c, $e + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n $c = \" \" . $c;\n $f = strpos($c, \"3\");\n if($f > 0)\n {\n $c = substr($c, $f + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n }\n $m--;\n $c = \" \" . $c;\n $g = strpos($c, $i[$x]);\n if($g > 0)\n {\n $c = substr($c, $g + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n if($m == 0)\n {\n $k = 0;\n }\n}\nif(strlen($c) != \"0\")\n{\n $c = \" \" . $c;\n $e = strpos($c, \"<\");\n if($e > 0)\n {\n $c = substr($c, $e + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n $c = \" \" . $c;\n $f = strpos($c, \"3\");\n if($f > 0)\n {\n $c = substr($c, $f + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n}\nif($h == 1)\n{\n print \"no\";\n}\nelse\n{\n print \"yes\";\n}\nprint \"\\n\" . $c;\n?>"}, {"source_code": " 0)\n {\n $c = substr($c, $e + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n $c = \" \" . $c;\n $f = strpos($c, \"3\");\n if($f > 0)\n {\n $c = substr($c, $f + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n $c = \" \" . $c;\n $g = strpos($c, $d[$x]);\n if($g > 0)\n {\n $c = substr($c, $g + strlen($d[$x]));\n }\n else\n {\n $h = 1;\n break;\n }\n}\n$c = \" \" . $c;\n$e = strpos($c, \"<\");\nif($e > 0)\n{\n $c = substr($c, $e + 1);\n}\nelse\n{\n $h = 1;\n}\n$c = \" \" . $c;\n$f = strpos($c, \"3\");\nif($f > 0)\n{\n $c = substr($c, $f + 1);\n}\nelse\n{\n $h = 1;\n}\nif($h == 1)\n{\n print \"no\";\n}\nelse\n{\n print \"yes\";\n}\n?>"}, {"source_code": " 0)\n {\n $c = substr($c, $e + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n $c = \" \" . $c;\n $f = strpos($c, \"3\");\n if($f > 0)\n {\n $c = substr($c, $f + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n }\n $m--;\n $c = \" \" . $c;\n $g = strpos($c, $i[$x]);\n if($g > 0)\n {\n $c = substr($c, $g + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n if($m == 0)\n {\n $k = 0;\n }\n}\nif(strlen($c) != \"0\")\n{\n $c = \" \" . $c;\n $e = strpos($c, \"<\");\n if($e > 0)\n {\n $c = substr($c, $e + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n $c = \" \" . $c;\n $f = strpos($c, \"3\");\n if($f > 0)\n {\n $c = substr($c, $f + 1);\n }\n else\n {\n $h = 1;\n break;\n }\n}\nif($h == 1)\n{\n print \"no\";\n}\nelse\n{\n print \"yes\";\n}\n?>"}, {"source_code": "\n$f = file('php://stdin',FILE_IGNORE_NEW_LINES);\ndefine('L',PHP_EOL);\n//-----------------------\n$q = $f[0];\n\nfor($i=1;$i<=$q;$i++) {\n\t$w[] = $f[$i];\n}\n\n$r = $f[$i];\n\n$r = preg_replace('/<([^<3]*)3/', '<3', $r);\n\nif (!preg_match('/^<3.*?<3$/', $r)) {\n\techo 'no';\n} else {\n\n\t$o = explode('<3',substr($r,2,-2));\n\n\tif (sizeof($o)!=sizeof($w)) {\n\t\t$no = true;\n\t} else {\n\t\tforeach ($w as $i=>$word) {\n\t\t\t$word = str_split($word);\n\n\t\t\tforeach ($word as $letter) {\n\t\t\t\t$found = false;\n\t\t\t\tfor($j=0;$j $word) {\n\t\t$word = str_split($word);\n\n\t\tforeach ($word as $letter) {\n\t\t\t$found = false;\n\t\t\tfor($j=0;$j $word) {\n\t\t\t$word = str_split($word);\n\n\t\t\tforeach ($word as $letter) {\n\t\t\t\t$found = false;\n\t\t\t\tfor($j=0;$j $minR && $minL < $maxR)\r\n echo \"YES\\n\";\r\n else\r\n echo \"NO\\n\";\r\n}\r\n\r\n?>", "positive_code": [{"source_code": "\";\r\n\t\t$m2 = max($c, $d);\r\n\t\t$arr = array($a, $b, $c, $d);\r\n\t\trsort($arr);\r\n//\t\tvar_dump($arr);\r\n//\t\techo \"
\";\r\n\t\tif (($m1 == $arr[0]|| $m1 == $arr[1])&& ($m2 == $arr[0]|| $m2 == $arr[1])) {\r\n\t\t\techo \"YES\".\"\\n\";\r\n\t\t}else echo \"NO\".\"\\n\";\r\n\t}\r\n\r\n\r\n\r\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "\";\r\n\t\t$m2 = max($c, $d);\r\n\t\t$arr = array($a, $b, $c, $d);\r\n\t\trsort($arr);\r\n//\t\tvar_dump($arr);\r\n//\t\techo \"
\";\r\n\t\tif (($m1 == $arr[0]|| $m1 == $arr[1])&& ($m2 == $arr[0]|| $m2 == $arr[1])) {\r\n\t\t\techo \"YES\".\"
\";\r\n\t\t}else echo \"NO\".\"
\";\r\n\t}\r\n\r\n\r\n\r\n?>"}], "src_uid": "cb24509580ff9b2f1a11103a0e4cdcbd"} {"source_code": " $r)\n $r = $a[$i];\n if ($r == $i + 1)\n $days++;\n}\n\necho $days . \"\\n\";\n", "positive_code": [{"source_code": " $d)\n {\n $d = $b[$x];\n }\n if(($b[$x] == $x + 1) && ($b[$x] == $d))\n {\n $c++;\n }\n}\nprint $c;\n?>"}], "negative_code": [], "src_uid": "291601d6cdafa4113c1154f0dda3470d"} {"source_code": " 1];\n $prev_value = $arr[0];\n for ($i = 1; $i < $n; $i++) {\n if ($arr[$i] != $prev_value) {\n isset($path[$arr[$i]]) or $path[$arr[$i]] = 0;\n $path[$arr[$i]] += 1;\n $prev_value = $arr[$i];\n }\n }\n $a = $arr[0];\n $b = $arr[$n-1];\n $arr = array_diff($arr, [$a, $b]);\n ($a == $b) and $path[$a] -= 1;\n foreach (array_unique($arr) as $value) {\n $path[$value] += 1;\n }\n printf(\"%d\\n\", min($path) ?? 0);\n}", "positive_code": [{"source_code": " 0];\n $bAll = true;\n for ($i = 1; $i < $n; $i++) {\n if ($a[$i] != $a[$i-1]) {\n $bAll = false;\n }\n if (isset($ex[$a[$i]])) {\n if ($a[$i] != $a[$i-1]) {\n $ex[$a[$i]] = $ex[$a[$i]] + 1;\n }\n } else {\n $ex[$a[$i]] = 0;\n }\n }\n\n if ($bAll) {\n echo \"0\\n\";\n } else {\n foreach($ex as $sValue => $iCount) {\n /* if ($a[$n-1] == $sValue && $sValue == $a[0]) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }*/\n if ($a[$n-1] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n if ($a[0] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n }\n echo min($ex).\"\\n\";\n }\n\n}"}, {"source_code": ""}], "negative_code": [{"source_code": " 0,\n $a[$n-1] => 0,\n ];\n $bAll = true;\n for ($i = 1; $i < ($n-1); $i++) {\n if ($a[$i] != $a[$i+1]) {\n $bAll = false;\n }\n if (isset($ex[$a[$i]])) {\n if ($a[$i] != $a[$i+1]) {\n $ex[$a[$i]] = $ex[$a[$i]] + 1;\n }\n } else {\n $ex[$a[$i]] = 0;\n }\n }\n\n if ($bAll) {\n echo \"0\\n\";\n } else {\n foreach($ex as $sValue => $iCount) {\n if ($a[$n-1] == $sValue && $sValue == $a[0]) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n if ($a[$n-1] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n if ($a[0] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n }\n echo min($ex).\"\\n\";\n }\n\n}"}, {"source_code": " $iCount) {\n if ($a[$n-1] == $sValue && $sValue == $a[0]) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n if ($a[$n-1] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n if ($a[0] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n }\n echo min($ex).\"\\n\";\n }\n\n}"}, {"source_code": " $sValue) {\n if ($a[$n-1] != $sKey) {\n $ex[$sKey] = $sValue + 1;\n }\n }\n \n echo $bStatus ? 0 : min($ex);\n echo \"\\n\";\n}"}, {"source_code": " $iCount) {\n if ($a[$n-1] == $sValue && $sValue == $a[0]) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n if ($a[$n-1] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n if ($a[0] != $sValue) {\n $ex[$sValue] = $ex[$sValue] + 1;\n }\n }\n echo min($ex).\"\\n\";\n }\n\n}"}, {"source_code": " 1];\n $prev_value = $arr[0];\n for ($i = 1; $i < $n; $i++) {\n if ($arr[$i] != $prev_value) {\n isset($path[$arr[$i]]) or $path[$arr[$i]] = 0;\n $path[$arr[$i]] += 1;\n $prev_value = $arr[$i];\n }\n }\n $a = $arr[0];\n $b = $arr[$n-1];\n $arr = array_diff($arr, [$arr[0], $arr[$n-1]])\n and ($a == $b) and $path[$a] -= 1;\n foreach (array_unique($arr) as $value) {\n $path[$value] += 1;\n }\n printf(\"%d\\n\", $arr ? min($path) : 0);\n}"}], "src_uid": "080eb61cbc4b0ffcbab10b86918f70fe"} {"source_code": "= 0; --$i) {\n $newitems = $items;\n $newperms = $perms;\n list($foo) = array_splice($newitems, $i, 1);\n array_unshift($newperms, $foo);\n pc_permute($newitems, $newperms, $p);\n }\n }\n}\n\n$perms = [];\npc_permute([0,1,2,3], [], $perms);\n\n$minToChange = $n*$n*4;\n\nfor ($p = 0; $p < 24; $p++) {\n $desk = [];\n for ($i = 0; $i < $n; $i++) {\n $desk[$i] = $a[$perms[$p][0]][$i] . $a[$perms[$p][1]][$i];\n }\n\n for ($i = 0; $i < $n; $i++) {\n $desk[$n + $i] = $a[$perms[$p][2]][$i] . $a[$perms[$p][3]][$i];\n }\n\n $toChange = 0;\n for ($i = 0; $i < 2*$n; $i++) {\n for ($j = 0; $j < 2*$n; $j++) {\n if (($i + $j) % 2 != $desk[$i][$j]) {\n $toChange ++;\n }\n }\n }\n\n if ($toChange > 4*$n*$n/2) {\n //echo $n . \" \" . ($n*$n) , \" \\n\";\n $toChange = 4*$n*$n - $toChange;\n //echo $toChange . \"\\n\";\n }\n\n if ($toChange < $minToChange) {\n $minToChange = $toChange;\n }\n\n}\n\necho $minToChange . \"\\n\";\n\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "dc46c6cb6b4b9b5e7e6e5b4b7d034874"} {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}], "negative_code": [], "src_uid": "329ac6671e26b73ab70749ca509f5b09"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " $n-3) $x = $n-4;\n if ($y > $n-3) $y = $n-4;\n \n for ($j = $x; $j < $x+2; ++$j) {\n for ($k = $y; $k < $y+2; ++$k) {\n if (\n $matrix[$j][$k] && $matrix[$j][$k+1] && $matrix[$j][$k+2]\n && $matrix[$j+1][$k] && $matrix[$j+1][$k+1] && $matrix[$j+1][$k+2]\n && $matrix[$j+2][$k] && $matrix[$j+2][$k+1] && $matrix[$j+2][$k+2]\n ) return $i+1;\n }\n }\n }\n \n return -1;\n}\n\n$in = explode(\"\\n\", file_get_contents('php://stdin'));\n$n; $m; $move = array();\n\nfor ($i = 0; $i < count($in); $i++) {\n $arr = explode(' ', $in[$i]);\n if ($i == 0) {\n $n = $arr[0];\n $m = $arr[1];\n } else {\n $move[$i-1] = array($arr[0], $arr[1]);\n }\n}\n\necho B($n, $m, $move);\n?>"}, {"source_code": " $value) {\n $move[] = array($value[0], $value[2]);\n}*/\n\n\n$a = <<< p\n4 11\n1 1\n1 2\n1 3\n2 2\n2 3\n1 4\n2 4\n3 4\n3 2\n3 3\n4 1\np;\n$in = explode(' ', file_get_contents('php://stdin'));\n$n; $m; $move;\n\nfor ($i = 0; $i < count($in); $i++) {\n $arr = explode(' ', $in[$i]);\n if ($i == 0) {\n $n = $arr[0];\n $m = $arr[1];\n $move = array($m);\n } else {\n $move[$i-1] = array($arr[0], $arr[1]);\n }\n}\n\necho B($n, $m, $move);\n?>"}, {"source_code": " $n-2) $x = (n-2);\n if ($y > $n-2) $y = (n-2);\n \n for ($j = $x; $j < $x+3; ++$j) {\n for ($k = $y; $k < $y+3; ++$k) {\n if (\n $matrix[$j][$k] && $matrix[$j][$k+1] && $matrix[$j][$k+2]\n && $matrix[$j+1][$k] && $matrix[$j+1][$k+1] && $matrix[$j+1][$k+2]\n && $matrix[$j+2][$k] && $matrix[$j+2][$k+1] && $matrix[$j+2][$k+2]\n ) return $i;\n }\n }\n }\n \n return -1;\n}\n\n$in = explode(\"\\n\", file_get_contents('php://stdin'));\n$n; $m; $move = array();\n\nfor ($i = 0; $i < count($in); $i++) {\n $arr = explode(' ', $in[$i]);\n if ($i == 0) {\n $n = $arr[0];\n $m = $arr[1];\n } else {\n $move[$i-1] = array($arr[0], $arr[1]);\n }\n}\n\necho B($n, $m, $move);\n?>"}], "src_uid": "8a4a46710104de78bdf3b9d5462f12bf"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " 0){$line = str_replace($del,'',$line);$dataex[] = $line;$text = explode(\" \",$line);\nforeach($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;}\nfunction G(){$ret = $this->arr_txt[$this->ntxt++];$this->nline = $this->linex[$this->ntxt];return $ret;}\nfunction GL(){$this->ntxt = $this->liney[$this->nline]+1;return $this->arr_line[$this->nline++];}} /*init*/ \n$dxs = new stdIn();\n\n$n = $dxs->G();\n$ok = false;\nfor($i = 0; $i < $n; $i++) {\n $x = $dxs->G();\n if($x == 1) {\n $ok = true;\n }\n}\n\nif($ok) {\n echo -1;\n} else {\n echo 1;\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "2c7add49d423de44a2bc09de56ffacf1"} {"source_code": "= $height || $x >= $width || $lines[$y][$x] === '#')\n {\n break;\n }\n\n if ($x === $endX && $y === $endY)\n {\n $result++;\n break;\n }\n }\n }\n }\n }\n}\n\necho $result;\n", "positive_code": [{"source_code": " $o, \"R\" => $p, \"U\" => $q, \"D\" => $r);\n $t = array_flip($s);\n for($u = 0; $u < strlen($l); $u++)\n {\n if($t[$l[$u]] == \"L\")\n {\n $g2--;\n }\n elseif($t[$l[$u]] == \"R\")\n {\n $g2++;\n }\n elseif($t[$l[$u]] == \"U\")\n {\n $h2++;\n }\n elseif($t[$l[$u]] == \"D\")\n {\n $h2--;\n }\n if($c[$g2][$h2] == $c[$i][$j])\n {\n $m++;\n break;\n }\n elseif($c[$g2][$h2] == \"#\")\n {\n break;\n }\n }\n }\n }\n }\n }\n}\nprint $m;\n?>"}], "negative_code": [], "src_uid": "8a1799f4ca028d48d5a12e8ac4b8bee1"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " "}], "negative_code": [], "src_uid": "46d734178b3acaddf2ee3706f04d603d"} {"source_code": "= $m){\n $res = $i + 1;\n break;\n }\n }\n echo($res);\n?>", "positive_code": [{"source_code": ""}, {"source_code": " 0) {\n $total_size -= $usbs_size[$i];\n $i++;\n}\necho $i;"}, {"source_code": "$a){\n $sum+= $a;\n if($sum >= $size){\n fprintf(STDOUT, '%d', $k + 1); exit;\n }\n}\n?>"}, {"source_code": "$a){\n $sum+= $a;\n if($sum >= $size){\n fprintf(STDOUT, '%d', $k + 1); exit;\n }\n}\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "$a){\n $sum+= $a;\n if($sum >= $size){\n fprintf(STDOUT, '%d', $k); exit;\n }\n}\n?>"}, {"source_code": "$a){\n $sum+= $a;\n if($sum > $size){\n fprintf(STDOUT, '%d', $k); exit;\n }\n}\n?>"}], "src_uid": "a02a9e37a4499f9c86ac690a3a427466"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "= 0; $y--)\n {\n if(($c[$y] == \"8\") && ($b - $y >= 11))\n {\n $d = 1;\n break;\n }\n }\n if($d == 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n}\n?>"}, {"source_code": "= 11){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n\n?>"}, {"source_code": "= 10)\n \t$result[]=\"YES\";\n else\n \t$result[]=\"NO\";\n }else{\n \t$result[]=\"NO\";\n }\n} \nforeach ($result as $value) {\n\techo($value.\"\\n\");\n}"}, {"source_code": "0; $n--)\n{\n\t$x = readline();\n\t$y = readline();\n\tif($x<11)\n\t{\n\t echo \"NO\\n\";\n\t continue;\n\t}\n\tfor($i=0; $i<=$x-11; $i++)\n\t{\n\t\tif($y[$i] == '8')\n\t\t{\n\t\t\techo \"Yes\\n\";;\n\t\t\tbreak;\n\t\t}\n\t\tif($i == $x-11) echo \"NO\\n\";\n\t}\n}"}, {"source_code": "=11)\n\t\t\t\t{\n\t\t\t\t\t$flag=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t }\n\t\t if($flag==1)\n\t\t \techo \"YES\\n\";\n\t\t else\n\t\t \techo \"NO\\n\";\n\n}"}, {"source_code": " 0 && $testCasesCount <= 100) {\n for ($i = 0; $i < $testCasesCount; $i++) {\n $testCasesArray[$i]['numberLength'] = intval(trim(fgets(STDIN)));\n $testCasesArray[$i]['number'] = trim(fgets(STDIN));\n }\n for ($i = 0; $i < $testCasesCount; $i++) {\n $numberLength = $testCasesArray[$i]['numberLength'];\n $number = $testCasesArray[$i]['number'];\n if ($numberLength < 11) {\n echo \"NO\\n\";\n continue;\n }\n $eightNumberPos = strpos($number, '8');\n if ($eightNumberPos === false) {\n echo \"NO\\n\";\n continue;\n } elseif (($numberLength - 11) >= $eightNumberPos) {\n echo \"YES\\n\";\n continue;\n } else {\n echo \"NO\\n\";\n continue;\n }\n }\n}\n"}, {"source_code": "= 11 && strlen($pos)) {\n echo \"YES\\n\";\n continue;\n } else {\n echo \"NO\\n\";\n continue;\n }\n }"}, {"source_code": "= 10 ? 'YES' : 'NO').\"\\n\"; \n}\n\necho $ans;"}, {"source_code": "= 11){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n\n?>"}], "negative_code": [{"source_code": "0; $n--)\n{\n\t$x = readline();\n\t$y = readline();\n\tfor($i=0; $i<=$x-10; $i++)\n\t{\n\t\tif($y[$i] == '8')\n\t\t{\n\t\t\techo \"Yes\\n\";;\n\t\t\tbreak;\n\t\t}\n\t\tif($i == $x-10) echo \"NO\\n\";\n\t}\n}"}, {"source_code": "0; $n--)\n{\n\t$x = readline();\n\t$y = readline();\n\tfor($i=0; $i<=$x-11; $i++)\n\t{\n\t\tif($y[$i] == '8')\n\t\t{\n\t\t\techo \"Yes\\n\";;\n\t\t\tbreak;\n\t\t}\n\t\tif($i == $x-10) echo \"NO\\n\";\n\t}\n}"}, {"source_code": "0; $n--)\n{\n\t$x = readline();\n\t$y = readline();\n\tfor($i=0; $i<=$x-11; $i++)\n\t{\n\t\tif($y[$i] == '8')\n\t\t{\n\t\t\techo \"Yes\\n\";;\n\t\t\tbreak;\n\t\t}\n\t\tif($i == $x-11) echo \"NO\\n\";\n\t}\n}"}, {"source_code": " ['numberLength' => 13, 'number' => 7818005553535],\n 1 => ['numberLength' => 11, 'number' => 31415926535]\n];\nif (is_int($testCasesCount) && $testCasesCount > 0) {\n// for ($i = 0; $i < $testCasesCount; $i++) {\n// $testCasesArray[$i]['numberLength'] = trim(fgets(STDIN));\n// $testCasesArray[$i]['number'] = trim(fgets(STDIN));\n// }\n for ($i = 0; $i < $testCasesCount; $i++) {\n $numberLength = $testCasesArray[$i]['numberLength'];\n $number = $testCasesArray[$i]['number'];\n if ($numberLength < 11) {\n //echo 'NO' . PHP_EOL;\n echo \"NO\\n\";\n continue;\n }\n $eightNumberPos = strpos(((string) $number), '8');\n if ($eightNumberPos === false) {\n //echo 'NO' . PHP_EOL;\n echo \"NO\\n\";\n continue;\n } elseif (($numberLength - 11) >= $eightNumberPos) {\n //echo 'YES' . PHP_EOL;\n echo \"YES\\n\";\n continue;\n } else {\n //echo 'NO' . PHP_EOL;\n echo \"NO\\n\";\n continue;\n }\n }\n}\n"}, {"source_code": " 0 && $testCasesCount <= 100) {\n for ($i = 0; $i < $testCasesCount; $i++) {\n $testCasesArray[$i]['numberLength'] = trim(fgets(STDIN));\n $testCasesArray[$i]['number'] = trim(fgets(STDIN));\n }\n for ($i = 0; $i < $testCasesCount; $i++) {\n $numberLength = $testCasesArray[$i]['numberLength'];\n $number = $testCasesArray[$i]['number'];\n if ($numberLength < 11) {\n echo \"NO\\n\";\n continue;\n }\n $eightNumberPos = strpos(((string) $number), '8');\n if ($eightNumberPos === false) {\n echo \"NO\\n\";\n continue;\n } elseif (($numberLength - 11) >= $eightNumberPos) {\n echo \"YES\\n\";\n continue;\n } else {\n echo \"NO\\n\";\n continue;\n }\n }\n}\n"}, {"source_code": " 0 && $testCasesCount <= 100) {\n for ($i = 0; $i < $testCasesCount; $i++) {\n $testCasesArray[$i]['numberLength'] = intval(trim(fgets(STDIN)));\n $testCasesArray[$i]['number'] = intval(trim(fgets(STDIN)));\n }\n for ($i = 0; $i < $testCasesCount; $i++) {\n $numberLength = $testCasesArray[$i]['numberLength'];\n $number = $testCasesArray[$i]['number'];\n if ($numberLength < 11) {\n echo \"NO\\n\";\n continue;\n }\n $eightNumberPos = strpos(((string) $number), '8');\n if ($eightNumberPos === false) {\n echo \"NO\\n\";\n continue;\n } elseif (($numberLength - 11) >= $eightNumberPos) {\n echo \"YES\\n\";\n continue;\n } else {\n echo \"NO\\n\";\n continue;\n }\n }\n}\n"}, {"source_code": " 0 && $testCasesCount <= 100) {\n for ($i = 0; $i < $testCasesCount; $i++) {\n $testCasesArray[$i]['numberLength'] = trim(fgets(STDIN));\n $testCasesArray[$i]['number'] = trim(fgets(STDIN));\n }\n for ($i = 0; $i < $testCasesCount; $i++) {\n $numberLength = $testCasesArray[$i]['numberLength'];\n $number = $testCasesArray[$i]['number'];\n if ($numberLength < 11) {\n echo 'NO' . PHP_EOL;\n continue;\n }\n $eightNumberPos = strpos(((string) $number), '8');\n if ($eightNumberPos === false) {\n echo 'NO' . PHP_EOL;\n continue;\n } elseif (($numberLength - 11) >= $eightNumberPos) {\n echo 'YES' . PHP_EOL;\n continue;\n } else {\n echo 'NO' . PHP_EOL;\n continue;\n }\n }\n}\n"}, {"source_code": "=11){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 12){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n\n?>"}, {"source_code": "=11){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n }\n}\n\n?>"}, {"source_code": "= 11)\n \t$result[]=\"YES\";\n else\n \t$result[]=\"NO\";\n} \nforeach ($result as $value) {\n\techo($value.\"\\n\");\n}"}, {"source_code": "= 11)\n \t$result[]=\"YES\";\n else\n \t$result[]=\"NO\";\n} \nforeach ($result as $value) {\n\techo($value.\"\\n\");\n}"}, {"source_code": "= 10)\n \t$result[]=\"YES\";\n else\n \t$result[]=\"NO\";\n} \nforeach ($result as $value) {\n\techo($value.\"\\n\");\n}"}, {"source_code": "= 11)\n \t$result[]=\"YES\";\n else\n \t$result[]=\"NO\";\n} \nforeach ($result as $value) {\n\techo($value.\"\\n\");\n}"}, {"source_code": "=11)\n\t\t \techo \"YES\\n\";\n\t\t else\n\t\t \techo \"NO\\n\";\n\n}"}, {"source_code": "=11)\n\t\t \techo \"YES\\n\";\n\t\t else\n\t\t \techo \"NO\\n\";\n\n}"}, {"source_code": ""}, {"source_code": "$handle = fopen (\"php://stdin\",\"r\");\n$t = fgets($handle);\nfor($i=0; $i<$t; $i++) {\n\t$n = fgets($handle);\n\t$s = fgets($handle);\n\t$n = (int)$n;\n\tvar_dump($n);\n\tif($n < 11) {\n\t\techo \"NO\\n\";\n\t} else if($n === 11) {\n\t\techo $s[0] === \"8\" ? \"YES\\n\" : \"NO\\n\";\n\t} else {\n\t\t$odd = $n - 11;\n\t\techo strpos($s, \"8\") <= $odd ? \"YES\\n\" : \"NO\\n\";\n\t}\n}"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "bcdd7862b718d6bcc25c9aba8716d487"} {"source_code": " $e) && ($g > $d))\n {\n $f++;\n }\n elseif(($e > $c) && ($d > $g))\n {\n $f++;\n }\n elseif(($d > $b) && ($h > $e))\n {\n $f++;\n }\n elseif(($b > $d) && ($e > $h))\n {\n $f++;\n }\n $b = $d;\n $c = $e;\n $d = $g;\n $e = $h;\n}\nprint $f;\n?>", "positive_code": [{"source_code": " $lastX) {\n $parts[$i] = 'R';\n } else if ($x < $lastX) {\n $parts[$i] = 'L';\n } else if ($y > $lastY) {\n $parts[$i] = 'T';\n } else {\n $parts[$i] = 'B';\n }\n \n if (isset($parts[$i-1])) {\n $situation = $parts[$i-1].$parts[$i];\n if (in_array($situation, array('RT','TL','LB', 'BR'))) {\n $danger++;\n }\n }\n }\n \n $lastX = $x;\n $lastY = $y;\n\n}\necho $danger;\n\n?>"}], "negative_code": [{"source_code": " $lastX) {\n $parts[$i] = 'R';\n } else if ($x < $lastX) {\n $parts[$i] = 'L';\n } else if ($y > $lastY) {\n $parts[$i] = 'T';\n } else {\n $parts[$i] = 'B';\n }\n \n if (isset($parts[$i-1])) {\n $situation = $parts[$i-1].$parts[$i];\n if (in_array($situation, array('RT','TL','LB', 'BR'))) {\n $danger++;\n }\n }\n }\n \n $lastX = $x;\n $lastY = $y;\n\n}\necho $danger;\n\n?>"}], "src_uid": "0054f9e2549900487d78fae9aa4c2d65"} {"source_code": " 0 ? $right.$left : $left.$right;\n}\n\n$input = array_map('trim', explode(\"\\n\", file_get_contents('php://stdin')));\n$a = order(array_shift($input));\n$b = order(array_shift($input));\n\nif ($a == $b)\n\techo 'YES', PHP_EOL;\nelse\n\techo 'NO', PHP_EOL;\n"}, {"source_code": " 0 ? $right.$left : $left.$right;\n}\n\n$input = array_map('trim', explode(\"\\n\", file_get_contents('php://stdin')));\n$a = order(array_shift($input));\n$b = order(array_shift($input));\n\nif ($a == $b)\n\techo 'YES', PHP_EOL;\nelse\n\techo 'NO', PHP_EOL;\n"}, {"source_code": " $busDatum) {\n if ($servalTime === $busDatum) {\n $result = $busIndex;\n break 2;\n }\n if ($time === $busDatum) {\n if ($time >= $servalTime) {\n $result = $busIndex;\n break 2;\n }\n $busArrival[$busIndex] += $busShift[$busIndex];\n }\n }\n $time = min($busArrival);\n}\necho $result;\n", "positive_code": [{"source_code": " $b)\n {\n $c[$x] = $d;\n }\n}\n$g = min($c);\nfor($x = 0; $x < $a; $x++)\n{\n if($c[$x] == $g)\n {\n print $x + 1;\n break;\n }\n}\n?>"}, {"source_code": " $b)\n {\n if($e < $c)\n {\n $c = $e;\n $d = $x;\n }\n }\n}\nprint $d;\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $d - $b;\n }\n}\n$g = min($c);\nfor($x = 0; $x < $a; $x++)\n{\n if($c[$x] == $g)\n {\n print $x + 1;\n break;\n }\n}\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $d;\n }\n}\n$g = min($c);\nfor($x = 0; $x < $a; $x++)\n{\n if($c[$x] == $g)\n {\n print $x + 1;\n break;\n }\n}\n?>"}, {"source_code": " $b)\n {\n if($e - $b < $c)\n {\n $c = $e - $b;\n $d = $x;\n }\n }\n}\nprint $d;\n?>"}, {"source_code": " $b)\n {\n if($e < $c)\n {\n $c = $e;\n $d = $x;\n }\n }\n}\nprint $d;\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $d - $b;\n }\n}\n$g = min($c);\nfor($x = 0; $x < $a; $x++)\n{\n if($c[$x] == $g)\n {\n print $x + 1;\n break;\n }\n}\n?>"}, {"source_code": " $b)\n {\n if($e - $b < $c)\n {\n $c = $e - $b;\n $d = $x;\n }\n }\n}\nprint $d;\n?>"}, {"source_code": " $b)\n {\n if($e < $c)\n {\n $c = $e;\n $d = $x;\n }\n }\n}\nprint $d;\n?>"}, {"source_code": " $busArrival) {\n $maxTime = $busArrival;\n $result = $i;\n }\n continue;\n }\n $delta = ($servalTime - $busArrival) / $busShift;\n if (($servalTime - $busArrival) % $busShift !==0) {\n $delta++;\n }\n $shift = $busArrival + $delta * $busShift;\n if ($shift < $maxTime) {\n $maxTime = $shift;\n $result = $i;\n }\n}\necho $result;\n"}, {"source_code": " $arrivalTime) {\n $waiting = $servalTime - $arrivalTime;\n $minimalWaiting = $waiting - floor($waiting / $busShift[$busIndex]) * $busShift[$busIndex];\n $busArrival[$busIndex] = (int)($minimalWaiting ?: $servalTime);\n}\n$time = min($busArrival);\nwhile ($time<= $servalTime) {\n foreach ($busArrival as $busIndex => $busDatum) {\n if ($servalTime === $busDatum) {\n echo $busIndex;\n break 2;\n }\n if ($time === $busDatum) {\n if ($time >= $servalTime) {\n echo $busIndex;\n break 2;\n }\n $busArrival[$busIndex] += $busShift[$busIndex];\n }\n }\n $time = min($busArrival);\n}\n"}, {"source_code": " $busArrival) {\n $maxTime = $busArrival;\n $result = $i;\n }\n continue;\n }\n $delta = ($servalTime - $busArrival) / $busShift;\n if (($servalTime - $busArrival) % $busShift !== 0) {\n $delta++;\n }\n $shift = $busArrival + $delta * $busShift;\n if ($shift < $maxTime) {\n $maxTime = $shift;\n $result = $i;\n }\n}\necho $result;\n"}, {"source_code": " $arrivalTime) {\n if ($servalTime > $arrivalTime) {\n $waiting = $servalTime - $arrivalTime;\n $minimalWaiting = $waiting - floor($waiting / $busShift[$busIndex]) * $busShift[$busIndex];\n $busArrival[$busIndex] = (int)($minimalWaiting ?: $servalTime);\n }\n}\n$time = min([-1 => $servalTime] + $busArrival);\n$result = 0;\nwhile ($result === 0) {\n foreach ($busArrival as $busIndex => $busDatum) {\n if ($servalTime === $busDatum) {\n $result = $busIndex;\n break 2;\n }\n if ($time === $busDatum) {\n if ($time >= $servalTime) {\n $result = $busIndex;\n break 2;\n }\n $busArrival[$busIndex] += $busShift[$busIndex];\n }\n }\n $time = min($busArrival);\n}\necho $result;\n"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($n,$k) = IO::arr();\r\n $arr = IO::arr();\r\n $cnt = 0;\r\n $total = 0;\r\n $end = count($arr) - 1;\r\n while (true) {\r\n if ($end == $cnt || $k == 0) {\r\n break;\r\n }\r\n\r\n\r\n if ($k - $arr[$cnt] > 0) {\r\n $k = $k - $arr[$cnt];\r\n $total += $arr[$cnt];\r\n $arr[$cnt] = 0;\r\n } else {\r\n $total += $k;\r\n $arr[$cnt] -= $k;\r\n $k = 0;\r\n }\r\n\r\n $cnt++;\r\n }\r\n\r\n $arr[$end] += $total;\r\n $res[] = $arr;\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $i) {\r\n echo $i . ' ';\r\n }\r\n echo \"\\n\";\r\n}\r\n", "positive_code": [{"source_code": " 0 && $i < $n - 1){\r\n\t\t$delta = min($k, $a[$i]);\r\n\t\t$a[$i] -= $delta;\r\n\t\t$a[$n-1] += $delta;\r\n\t\t$k -= $delta;\r\n\t\t$i++;\r\n\t}\r\n\treturn $a;\r\n};\r\n\r\n\r\n$t = intval(fgets(STDIN));\r\nfor (; $t > 0; $t--) {\r\n\r\n\tlist ($n, $k) = explode(' ', fgets(STDIN));\r\n\t$a = array_map(function($itm){ return intval($itm); }, explode(' ', trim(fgets(STDIN))));\r\n\t\r\n\t$a = $solve($n, $k, $a);\r\n\techo implode(' ', $a);\r\n\techo \"\\n\";\r\n\r\n}\r\n"}, {"source_code": "= 1) { \r\n $a[$s] = $a[$s] - 1; \r\n $a[$e - 1] = $a[$e - 1] + 1;\r\n } else { \r\n if ($a[$e - 2] == 0) { break; }\r\n $s++; $j--;\r\n }\r\n }\r\n \r\n for ($j = 0; $j < $n; $j++) { echo $a[$j].' '; }\r\n echo PHP_EOL;\r\n } else {\r\n for ($j = 0; $j < $n - 1; $j++) { echo '0 '; }\r\n echo $sum + $a[$n - 1];\r\n echo PHP_EOL;\r\n }\r\n \r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($n,$k) = IO::arr();\r\n $arr = IO::arr();\r\n $cnt = 0;\r\n $total = 0;\r\n $end = count($arr) - 1;\r\n while ($k--) {\r\n if ($cnt == $end) {\r\n break;\r\n }\r\n\r\n if ($arr[$cnt] > 0) {\r\n $arr[$cnt]--;\r\n if ($arr[$cnt] == 0) {\r\n $cnt++;\r\n }\r\n $total++;\r\n } else {\r\n $cnt++;\r\n }\r\n }\r\n\r\n $arr[$end] += $total;\r\n $res[] = $arr;\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $i) {\r\n echo $i . ' ';\r\n }\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($n,$k) = IO::arr();\r\n $arr = IO::arr();\r\n $cnt = 0;\r\n $total = 0;\r\n $end = count($arr) - 1;\r\n while ($k--) {\r\n if ($cnt == $end) {\r\n break;\r\n }\r\n\r\n if ($arr[$cnt] > 0) {\r\n $arr[$cnt]--;\r\n if ($arr[$cnt] == 0) {\r\n $cnt++;\r\n }\r\n $total++;\r\n }\r\n }\r\n\r\n $arr[$end] += $total;\r\n $res[] = $arr;\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $i) {\r\n echo $i . ' ';\r\n }\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($n,$k) = IO::arr();\r\n $arr = IO::arr();\r\n $cnt = 0;\r\n $total = 0;\r\n $end = count($arr) - 1;\r\n while ($k--) {\r\n if ($cnt == $end) {\r\n break;\r\n }\r\n\r\n if ($arr[$cnt] > 0) {\r\n $arr[$cnt]--;\r\n $total++;\r\n } else {\r\n $cnt++;\r\n }\r\n }\r\n $arr[$end] += $total;\r\n $res[] = $arr;\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $i) {\r\n echo $i . ' ';\r\n }\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list($n,$k) = IO::arr();\r\n $arr = IO::arr();\r\n if ($k < $arr[0]) {\r\n $s = $k;\r\n } else {\r\n $s = $arr[0];\r\n }\r\n\r\n $arr[0] = $arr[0] - $s;\r\n\r\n $arr[count($arr) - 1] = $arr[count($arr) - 1] + $s;\r\n\r\n $res[] = $arr;\r\n}\r\n\r\nforeach ($res as $r) {\r\n foreach ($r as $i) {\r\n echo $i . ' ';\r\n }\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": " 0 && $i < $n - 1){\r\n\t\t$delta = min($k, $a[$i]);\r\n\t\t$a[$i] -= $delta;\r\n\t\t$a[$n-1] += $delta;\r\n\t\t$k -= $delta;\r\n\t\t$i++;\r\n\t}\r\n\treturn $a;\r\n};\r\n\r\n\r\n$t = intval(fgets(STDIN));\r\nfor (; $t > 0; $t--) {\r\n\r\n\tlist ($n, $k) = explode(' ', fgets(STDIN));\r\n\t$a = array_map(function($itm){ return intval($itm); }, explode(' ', trim(fgets(STDIN))));\r\n\techo implode(' ', $a) . \"\\n\";\r\n\t$a = $solve($n, $k, $a);\r\n\techo implode(' ', $a);\r\n\r\n\techo \"\\n\";\r\n\r\n}\r\n"}], "src_uid": "6854ad3597f9f41d475aacb774b823ed"} {"source_code": "= 30) {\n break;\n }\n }\n if (check3Sum($realNumArray)) {\n echo('YES'.PHP_EOL);\n } else {\n echo('NO'.PHP_EOL);\n }\n }\n\n function check3Sum($numArray)\n {\n for ($i = 0; $i < count($numArray); $i++) {\n $numMap = [];\n for ($j = $i + 1; $j < count($numArray); $j++) {\n $tempSum = $numArray[$i] + $numArray[$j];\n if ($tempSum <= 3) {\n if ($numMap[3 - $tempSum]) {\n return true;\n }\n } else {\n if ($numMap[10 - (($tempSum - 3) % 10)]) {\n return true;\n }\n }\n $numMap[$numArray[$j]] = true;\n }\n }\n return false;\n }\n", "positive_code": [{"source_code": " $count) {\n $count = min($count, 3);\n\n while ($count--) {\n $simplified[] = $item;\n }\n }\n\n $y = false;\n\n for ($i = 0, $iM = count($simplified); $i < $iM; ++$i) {\n for ($j = $i + 1; $j < $iM; ++$j) {\n for ($k = $j + 1; $k < $iM; ++$k) {\n if (($simplified[$i] + $simplified[$j] + $simplified[$k]) % 10 === 3) {\n fprintf(STDOUT, \"%s\\n\", 'YES');\n $y = true;\n break 3;\n }\n }\n }\n }\n\n if (!$y) {\n fprintf(STDOUT, \"%s\\n\", 'NO');\n }\n}\n/*\n\n1\n3\n1 1 1\n\n1\n5\n1 1 1 3 3\n\n1\n3\n13 0 0\n\n1\n3\n5 5 3\n\n\n */\n"}, {"source_code": " 0 ) {\r\n $we[$rr[$j]] -= 1;\r\n $pp++;\r\n }\r\n \r\n }\r\n if($pp == 3) {\r\n $ans = 'YES';\r\n break;\r\n } else {\r\n $pp = 0;\r\n }\r\n}\r\nIO::pr($ans);\r\n}\r\n\r\n\r\nclass IO {\r\n public static function getInt()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}\r\n\r\nclass Algor {\r\n public static function efclidLcm($a, $b) {\r\n return ($a / self::efclidGcd($a, $b)) * $b;\r\n }\r\n public static function efclidGcd($a, $b) {\r\n return $b > 0 ? self::efclidGcd($b, $a % $b) : $a;\r\n }\r\n public static function isPrime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n $d += 1;\r\n }\r\n\r\n return $d == $n;\r\n }\r\n\r\n public static function fabicon($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n function getRotate($a, $s, $e, $ind) {\r\n $ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n $ar[$i] = $a[$i];\r\n $j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n // echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\";\r\n $a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n }\r\n\r\n}\r\n\r\nclass bigOperation {\r\n public static function efclidLcm($a, $b) {\r\n return bcmul(bcdiv($a, self::efclidGcd($a, $b)), $b);\r\n }\r\n public static function efclidGcd($a, $b) {\r\n return bccomp($b, 0) == 1 ? self::efclidGcd($b, bcmod($a, $b)) : $a;\r\n }\r\n public static function isBigNumber($n)\r\n {\r\n return bccomp($n, INTMAXVALUE) == 1;\r\n }\r\n // bcadd \u2014 \u0421\u043b\u043e\u0436\u0438\u0442\u044c 2 \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcAdd($x, $y)\r\n {\r\n return bcadd($x, $y);\r\n }\r\n// bccomp \u2014 \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n//return 1 if x>y, 0= x==y, -1 x < y\r\n public static function bcComp($x, $y)\r\n {\r\n return bccomp($x, $y);\r\n }\r\n// bcdiv \u2014 \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcDiv($x, $y)\r\n {\r\n return bcdiv($x, $y);\r\n }\r\n// bcmod \u2014 \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMod($x, $y)\r\n {\r\n return bcmod($x, $y);\r\n }\r\n// bcmul \u2014 \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMul($x, $y)\r\n {\r\n return bcmul($x, $y);\r\n }\r\n// bcpow \u2014 \u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcPow($x, $y)\r\n {\r\n return bcpow($x, $y);\r\n }\r\n// bcpowmod \u2014 \u0412\u043e\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435 \u0447\u0438\u0441\u043b\u043e\r\n// bcscale \u2014 \u0417\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 bc math \u0444\u0443\u043d\u043a\u0446\u0438\u0439.\r\n// bcsqrt \u2014 \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcSqrt($x, $y)\r\n {\r\n return bcsqrt($x, $y);\r\n }\r\n// bcsub \u2014 \u0412\u044b\u0447\u0438\u0442\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e\r\n public static function bcSub($x, $y)\r\n {\r\n return bcsub($x, $y);\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $y : $x;\r\n }\r\n\r\n public static function getDareje($n, $k) {\r\n if($k == 0) {\r\n return 1;\r\n }\r\n return bcmul($n, self::getDareje($n, $k-1));\r\n }\r\n}\r\n\r\nclass Sorting\r\n{\r\n public static function mergeSort($aArray) {\r\n if(count($aArray) <= 1) {\r\n return $aArray;\r\n }\r\n $aLeft = [];\r\n $aRight = [];\r\n $n =floor(count($aArray) / 2);\r\n for($i = 0; $i <$n; $i++) {\r\n $aLeft[] = $aArray[$i];\r\n }\r\n for($i = $n; $i", "positive_code": [{"source_code": "0)\n {\n $s=trim(fgets($handle));\n $arr=explode('_',$s);\n $newStr= $arr[sizeof($arr)-1];\n\n if($newStr[strlen($newStr)-1]=='o')\n {\n echo \"FILIPINO\";\n echo \"\\n\";\n }else if($newStr[strlen($newStr)-1]=='u')\n {\n echo \"JAPANESE\";\n echo \"\\n\";\n }else\n {\n echo \"KOREAN\";\n echo \"\\n\";\n }\n\n --$t;\n }\n\n\n}\n\nsolve();\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "';\n }elseif (ord($char) == 117) {\n return 'JAPANESE
';\n }elseif (ord($char) == 97) {\n return 'KOREAN
';\n } \n}\n \n// keep this function call here\n$file = fopen('php://stdin', 'r');\n$num = fgets($file);\nfor ($i=0; $i < $num; $i++) { \n $str = fgets($file);\n echo FirstReverse($str); \n // return 0;\n}\n// echo FirstReverse(fgets(fopen('input.txt', 'r')));\n// echo FirstReverse(fgets(fopen('php://stdin', 'r'))); \n\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "816907d873bce3573ce1e5ae3f494768"} {"source_code": "= $leftSize; $j--) {\n\t\t$num = pow(2, $j);\n\n\t\t$left += $num;\n\t}\n\n\techo max($left, $right) - min($left, $right);\n\techo PHP_EOL;\n}", "positive_code": [{"source_code": " 2) {\n for ($i = 1; $i < $coinsCount / 2; $i++) {\n $firstPileWeight += pow(2, $i);\n $secondPileWeight += pow(2, $coinsCount - 1 - $i);\n }\n }\n \n return abs($firstPileWeight - $secondPileWeight);\n}"}, {"source_code": " $n)\n {\n $g -= $e[$o];\n $f += $e[$o];\n $o++;\n $m--;\n $n++;\n }\n print abs($g - $f) . \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": "= 1; $power--) {\n if ($pile1 > $pile2) $pile2[] = pow(2, $power);\n else $pile1[] = pow(2, $power);\n }\n\n return abs(array_sum($pile1) - array_sum($pile2));\n}"}, {"source_code": "= 1000000000) {\n $temp = floor($sumLo / 1000000000);\n $sumHi += floor($sumLo / 1000000000);\n $sumLo -= $temp * 1000000000;\n }\n if($x>1)\n $x--;\n}\n\nif ($sumHi) {\n echo $sumHi . substr('' .($sumLo + 1000000000), 1);\n} else {\n echo $sumLo;\n}", "positive_code": [{"source_code": " 1) {\n $x_sort--;\n }\n}\n\nfor ($i = 0; $i < $n; $i++) {\n $sum_rsort = bcadd($sum_rsort, $x_rsort * $c_rsort[$i]);\n if ($x_rsort > 1) {\n $x_rsort--;\n }\n}\n\n$result = $sum_sort < $sum_rsort ? $sum_sort : $sum_rsort;\n\necho (string)$result;"}], "negative_code": [{"source_code": "1)\n $x--;\n}\n\necho $sum;"}, {"source_code": "= 1000000000) {\n $temp = floor($sumLo / 1000000000);\n $sumHi += floor($sumLo / 1000000000);\n $sumLo -= $temp * 1000000000;\n }\n if($x>1)\n $x--;\n}\n\necho $sumHi . substr('' .($sumLo + 1000000000), 1);"}, {"source_code": " 1) {\n $x_sort--;\n }\n}\n\nfor ($i = 0; $i < $n; $i++) {\n $sum_rsort += $x_rsort * $c_rsort[$i];\n if ($x_rsort > 1) {\n $x_rsort--;\n }\n}\n\n$result = $sum_sort < $sum_rsort ? $sum_sort : $sum_rsort;\n\necho (string)$result;"}, {"source_code": " 1) {\n $x_sort--;\n }\n}\n\nfor ($i = 0; $i < $n; $i++) {\n $sum_rsort += $x_rsort * $c_rsort[$i];\n if ($x_rsort > 1) {\n $x_rsort--;\n }\n}\n\necho $sum_sort < $sum_rsort ? $sum_sort : $sum_rsort;"}], "src_uid": "ce27e56433175ebf9d3bbcb97e71091e"} {"source_code": " $value){\n if($currentBillIndex >= $a[1]){\n break;\n }\n if($value > $bills[$currentBillIndex]){\n continue;\n }\n\n $count++;\n $currentBillIndex++;\n}\necho \"$count\";\n\n?>", "positive_code": [{"source_code": "= $c[$x])\n {\n $e++;\n $f++;\n }\n}\nprint $e;\n?>"}, {"source_code": ""}, {"source_code": " $value){\n if($currentBillIndex >= $a[1]){\n break;\n }\n if($value > $bills[$currentBillIndex]){\n continue;\n }\n\n $count++;\n $currentBillIndex++;\n}\necho \"$count\";\n\n?>"}], "negative_code": [], "src_uid": "c3f080681e3da5e1290ef935ff91f364"} {"source_code": "= $d[$f + 1]) && ($d[$f] == $d[0]) && ($f != 0))\n {\n $f = 0;\n }\n if($d[$f] >= $d[$f + 1])\n {\n $e += $d[$f];\n $d[$f]--;\n }\n else\n {\n $f++;\n $x--;\n }\n}\n$g = $c;\nsort($g);\n$h = 0;\n$i = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($g[$i] != 0)\n {\n $h += $g[$i];\n $g[$i]--;\n }\n else\n {\n $i++;\n $x--;\n }\n}\nprint $e . \" \" . $h;\n?>", "positive_code": [{"source_code": " $f) {\n\t\t\n\t\tif( $f == 0 ) continue;\n\t\t\n\t\tif( $max_free_value < $f ) {\n\t\t\t$max_free_index = $k;\n\t\t\t$max_free_value = $f;\n\t\t}\n\t}\n\t\n\t$mx[ $max_free_index ]--;\n\t\n\t$max += $max_free_value;\n}\n\n// Min\n$mn = $free;\n\nfor( $i = 1; $i <= $n; $i++ ) {\n\t\n\t$min_free_index = 0;\n\t$min_free_value = 1000;\n\t\n\tforeach ($mn as $k => $f) {\n\t\t\n\t\tif( $f == 0 ) continue;\n\t\t\n\t\tif( $min_free_value > $f ) {\n\t\t\t\n\t\t\t$min_free_index = $k;\n\t\t\t$min_free_value = $f;\n\t\t}\n\t}\n\t\n\t$mn[ $min_free_index ]--;\n\t\n\t$min += $min_free_value;\n}\n\n$result = \"$max $min\";\n\necho $result;"}, {"source_code": "0)\n if($a_min[$min]>0) {\n --$n_min;\n $out_min+=$a_min[$min];\n --$a_min[$min];\n }\n else $min++;\nwhile($n_max>0) {\n --$n_max;\n rsort($a_max);\n $out_max+=$a_max[0];\n $a_max[0]--;\n}\nprint \"$out_max $out_min\";\n"}, {"source_code": "= 0; $y--) {\n\t\tif ($b[$y] > $b[$y-1]) {\n\t\t\t$max += $b[$y];\n\t\t\t$b[$y]--;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n$b = merge_sort($a);\n$b[-1] = 0;\n$min = 0;\nfor ($x = 0; $x < $n; $x++) {\n\tfor ($y = 0; $y < $m; $y++) {\n\t\tif ($b[$y] != 0) {\n\t\t\t$min += $b[$y];\n\t\t\t$b[$y]--;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\necho $max . \" \" . $min;\n\nfunction merge_sort($m) {\n if (count($m) <= 1) {\n return $m;\n\t}\n\t$mid = round((count($m) - 1) / 2, 0, PHP_ROUND_HALF_UP);\n for ($x = 0; $x < $mid; $x++) {\n\t\t$left[$x] = $m[$x];\n\t}\n for ($x = 0; $x <= $mid; $x++) {\n\t\tif ($mid + $x < count($m)) {$right[$x] = $m[$mid + $x];}\n\t}\n\t$left = merge_sort($left);\n\t$right = merge_sort($right);\n\t\n\t$l = 0;\n\t$r = 0;\n\tfor ($x = 0; $x < count($m); $x++) {\n\t\tif (($l < count($left)) && ($r < count($right))) {\n\t\t\tif ($left[$l] <= $right[$r]) {\n\t\t\t\t$res[$x] = $left[$l];\n\t\t\t\t$l++;\n\t\t\t} else {\n\t\t\t\t$res[$x] = $right[$r];\n\t\t\t\t$r++;\n\t\t\t}\n\t\t} else if ($l >= count($left)) {\n\t\t\t$res[$x] = $right[$r];\n\t\t\t$r++;\n\t\t} else {\n\t\t\t$res[$x] = $left[$l];\n\t\t\t$l++;\n\t\t}\n\t}\n\t\n\treturn $res;\n}\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}], "negative_code": [{"source_code": "= $d[$f + 1])\n {\n $e += $d[$f];\n $d[$f]--;\n }\n else\n {\n $f++;\n $x--;\n }\n}\n$g = $c;\nsort($g);\n$h = 0;\n$i = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($g[$i] != 0)\n {\n $h += $g[$i];\n $g[$i]--;\n }\n else\n {\n $i++;\n $x--;\n }\n}\nprint $e . \" \" . $h;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $d[$f + 1])\n {\n $e += $d[$f];\n $d[$f]--;\n }\n else\n {\n $f++;\n $x--;\n }\n}\n$g = $c;\nsort($g);\n$h = 0;\n$i = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($g[$i] != 0)\n {\n $h += $g[$i];\n $g[$i]--;\n }\n else\n {\n $i++;\n $x--;\n }\n}\nprint $e . \" \" . $h;\n?>"}, {"source_code": "\nlist($n,$m)=explode(\" \",trim(fgets(STDIN)));\n//$a_min=explode(\" \",fgets(STDIN));\nfor($i=0;$i<$m;$i++) $s.=\"%d \";\n$a_min=fscanf(STDIN,\"$s\");\nsort($a_min); $a_max=$a_min; //rsort($a_max);\n$n_min=$n;$n_max=$n;\n$min=0; $max=$m-1;\nwhile($n_min>0 or $n_max>0){\n if($a_min[$min]>0) {--$n_min; $out_min+=$a_min[$min]; --$a_min[$min]; }\n else $min++;\n if($a_max[$max]>0 && !($a_max[$max]<$a_max[$max-1])) {--$n_max; $out_max+=$a_max[$max]; --$a_max[$max]; }\n else $max--;\n\n}\nprint \"$out_max $out_min\";\n"}, {"source_code": "\n$in=fopen('input.txt','r');\n$out=fopen('output.txt','w');\n$n=fgets($in);\nif($n==2) $sq=1;\n else $sq=ceil(sqrt($n)); fwrite($out,floor($sq).\"\\n\");\n$dn=ceil($n/2);\nfwrite($out, $dn.\" \");for($q=1;$q<=$dn;$q++) { $a[$q]=$q; fwrite($out, $a[$q].\" \");}\n$i=1; $dd=$dn;$z=0;\nwhile ($i<$sq)\n{\n $zz=$z; fwrite($out,\"\\n\");\n \n for($q=$dd;$q>$dd-$sq+1;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\n // if($n==5)$a[1]=1;\n fwrite($out, $dn.\" \");for($e=1;$e<=$dn;$e++) fwrite($out, $a[$e].\" \");\n $dd--;$i++;$z++;\n\n}\nfclose($in);\nfclose($out);\n"}, {"source_code": "\nlist($n,$m)=explode(\" \",trim(fgets(STDIN)));\n//$a_min=explode(\" \",fgets(STDIN));\nfor($i=0;$i<$m;$i++) $s.=\"%d \";\n$a_min=fscanf(STDIN,\"$s\");\nsort($a_min); $a_max=$a_min; //rsort($a_max);\n$n_min=$n;$n_max=$n;\n$min=0; $max=$m-1;\nwhile($n_min>0) if($a_min[$min]>0) {--$n_min; $out_min+=$a_min[$min]; --$a_min[$min]; }\n else $min++;\nwhile($n_max>0) if($a_max[$max]>0 && !($a_max[$max]<$a_max[$max-1])) {--$n_max; $out_max+=$a_max[$max]; --$a_max[$max]; }\n elseif ($a_max[$max]==0 && !($a_max[$max-1])) $max++;\n else $max--;\n\n\nprint \"$out_max $out_min\";\n"}], "src_uid": "6dea4611ca210b34ae2da93ebfa9896c"} {"source_code": " 0) {\n\t\tif ($c1 < 0) {\n\t\t\t$sum -= $c1; $k--;\n\t\t} else {\n\t\t\tif ($c1 > 0) {\n\t\t\t\tif ($k % 2 == 0) {\n\t\t\t\t\t$sum += $c1;\n\t\t\t\t} else {\n\t\t\t\t\tif ($i > 0) {\n\t\t\t\t\t\t$c2 = $c[$i - 1] + 0;\n\t\t\t\t\t\t$sum = ($c1 > -$c2)?$sum+2*$c2 + $c1:$sum-$c1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sum -= $c1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$k = 0;\n\t\t}\n\t} else {\n\t\t$sum += $c1;\n\t}\n}\nif ($k % 2 == 1) {\n\t$sum += 2 * ($c[$n-1] + 0);\n}\nfwrite($f2, $sum);\nfclose($f2);", "positive_code": [{"source_code": " 0)\n {\n array_push($e, $c[$x]);\n }\n elseif($c[$x] == 0)\n {\n $g = 1;\n }\n}\nsort($d);\nsort($e);\nif((count($d) == 0) && (count($e) == 0) && ($g == 1)) // \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u043b\u044c\n{\n $f = 0;\n}\nelseif((count($d) == 0) && (count($e) != 0) && ($g == 0)) // \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b.\n{\n if(($b % 2) == 0)\n {\n $f = array_sum($e);\n }\n else\n {\n $e[0] *= -1;\n $f = array_sum($e);\n }\n}\nelseif((count($d) == 0) && (count($e) != 0) && ($g == 1)) // \u043f\u043e\u043b. \u0438 \u043d\u043e\u043b\u044c\n{\n $f = array_sum($e);\n}\nelseif((count($e) == 0) && (count($d) != 0) && ($g == 0)) // \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0440.\n{\n if($b <= count($d))\n {\n for($y = 0; $y < $b; $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n }\n else\n {\n $h = $b - count($d) + 1;\n for($y = 0; $y < $b - $h; $y++)\n {\n $d[$y] *= -1;\n }\n if(($h % 2) != 0)\n {\n $d[count($d) - 1] *= -1;\n }\n $f = array_sum($d);\n }\n}\nelseif((count($e) == 0) && (count($d) != 0) && ($g == 1)) // \u043e\u0442\u0440. \u0438 \u043d\u043e\u043b\u044c\n{\n for($y = 0; $y < $b; $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n}\nelseif((count($e) != 0) && (count($d) != 0) && ($g == 0)) // \u043f\u043e\u043b. \u0438 \u043e\u0442\u0440.\n{\n if(abs($d[count($d) - 1]) <= $e[0])\n {\n if($b <= count($d))\n {\n for($y = 0; $y < $b; $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n $f += array_sum($e);\n }\n else\n {\n $h = $b - count($d) + 1;\n for($y = 0; $y < $b - $h; $y++)\n {\n $d[$y] *= -1;\n }\n if(($h % 2) != 0)\n {\n $d[count($d) - 1] *= -1;\n }\n $f = array_sum($d);\n $f += array_sum($e);\n }\n }\n else\n {\n if($b < count($d))\n {\n for($y = 0; $y < $b; $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n $f += array_sum($e);\n }\n else\n {\n for($y = 0; $y < count($d); $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n $i = $b - count($d);\n if(($i % 2) != 0)\n {\n $e[0] *= -1;\n }\n $f += array_sum($e);\n }\n }\n}\nelseif((count($e) != 0) && (count($d) != 0) && ($g == 1)) // \u043f\u043e\u043b., \u043e\u0442\u0440. \u0438 \u043d\u043e\u043b\u044c\n{\n for($y = 0; $y < count($d); $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n $f += array_sum($e);\n}\nprint $f;\n?>"}], "negative_code": [{"source_code": " 0)\n {\n array_push($e, $c[$x]);\n }\n elseif($c[$x] == 0)\n {\n $g = 1;\n }\n}\nsort($d);\nsort($e);\nif((count($d) == 0) && (count($e) == 0) && ($g == 1)) // \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u043b\u044c\n{\n $f = 0;\n}\nelseif((count($d) == 0) && (count($e) != 0) && ($g == 0)) // \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b.\n{\n if(($b % 2) == 0)\n {\n $f = array_sum($e);\n }\n else\n {\n $e[0] *= -1;\n $f = array_sum($e);\n }\n}\nelseif((count($d) == 0) && (count($e) != 0) && ($g == 1)) // \u043f\u043e\u043b. \u0438 \u043d\u043e\u043b\u044c\n{\n $f = array_sum($e);\n}\nelseif((count($e) == 0) && (count($d) != 0) && ($g == 0)) // \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0440.\n{\n if($b <= count($d))\n {\n for($y = 0; $y < $b; $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n }\n else\n {\n $h = $b - count($d) + 1;\n for($y = 0; $y < $b - $h; $y++)\n {\n $d[$y] *= -1;\n }\n if(($h % 2) != 0)\n {\n $d[count($d) - 1] *= -1;\n }\n $f = array_sum($d);\n }\n}\nelseif((count($e) == 0) && (count($d) != 0) && ($g == 1)) // \u043e\u0442\u0440. \u0438 \u043d\u043e\u043b\u044c\n{\n for($y = 0; $y < $b; $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n}\nelseif((count($e) != 0) && (count($d) != 0) && ($g == 0)) // \u043f\u043e\u043b. \u0438 \u043e\u0442\u0440.\n{\n if(abs($d[count($d) - 1]) <= $e[0])\n {\n \n if($b <= count($d))\n {\n for($y = 0; $y < $b; $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n $f += array_sum($e);\n }\n else\n {\n $h = $b - count($d) + 1;\n for($y = 0; $y < $b - $h; $y++)\n {\n $d[$y] *= -1;\n }\n if(($h % 2) != 0)\n {\n $d[count($d) - 1] *= -1;\n }\n $f = array_sum($d);\n $f += array_sum($e);\n }\n }\n else\n {\n for($y = 0; $y < count($d); $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n $i = $b - count($d);\n if(($i % 2) != 0)\n {\n $e[0] *= -1;\n }\n $f += array_sum($e);\n }\n}\nelseif((count($e) != 0) && (count($d) != 0) && ($g == 1)) // \u043f\u043e\u043b., \u043e\u0442\u0440. \u0438 \u043d\u043e\u043b\u044c\n{\n for($y = 0; $y < count($d); $y++)\n {\n $d[$y] *= -1;\n }\n $f = array_sum($d);\n $f += array_sum($e);\n}\nprint $f;\n?>"}, {"source_code": " 0) {\n\t\tif ($c1 < 0) {\n\t\t\t$sum -= $c1; $k--;\n\t\t} else {\n\t\t\tif ($c1 == 0) {\n\t\t\t\t$k = 0;\n\t\t\t} else {\n\t\t\t\tif ($k % 2 == 0) {\n\t\t\t\t\t$k = 0; $sum += $c1;\n\t\t\t\t} else {\n\t\t\t\t\t$k = 0;\n\t\t\t\t\tif ($i > 0) {\n\t\t\t\t\t\t$c2 = $c[$i - 1];\n\t\t\t\t\t\t$sum = ($c1 > -$c2)?$sum+2*$c2:$sum-$c1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sum -= $c1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$sum += $c1;\n\t}\n}\nfwrite($f2, $sum);\nfclose($f2);"}, {"source_code": " 0) {\n\t\tif ($c1 < 0) {\n\t\t\t$sum -= $c1; $k--;\n\t\t} else {\n\t\t\tif ($c1 == 0) {\n\t\t\t\t$k = 0;\n\t\t\t} else {\n\t\t\t\tif ($k % 2 == 0) {\n\t\t\t\t\t$k = 0; $sum += $c1;\n\t\t\t\t} else {\n\t\t\t\t\t$k = 0;\n\t\t\t\t\tif ($i > 0) {\n\t\t\t\t\t\t$c2 = $c[$i - 1];\n\t\t\t\t\t\t$sum = ($c1 > -$c2)?$sum+2*$c2:$sum-$c1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sum -= $c1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$sum += $c1;\n\t}\n}\nif ($k % 2 == 1) {\n\t$sum += 2 * ($c[$n-1] + 0);\n}\nfwrite($f2, $sum);\nfclose($f2);"}, {"source_code": " 0) {\n\t\tif ($c1 < 0) {\n\t\t\t$sum -= $c1; $k--;\n\t\t} else {\n\t\t\tif ($c1 == 0) {\n\t\t\t\t$k = 0;\n\t\t\t} else {\n\t\t\t\tif ($k % 2 == 0) {\n\t\t\t\t\t$k = 0; $sum += $c1;\n\t\t\t\t} else {\n\t\t\t\t\t$k = 0;\n\t\t\t\t\tif ($i > 0) {\n\t\t\t\t\t\t$c2 = $c[$i - 1];\n\t\t\t\t\t\t$sum = ($c1 > -$c2)?$sum+2*$c2:$sum-$c1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sum -= $c1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$sum += $c1;\n\t}\n}\nif ($k % 2 == 1) {\n\t$sum -= 2 * ($c[$n-1] + 0);\n}\nfwrite($f2, $sum);\nfclose($f2);"}, {"source_code": " 0) {\n\t\tif ($c1 < 0) {\n\t\t\t$sum -= $c1; $k--;\n\t\t} else {\n\t\t\tif ($c1 == 0) {\n\t\t\t\t$k = 0;\n\t\t\t} else {\n\t\t\t\tif ($k % 2 == 0) {\n\t\t\t\t\t$k = 0; $sum += c1;\n\t\t\t\t} else {\n\t\t\t\t\t$k = 0;\n\t\t\t\t\tif ($i > 0) {\n\t\t\t\t\t\t$c2 = $c[$i - 1];\n\t\t\t\t\t\t$sum = ($c1 > -$c2)?$sum+2*$c2:$sum-$c1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sum -= $c1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$sum += $c1;\n\t}\n}\nfwrite($f2, $sum);\nfclose($f2);"}], "src_uid": "befd3b1b4afe19ff619c0b34ed1a4966"} {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $iCountBob) {\r\n echo 'Alice';\r\n } else {\r\n echo 'Bob';\r\n }\r\n}\r\n\r\n$t = trim(fgets(STDIN));\r\nwhile ($t--) {\r\n solve();\r\n echo \"\\n\";\r\n}\r\n?>\r\n", "positive_code": [{"source_code": " 0) + ($sma >= 0)] . PHP_EOL;\r\n}\r\n"}, {"source_code": " $value)\r\n\t{\r\n\t\tif($key % 2 == 0)\r\n\t\t{\r\n\t\t\tif($value % 2 == 0)\r\n\t\t\t\t$A += $value;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif($value % 2 != 0)\r\n\t\t\t\t$B += $value;\r\n\t\t}\r\n\t}\r\n\r\n\tif($A == $B)\r\n\t\t$res = \"Tie\";\r\n\telseif($A > $B)\r\n\t\t$res = \"Alice\";\r\n\telse\r\n\t\t$res = \"Bob\";\r\n\treturn $res;\r\n}\r\n\r\n$t = fgets(STDIN);\r\nfor($i=0;$i<$t;$i++)\r\n{\r\n\t$arr = array();\r\n\t$n = fgets(STDIN);\r\n\t$arr_str = fgets(STDIN);\r\n\t$arr = explode(\" \", trim($arr_str));\r\n\tprint(startPlay($arr).\"\\r\\n\");\r\n}\r\n$end = fgets(STDIN);\r\n?>"}], "negative_code": [], "src_uid": "b1e911fbc33fb031b2398cdd545f502a"} {"source_code": " $num[1] ? $num[0] : $num[1];\n $mn = $num[0] < $num[1] ? $num[0] : $num[1];\n// echo $mx . ' ' . $mn;\n if ($mx == $mn) {\n $res[] = $mx + $mn . \"\\n\";\n } else {\n $res[] = (2*$mn) + (2*($mx-$mn)-1) . \"\\n\";\n }\n}\n\nforeach ($res as $r) {\n echo $r;\n}"}, {"source_code": ""}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": "\n$n = trim(fgets(STDIN));\n\n$arr = $arr = explode(' ',trim(fgets(STDIN)));\nsort($arr,SORT_NUMERIC);\n\n$sum = 0 ;\n//print_r($arr);\nfor($i=0;$i<$n/2;$i++){\n\t//echo $arr[$i].\" \".$arr[$n-$i-1].\"\\n\";\n\t$sum += ($arr[$i]+$arr[$n-$i-1])*($arr[$i]+$arr[$n-$i-1]);\n}\n\necho $sum;\n"}], "negative_code": [], "src_uid": "28c555fefd5c36697a5082c61d8a82b3"} {"source_code": "", "positive_code": [{"source_code": " 0)\n\t\t\t{\n\t\t\t\t$ok = 0;\n\t\t\t\t$ans .= \"NO\\n\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($a[$j] - $b[$j] != $diff) {\n\t\t\t\t$ok = 0;\n\t\t\t\t$ans .= \"NO\\n\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($is_diff == 1)\n\t\t\t\t$is_diff = 2;\n\t\t}\n\t}\n\tif ($ok == 1)\n\t\t$ans .= \"YES\\n\";\n}\n\necho $ans;\n?>"}, {"source_code": "=0;$i--)\n {\n if($arr1[$i]!=$arr2[$i])\n {\n $l=$i;\n }\n }\n $ans=1;\n $count=$arr2[$l]-$arr1[$l];\n if($count>=0)\n for ($i=$l;$i<$r+1;$i++)\n {\n if($arr2[$i]-$arr1[$i]!=$count)\n {\n $ans=0;\n break;\n }\n }\n else\n {\n $ans=0;\n }\n\n if($ans)\n {\n echo \"YES\\n\";\n }else\n {\n echo \"NO\\n\";\n }\n }\n}\n\nsolve();\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " 0)\n\t\t\t{\n\t\t\t\t$ok = 0;\n\t\t\t\t$ans .= \"NO\\n\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($a[$j] - $b[$j] != $diff) {\n\t\t\t\t$ok = 0;\n\t\t\t\t$ans .= \"NO\\n\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($is_diff == 1)\n\t\t\t\t$is_diff = 2;\n\t\t}\n\t}\n\tif ($ok == 1)\n\t\t$ans .= \"YES\\n\";\n}\n\necho $ans;\n?>"}], "src_uid": "0e0ef011ebe7198b7189fce562b7d6c1"} {"source_code": "", "positive_code": [{"source_code": " $b) {\n $fMin = $b;\n }\n}\n$m = trim(fgets(STDIN));\n$sMin = -1;\n$sMax = -1;\nfor($i = 0; $i < $m; $i++) {\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\n if($sMax == -1 || $sMax < $a) {\n $sMax = $a;\n }\n if($sMin == -1 || $sMin > $b) {\n $sMin = $b;\n }\n}\n$r = 0;\nif($fMin < $sMax) {\n $r = max($r, $sMax - $fMin);\n}\nif($sMin < $fMax) {\n $r = max($r, $fMax - $sMin);\n}\necho $r;"}], "negative_code": [{"source_code": " $b) {\n $fMin = $b;\n }\n}\n$m = trim(fgets(STDIN));\n$sMin = -1;\n$sMax = -1;\nfor($i = 0; $i < $m; $i++) {\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\n if($sMax == -1 || $sMax < $a) {\n $sMax = $a;\n }\n if($sMin == -1 || $sMin > $b) {\n $sMin = $b;\n }\n}\n//echo $fMin, $sMax, $sMin, $fMax;\nif($fMin < $sMax) {\n echo $sMax - $fMin;\n}\nelse if($sMin < $fMax) {\n echo $fMax - $sMin;\n}\nelse {\n echo 0;\n}"}], "src_uid": "4849a1f65afe69aad12c010302465ccd"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $sV){\n $sV % 2 === 1 ? $iEven++ : $iOdd++;\n}\n\nforeach ($aChests as $sK => $sVal){\n $sVal % 2 === 1 ? $jEven++ : $jOdd++;\n}\n\nif($jOdd >= $iEven){\n $iTotal += $iEven;\n} else {\n $iTotal += $jOdd;\n}\n\nif($jEven >= $iOdd){\n $iTotal += $iOdd;\n} else {\n $iTotal += $jEven;\n}\necho $iTotal;\n\n\n\n"}, {"source_code": " $sV) {\n if($sV % 2 == 0) {\n $jup++;\n }\n }\n foreach($z as $sK1 => $sV1) {\n if($sV1 % 2 !== 0){\n $tak++;\n }\n }\n $a = $n[0] - $jup;\n $b = $n[1] - $tak;\n if($a == 0 && $tak == 0) { echo '0'; exit;}\n if($b == 0 && $jup == 0) { echo '0'; exit;}\n if($jup > $tak){\n $summ += $tak;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n } else {\n $summ += $jup;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n }\n echo $summ;\n \n?>"}], "negative_code": [{"source_code": " $sV) {\n if($sV % 2 == 0) {\n $jup++;\n }\n }\n foreach($z as $sK1 => $sV1) {\n if($sV1 % 2 !== 0){\n $tak++;\n }\n }\n $a = $n[0] - $jup;\n $b = $n[1] - $tak;\n if($ja == 0 || $tak == 0) { echo '0'; exit;}\n if($jb == 0 || $jup == 0) { echo '0'; exit;}\n if($jup > $tak){\n $summ += $tak;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n } else {\n $summ += $jup;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n }\n echo $summ;\n \n?>"}, {"source_code": " $sV) {\n if($sV % 2 == 0){\n $jup++;\n }\n }\n foreach($z as $sK1 => $sV1) {\n if($sV1 % 2 !== 0){\n $tak++;\n }\n }\n $a = $n[0] - $jup;\n $b = $n[1] - $tak;\n if($jup == 0 || $tak == 0) { echo '0'; exit;}\n if($jup > $tak){\n $summ += $tak;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n } else {\n $summ += $jup;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n }\n echo $summ;\n \n?>"}, {"source_code": " $sV) {\n if($sV % 2 == 0) {\n $jup++;\n }\n }\n foreach($z as $sK1 => $sV1) {\n if($sV1 % 2 !== 0){\n $tak++;\n }\n }\n $a = $n[0] - $jup;\n $b = $n[1] - $tak;\n if($a == 0 || $tak == 0) { echo '0'; exit;}\n if($b == 0 || $jup == 0) { echo '0'; exit;}\n if($jup > $tak){\n $summ += $tak;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n } else {\n $summ += $jup;\n if($a > $b) {\n $summ += $b;\n } else {\n $summ += $a;\n }\n }\n echo $summ;\n \n?>"}], "src_uid": "bc532d5c9845940b5f59485394187bf6"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "= 1; $j--) {\n if ($isOdd && $j === 1) {\n echo \"$middle \";\n } elseif ($isOdd && $j === $middle) {\n echo \"1 \";\n } else {\n echo \"$j \";\n }\n }\n echo \"\\n\";\n}\n", "positive_code": [{"source_code": "=ceil($n/2);$i-=1){\n $temp=$arr[$j][$i];\n $arr[$j][$i]=$arr[$j][$i-1];\n $arr[$j][$i-1]=$temp;\n}\n}\necho implode (' ',$arr[$j]).PHP_EOL;\n}"}, {"source_code": " 0; $i--) {\n $res.= $i.' ';\n }\n } else {\n for ($i = $n; $i > ceil($n/2); $i--) {\n $res.=$i.' ';\n }\n\n for ($i = 1; $i < ceil($n/2); $i++) {\n $res.=$i.' ';\n }\n $res.= ceil($n/2);\n }\n\n echo trim($res).\"\\n\";\n}"}, {"source_code": "=2)\n\t\t\t echo \"$i \";\n\t\t\t\n\t\t}\n\t\techo \"1\".\"\\n\";\n}"}, {"source_code": "=1 ; $i--)\n\t\t { \n\t\t \tif($i==1)\n\t\t\techo \"$i\".\"\\n\";\n\t\t else\n\t\t \techo \"$i \";\n\t\t }\n\t}\n}"}, {"source_code": "= 1; $i--) {\n\t\t\tif ($n % 2 != 0 && $i == intdiv($n, 2) + 1)\n\t\t\t\tcontinue;\t\n\t\t\t$ans .= $i.\" \";\n\t\t\n\t\t}\n\t\tif ($n % 2 != 0)\n\t\t\t$ans .= intdiv($n, 2) + 1;\n\t\tprint trim($ans).\"\\n\";\n\t}\n?>"}, {"source_code": "=ceil($n[$j]/2);$i-=1){\n $temp[$j]=$arr[$j][$i];\n $arr[$j][$i]=$arr[$j][$i-1];\n $arr[$j][$i-1]=$temp[$j];\n}\n}\necho implode (' ',$arr[$j]).PHP_EOL;\n}"}, {"source_code": "=ceil($n/2);$i-=1){\n $temp=$arr[$i];\n $arr[$i]=$arr[$i-1];\n $arr[$i-1]=$temp;\n}\n}\necho implode (' ',$arr).PHP_EOL;\n}"}, {"source_code": "2){\nfor($i=ceil($n/2);$i<$n-1;$i++){\n $temp=$arr[$i];\n $arr[$i]=$arr[$i+1];\n $arr[$i+1]=$temp;\n}\n}\necho implode (' ',$arr).PHP_EOL;\n}"}, {"source_code": "=ceil($n/2);$i-=1){\n $temp=$arr[$i];\n $arr[$i]=$arr[$i-1];\n $arr[$i-1]=$temp;\n}\n}\necho implode (' ',$arr).PHP_EOL;\n}"}, {"source_code": " 0; $i--) {\n $res.=$i.' ';\n }\n echo trim($res).\"\\n\";\n}"}, {"source_code": " 0; $i--) {\n $res.= $i.' ';\n }\n } else {\n for ($i = $n; $i > ceil($n/2); $i--) {\n $res.=$i.' ';\n }\n\n for ($i = 1; $i < ceil($n/2); $i++) {\n $res.=$i.' ';\n }\n $res.= ceil($n/2);\n }\n\n echo trim($res);\n}"}, {"source_code": "=1 ; $i--)\n\t { \n\t \tif($i==1)\n\t\techo \"$i\".\"\\n\";\n\t else\n\t \techo \"$i \";\n\t }\n}"}, {"source_code": "=1 ; $i--)\n\t\t { \n\t\t \tif($i==1)\n\t\t\techo \"$i\".\"\\n\";\n\t\t else\n\t\t \techo \"$i \";\n\t\t }\n\t}\n}"}, {"source_code": ""}, {"source_code": "= 1; $j--) {\n if ($isOdd && $j === $n) {\n echo \"$middle \";\n } elseif ($isOdd && $j === $middle) {\n echo \"1 \";\n } else {\n echo \"$j \";\n }\n }\n echo \"\\n\";\n}\n"}], "src_uid": "f4779e16e0857e6507fdde55e6d4f982"} {"source_code": "\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\nforeach (range(1, $n) as $i) {\n $dat = explode(' ', fgets(STDIN));\n $name[$i] = $dat[0];\n $gain[$i] = intval($dat[1]);\n $score[$name[$i]] += $gain[$i];\n}\nforeach ($score as $val)\n if ($val > $best) $best = $val;\n$second = array();\nforeach (range(1, $n) as $i) {\n $second[$name[$i]] += $gain[$i];\n if ($score[$name[$i]] == $best && $second[$name[$i]] >= $best) break;\n}\n\nprint $name[$i].chr(10);\n?>", "positive_code": [{"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $winnerCandidates = $max = array();\n\n\n foreach($resultNames as $k=>$name){\n\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n $max[$name] += $addScore;\n\n if($max[$name] >= $maxScore) {\n $winnerCandidates[$name] = 0;\n }\n }\n\n //var_dump($winnerCandidates, $max, $maxScore);\n\n foreach($winnerCandidates as $name=>$result) {\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n\n"}, {"source_code": " $score){\n if($score > $max) $max = $score;\n }\n\n foreach($stack as $name => $score){\n if($score == $max) $maxItems[$name] = 1;\n }\n\n $stack = array();\n\n foreach($inputs as $input){\n\n $name = $input[0];\n $score = $input[1];\n\n if (!isset($stack[$name])) $stack[$name] = $score;\n else $stack[$name] += $score;\n\n if(isset($maxItems[$name]) && $stack[$name] >= $max){\n echo $name;\n exit();\n }\n }\n\n}\n\n"}, {"source_code": " $p_results) {\n\t\t\t$player_score = 0;\n\n\t\t\tforeach($p_results as $round_number => $round_result) {\n\t\t\t\t$player_score += $round_result;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$players[$p_name][$number_of_rounds + 1] = $player_score;\n\t\t\tif ($player_score > $highest_result) {\n\t\t\t\t$highest_result = $player_score;\n\t\t\t}\n\t\t}\n\t}\n\n\t$current_round++;\n}\n\nfunction findOverallWinner($winners_array, $winning_score) \n{\n\t$temp_winners = array();\n\tglobal $number_of_rounds;\t\n\t$winning_round = $number_of_rounds + 1;\n\n\tforeach($winners_array as $w_name => $w_score) {\n\t\tif ($w_score[$number_of_rounds + 1] == $winning_score) {\n\t\t\t$temp_score = 0;\n\n\t\t\tforeach($w_score as $t_round => $t_score) {\n\t\t\t\tif ($t_round >= $winning_round) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$temp_score += $t_score;\n\n\t\t\t\tif($temp_score >= $winning_score) {\n\t\t\t\t\t$winning_round = $t_round;\n\t\t\t\t\t$winner_name = $w_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $winner_name;\n}\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\t\tsaveResult($matches[1], $matches[2]);\t\n\t}\n}\nfprintf($fw, findOverallWinner($players, $highest_result));\n"}, {"source_code": " $v) {\n if ($v['score'] > $max) {\n $max = $v['score'];\n $name = $k;\n } else if ($v['score'] == $max) {\n $sum1 = $sum2 = 0;\n $key1 = $key2 = 0;\n foreach ($list as $keys => $val) {\n if ($val[0] == $name) {\n $sum1 += $val[1];\n }\n if ($sum1 >= $max) {\n if (!$key1) {\n $key1 = $keys+1;\n }\n }\n\n if ($val[0] == $k) {\n $sum2 += $val[1];\n }\n\n if ($sum2 >= $max) {\n if (!$key2) {\n $key2 = $keys+1;\n }\n }\n if ($key1 && $key2) break;\n }\n if ($key1 > $key2) {\n $name = $k;\n }\n }\n }\n echo $name;\n}\n\nwhile ($row = fscanf(STDIN,\"%s %i\")) {\n $data[] = $row;\n}\n\n$line = array_shift($data);\n\n$max = 0;\n$name = '';\n$list = [];\nfor ($i=0;$i<$line[0];$i++) {\n $list[$data[$i][0]]['score'] += $data[$i][1];\n}\n\n\n_max($list,$data);"}, {"source_code": " $best) $best = $val;\n$second = array();\nforeach (range(1, $n) as $i) {\n $second[$name[$i]] += $gain[$i];\n if ($score[$name[$i]] == $best && $second[$name[$i]] >= $best) break;\n}\n\necho $name[$i];"}, {"source_code": " $name,\n 'score' => intval($score),\n ];\n $plays[] = $play;\n if (isset($scores[$play['name']])) {\n $scores[$play['name']] += $play['score'];\n } else {\n $scores[$play['name']] = $play['score'];\n }\n}\n\n$best = 0;\nforeach ($scores as $score) {\n if ($score > $best) $best = $score;\n}\n\n$second = [];\nforeach ($plays as $play) {\n $name = $play['name'];\n $score = $play['score'];\n if(isset($second[$name])) {\n $second[$name] += $score;\n } else {\n $second[$name] = $score;\n }\n if ($scores[$name] == $best && $second[$name] >= $best) {\n echo $name;\n break;\n }\n}\n\n"}, {"source_code": "$value)\n{\n\tif($value > $max){\n\t\t$winner_list = array($key);\n\t\t$max = $value;\n\t}else if($value == $max){\n\t\t$winner_list[] = $key;\n\t}\n}\n\n$min = $n;\n\nforeach($winner_list as $name){\n\tfor($i=0; $i= $max){\n\t\t\tif($player_hs[$name][$i][1] < $min){\n\t\t\t\t$min = $player_hs[$name][$i][1];\n\t\t\t\t$winner = $name;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $winner.\"\\n\";\n?>\n"}, {"source_code": "= $max && $scores[$name] == $max) {\n $winner = $name;\n break;\n }\n}\n\necho $winner;\n?>"}, {"source_code": " 0,\n\t\t\t'history' => array(),\n\t\t);\n\t}\n\t$scores[$name]['score'] += intval($score);\n\t$scores[$name]['history'][] = array('round' => $i, 'score' => $scores[$name]['score']);\n}\n\nuasort($scores, function($a, $b){\n\tif($a['score'] > $b['score']){\n\t\treturn -1;\n\t} elseif($a['score'] == $b['score']){\n\t\t$ai = $bi = 0;\n\t\tforeach($a['history'] as $s){\n\t\t\tif($s['score'] >= $a['score']){\n\t\t\t\t$ai = $s['round'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tforeach($b['history'] as $s){\n\t\t\tif($s['score'] >= $b['score']){\n\t\t\t\t$bi = $s['round'];\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn ($ai < $bi) ? -1 : 1;\n\t} else {\n\t\treturn 1;\n\t}\n});\n\n$names = array_keys($scores);\necho reset($names);"}, {"source_code": " $maxScore)\n $maxScore = $score;\n$tmpScores = array();\nfor ($i = 0; $i < $n; $i++) {\n $tmpScores[$historyNames[$i]] += intval($historyScores[$i]);\n if ($scores[$historyNames[$i]] == $maxScore && $tmpScores[$historyNames[$i]] >= $maxScore)\n break;\n}\nprintf(\"%s\", $historyNames[$i]);\n?>"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n $new[$istr[0]] += $istr[1];\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] >= $max AND $new[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n}"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n $new[$istr[0]] += $istr[1];\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] >= $max AND $new[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n \n}"}, {"source_code": " $name, 'score' => $num);\n if (!isset($end_scores[$name])) {\n $end_scores[$name] = 0;\n }\n $end_scores[$name] += $num;\n }\n\n $end_max_score = max($end_scores);\n\n foreach($end_scores as $player => $score) {\n if ($score == $end_max_score)\n $list_winners[] = $player;\n }\n\n $sum = array();\n foreach ($res as $data) {\n if (!isset($sum[$data['name']])) {\n $sum[$data['name']] = 0;\n }\n $sum[$data['name']] += $data['score'];\n if ($sum[$data['name']] >= $end_max_score && in_array($data['name'], $list_winners)) {\n echo $data['name'];\n exit();\n }\n }\n?>"}, {"source_code": "$v)\n {\n $p=$v;\n break;\n }\n \n $tie = array();\n $i=0;\n foreach($a as $key=>$value)\n {\n if($value==$p)\n {\n $tie[$i++]=$key;\n }\n }\n \n $a = array();\n // var_dump($tie);\n for($i=1;$i =$p&&nameExists($ee[0],$tie))\n {\n echo($ee[0]);\n exit;\n }\n }\n \n \n ?>"}, {"source_code": " $j[$l[1]])\n {\n print $i[$k[$l[0]]];\n }\n else\n {\n for($x = 0; $x < count($j); $x++)\n {\n if($j[$x] == $j[$l[0]])\n {\n array_push($p, $i[$k[$x]]);\n }\n }\n for($x = 0; $x < count($f); $x++)\n {\n if(($f[$x] >= $j[$l[0]]) && ($s == 0))\n {\n for($y = 0; $y < count($p); $y++)\n {\n if($p[$y] == $r[$x])\n {\n print $p[$y];\n $s = 1;\n break;\n }\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 0);\n }\n\n $max[$name][0] += $point;\n $max[$name][$j] = $max[$name][0];\n}\n\n$max_names = array();\n$m = -999999999;\n\n$min_user = '';\n$min_step = 1000;\n\nforeach ($max as $name => $points) {\n if ($m < $points[0]) $m = $points[0];\n}\n\nforeach ($max as $name => $points) {\n if ($m == $points[0]) {\n $max_names[$name] = $points;\n }\n}\n\nforeach ($max_names as $name => $points) {\n $j = 1;\n\n while ($points[$j] < $m) {\n $j++;\n if ($j > 1000) break;\n }\n\n if ($min_step > $j) {\n $min_step = $j;\n $min_user = $name;\n }\n\n}\n\nprint $min_user;\n"}, {"source_code": "= $m && in_array($name, $winnerNames)) {\n echo $name;\n exit;\n }\n}\n"}, {"source_code": " $value) {\n \tif($data[$name]['score'] > $maxScore) {\n \t\t$maxScore = $data[$name]['score'];\n \t\t$winName = $name;\n \t\t$testCheck = 0;\n \t\tforeach ($data[$name]['log'] as $check => $s) {\n \t\t\t$testCheck += $s;\n \t\t\tif($testCheck >= $maxScore) {\n \t\t\t\t$maxCheck = $check;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \telseif($data[$name]['score'] == $maxScore) {\n \t\t$testCheck = 0;\n \t\tforeach ($data[$name]['log'] as $check => $s) {\n \t\t\t$testCheck += $s;\n \t\t\tif($testCheck >= $maxScore) {\n \t\t\t\tif($check < $maxCheck) {\n \t\t\t\t\t$maxCheck = $check;\n \t\t\t\t\t$winName = $name;\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n }\n\n printf(\"%s\", $winName);\n?>"}, {"source_code": " $pi){\n $fi = explode(' ', $pi);\n $sorted[$fi[0]] += (int)trim($fi[1]);\n }\n $max = max($sorted); \n foreach($ps as $key => $pi){\n $fi = explode(' ', $pi);\n $scores[$fi[0]] += (int)trim($fi[1]);\n if($scores[$fi[0]] >= $max && $sorted[$fi[0]] == $max){\n echo $fi[0];\n return;\n }\n }"}, {"source_code": " [],\n];\n$maxPerson = null;\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 1; $i <= $n; ++$i) {\n list($person, $points) = fscanf($input, \"%s %d\\n\");\n\n $t[$i] = $t[$i - 1];\n\n if (isset($t[$i][$person])) {\n $t[$i][$person] += $points;\n } else {\n $t[$i][$person] = $points;\n }\n}\n\n$end = end($t);\n$finalsMax = max($end);\n$leaders = array_keys($end, $finalsMax);\n\n//dd($t, $end, $finalsMax, $leaders);\n\nforeach ($t as $k => $v) {\n foreach ($v as $person => $points) {\n if ($points >= $finalsMax && in_array($person, $leaders)) {\n $maxPerson = $person;\n break;\n }\n }\n\n if ($maxPerson) {\n break;\n }\n}\n\n//dd($t, $end, $finalsMax);\n\nfwrite($output, $maxPerson);"}, {"source_code": "name = $array[0];\n $line[$i]->point = $array[1];\n\n if(isset($names[$array[0]]))\n {\n $names[$array[0]] = $names[$array[0]] + $array[1];\n }\n else\n {\n $names += array($array[0] => $array[1]);\n }\n}\n\n\n$max=0;\nforeach ($names as $key => $val) \n{\n if($max < $val)\n $max = $val;\n}\nunset($val);\n\n$str;\n$pnt;\nforeach ($line as &$val) \n{\n $str = $val->name;\n $pnt = $val->point;\n\n if(isset($winner[$str]))\n {\n $winner[$str] = $winner[$str] + $pnt;\n }\n else\n {\n $winner += array($str => $pnt);\n }\n\n if($winner[$str] >= $max && $names[$str] == $max)\n {\n echo $str;\n break;\n }\n\n}\nunset($val);\n\n"}, {"source_code": "name = $array[0];\n $list[$i]->point = $array[1];\n\n if(isset($names[$array[0]]))\n $names[$array[0]] = $names[$array[0]] + $array[1];\n else\n $names += array($array[0] => $array[1]);\n}\n\n$max=0;\nforeach ($names as $key => $val) \n{\n if($max < $val)\n $max = $val;\n}\nunset($val);\n\n$winner = array();\nforeach ($list as &$val) \n{\n $str = $val->name;\n $pnt = $val->point;\n\n if(isset($winner[$str]))\n $winner[$str] = $winner[$str] + $pnt;\n else\n $winner += array($str => $pnt);\n\n if($winner[$str] >= $max && $names[$str] == $max)\n {\n echo $str;\n break;\n }\n\n}\nunset($val);\nfclose($fr);\n?>\n"}, {"source_code": "name = $array[0];\n $list[$i]->point = $array[1];\n\n if(isset($names[$array[0]]))\n $names[$array[0]] = $names[$array[0]] + $array[1];\n else\n $names += array($array[0] => $array[1]);\n}\n\n\n$max=0;\nforeach ($names as $key => $val) \n{\n if($max < $val)\n $max = $val;\n}\nunset($val);\n\n$winner = array();\nforeach ($list as &$val) \n{\n $str = $val->name;\n $pnt = $val->point;\n\n if(isset($winner[$str]))\n $winner[$str] = $winner[$str] + $pnt;\n else\n $winner += array($str => $pnt);\n\n if($winner[$str] >= $max && $names[$str] == $max)\n {\n echo $str;\n break;\n }\n\n}\nunset($val);\n\n"}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\n$players[] = $player;\nif (isset($total[$player[0]])){\n$total[$player[0]] += $player[1];\n} else {\n$total[$player[0]] = $player[1];\n}\n}\n}\n$higher_score = null;\n$same_player = array();\n$winner = \"\";\nforeach($total as $key =>$value) {\nif ($higher_score === null) {\n$higher_score = $value;\n}\nif ($value > $higher_score) {\n$higher_score = $value;\n$winner = $key;\n$same_player = array();\n} else if ($value == $higher_score) {\n$same_player[] = $winner;\n$same_player[] = $key;\n}\n}\nif (!empty($same_player)){\nforeach($same_player as $key =>$value) {\n$same_player_score[$value] = 0;\n}\nforeach($players as $key =>$value) {\nif (in_array($value[0], $same_player)) {\n$same_player_score[$value[0]]+= $value[1];\nif ($same_player_score[$value[0]] >= $higher_score) {\n$winner = $value[0];\nbreak;\n}\n}\n}\n}\necho $winner;\n?>"}, {"source_code": " $scor) {\n if ($scor > $maxScore) {$maxScore = $scor;}\n}\n\n$winners = array();\n\nforeach ($scoremap as $nume => $scor) {\n if ($scor >= $maxScore) {array_push($winners, $nume);}\n}\n\n// foreach ($scoremap as $nume => $scor) {\n// echo $nume . \":\" . $scor . \"
\";\n// }\n\nunset($scoremap);\n$scoremap = array();\n\n$newMaxScore = 0;\n$newWinner = \"\";\nfor ($i = 0; $i < $n; ++$i) {\n if (!isset($scoremap[$comitsname[$i]])) {\n $scoremap[$comitsname[$i]] = 0;\n }\n $scoremap[$comitsname[$i]] += $comitsvalue[$i];\n // if ($scoremap[$comitsname[$i]] > $newMaxScore) {\n // $newMaxScore = $scoremap[$comitsname[$i]];\n // $newWinner = $comitsname[$i];\n // }\n if ($scoremap[$comitsname[$i]] >= $maxScore) {\n if (array_search($comitsname[$i], $winners) !== false) {\n //echo \"zz\";\n $winner = $comitsname[$i];\n //echo $winner;\n break;\n }\n }\n}\n\nfprintf($fileOut, $winner . \"\\n\");\n\nfclose($fileIN);\nfclose($fileOut);\n\n?>"}, {"source_code": " $name) {\n $score = $points[$i];\n $currentScores[$name] += $score;\n if ($currentScores[$name] >= $max && $scores[$name] == $max) {\n exit($name);\n }\n }"}, {"source_code": " $max) $max = $v;\n}\n\n$w = array();\nforeach($g as $k => $v){\n if($v == $max) $w[$k] = $v;\n}\n\nif(count($w) == 1){\n print array_search($max, $w);\n exit(0);\n}\n\n$g = array();\nforeach($s as $v){\n list($player, $score) = explode(' ',$v);\n if(!array_key_exists($player,$w)) continue;\n $g[$player] += $score;\n if($g[$player] >= $max){\n print $player;\n exit(0);\n }\n}\n\n\n?>"}, {"source_code": " $max)\n $max = end($score);\n foreach($scores as $name=>$score)\n if(end($score) == $max)\n foreach($score as $time=>$value)\n if($value >= $max && $time <= $n){ \n $n = $time;\n $win = $name;\n }\n echo $win;\n?>"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\nforeach (range(1, $n) as $i) {\n $dat = explode(' ', fgets(STDIN));\n $name[$i] = $dat[0];\n $gain[$i] = intval($dat[1]);\n $score[$name[$i]] += $gain[$i];\n}\nforeach ($score as $val)\n if ($val > $best) $best = $val;\n$second = array();\nforeach (range(1, $n) as $i) {\n $second[$name[$i]] += $gain[$i];\n if ($score[$name[$i]] == $best && $second[$name[$i]] >= $best) break;\n}\n\nprint $name[$i].chr(10);\n?>"}], "negative_code": [{"source_code": " $max) {\n $max = $newMax;\n $maxPerson = $person;\n }\n}\n\n$a = $b = [];\n$max = -10000000000;\n$maxPerson = '';\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; ++$i) {\n list($person, $points) = fscanf($input, \"%s %d\\n\");\n\n foo($a, $b, $max, $maxPerson, $person, $points);\n}\n\nfwrite($output, $b[max($a)][0]);\n"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n if($resultScore[$k] <0) {\n continue;\n }\n $max[$name] += $resultScore[$k];\n }\n\n $maxScore = max($max);\n $max = array();\n\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": " $v) {\n if ($v[0] > $max) {\n $max = $v[0];\n $name = $k;\n $key = $v[1];\n } else if ($v == $max) {\n if ($key > $v[1]) {\n $name = $k;\n $key = $v[1];\n }\n }\n }\n return $name;\n}\n\n$in = fopen(STDIN,'r');\nwhile ($row = fscanf($in,\"%s %i\")) {\n $data[] = $row;\n}\n\n$line = array_shift($data);\n\n$max = 0;\n$name = '';\n$list = [];\nfor ($i=0;$i<$line[0];$i++) {\n if (!$list[$data[$i][0]]) {\n $list[$data[$i][0]] = [\n $data[$i][1],$i\n ];\n } else {\n $list[$data[$i][0]][0] += $data[$i][1];\n $list[$data[$i][0]][1] = $i;\n }\n}\n\necho _max($list);"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n if(isset($bad[$name]) && $resultScore[$k] <0) {\n $bad[$name] = 1;\n continue;\n }\n $max[$name] += $resultScore[$k];\n }\n\n $maxScore = max($max);\n $max = array();\n\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": " $max) {\n $max = $newMax;\n $maxPerson = $person;\n }\n}\n\n$a = [];\n$max = 0;\n$maxPerson = '';\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; ++$i) {\n list($person, $points) = fscanf($input, \"%s %d\\n\");\n\n foo($a, $max, $maxPerson, $person, $points);\n}\n\nfwrite($output, $maxPerson);\n"}, {"source_code": "$value)\n{\n\tif($value > $max){\n\t\t$winner_list = array($key);\n\t\t$max = $value;\n\t}else if($value == $max){\n\t\t$winner_list[] = $key;\n\t}\n}\n\n$min = $n;\nforeach($winner_list as $name){\n\tfor($i=0; $i\n"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n $new[$istr[0]] += $istr[1];\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n}"}, {"source_code": "$value)\n{\n\tif(($value > $max) || (($value == $max) && $player_hs[$key]<$winner_t) ){\n\t\t$max = $value;\n\t\t$winner = $key;\n\t\t$winner_t = $player_hs[$key];\n\t}\n}\n\necho $winner.\"\\n\";\n?>\n"}, {"source_code": " $scor) {\n if ($scor > $maxScore) {$maxScore = $scor;}\n}\n\n$winners = array();\n\nforeach ($scoremap as $nume => $scor) {\n if ($scor == $maxScore) {array_push($winners, $nume);}\n}\n\nunset($scoremap);\n$scoremap = array();\n\nfor ($i = 0; $i < $n; ++$i) {\n if (!isset($scoremap[$comitsname[$i]])) {\n $scoremap[$comitsname[$i]] = 0;\n }\n $scoremap[$comitsname[$i]] += $comitsvalue[$i];\n if ($scoremap[$comitsname[$i]] == $maxScore) {\n if (array_search($comitsname[$i], $winners) == true) {\n //echo \"zz\";\n $winner = $comitsname[$i];\n break;\n }\n }\n}\n\nfprintf($fileOut, $winner . \"\\n\");\n\nfclose($fileIN);\nfclose($fileOut);\n\n?>"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n /*if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }*/\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n\n $addScore = $resultScore[$k];\n if($addScore>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": "$value)\n {\n if($value>$point)\n {\n $winner=$key;\n $point = $value;\n }\n \n // echo($winner.\"\\n\");\n }\n \n \n }\n \n echo($winner);\n ?>"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\nwhile ($n--) {\n $dat = explode(' ', fgets(STDIN));\n $score[$dat[0]] += intval($dat[1]);\n}\n$best = $dat[0];\nforeach ($score as $name => $val) {\n if ($val > $score[$best] || ($val == $score[$best] && $name < $best))\n $best = $name;\n}\nprint $best.chr(10);\n?>"}, {"source_code": ""}, {"source_code": "= $max) {\n echo $res[$i][0];\n exit();\n }\n }\n?>"}, {"source_code": ""}, {"source_code": " $m) {\n $winner = $name;\n $m = $a[$name];\n }\n}\nif ($m == max($a) && count($winnerNames = array_keys($a, $m)) == 1) {\n echo $winnerNames[0];\n} else {\n echo $winner;\n}\n"}, {"source_code": " $m) {\n $winner = $name;\n $m = $a[$name];\n }\n}\nif ($m == max($a) && count($winnerNames = array_keys($a, $m)) == 1) {\n echo $winnerNames[0];\n} else {\n echo $winner;\n}\n"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n /*if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }*/\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n\n if($addScore<$maxScore) {\n $max[$name] += $addScore;\n }\n\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": " $maxScore) {\n $maxScore = $scoremap[$lineSplit[0]];\n $winner = $lineSplit[0];\n }\n}\n\nfprintf($fileOut, $winner . \"\\n\");\n\nfclose($fileIN);\nfclose($fileOut);\n\n?>"}, {"source_code": ""}, {"source_code": " $max) {\n $max = $newMax;\n $maxPerson = $person;\n }\n}\n\n$a = [];\n$max = 0;\n$maxPerson = '';\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; ++$i) {\n list($person, $points) = fscanf($input, \"%s %d\\n\");\n\n foo($a, $max, $maxPerson, $person, $points);\n}\n\nfwrite($output, $maxPerson);\n"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n if($resultScore[$k] <0) {\n continue;\n }\n $max[$name] += $resultScore[$k];\n }\n\n $maxScore = max($max);\n $max = array();\n\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": " $p_result) {\n\t\tif ($p_name == $name) {\n\t\t\t$players[$p_name][] = $players[$p_name][$round -1] + $result;\n\t\t\t$added = true;\n\t\t} else {\n\t\t\t$players[$p_name][] = $players[$p_name][$round -1];\n\t\t}\n\t}\n\n\tif (!$added) {\n\t\tfor($i = 0; $i <= $round; $i++) {\n\t\t\t$players[$name][] = ($i == $round -1) ? $result : 0; \n\t\t}\n\t}\n\n\t$round++;\n}\n\nfunction findHighest()\n{\t\t\n\tglobal $players, $round;\n\t$highest_score = -1001;\n\t$leader_name = \"Pawel\";\n\n\tforeach($players as $player => $score) {\n\t\t$final_score = $score[$round - 1];\n\n\t\tif ($final_score > $highest_score) {\n\t\t\t$leader_name = $player;\n\t\t\t$highest_score = $final_score;\n\t\t\t$multiple_leaders = false;\n\t\t} else if ($final_score == $highest_score) {\n\t\t\t$multiple_leaders = true; \n\t\t}\n\t}\n\t\n\treturn array($leader_name, $highest_score, $multiple_leaders);\n}\n\nfunction findOverallWinner($winners_array, $winning_score) \n{\n\t$temp_winners = array();\n\tglobal $round;\t\n\t$winning_round = $round - 1;\n\n\tforeach($winners_array as $w_name => $w_score) {\n\t\tif ($w_score[$round] == $winning_score) {\n\t\t\tforeach($w_score as $t_round => $t_score) {\n\t\t\t\tif($t_score >= $winning_score && $t_round < $winning_round) {\n\t\t\t\t\t$winning_round = $t_round;\n\t\t\t\t\t$winner_name = $w_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\treturn $winner_name;\n}\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\t\tsaveResult($matches[1], $matches[2]);\t\n\t}\n}\n\n$winner = findHighest();\n$overall_winner = ($winner[2]) ? findOverallWinner($players, $winner[1]) : $winner[0];\nfprintf($fw, $overall_winner);\n"}, {"source_code": " $v) {\n if ($v[0] > $max) {\n $max = $v[0];\n $name = $k;\n $key = $v[1];\n } else if ($v == $max) {\n if ($key > $v[1]) {\n $name = $k;\n $key = $v[1];\n }\n }\n }\n return $name;\n}\n\n$in = fopen(STDIN,'r');\nwhile ($row = fscanf($in,\"%s %i\")) {\n $data[] = $row;\n}\n\n$line = array_shift($data);\n\n$max = 0;\n$name = '';\n$list = [];\nfor ($i=0;$i<$line[0];$i++) {\n if (!$list[$data[$i][0]]) {\n $list[$data[$i][0]] = [\n $data[$i][1],$i\n ];\n } else {\n $list[$data[$i][0]][0] += $data[$i][1];\n $list[$data[$i][0]][1] = $i;\n }\n}\n\necho _max($list);"}, {"source_code": "= $max) {\n //echo $line[0];\n exit();\n }\n }\n?>"}, {"source_code": ""}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\nif (isset($total[$player[0]])){\n$total[$player[0]] += $player[1];\n} else {\n$total[$player[0]] = $player[1];\n}\nif ($total[$player[0]]>$higher_score){\n if ($prev_winner == \"\"){\n $prev_winner = $player[0];\n $prev_higher_score = $total[$player[0]];\n }\n else {\n $prev_winner = $winner;\n $prev_higher_score = $higher_score;\n $winner = $player[0];\n $higher_score = $total[$player[0]];\n }\n} else if($total[$player[0]]<0 && $winner == $player[0]) {\n $winner = $prev_winner;\n $higher_score = $prev_higher_score;\n}\n}\n}\nif ($winner == \"\") {\nforeach($text as $key => $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\n$winner = $player[0];\n}\n}\n}\necho $winner;\n?>"}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\nif (isset($total[$player[0]])){\n$total[$player[0]] += $player[1];\n} else {\n$total[$player[0]] = $player[1];\n}\nif ($total[$player[0]]>$higher_score){\n if ($prev_winner == \"\"){\n $prev_winner = $player[0];\n $prev_higher_score = $total[$player[0]];\n }\n else {\n $prev_winner = $winner;\n $prev_higher_score = $higher_score;\n $winner = $player[0];\n $higher_score = $total[$player[0]];\n }\n} else if($total[$player[0]]<0 && $winner == $player[0]) {\n $winner = $prev_winner;\n $higher_score = $prev_higher_score;\n}\n}\n}\nif ($av) {\nforeach($total as $key => $str) {\necho $key.\"=\".$value;\necho \"\\n\";\n\n}\n}\nif ($winner == \"\") {\nforeach($text as $key => $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\n$winner = $player[0];\n}\n}\n}\necho $winner;\n?>"}, {"source_code": "$value)\n {\n if($value>$point)\n {\n $winner=$key;\n $point = $value;\n }\n \n // echo($winner.\"\\n\");\n }\n \n \n }\n \n echo($winner);\n ?>"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\n$ub = array();\nwhile ($n--) {\n $dat = explode(' ', fgets(STDIN));\n $score[$dat[0]] += intval($dat[1])*1000;\n $score[$dat[0]] += $n - $score[$dat[0]]%1000;\n if (floor($score[$dat[0]] / 1000) == floor($ub[$dat[0]] / 1000))\n $score[$dat[0]] = $ub[$dat[0]];\n if (floor($score[$dat[0]] / 1000) > floor($ub[$dat[0]] / 1000))\n $ub[$dat[0]] = $score[$dat[0]];\n}\n$best = '';\nforeach ($score as $name => $val)\n if ($val > $score[$best]) $best = $name;\n\nprint $best.chr(10);\n?>"}, {"source_code": " $players[$winner]) {\n $winner = $name;\n }\n}\n\necho $winner;"}, {"source_code": "$v)\n {\n echo $k;\n break;\n }\n ?>"}, {"source_code": " $score) {\n\t\tif ($score > $highest_score) {\n\t\t\t$leader_name = $player;\n\t\t\t$highest_score = $score;\n\t\t\t$multiple_leaders = false;\n\t\t} else if ($score == $highest_score) {\n\t\t\t$multiple_leaders = true; \n\t\t}\n\t}\n\t\n\treturn array($leader_name, $highest_score, $multiple_leaders);\n}\n\n$players = $top_scores = array();\n$current_leader = $temp_leader = array(\"Pawel\", -1001, 0);\n$players[$temp_leader[0]] = $temp_leader[1];\n$top_scores[$temp_leader[0]] = $temp_leader[1];\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\n\t\tif (isset($players[$matches[1]])) {\n\t\t\t$players[$matches[1]] += $matches[2];\n\t\t} else {\n\t\t\t$players[$matches[1]] = $matches[2];\n\t\t}\n\t\t\n//\t\tif ($top_scores[$matches[1]] < $players[$matches[1]]) {\n//\t\t\t$top_scores[$matches[1]] = $players[$matches[1]];\n//\t\t}\n\n\t\t$temp_leader = findHighest($players);\n\n\t\tif ($temp_leader[1] > $current_leader[1]) {\n\t\t\t$current_leader = $temp_leader;\n\t\t}\t\n\t}\n}\n\n$last_check = findHighest($players);\nif ($current_leader[1] > $last_check[1]) {\n\tfprintf($fw, $current_leader[0]);\n} else {\n\tfprintf($fw, $last_check[0]);\n}\n\n"}, {"source_code": " $pi){\n $fi = explode(' ', $pi);\n $sorted[$fi[0]] += (int)trim($fi[1]);\n }\n $max = max($sorted); \n $winner = $fi[0];\n foreach($ps as $key => $pi){\n $fi = explode(' ', $pi);\n $scores[$fi[0]] += (int)trim($fi[1]);\n if($scores[$fi[0]] == $max){\n if($scores[$fi[0]] > $scores[$winner]){\n $winner = $fi[0];\n }\n }\n }\n echo $winner;"}, {"source_code": " 0,\n\t\t);\n\t}\n\t$scores[$name]['score'] += intval($score);\n\t$scores[$name]['round'] = $i;\n}\n\nuasort($scores, function($a, $b){\n\tif($a['score'] > $b['score']){\n\t\treturn -1;\n\t} elseif($a['score'] == $b['score']){\n\t\treturn ($a['round'] < $b['round']) ? -1 : 1;\n\t} else {\n\t\treturn 1;\n\t}\n});\n\n$names = array_keys($scores);\necho reset($names);"}, {"source_code": "= $max) {\n echo $line[0];\n exit();\n }\n }\n?>"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n if(isset($bad[$name]) && $resultScore[$k] <0) {\n $bad[$name] = 1;\n continue;\n }\n $max[$name] += $resultScore[$k];\n }\n\n $maxScore = max($max);\n $max = array();\n\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": " $winnerScore) {\n $winner = $name;\n $winnerScore = $a[$name];\n }\n}\necho $winner;\n\n"}, {"source_code": " $score) {\n\t\tif ($score > $highest_score) {\n\t\t\t$leader_name = $player;\n\t\t\t$highest_score = $score;\n\t\t\t$multiple_leaders = false;\n\t\t} else if ($score == $highest_score) {\n\t\t\t$multiple_leaders = true; \n\t\t}\n\t}\n\t\n\treturn array($leader_name, $highest_score, $multiple_leaders);\n}\n\n$players = $top_scores = array();\n$current_leader = $temp_leader = array(\"Pawel\", -1001, 0);\n$players[$temp_leader[0]] = $temp_leader[1];\n$top_scores[$temp_leader[0]] = $temp_leader[1];\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\n\t\tif (isset($players[$matches[1]])) {\n\t\t\t$players[$matches[1]] += $matches[2];\n\t\t} else {\n\t\t\t$players[$matches[1]] = $matches[2];\n\t\t}\n\t\t\n//\t\tif ($top_scores[$matches[1]] < $players[$matches[1]]) {\n//\t\t\t$top_scores[$matches[1]] = $players[$matches[1]];\n//\t\t}\n\n\t\t$temp_leader = findHighest($players);\n\n\t\tif ($temp_leader[2] > 0) {\n\t\t\tif ($temp_leader[1] > $current_leader[1]) {\n\t\t\t\t$current_leader = $temp_leader;\n\t\t\t}\t\n\t\t}\n\t}\n}\n\nfprintf($fw, $current_leader[0]);\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\nif (isset($total[$player[0]])){\n$total[$player[0]]['score'] += $player[1];\n$total[$player[0]]['turn'] = $turn;\n} else {\n$total[$player[0]]['score'] = $player[1];\n$total[$player[0]]['turn'] = $turn;\n}\n$turn++;\n}\n}\n$is_first = true;\n$winner_turn = 0;\nforeach($total as $key => $str) {\nif ($is_first) {\n$winner = $key;\n$higher_score = $str['score'];\n$winner_turn = $str['turn'];\n\n}\nif ($str['score']>$higher_score) {\n$winner = $key;\n$higher_score = $str['score'];\n$winner_turn = $str['turn'];\n\n} else if (intval($str['score']) == $higher_score && $winner_turn > $str['turn']){\n$winner = $key;\n$higher_score = $str['score'];\n$winner_turn = $str['turn'];\n}\n$is_first = false;\n}\n// var_dump($char_array2);die();\n// foreach($text as $key => $str) {\n// if (strlen($str)>0){\n// $player = explode(\" \",$str);\n// if (isset($total[$player[0]])){\n// $total[$player[0]] += $player[1];\n// } else {\n// $total[$player[0]] = $player[1];\n// }\n// if ($total[$player[0]]>$higher_score){\n // if ($prev_winner == \"\"){\n // $prev_winner = $player[0];\n // $prev_higher_score = $total[$player[0]];\n // }\n // else {\n // $prev_winner = $winner;\n // $prev_higher_score = $higher_score;\n // $winner = $player[0];\n // $higher_score = $total[$player[0]];\n // }\n// } else if($total[$player[0]]<0 && $winner == $player[0]) {\n // $winner = $prev_winner;\n // $higher_score = $prev_higher_score;\n// }\n// }\n// }\n\n\nif ($winner == \"\") {\nforeach($text as $key => $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\n$winner = $player[0];\n}\n}\n}\necho $winner;\n?>"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n if(isset($bad[$name]) && $resultScore[$k] <0) {\n $bad[$name] = 1;\n continue;\n }\n $max[$name] += $resultScore[$k];\n }\n\n $maxScore = max($max);\n $max = array();\n\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": "=$point && $ee[0] != \"\")\n {\n $winner=$ee[0];\n $point = $a[$ee[0]];\n }\n\n \n}\necho($winner);\n?>"}, {"source_code": ""}, {"source_code": " $score) {\n\t\tif ($score > $highest_score) {\n\t\t\t$leader_name = $player;\n\t\t\t$highest_score = $score;\n\t\t\t$multiple_leaders = false;\n\t\t} else if ($score == $highest_score) {\n\t\t\t$multiple_leaders = true; \n\t\t}\n\t}\n\t\n\treturn array($leader_name, $highest_score, $multiple_leaders);\n}\n\n$players = $top_scores = array();\n$current_leader = $temp_leader = array(\"Pawel\", -1001, 0);\n$players[$temp_leader[0]] = $temp_leader[1];\n$top_scores[$temp_leader[0]] = $temp_leader[1];\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\n\t\tif (isset($players[$matches[1]])) {\n\t\t\t$players[$matches[1]] += $matches[2];\n\t\t} else {\n\t\t\t$players[$matches[1]] = $matches[2];\n\t\t}\n\t\t\n//\t\tif ($top_scores[$matches[1]] < $players[$matches[1]]) {\n//\t\t\t$top_scores[$matches[1]] = $players[$matches[1]];\n//\t\t}\n\n\t\t$temp_leader = findHighest($players);\n\n\t\tif ($temp_leader[1] > $current_leader[1]) {\n\t\t\t$current_leader = $temp_leader;\n\t\t}\t\n\t}\n}\n\n$last_check = findHighest($players);\nif ($current_leader[1] > $last_check[1]) {\n\tfprintf($fw, $current_leader[0]);\n} else {\n\tfprintf($fw, $last_check[0]);\n}\n\n"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\nwhile ($n--) {\n $dat = explode(' ', fgets(STDIN));\n $score[$dat[0]] += intval($dat[1]);\n}\n$best = $dat[0];\nforeach ($score as $name => $val) {\n if ($val > $score[$best] || ($val == $score[$best] && $name < $best))\n $best = $name;\n}\nprint $best.chr(10);\n?>"}, {"source_code": " $value) {\n if($data[$name]['score'] > $maxScore) {\n $maxScore = $data[$name]['score'];\n $winName = $name;\n $testCheck = 0;\n foreach ($data[$name]['log'] as $check => $s) {\n $testCheck += $s;\n if($testCheck >= $maxScore) {\n $maxCheck = $check;\n break;\n }\n }\n }\n elseif($data[$name]['score'] == $maxScore) {\n foreach ($data[$name]['log'] as $check => $s) {\n $testCheck += $s;\n if($testCheck >= $maxScore) {\n if($check < $maxCheck) {\n $maxCheck = $check;\n $winName = $name;\n }\n break;\n }\n }\n }\n }\n\n printf(\"%s\", $winName);\n?>"}, {"source_code": " $s) {\n if($n != $name) {\n if($data[$name] > $s) $check++;\n }\n }\n if($check == count($data) - 1) $winName = $name;\n\n }\n printf(\"%s\", $winName);\n?>"}, {"source_code": " $player_hs[$name][0])\n\t\t\t$player_hs[$name] = array($score,$i);\n\n\t}else{\n\t\t$player[$name] = $score;\n\t\t$player_hs[$name] = array($score,$i);\n\t}\n\n}\n\n$max = 0;\n$winner = \"\";\n$winner_t = 0;\n\nforeach($player as $key=>$value)\n{\n\tif(($value > $max) || (($value == $max) && $player_hs[$key][1]<$winner_t) ){\n\t\t$max = $value;\n\t\t$winner = $key;\n\t\t$winner_t = $player_hs[$key][1];\n\t}\n}\n\necho $winner.\"\\n\";\n?>\n"}, {"source_code": " $maxScore) {\n $maxScore = $scoremap[$lineSplit[0]];\n $winner = $lineSplit[0];\n }\n}\n\nfprintf($fileOut, $winner . \"\\n\");\n\nfclose($fileIN);\nfclose($fileOut);\n\n?>"}, {"source_code": ""}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\nif ($player[1]<0) {\nif ($player[0] == $winner) {\n$winner = $prev_winner;\n$higher_score = $prev_higher_score;\n}\n$total[$player[0]] = \"loser\";\ncontinue;\n}\nif ($total[$player[0]] =='loser') continue;\nif (isset($total[$player[0]]) && $total[$player[0]] !='loser'){\n$total[$player[0]] += $player[1];\n} else {\n$total[$player[0]] = $player[1];\n}\nif ($total[$player[0]]>$higher_score){\nif ($prev_winner == \"\"){\n$prev_winner = $player[0];\n$prev_higher_score = $total[$player[0]];\n}\nelse {\n$prev_winner = $winner;\n$prev_higher_score = $higher_score;\n$winner = $player[0];\n$higher_score = $total[$player[0]];\n}\n}\n}\n}\nif ($winner == \"\") {\nforeach($text as $key => $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);$winner = $player[0];\n\n}\n}\n} else {\necho $winner;\n}\n?>"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\nwhile ($n--) {\n $dat = explode(' ', fgets(STDIN));\n $score[$dat[0]] += intval($dat[1]);\n}\n$best = $dat[0];\nforeach ($score as $name => $val) {\n if ($val > $score[$best] || ($val == $score[$best] && $name < $best))\n $best = $name;\n}\nprint $best.chr(10);\n?>"}, {"source_code": "$point)\n {\n $winner=$ee[0];\n $point = $a[$ee[0]];\n }\n\n \n}\necho($winner);\n?>"}, {"source_code": "= $m) {\n echo $name;\n exit;\n }\n}\n"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n $new[$istr[0]] += $istr[1];\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] == $max AND $new[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n}"}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\nif ($player[1]<0) {\nif ($player[0] == $winner) {\n$winner = $prev_winner;\n$higher_score = $prev_higher_score;\n}\n$total[$player[0]] = \"loser\";\ncontinue;\n}\nif ($total[$player[0]] =='loser') continue;\nif (isset($total[$player[0]]) && $total[$player[0]] !='loser'){\n$total[$player[0]] += $player[1];\n} else {\n$total[$player[0]] = $player[1];\n}\nif ($total[$player[0]]>$higher_score){\nif ($prev_winner == \"\"){\n$prev_winner = $player[0];\n$prev_higher_score = $total[$player[0]];\n}\nelse {\n$prev_winner = $winner;\n$prev_higher_score = $higher_score;\n$winner = $player[0];\n$higher_score = $total[$player[0]];\n}\n}\n}\n}\nif ($winner == \"\") {\nforeach($text as $key => $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\n$winner = $player[0];\n}\n}\n}\necho $winner;\n?>"}, {"source_code": " 0; $x++, $z--)\n{\n $n = $z / 1000;\n $p = \".\" . $z;\n for($y = 0; $y < count($i); $y++)\n {\n if($i[$y] == $e[$x])\n {\n if($j[$e[$x]] >= 0)\n {\n $j[$e[$x]] = floor($j[$e[$x]]);\n }\n else\n {\n $j[$e[$x]] = ceil($j[$e[$x]]);\n }\n $j[$e[$x]] = floor($j[$e[$x]]);\n $j[$e[$x]] = $j[$e[$x]] + $f[$x];\n $j[$e[$x]] = $j[$e[$x]] . $p;\n }\n }\n arsort($j);\n $m = array_keys($j);\n}\nprint_r($j);\n?>"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $winnerCandidates = $max = array();\n\n\n foreach($resultNames as $k=>$name){\n\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n $max[$name] += $addScore;\n\n if($max[$name] >= $maxScore) {\n $winnerCandidates[$name] = 0;\n }\n }\n\n //var_dump($winnerCandidates, $max, $maxScore);\n\n foreach($max as $name=>$result) {\n if($result>=$maxScore && isset($winnerCandidates[$name])) {\n exit($name);\n }\n }\n\n"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n /*if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }*/\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n\n $max[$name] += $addScore;\n\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n /*if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }*/\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n\n if($addScore<$maxScore) {\n $max[$name] += $addScore;\n } else {\n exit($name);\n }\n\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n $new[$istr[0]] += $istr[1];\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] == $max AND $new[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n}"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\n$best = '';\n$score[$best] = -10000000;\nwhile ($n--) {\n $dat = explode(' ', fgets(STDIN));\n $score[$dat[0]] += intval($dat[1]);\n if ($score[$dat[0]] > $score[$best])\n $best = $dat[0];\n}\nprint $best.chr(10);\n?>"}, {"source_code": "= $m) {\n echo $winner;\n exit;\n }\n}\n"}, {"source_code": "$value)\n{\n\tif(($value > $max) || (($value == $max) && $player_hs[$key]<$winner_t) ){\n\t\t$max = $value;\n\t\t$winner = $key;\n\t\t$winner_t = $player_hs[$key];\n\t}\n}\n\necho $winner.\"\\n\";\n?>\n"}, {"source_code": " $max) {\n $max = $a[$person];\n $maxPerson = $person;\n }\n}\n\n$a = $b = [];\n$max = -10000000000;\n$maxPerson = '';\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; ++$i) {\n list($person, $points) = fscanf($input, \"%s %d\\n\");\n\n foo($a, $b, $max, $maxPerson, $person, $points);\n}\n\nfwrite($output, $b[max($a)][0]);"}, {"source_code": ""}, {"source_code": " $max) {\n $max = $res[$name];\n $winner = $name;\n }\n }\n \n fprintf(STDOUT, \"%s\", $winner);\n?>"}, {"source_code": " $score) {\n\t\tif ($score > $highest_score) {\n\t\t\t$leader_name = $player;\n\t\t\t$highest_score = $score;\n\t\t\t$multiple_leaders = false;\n\t\t} else if ($score == $highest_score) {\n\t\t\t$multiple_leaders = true; \n\t\t}\n\t}\n\t\n\treturn array($leader_name, $highest_score, $multiple_leaders);\n}\n\n$players = $top_scores = array();\n$current_leader = $temp_leader = array(\"Pawel\", -1001, 0);\n$players[$temp_leader[0]] = $temp_leader[1];\n$top_scores[$temp_leader[0]] = $temp_leader[1];\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\n\t\tif (isset($players[$matches[1]])) {\n\t\t\t$players[$matches[1]] += $matches[2];\n\t\t} else {\n\t\t\t$players[$matches[1]] = $matches[2];\n\t\t}\n\t\t\n//\t\tif ($top_scores[$matches[1]] < $players[$matches[1]]) {\n//\t\t\t$top_scores[$matches[1]] = $players[$matches[1]];\n//\t\t}\n\n\t\t$temp_leader = findHighest($players);\n\n\t\tif ($temp_leader[1] > $current_leader[1]) {\n\t\t\t$current_leader = $temp_leader;\n\t\t}\t\n\t}\n}\n\n$last_check = findHighest($players);\nif ($last_check[1] > $players[$current_leader[0]]) {\n\tfprintf($fw, $last_check[2]);\n} else {\n\tfprintf($fw, $current_leader[2]);\n}\n\n"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n $new[$istr[0]] += $istr[1];\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n}"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n if ( $istr[1] < 0 ) {\n unset( $in[$key] );\n } else {\n $new[$istr[0]] += $istr[1];\n }\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n}"}, {"source_code": " $score) {\n\t\tif ($score > $highest_score) {\n\t\t\t$leader_name = $player;\n\t\t\t$highest_score = $score;\n\t\t\t$multiple_leaders = false;\n\t\t} else if ($score == $highest_score) {\n\t\t\t$multiple_leaders = true; \n\t\t}\n\t}\n\t\n\treturn array($leader_name, $highest_score, $multiple_leaders);\n}\n\n$players = $top_scores = array();\n$current_leader = $temp_leader = array(\"Pawel\", -1001, 0);\n$players[$temp_leader[0]] = $temp_leader[1];\n$top_scores[$temp_leader[0]] = $temp_leader[1];\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\n\t\tif (isset($players[$matches[1]])) {\n\t\t\t$players[$matches[1]] += $matches[2];\n\t\t} else {\n\t\t\t$players[$matches[1]] = $matches[2];\n\t\t}\n\t\t\n//\t\tif ($top_scores[$matches[1]] < $players[$matches[1]]) {\n//\t\t\t$top_scores[$matches[1]] = $players[$matches[1]];\n//\t\t}\n\n\t\t$temp_leader = findHighest($players);\n\n\t\tif ($temp_leader[2] > 0) {\n\t\t\tif ($temp_leader[1] > $current_leader[1]) {\n\t\t\t\t$current_leader = $temp_leader;\n\t\t\t}\t\n\t\t}\n\t}\n}\n\nfprintf($fw, $current_leader[0]);\n\n"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\nif (isset($total[$player[0]])){\n$total[$player[0]]['score'] += $player[1];\n$total[$player[0]]['turn'] = $turn;\n} else {\n$total[$player[0]]['score'] = $player[1];\n$total[$player[0]]['turn'] = $turn;\n}\n$turn++;\n}\n}\n$is_first = true;\n$winner_turn = 0;\nforeach($total as $key => $str) {\nif ($is_first) {\n$winner = $key;\n$higher_score = $str['score'];\n$winner_turn = $str['turn'];\ncontinue;\n}\nif ($str['score']>$higher_score) {\n$winner = $key;\n$higher_score = $str['score'];\n$winner_turn = $str['turn'];\n} else if ($str['score'] == $higher_score && $winner_turn > $str['turn']){\n$winner = $key;\n$higher_score = $str['score'];\n$winner_turn = $str['turn'];\n}\n$is_first = false;\n}\n// var_dump($char_array2);die();\n// foreach($text as $key => $str) {\n// if (strlen($str)>0){\n// $player = explode(\" \",$str);\n// if (isset($total[$player[0]])){\n// $total[$player[0]] += $player[1];\n// } else {\n// $total[$player[0]] = $player[1];\n// }\n// if ($total[$player[0]]>$higher_score){\n // if ($prev_winner == \"\"){\n // $prev_winner = $player[0];\n // $prev_higher_score = $total[$player[0]];\n // }\n // else {\n // $prev_winner = $winner;\n // $prev_higher_score = $higher_score;\n // $winner = $player[0];\n // $higher_score = $total[$player[0]];\n // }\n// } else if($total[$player[0]]<0 && $winner == $player[0]) {\n // $winner = $prev_winner;\n // $higher_score = $prev_higher_score;\n// }\n// }\n// }\n\n\nif ($winner == \"\") {\nforeach($text as $key => $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\n$winner = $player[0];\n}\n}\n}\necho $winner;\n?>"}, {"source_code": " $score) {\n\t\tif ($score > $highest_score) {\n\t\t\t$leader_name = $player;\n\t\t\t$highest_score = $score;\n\t\t\t$multiple_leaders = false;\n\t\t} else if ($score == $highest_score) {\n\t\t\t$multiple_leaders = true; \n\t\t}\n\t}\n\t\n\treturn array($leader_name, $highest_score, $multiple_leaders);\n}\n\n$players = $top_scores = array();\n$current_leader = $temp_leader = array(\"Pawel\", -1001, 0);\n$players[$temp_leader[0]] = $temp_leader[1];\n$top_scores[$temp_leader[0]] = $temp_leader[1];\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\n\t\tif (isset($players[$matches[1]])) {\n\t\t\t$players[$matches[1]] += $matches[2];\n\t\t} else {\n\t\t\t$players[$matches[1]] = $matches[2];\n\t\t}\n\t\t\n//\t\tif ($top_scores[$matches[1]] < $players[$matches[1]]) {\n//\t\t\t$top_scores[$matches[1]] = $players[$matches[1]];\n//\t\t}\n\n\t\t$temp_leader = findHighest($players);\n\n\t\tif ($temp_leader[2] > 0) {\n\t\t\tif ($temp_leader[1] > $current_leader[1]) {\n\t\t\t\t$current_leader = $temp_leader;\n\t\t\t}\t\n\t\t}\n\t}\n}\n\nfprintf($fw, $current_leader[0]);\n\n"}, {"source_code": "name = $array[0];\n $line[$i]->point = $array[1];\n\n if(isset($names[$array[0]]))\n {\n $names[$array[0]] = $names[$array[0]] + $array[1];\n }\n else\n {\n $names += array($array[0] => $array[1]);\n }\n}\n\n\n$max=0;\nforeach ($line as &$val) \n{\n if($max < $val->point)\n $max = $val->point;\n}\nunset($val);\n\n$str;\n$pnt;\nforeach ($line as &$val) \n{\n $str = $val->name;\n $pnt = $val->point;\n\n\n if(isset($winner[$str]))\n {\n $winner[$str] = $winner[$str] + $pnt;\n }\n else\n {\n $winner += array($str => $pnt);\n }\n\n if($winner[$str] >= $max && $names[$str] == $max)\n {\n echo $str;\n break;\n }\n\n}\nunset($val);\n\n\n"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n /*if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }*/\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n\n if($addScore<$maxScore) {\n $max[$name] += $addScore;\n } else {\n exit($name);\n }\n\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}, {"source_code": ""}, {"source_code": "$value)\n{\n\tif($value > $max){\n\t\t$winner_list = array($key);\n\t\t$max = $value;\n\t}else if($value == $max){\n\t\t$winner_list[] = $key;\n\t}\n}\n\n$min = $n;\nforeach($winner_list as $name){\n\tfor($i=0; $i \n"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\nforeach (range(1, $n) as $i) {\n $dat = explode(' ', fgets(STDIN));\n $name[$i] = $dat[0];\n $gain[$i] = intval($dat[1]);\n $score[$name[$i]] += $gain[$i];\n}\nforeach ($score as $val)\n if ($val > $best) $best = $val;\n$second = array();\nforeach (range(1, $n) as $i) {\n $second[$name[$i]] += $gain[$i];\n if ($score[$name[$i]] == $best && $second[$name[$i]] == $best) break;\n}\n\nprint $name[$i].chr(10);\n?>"}, {"source_code": "= $max) {\n //echo $line[0];\n exit();\n }\n }\n?>"}, {"source_code": " $max) {\n $max = $newMax;\n $maxPerson = $person;\n }\n}\n\n$a = $b = [];\n$max = -10000000000;\n$maxPerson = '';\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; ++$i) {\n list($person, $points) = fscanf($input, \"%s %d\\n\");\n\n foo($a, $b, $max, $maxPerson, $person, $points);\n}\n\nfwrite($output, $b[max($a)][0]);\n"}, {"source_code": " 0; $x++, $z--)\n{\n $n = $z / 1000;\n $p = \".\" . $z;\n for($y = 0; $y < count($i); $y++)\n {\n if($i[$y] == $e[$x])\n {\n if($j[$e[$x]] >= 0)\n {\n $j[$e[$x]] = floor($j[$e[$x]]);\n }\n else\n {\n $j[$e[$x]] = ceil($j[$e[$x]]);\n }\n $j[$e[$x]] = floor($j[$e[$x]]);\n $j[$e[$x]] = $j[$e[$x]] + $f[$x];\n $j[$e[$x]] = $j[$e[$x]] . $p;\n }\n }\n arsort($j);\n $m = array_keys($j);\n}\nprint $m[0];\n?>"}, {"source_code": " $str) {\nif (strlen($str)>0){\n$player = explode(\" \",$str);\nif ($player[1]<0) {\n$total[$player[0]] = \"loser\";\ncontinue;\n}\nif (isset($total[$player[0]]) && $total[$player[0]] !='loser'){\n$total[$player[0]] += $player[1];\n}else {\n$total[$player[0]] = $player[1];\n}\n}\n}\n$winner = \"\";\n$higher_score = 0;\nforeach ($total as $key=> $value) {\nif ($value != \"loser\" && $value>$higher_score) {\n$winner = $key;\n}\n}\necho $winner;\n?>"}, {"source_code": " $p_results) {\n\t\t\t$player_score = 0;\n\n\t\t\tforeach($p_results as $round_number => $round_result) {\n\t\t\t\t$player_score += $round_result;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$players[$p_name][$number_of_rounds + 1] = $player_score;\n\t\t\tif ($player_score > $highest_result) {\n\t\t\t\t$highest_result = $player_score;\n\t\t\t}\n\t\t}\n\t}\n\n\t$current_round++;\n}\n\nfunction findOverallWinner($winners_array, $winning_score) \n{\n\t$temp_winners = array();\n\tglobal $number_of_rounds;\t\n\t$winning_round = $number_of_rounds;\n\n\tforeach($winners_array as $w_name => $w_score) {\n\t\tif ($w_score[$number_of_rounds + 1] == $winning_score) {\n\t\t\t$temp_score = 0;\n\n\t\t\tforeach($w_score as $t_round => $t_score) {\n\t\t\t\tif ($t_round >= $winning_round) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$temp_score += $t_score;\n\n\t\t\t\tif($t_score >= $winning_score) {\n\t\t\t\t\t$winning_round = $t_round;\n\t\t\t\t\t$winner_name = $w_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $winner_name;\n}\n\n\nwhile(($line = fgets($fr)) !== false) {\n\tif (preg_match('/([a-z]+)\\s+([\\-0-9]+)/', $line, $matches)) {\n\t\tsaveResult($matches[1], $matches[2]);\t\n\t}\n}\n\nfprintf($fw, findOverallWinner($players, $highest_result));\n"}, {"source_code": " $value) {\n if($data[$name]['score'] > $maxScore) {\n $maxScore = $data[$name]['score'];\n $winName = $name;\n $testCheck = 0;\n foreach ($data[$name]['log'] as $check => $s) {\n $testCheck += $s;\n if($testCheck >= $maxScore) {\n $maxCheck = $check;\n break;\n }\n }\n }\n elseif($data[$name]['score'] == $maxScore) {\n foreach ($data[$name]['log'] as $check => $s) {\n $testCheck += $s;\n if($testCheck >= $maxScore) {\n if($check < $maxCheck) {\n $maxCheck = $check;\n $winName = $name;\n }\n break;\n }\n }\n }\n }\n\n printf(\"%s\", $winName);\n?>"}, {"source_code": "#!/usr/bin/env php\n\nerror_reporting(0);\n$n = intval(fgets(STDIN));\n$score = array();\n$ub = array();\nwhile ($n--) {\n $dat = explode(' ', fgets(STDIN));\n $score[$dat[0]] += intval($dat[1])*1000;\n $score[$dat[0]] += $n - $score[$dat[0]]%1000;\n if (floor($score[$dat[0]] / 1000) == floor($ub[$dat[0]] / 1000))\n $score[$dat[0]] = $ub[$dat[0]];\n if (floor($score[$dat[0]] / 1000) > floor($ub[$dat[0]] / 1000))\n $ub[$dat[0]] = $score[$dat[0]];\n}\n$best = '';\nforeach ($score as $name => $val)\n if ($val > $score[$best]) $best = $name;\n\nprint $best.chr(10);\n?>"}, {"source_code": " $value) {\n if($data[$name]['score'] > $maxScore) {\n $maxScore = $data[$name]['score'];\n $maxDeep = $data[$name]['log'];\n $winName = $name;\n }\n elseif($data[$name]['score'] == $maxScore) {\n if($maxDeep > $data[$name]['log']) {\n $winName = $name;\n $maxDeep = $data[$name]['log'];\n }\n }\n }\n \n printf(\"%s\", $winName);\n?>"}, {"source_code": " $v) {\n if ($v[0] > $max) {\n $max = $v[0];\n $name = $k;\n $key = $v[1];\n } else if ($v == $max) {\n if ($key > $v[1]) {\n $name = $k;\n $key = $v[1];\n }\n }\n }\n return $name;\n}\n\n$in = fopen(STDIN,'r');\nwhile ($row = fscanf($in,\"%s %i\")) {\n $data[] = $row;\n}\n\n$line = array_shift($data);\n\n$max = 0;\n$name = '';\n$list = [];\nfor ($i=0;$i<$line[0];$i++) {\n if (!$list[$data[$i][0]]) {\n $list[$data[$i][0]] = [\n $data[$i][1],$i\n ];\n } else {\n $list[$data[$i][0]][0] += $data[$i][1];\n $list[$data[$i][0]][1] = $i;\n }\n}\n\necho _max($list);"}, {"source_code": " $j[$l[1]])\n {\n print $i[$k[$l[0]]];\n }\n else\n {\n $n = array_search($j[$k[0]], $m);\n print $i[$k[$l[$n]]];\n }\n}\n?>"}, {"source_code": " $max) {\n $max = $newMax;\n $maxPerson = $person;\n }\n}\n\n$a = $b = [];\n$max = -10000000000;\n$maxPerson = '';\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; ++$i) {\n list($person, $points) = fscanf($input, \"%s %d\\n\");\n\n foo($a, $b, $max, $maxPerson, $person, $points);\n}\n\nfwrite($output, $b[max($a)][0]);\n"}, {"source_code": " $players[$winner]) {\n $winner = $name;\n }\n}\n\necho $winner;"}, {"source_code": " $max) $max = $v;\n}\n\n$w = array();\nforeach($g as $k => $v){\n if($v == $max) $w[$k] = $v;\n}\n\nif(count($w) == 1){\n print array_search($max, $w);\n exit(0);\n}\n\n$g = array();\nforeach($s as $v){\n list($player, $score) = explode(' ',$v);\n $g[$player] += $score;\n if($g[$player] >= $max){\n print $player;\n exit(0);\n }\n}\n\n\n?>"}, {"source_code": " $str ) {\n $istr = explode( \" \", $str );\n $new[$istr[0]] += $istr[1];\n}\n\n$max = max($new);\n\nforeach( $in as $str ) {\n $istr = explode( \" \", $str );\n $new1[$istr[0]] += $istr[1];\n \n if ( $new1[$istr[0]] == $max AND $new[$istr[0]] == $max ) {\n echo $istr[0];\n break;\n }\n}"}, {"source_code": " $pi){\n $fi = explode(' ', $pi);\n $sorted[$fi[0]] += $fi[1];\n }\n $max = max($sorted);\n foreach($ps as $key => $pi){\n $fi = explode(' ', $pi);\n $scores[$fi[0]] += $fi[1];\n if($scores[$fi[0]] == $max){\n echo $fi[0];\n return;\n }\n }"}, {"source_code": " $j[$l[1]])\n {\n print $i[$k[$l[0]]];\n }\n else\n {\n $n = array_search($j[$k[0]], $m);\n print $i[$k[$l[$n]]];\n }\n}\n?>"}, {"source_code": "$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = intval($resultScore[$k]);\n if($addScore<0) {\n unset($resultNames[$k]);\n continue;\n }\n $max[$name] += $addScore;\n }\n\n $maxScore = max($max);\n\n $max = array();\n foreach($resultNames as $k=>$name){\n if(!isset($max[$name])) {\n $max[$name] = 0;\n }\n\n $addScore = $resultScore[$k];\n $max[$name] += $addScore;\n if($max[$name]>=$maxScore) {\n exit($name);\n }\n }\n"}], "src_uid": "c9e9b82185481951911db3af72fd04e7"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $ans)\r\n {\r\n $ans = ord($s[$i]) - 96;\r\n }\r\n }\r\n\r\n print($ans . \"\\n\");\r\n }"}, {"source_code": " $max){\r\n $max = strpos($alphabet, $letter[0][$j]) + 1;\r\n }\r\n }\r\n InOutPut::print($max);\r\n}\r\n\r\nclass InOutPut {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function getArr()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function print($string)\r\n {\r\n echo $string . \"\\n\";\r\n }\r\n}\r\n?>"}, {"source_code": "= $x ) {\r\n if($y % $x == 0) {\r\n $tc = $y/ $x;\r\n $a = $tc; \r\n $b = 1;\r\n } \r\n }\r\n echo $b, ' ', $a, $inter;\r\n \r\n// echo $ans, $inter;\r\n \r\n \r\n\r\n }\r\n// bcadd \u2014 Add two arbitrary precision numbers\r\n// bccomp \u2014 Compare two arbitrary precision numbers\r\n// bcdiv \u2014 Divide two arbitrary precision numbers\r\n// bcmod \u2014 Get modulus of an arbitrary precision number\r\n// bcmul \u2014 Multiply two arbitrary precision numbers\r\n// bcpow \u2014 Raise an arbitrary precision number to another\r\n// bcpowmod \u2014 Raise an arbitrary precision number to another, reduced by a specified modulus\r\n// bcscale \u2014 Set or get default scale parameter for all bc math functions\r\n// bcsqrt \u2014 Get the square root of an arbitrary precision number\r\n// bcsub \u2014 Subtract one arbitrary precision number from another\r\n function ComandR($aCordinate) {\r\n return [$aCordinate[0] + 1, $aCordinate[1]];\r\n }\r\n function ComandL($aCordinate) {\r\n return [$aCordinate[0] - 1, $aCordinate[1]];\r\n }\r\n function ComandU($aCordinate) {\r\n return [$aCordinate[0], $aCordinate[1] + 1];\r\n }\r\n function ComandD($aCordinate) {\r\n return [$aCordinate[0], $aCordinate[1] - 1];\r\n }\r\n \r\n function getT() {\r\n return trim(fgets(STDIN));\r\n }\r\n function getA() {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n \r\n function is_prime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n \t $d += 1;\r\n }\r\n \r\n return $d == $n;\r\n }\r\nfunction getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n \r\n function getMaxValueBc($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n function getRotate($a, $s, $e, $ind) {\r\n \t\t$ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n \t$ar[$i] = $a[$i];\r\n \t$j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n \t// echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\"; \r\n \t$a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n } ", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "= $x ) {\r\n if($y % $x == 0) {\r\n $tc = $y/ $x;\r\n $a = $tc; \r\n $b = 1;\r\n } \r\n }\r\n echo $a, ' ', $b, $inter;\r\n \r\n// echo $ans, $inter;\r\n \r\n \r\n\r\n }\r\n// bcadd \u2014 Add two arbitrary precision numbers\r\n// bccomp \u2014 Compare two arbitrary precision numbers\r\n// bcdiv \u2014 Divide two arbitrary precision numbers\r\n// bcmod \u2014 Get modulus of an arbitrary precision number\r\n// bcmul \u2014 Multiply two arbitrary precision numbers\r\n// bcpow \u2014 Raise an arbitrary precision number to another\r\n// bcpowmod \u2014 Raise an arbitrary precision number to another, reduced by a specified modulus\r\n// bcscale \u2014 Set or get default scale parameter for all bc math functions\r\n// bcsqrt \u2014 Get the square root of an arbitrary precision number\r\n// bcsub \u2014 Subtract one arbitrary precision number from another\r\n function ComandR($aCordinate) {\r\n return [$aCordinate[0] + 1, $aCordinate[1]];\r\n }\r\n function ComandL($aCordinate) {\r\n return [$aCordinate[0] - 1, $aCordinate[1]];\r\n }\r\n function ComandU($aCordinate) {\r\n return [$aCordinate[0], $aCordinate[1] + 1];\r\n }\r\n function ComandD($aCordinate) {\r\n return [$aCordinate[0], $aCordinate[1] - 1];\r\n }\r\n \r\n function getT() {\r\n return trim(fgets(STDIN));\r\n }\r\n function getA() {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n \r\n function is_prime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n \t $d += 1;\r\n }\r\n \r\n return $d == $n;\r\n }\r\nfunction getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n \r\n function getMaxValueBc($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n function getRotate($a, $s, $e, $ind) {\r\n \t\t$ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n \t$ar[$i] = $a[$i];\r\n \t$j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n \t// echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\"; \r\n \t$a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n } "}], "src_uid": "f7defb09175c842de490aa13a4f5a0c9"} {"source_code": " 1) {\n\t\t++$cnt;\n\t\t$ans[] = 1;\n\t}\n\t$ans[] = $arr[$i];\n}\necho $cnt.\"\\n\";\nforeach ($ans as $key => $value) {\n\tif($key == $n + $cnt - 1) {\n\t\techo $value.\"\\n\";\n\t} else {\n\t\techo $value.' ';\n\t}\n}\n?>", "positive_code": [{"source_code": " 0) {\n return gcd($m, $n % $m);\n } else {\n return abs($n);\n }\n}\n$c = trim(fgets(STDIN));\n$d = explode(\" \", trim(fgets(STDIN)));\n$f = 0;\nfor($x = 0; $x < $c - 1; $x++)\n{\n $e = gcd($d[$x], $d[$x + 1]);\n if($e != 1)\n {\n $d[$x] = $d[$x] . \" 1\";\n $f++;\n }\n}\nprint $f . \"\\n\";\nprint implode(\" \", $d);\n?>"}], "negative_code": [{"source_code": " 0) {\n return gcd($m, $n % $m);\n } else {\n return abs($n);\n }\n}\n$c = trim(fgets(STDIN));\n$d = explode(\" \", trim(fgets(STDIN)));\nfor($x = 0; $x < $c - 1; $x++)\n{\n $e = gcd($d[$x], $d[$x + 1]);\n if($e != 1)\n {\n $f = array_slice($d, 0, $x + 1);\n $g = array_slice($d, $x + 1);\n $d = array_merge($f, array(1), $g);\n $x = -1;\n }\n}\nprint (count($d) - $c) . \"\\n\";\nprint implode(\" \", $d);\n?>"}, {"source_code": ""}], "src_uid": "b0b4cadc46f9fd056bf7dc36d1cf51f2"} {"source_code": " $sum - max($a) ? 'YES' : 'NO').PHP_EOL;\r\n}\r\n", "positive_code": [{"source_code": "= 1) { $f = 1; break; }\r\n\t}\r\n\t\t\r\n if ($f == 1) { echo 'YES'.PHP_EOL; }\r\n else { echo 'NO'.PHP_EOL; }\r\n}\r\n?>"}], "negative_code": [{"source_code": " $cnt) {\r\n $flg = false;\r\n break;\r\n }\r\n $bx -= $cntx * $a[$j];\r\n }\r\n echo ($flg ? 'YES' : 'NO').PHP_EOL;\r\n}\r\n"}, {"source_code": ""}], "src_uid": "b63a6369023642a8e7e8f449d7d4b73f"} {"source_code": " 1, b => 2, c => 3, d => 4, e => 5, f => 6, g => 7, h => 8, i => 9, j => 10, k => 11, l => 12, m => 13, n => 14, o => 15, p => 16, q => 17, r => 18, s => 19, t => 20, u => 21, v => 22, w => 23, x => 24, y => 25, z => 26);\nfor($x = 1; $x <= $a; $x++)\n{\n $c = str_split(trim(fgets(STDIN)));\n rsort($c);\n $d = array();\n for($y = 0; $y < count($c); $y++)\n {\n $d[$y] = $b[$c[$y]];\n }\n $e = 0;\n for($y = 0; $y < count($c) - 1; $y++)\n {\n if($d[$y] - $d[$y + 1] != 1)\n {\n $e = 1;\n break;\n }\n }\n if($e == 0)\n {\n print \"Yes\\n\";\n }\n else\n {\n print \"No\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n } else {\n if(isset($b[$i - 1]) && $b[$i - 1] != -1 && !isset($arr[$i - 1])){\n $count++;\n $all += $b[$i - 1];\n $arr[$i - 1] = 1;\n }\n if(isset($b[$i + 1]) && $b[$i + 1] != -1 && !isset($arr[$i + 1])){\n $count++;\n $all += $b[$i + 1];\n $arr[$i + 1] = 1;\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = round(($max + $min)/ 2);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if($bool3 || abs($x - $z) > $m){\n $m = abs($x - $z);\n $bool3 = false;\n }\n }\n }\n echo $m.\" \".$k.\"\\n\";\n \n}", "positive_code": [{"source_code": " $d)\n {\n $d = $c[$y - 1];\n }\n if($c[$y - 1] < $e)\n {\n $e = $c[$y - 1];\n }\n }\n if(($c[$y + 1] !== NULL) && ($c[$y + 1] != \"-1\"))\n {\n if($c[$y + 1] > $d)\n {\n $d = $c[$y + 1];\n }\n if($c[$y + 1] < $e)\n {\n $e = $c[$y + 1];\n }\n }\n }\n }\n if($e == \"1000000001\")\n {\n print \"0 0\\n\";\n }\n else\n {\n $f = ceil(($e + $d) / 2);\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"-1\")\n {\n $c[$y] = $f;\n }\n }\n $g = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n $h = abs($c[$y] - $c[$y + 1]);\n if($h > $g)\n {\n $g = $h;\n }\n }\n print $g . \" \" . $f . \"\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": " $c2)\n {\n $c2 = $c[$y];\n }\n if($c[$y] < $c3)\n {\n $c3 = $c[$y];\n }\n }\n }\n $d = $c2 + $c3;\n if($d % 2 == 0)\n {\n $d /= 2;\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"-1\")\n {\n $c[$y] = $d;\n }\n }\n $e = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n $f = abs($c[$y] - $c[$y + 1]);\n if($f > $e)\n {\n $e = $f;\n }\n }\n print $e . \" \" . $d . \"\\n\";\n }\n else\n {\n if($d == \"1000000001\")\n {\n print \"0 0\\n\";\n }\n else\n {\n $d = ceil($d / 2);\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"-1\")\n {\n $c[$y] = $d;\n }\n }\n $e = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n $f = abs($c[$y] - $c[$y + 1]);\n if($f > $e)\n {\n $e = $f;\n }\n }\n print $e . \" \" . $d . \"\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " $c2)\n {\n $c2 = $c[$y];\n }\n if($c[$y] < $c3)\n {\n $c3 = $c[$y];\n }\n }\n else\n {\n $d2++;\n if($y == 0)\n {\n $d = $c[$y + 1];\n $d3 = $c[$y + 1];\n }\n elseif($y == $b - 1)\n {\n $d = $c[$y - 1];\n $d3 = $c[$y - 1];\n }\n else\n {\n $d = ceil(abs($c[$y - 1] + $c[$y + 1]) / 2);\n $d3 = $c[$y - 1];\n }\n }\n }\n if($d2 == 1)\n {\n print abs($d3 - $d) . \" \" . $d . \"\\n\";\n }\n else\n {\n $d = $c2 + $c3;\n if($d % 2 == 0)\n {\n $d /= 2;\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"-1\")\n {\n $c[$y] = $d;\n }\n }\n $e = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n $f = abs($c[$y] - $c[$y + 1]);\n if($f > $e)\n {\n $e = $f;\n }\n }\n print $e . \" \" . $d . \"\\n\";\n }\n else\n {\n if($d == \"1000000001\")\n {\n print \"0 0\\n\";\n }\n else\n {\n $d = ceil($d / 2);\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"-1\")\n {\n $c[$y] = $d;\n }\n }\n $e = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n $f = abs($c[$y] - $c[$y + 1]);\n if($f > $e)\n {\n $e = $f;\n }\n }\n print $e . \" \" . $d . \"\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " $c2)\n {\n $c2 = $c[$y];\n }\n if($c[$y] < $c3)\n {\n $c3 = $c[$y];\n }\n }\n }\n $d = $c2 + $c3;\n if($d % 2 == 0)\n {\n $d /= 2;\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"-1\")\n {\n $c[$y] = $d;\n }\n }\n $e = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n $f = abs($c[$y] - $c[$y + 1]);\n if($f > $e)\n {\n $e = $f;\n }\n }\n print $e . \" \" . $d . \"\\n\";\n }\n else\n {\n if($d == \"1000000001\")\n {\n print \"0 0\\n\";\n }\n else\n {\n $d = ceil($d / 2);\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"-1\")\n {\n $c[$y] = $d;\n }\n }\n $e = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n $f = abs($c[$y] - $c[$y + 1]);\n if($f > $e)\n {\n $e = $f;\n }\n }\n print $e . \" \" . $d . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n } else {\n if(isset($b[$i - 1]) && $b[$i - 1] != -1){\n $count++;\n $all += $b[$i - 1];\n }\n if(isset($b[$i + 1]) && $b[$i + 1] != -1){\n $count++;\n $all += $b[$i + 1];\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = ceil($all / $count);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if($bool3 || abs($x - $z) > $m){\n $m = abs($x - $z);\n $bool3 = false;\n }\n }\n }\n \n echo $m.\" \".$k.\"\\n\";\n \n}\n"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n }\n }\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = round($all / $count);\n $m = $k - $min > $max - $k ? $k - $min : $max - $k;\n }\n \n echo $m.\" \".$k.\"\\n\";\n \n}\n"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n } else {\n if(isset($b[$i - 1]) && $b[$i - 1] != -1 && !isset($arr[$i - 1])){\n $count++;\n $all += $b[$i - 1];\n $arr[$i - 1] = 1;\n }\n if(isset($b[$i + 1]) && $b[$i + 1] != -1 && !isset($arr[$i + 1])){\n $count++;\n $all += $b[$i + 1];\n $arr[$i + 1] = 1;\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = ceil(($max + $min) / 2);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if($bool3 || abs($x - $z) > $m){\n $m = abs($x - $z);\n $bool3 = false;\n }\n }\n }\n echo $m.\" \".$k.\"\\n\";\n \n}"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n } else {\n if(isset($b[$i - 1]) && $b[$i - 1] != -1){\n $count++;\n $all += $b[$i - 1];\n }\n if(isset($b[$i + 1]) && $b[$i + 1] != -1){\n $count++;\n $all += $b[$i + 1];\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = round($all / $count);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if($bool3 || abs($x - $z) > $m){\n $m = abs($x - $z);\n $bool3 = false;\n }\n }\n }\n \n echo $m.\" \".$k.\"\\n\";\n \n}\n"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = round(($max + $min) / 2);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if(abs($x - $z) > $m){\n $m = abs($x - $z);\n }\n }\n }\n echo $m.\" \".$k.\"\\n\";\n \n}"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = round($all / $count);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if($bool3 || abs($x - $z) > $m){\n $m = abs($x - $z);\n $bool3 = false;\n }\n }\n }\n \n echo $m.\" \".$k.\"\\n\";\n \n}\n"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = ceil(($max + $min) / 2);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if(abs($x - $z) > $m){\n $m = abs($x - $z);\n }\n }\n }\n echo $m.\" \".$k.\"\\n\";\n \n}"}, {"source_code": " $b[$i]){\n $min = $b[$i];\n $bool2 = false;\n }\n } else {\n if(isset($b[$i - 1]) && $b[$i - 1] != -1 && !isset($arr[$i - 1])){\n $count++;\n $all += $b[$i - 1];\n $arr[$i - 1] = 1;\n }\n if(isset($b[$i + 1]) && $b[$i + 1] != -1 && !isset($arr[$i + 1])){\n $count++;\n $all += $b[$i + 1];\n $arr[$i + 1] = 1;\n }\n }\n }\n $bool3 = true;\n $m = 0;\n if($bool && $bool2){\n $k = 5;\n $m = 0;\n } else {\n $k = ceil($all / $count);\n for($h = 1; $h < $a; $h++){\n if($b[$h] == -1){\n $x = $k;\n }\n if($b[$h] != -1){\n $x = $b[$h];\n }\n if($b[$h-1] == -1){\n $z = $k;\n }\n if($b[$h-1] != -1){\n $z = $b[$h-1];\n }\n if($bool3 || abs($x - $z) > $m){\n $m = abs($x - $z);\n $bool3 = false;\n }\n }\n }\n echo $m.\" \".$k.\"\\n\";\n \n}\n"}], "src_uid": "8ffd80167fc4396788b745b53068c9d3"} {"source_code": ""}, {"source_code": " $i) {\n if (isset($a2[$s])) {\n if ($a1[$s] >= $a2[$s]) {\n $iMatchCount += $a2[$s];\n $a1[$s] = $i - $a2[$s]; \n $a2[$s] = 0;\n \n }\n else {\n $iMatchCount += $i;\n $a1[$s] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n \n }\n \n}\n\nforeach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtolower($s);\n if ($i == 0) {\n continue;\n }\n \n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n \n}\n\nforeach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtoupper($s);\n if ($i == 0) {\n continue;\n }\n \n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n \n}\n\necho $iMatchCount . ' ' . $iDismatchCount;\nfclose($r);\nexit();\n?>"}, {"source_code": " $i) {\n if (isset($a2[$s])) {\n if ($a1[$s] >= $a2[$s]) {\n $iMatchCount += $a2[$s];\n $a1[$s] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iMatchCount += $i;\n $a1[$s] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n }\n }\n foreach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtolower($s);\n if ($i == 0) {\n continue;\n }\n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n }\n foreach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtoupper($s);\n if ($i == 0) {\n continue;\n }\n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n}\nprint $iMatchCount . ' ' . $iDismatchCount;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " $i) {\n if (isset($a2[$s])) {\n if ($a1[$s] >= $a2[$s]) {\n $iMatchCount += $a2[$s];\n $a1[$s] = $i - $a2[$s]; \n $a2[$s] = 0;\n \n }\n else {\n $iMatchCount += $i;\n $a1[$s] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n \n }\n \n}\n\nforeach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtolower($s);\n if ($i == 0) {\n continue;\n }\n \n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n \n}\n\nforeach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtoupper($s);\n if ($i == 0) {\n continue;\n }\n \n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = 0; \n $a2[$s] = $a2[$s] - $i;\n }\n \n}\n\n\nprint_r($a1);\nprint_r($a2);\necho $iMatchCount . ' ' . $iDismatchCount;\nfclose($r);\nexit();\n?>"}, {"source_code": " $i) {\n if (isset($a2[$s])) {\n if ($a1[$s] >= $a2[$s]) {\n $iMatchCount += $a2[$s];\n $a1[$s] = $i - $a2[$s]; \n $a2[$s] = 0;\n \n }\n else {\n $iMatchCount += $i;\n $a1[$s] = $i - $a2[$s]; \n $a2[$s] = $a2[$s] - $i;\n }\n \n }\n \n}\n\nforeach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtolower($s);\n if ($i == 0) {\n continue;\n }\n \n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = $a2[$s] - $i;\n }\n \n}\n\nforeach ($a1 AS $s => $i) {\n $sOrig = $s;\n $s = strtoupper($s);\n if ($i == 0) {\n continue;\n }\n \n if (!isset($a2[$s]) || $a2[$s] == 0) {\n continue;\n }\n else if ($i >= $a2[$s]) {\n $iDismatchCount += $a2[$s];\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = 0;\n }\n else {\n $iDismatchCount += $i;\n $a1[$sOrig] = $i - $a2[$s]; \n $a2[$s] = $a2[$s] - $i;\n }\n \n}\n\necho $iMatchCount . ' ' . $iDismatchCount;\nfclose($r);\nexit();\n?>"}, {"source_code": " $i) {\n if (!isset($a2[$s])) {\n $iDismatchCount += $i;\n }\n else if ($a1[$s] == $a2[$s]) {\n $iMatchCount += $a2[$s];\n }\n else if ($a1[$s] - $a2[$s] > 0) {\n $iDiff = $a1[$s] - $a2[$s];\n $iMatchCount += $a2[$s];\n $iDismatchCount += $iDiff; \n }\n\n \n}\n\necho $iMatchCount . ' ' . $iDismatchCount;\nfclose($r);\nexit();\n?>"}], "src_uid": "96e2ba997eff50ffb805b6be62c56222"} {"source_code": "\n$number = 0;\nfscanf(STDIN, \"%d\\n\", $number);\n$ans = \"\";\nwhile ($number > 1){\n if ($number > 5){\n \t$ans = $ans . \"11\";\n \t$number = $number - 4;\n }\n if ($number == 5){\n\t $ans = \"71\" . $ans;\n $number = $number - 5;\n }\n if ($number == 4){\n\t $ans = \"11\" . $ans;\n $number = $number - 4;\n }\n if ($number == 3){\n\t $ans = \"7\" . $ans;\n $number = $number - 3;\n }\n if ($number == 2){\n\t $ans = \"1\" . $ans;\n $number = $number - 2;\n }\n}\n\nfwrite(STDOUT, $ans);\n?>", "positive_code": [{"source_code": "= 2)\n{\n if ($n == 3)\n {\n $ans = \"7\".$ans;\n $n -= 3;\n }\n else \n {\n $ans = \"1\".$ans;\n $n -= 2;\n }\n \n}\nprintf(\"%s\\n\",$ans);\n\n?>"}, {"source_code": "= 2; $n = $n - 2) echo '1';"}, {"source_code": " 0)\n{\n printf(\"1\");\n $n -= 2;\n}\n?>"}, {"source_code": ""}, {"source_code": " "}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": " "}, {"source_code": ""}, {"source_code": " 0) {\n if ($n % 2 == 1) { echo '7'; $n = $n - 3; }\n else { echo '1'; $n = $n - 2; }\n }\n"}, {"source_code": ""}, {"source_code": "=2) {\n echo 1;\n $n -= 2;\n }\n \n?> "}, {"source_code": " 3) {\n \t\n \t\t\t$ret .= \"1\";\n $n--;\n $n--;\n }\n if ($n == 3) {\n \techo \"7\";\t\n }\n else {\n \techo \"1\";\n }\n echo $ret;\n \n?> "}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n{\n printf(\"1\");\n $n-=2;\n}\n?>"}, {"source_code": "= 2; $n = $n - 2)\n{\n\techo \"1\";\n}\n?>"}, {"source_code": "=2)\n \t{\n \t\techo 1;\n \t\t$a-=2;\n \t}\n }\n else \n {\n while($a)\n {\n echo 1;\n $a-=2;\n }\n }\n ?>"}, {"source_code": " "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "10)\n\t\tprintf(\"%s%d%s\\n\",$a[0],strlen($a)-2,$a[strlen($a)-1]);\n\telse\n\t\tprintf(\"%s\\n\",$a);\n}*/\n\n?>"}, {"source_code": " "}, {"source_code": " 0) {\n printf(\"1\");\n $number -= 2;\n}\n?>"}, {"source_code": " 0; $i++){\n echo 1;\n $n -= 2;\n }\n?>"}], "negative_code": [{"source_code": "= 4; $n = $n - 2)\n{\n\techo \"1\";\n}\nif($n == 3){\n echo \"7\";\n}else{\n echo \"1\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n$number = 0;\nfscanf(STDIN, \"%d\\n\", $number);\n$ans = \"\";\nwhile ($number > 3){\n\t$ans = $ans . \"11\";\n\t$number = $number - 4; \n}\nif ($number == 3){\n\t$ans = \"7\" . $ans;\n}\nif ($number == 2){\n\t$ans = \"1\" . $ans;\n}\n\nfwrite(STDOUT, $ans);\n?>"}, {"source_code": " 3; $i++){\n echo 1;\n $n -= 2;\n }\n if ($n == 3)\n\techo 7;\n else\n\techo 1;\n?>"}, {"source_code": ""}, {"source_code": " 0) {\n $kek = 0;\n for ($i = 9; $i >= 0; $i--) {\n if ($n >= $arr[$i]) {\n $n -= $arr[$i];\n $ans .= ((string) $i);\n $kek = 1;\n break;\n }\n }\n if ($kek == 0) {\n \tbreak;\n }\n}\nprintf(\"%s\\n\",$ans);\n?>"}, {"source_code": " "}, {"source_code": "=6) {\n echo 9;\n $n -= 6;\n }\n \n if ($n == 3) {\n echo 7;\n } else if ($n == 5) {\n echo 5;\n } else if ($n == 4) {\n echo 4;\n } else if ($n == 2) {\n echo 1;\n }\n?> "}, {"source_code": "= 4)\n{\n for( $i = 1; $i <= $a/2; $i++ )\n echo 1;\n}\nelse if( $a == 3 )\n{\n echo 7;\n}\nelse \n{\n echo 1;\n}\n?>"}, {"source_code": "= 0; --$i) {\n $x = $i;\n $curr = 0;\n\n while ($x >= 1) {\n $curr = $curr + $ve[$x%10];\n $x = floor($x/10 + 0.00000001);\n }\n\n if ($curr <= $n) {\n $ok = 0;\n echo $i;\n }\n}\n?>\n"}, {"source_code": "\n"}, {"source_code": "= 0; --$i) {\n $x = $i;\n $curr = 0;\n\n while ($x >= 1) {\n $curr = $curr + $ve[$x%10];\n $x = floor($x/10);\n }\n\n if ($curr <= $n) {\n $ok = 0;\n echo $i;\n }\n}\n?>\n"}, {"source_code": "= 0; --$i) {\n $x = $i;\n $curr = 0;\n\n while ($x >= 1) {\n $y = $x;\n $x = round($x / 10);\n \n $y = ($x - 10*$y);\n $curr = (int) $curr + (int) $ve[$y];\n $x = round($x/10);\n }\n \n\n if ($curr <= $n) {\n $ok = 0;\n echo $i;\n }\n}\n?>\n"}, {"source_code": "= 0; --$i) {\n $x = $i;\n $curr = 0;\n\n while ($x >= 1) {\n $curr = (int) $curr + (int) $ve[($x%10)];\n $x /= 10;\n }\n \n\n if ($curr <= $n) {\n $ok = 0;\n echo $i;\n }\n}\n?>\n"}, {"source_code": "= 0; --$i) {\n $x = $i;\n $curr = 0;\n\n while ($x >= 1) {\n $curr = $curr + $ve[$x%10];\n $x = floor($x/10);\n }\n\n if ($curr <= $n) {\n $ok = 0;\n echo $i;\n }\n}\n?>\n"}, {"source_code": ""}], "src_uid": "4ebea3f56ffd43efc9e1496a0ef7fa2d"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $mx) {\n $mx = $v;\n }\n}\n\n$v = 60 * 24 - ($a[count($a) - 1] - $a[0] + 1);\nif ($v > $mx) {\n $mx = $v;\n}\n\necho str_pad(floor($mx / 60), 2, \"0\", STR_PAD_LEFT) . \":\" . str_pad($mx % 60, 2, \"0\", STR_PAD_LEFT);\n\n\n\n?>\n"}, {"source_code": " $mx) {\n $mx = $now;\n }\n}\n\nif ($now > $mx) {\n $mx = $now;\n}\n\n$h = $mx / 60;\n$m = $mx % 60;\n\nif ($h < 10) {\n fprintf(STDOUT, \"0%d:\", $h);\n} else {\n fprintf(STDOUT, \"%d:\", $h);\n}\n\nif ($m < 10) {\n fprintf(STDOUT, \"0%d\", $m);\n} else {\n fprintf(STDOUT, \"%d\", $m);\n}"}, {"source_code": ""}, {"source_code": " $ans) {\n $ans = $diff;\n }\n // var_dump($diff);\n}\n\n// var_dump($ans);\nprint(to_date($ans - 1));\n"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c3b0b7194ce018bea9c0b9139e537a09"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "475239ff4ae3675354d2229aba081a58"} {"source_code": "", "positive_code": [{"source_code": " $maxi)\n {\n $maxi = $m[$x]; // The max occurrence times\n $mini = $i - $L[$x] + 1; // The subsegment length (We should count the start and end both)\n $ch = $L[$x] + 1; // Output is to start from 1 as beginning the input array\n }\n // The length is shorter, we change the start and min length\n else if ($m[$x] == $maxi && $i - $L[$x] + 1 < $mini)\n {\n $mini = $i - $L[$x] + 1;\n $ch = $L[$x] + 1;\n }\n}\n\necho $ch . \" \" . ($ch + $mini - 1);\n\n\n\n"}], "negative_code": [{"source_code": "= 0; $y--)\n {\n if($e[$x] == $b[$y])\n {\n $j[$k] = $y + 1;\n $k++;\n break;\n }\n }\n}\n$k = array();\nfor($x = 0; $x < count($e); $x++)\n{\n $l = $j[$x] - $h[$x];\n $k[$x] = $l;\n}\n$m = max($k);\nfor($x = 0; $x < count($e); $x++)\n{\n if($k[$x] == $m)\n {\n break;\n }\n}\nprint $h[$x] . \" \" . $j[$x];\n?>"}, {"source_code": ""}, {"source_code": " $maxi)\n {\n $maxi = $m[$x]; // The max occurrence times\n $mini = $i - $L[$x] + 1; // The subsegment length (We should count the start and end both)\n $ch = $L[$x] + 1; // Output is to start from 1 as beginning the input array\n }\n // The length is shorter, we change the start and min length\n else if ($m[$x] == $maxi && $i - $L[$x] + 1 < $mini)\n {\n $mini = $i - $L[$x] + 1;\n $ch = $L[$x] + 1;\n }\n}\n\necho $ch . \" \" . ($ch + $mini - 1);\n\n\n\n"}], "src_uid": "ecd9bbc05b97f3cd43017dd0eddd014d"} {"source_code": "= $l-1 && $i <= $r-1) {\n $checka[] = (int)$arra[$i];\n //printf(\"%d \",(int)$arra[$i]);\n }\n}\nfor($i=0;$i<$n;++$i)\n{\n if ($i >= $l-1 && $i <= $r-1) {\n $checkb[] = (int)$arrb[$i];\n }\n else {\n if ($arra[$i] != $arrb[$i]) $flag = 1;\n }\n}\n\nsort ($checka);\nsort($checkb);\nfor($i=0;$i<$r-$l+1;++$i) {\n //printf(\"%d \",$checka[$i]);\n if ($checka[$i] != $checkb[$i]) $flag = 1;\n}\nif ($flag == 0) {\n printf(\"TRUTH\");\n}\nelse {\n printf(\"LIE\");\n}\n?>\n"}, {"source_code": " "}, {"source_code": " $r) {\n if ($a[$i] != $b[$i]) {\n $ok = false;\n break;\n }\n }\n}\n\nif ($ok) {\n echo \"TRUTH\";\n}\nelse {\n echo \"LIE\";\n}\n\n?>\n"}, {"source_code": " "}, {"source_code": ""}, {"source_code": "= $L && $i <= $R){\n $box1[ (int)$arr[0][$i] ]++;\n $box2[ (int)$arr[1][$i] ]++;\n }else if( $arr[0][$i] != $arr[1][$i] ){\n printf(\"LIE\\n\");\n return;\n }\n}\nif( count( $box1 ) != count( $box2 ) ){\n printf(\"LIE\\n\");\n return;\n}\n\nforeach( $box1 as $i => $v){\n //printf(\"(%d, %d) vs (%d, %d)\\n\", $i, $v, $i, $box1[$i]);\n if( $v != $box2[$i] ){\n printf(\"LIE\\n\");\n return;\n }\n}\nprintf(\"TRUTH\\n\");\n\n?>\n"}, {"source_code": "=$r) {\n if((int)$a[$i]!=(int)$b[$i]) $ans = false;\n }\n }\n \n //print_r($a);\n //print_r(array($l, $r));\n \n if($ans) printf(\"TRUTH\");\n else printf(\"LIE\");\n?>"}, {"source_code": " $value) {\n$arr1[$key] = (int) $value;\n}\nforeach ($arr2 as $key => $value) {\n$arr2[$key] = (int) $value;\n}\n $a = array_slice($arr1, 0, $l-1);\n $b = array_slice($arr2, 0, $l-1);\n $a2 = array_slice($arr1, $r, count($arr1)-$r);\n $b2 = array_slice($arr2, $r, count($arr1)-$r);\n $a1 = array_slice($arr1, $l-1, $r-$l+1);\n $b1 = array_slice($arr2, $l-1, $r-$l+1);\n sort($a1);\n sort($b1);\n\n if ($a1 == $b1 and $a == $b and $a2 == $b2) {\n echo \"TRUTH\";\n } else {\n echo \"LIE\";\n }\n?> \n"}, {"source_code": ""}, {"source_code": "\n$stdin = fopen('php://stdin', 'r');\n$a = fgets($stdin);\n$t = explode(\" \", $a);\n$n = $t[0] + 0;\n$l = $t[1] - 1;\n$r = $t[2] - 1;\n\n$a = fgets($stdin);\n$a = explode(\" \", $a);\n\n$b = fgets($stdin);\n$b = explode(\" \", $b);\n\n\n$stdout = fopen('php://stdout', 'w');\n\n\nfor($i = 0; $i < $n; $i++){\n if($a[$i] != $b[$i]){\n if($i < $l || $i > $r){\n fwrite($stdout, \"LIE\");\n die();\n }\n }\n}\n\n\nfwrite($stdout, \"TRUTH\");\n\n\n\nfclose($stdout);"}, {"source_code": ""}, {"source_code": " \n"}, {"source_code": " "}, {"source_code": "= $l && $i <= $r) {\n\t\tif (!array_key_exists($x, $cnts)) {\n\t\t\t$cnts[$x] = 0;\n\t\t}\n\t\t$cnts[$x] += 1;\n\t}\n}\n\n$b = explode(\" \", trim(fgets($fl)));\nfor ($i = 1; $i <= $n; ++$i) {\n\t$x = intval($b[$i - 1]);\n\tif ($i >= $l && $i <= $r) {\n\t\tif (!array_key_exists($x, $cnts) || $cnts[$x] == 0) {\n\t\t\techo \"LIE\";\n\t\t\tdie();\n\t\t} else {\n\t\t\t$cnts[$x] -= 1;\n\t\t}\n\t} else {\n\t\tif ($x != intval($a[$i - 1])) {\n\t\t\techo \"LIE\";\n\t\t\tdie();\n\t\t}\n\t}\n}\n\necho \"TRUTH\";\n?>\n"}, {"source_code": " = $l && $x <= $r){\n $ar[$cur]++;\n }else{\n $a[] = $cur;\n }\n }\n\n for($x=1;$x<=$n;$x++){\n $cur = (int)$line3[$x - 1];\n \n if($x >= $l && $x <= $r){\n $ar[$cur]--;\n }else{\n $b[] = $cur;\n }\n }\n \n for ($i = 0 ; $i - 2 < $n ; ++$i) {\n if($ar[$i] != 0) $flag = 0;\n }\n for($i = 0 ; $i < count($a) ; ++$i){\n if($a[$i] != $b[$i]) $flag = 0;\n }\n\n $ans = \"LIE\";\n if($flag == 1){\n $ans = \"TRUTH\";\n }\n echo $ans;\n \n ?> "}, {"source_code": ""}], "negative_code": [{"source_code": "= $l-1 && $i <= $r-1) {\n $checka[] = (int)$arra[$i];\n //printf(\"%d \",(int)$arra[$i]);\n }\n}\nfor($i=0;$i<$n;++$i)\n{\n if ($i >= $l-1 && $i <= $r-1) {\n $checkb[] = (int)$arrb[$i];\n }\n}\nsort ($checka);\nsort($checkb);\nfor($i=0;$i<$r-$l+1;++$i) {\n //printf(\"%d \",$checka[$i]);\n if ($checka[$i] != $checkb[$i]) $flag = 1;\n}\nif ($flag == 0) {\n printf(\"TRUTH\");\n}\nelse {\n printf(\"LIE\");\n}\n?>\n"}, {"source_code": "= l-1 && $i <= r-1) {\n $checka[$arra[$i]]++;\n }\n}\nfor($i=0;$i<$n;++$i)\n{\n if ($i >= l-1 && $i <= r-1) {\n $checkb[$arrb[$i]]++;\n }\n}\nfor($i=0;$i<100001;++$i) {\n if ($checka[$i] != $checkb[$i]) $flag = 1;\n}\nif (!$flag) {\n printf(\"TRUTH\");\n}\nelse {\n printf(\"LIE\");\n}\n?>\n"}, {"source_code": "= $L && $i <= $R){\n $box[0][ $arr[0][$i] ]++;\n $box[1][ $arr[1][$i] ]++;\n }else if( $arr[0][$i] != $arr[1][$i] ){\n printf(\"LIE\\n\");\n return;\n }\n}\nif( count( $box[0] ) != count( $box[1] ) ){\n printf(\"LIE\\n\");\n return;\n}\n\nforeach( $box[0] as $i => $v){\n //printf(\"(%d, %d) vs (%d, %d)\\n\", $i, $v, $i, $box[1][$i]);\n if( $v != $box[1][$i] ){\n printf(\"LIE\\n\");\n return;\n }\n}\nprintf(\"TRUTH\\n\");\n\n?>\n"}, {"source_code": " = $l && $x <= $r)\n $ar[$cur]++;\n }\n\n for($x=1;$x<=$n;$x++){\n $cur = (int)$line3[$x - 1];\n \n if($x >= $l && $x <= $r){\n $ar[$cur]--;\n }\n }\n \n for ($i = 0 ; $i - 2 < $n ; ++$i) {\n if($ar[$i] != 0) $flag = 0;\n }\n\n $ans = \"LIE\";\n if($flag == 1){\n $ans = \"TRUTH\";\n }\n echo $ans;\n \n ?> "}, {"source_code": " = $l && $x <= $r)\n $ar[$cur]++;\n }\n\n for($x=1;$x<=$n;$x++){\n $cur = (int)$line3[$x - 1];\n \n if($x >= $l && $x <= $r){\n $ar[$cur]--;\n }\n }\n \n foreach ($ar as $key => $value) {\n if($value != 0) $flag = 0;\n }\n\n $ans = \"LIE\";\n if($flag == 1){\n $ans = \"TRUTH\";\n }\n echo $ans;\n \n ?> "}, {"source_code": ""}, {"source_code": "= $l && $i <= $r) {\n\t\tif (!array_key_exists($x, $cnts)) {\n\t\t\t$cnts[$x] = 0;\n\t\t}\n\t\t$cnts[$x] += 1;\n\t}\n}\n\n$a = explode(\" \", trim(fgets($fl)));\nfor ($i = 1; $i <= $n; ++$i) {\n\t$x = intval($a[$i - 1]);\n\tif ($i >= $l && $i <= $r) {\n\t\tif (!array_key_exists($x, $cnts) || $cnts[$x] == 0) {\n\t\t\techo \"LIE\";\n\t\t\tdie();\n\t\t} else {\n\t\t\t$cnts[$x] -= 1;\n\t\t}\n\t}\n}\n\necho \"TRUTH\";\n?>\n"}], "src_uid": "1951bf085050c7e32fcf713132b30605"} {"source_code": "", "positive_code": [{"source_code": " 0) {\n\t\n\t$b = array_unique($a);\n\tsort($b);\n\n\tfor ($i=0; $i < count($b); $i++) { \n\t\tunset($a[array_search($b[$i], $a)]);\n\t}\n\n\t$c = array_merge($c, $b);\n}\n\nfor ($i=1; $i < count($c); $i++) { \n\tif ($c[$i] > $c[$i-1]) $m++;\n}\n\nprint $m;\n?>"}], "negative_code": [], "src_uid": "30ad5bdc019fcd8a4e642c90decca58f"} {"source_code": "= $ans && $t){\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\t\n\t//print_r($cur);\n\techo (count($cur) == 1 ? ($n == 1 ? 1 : $ans+1) : $ans+1);\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "= 0; $x--)\n {\n if(max($c) - min($c) == 0)\n {\n print $x + 2;\n break;\n }\n elseif(max($c) - min($c) == 1)\n {\n print $x + 1;\n break;\n }\n $c[$b[$x]]--;\n if($c[$b[$x]] == 0)\n {\n unset($c[$b[$x]]);\n }\n }\n }\n }\n elseif(max($c) - min($c) == 1)\n {\n print $a;\n }\n else\n {\n for($x = $a - 1; $x >= 0; $x--)\n {\n if(max($c) - min($c) == 0)\n {\n print $x + 2;\n break;\n }\n elseif(max($c) - min($c) == 1)\n {\n print $x + 1;\n break;\n }\n $c[$b[$x]]--;\n if($c[$b[$x]] == 0)\n {\n unset($c[$b[$x]]);\n }\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n $d[$c[$b[$x]] - 1]--;\n if($d[$c[$b[$x]] - 1] == 0)\n {\n unset($d[$c[$b[$x]] - 1]);\n }\n }\n if(count($d) == 1)\n {\n $e = reset($d);\n $f = key($d);\n if($e == 2)\n {\n $i = $e * $f - $e + 1;\n }\n else\n {\n $i = $e * $f - $f + 1;\n }\n }\n elseif(count($d) == 2)\n {\n $e = reset($d);\n $f = key($d);\n $g = next($d);\n $h = key($d);\n if($h == 1)\n {\n $i = $e * $f + 1;\n }\n elseif(abs($f - $h) == 1)\n {\n $i = $e * $f + $g * $h;\n }\n }\n}\nprint $i;\n?>"}, {"source_code": " 1)\n {\n $d[$c[$b[$x]] - 1]--;\n if($d[$c[$b[$x]] - 1] == 0)\n {\n unset($d[$c[$b[$x]] - 1]);\n }\n }\n if(count($d) == 1)\n {\n $e = reset($d);\n $f = key($d);\n if($e == 2)\n {\n $i = $e * $f - $e + 1;\n }\n else\n {\n $i = $e * $f - $f + 1;\n }\n }\n elseif(count($d) == 2)\n {\n $e = reset($d);\n $f = key($d);\n $g = next($d);\n $h = key($d);\n if(abs($f - $h) == 1)\n {\n $i = $e * $f + $g * $h;\n }\n }\n}\nprint $i;\n?>"}, {"source_code": "= 0; $x--)\n {\n if(max($c) - min($c) == 0)\n {\n print $x + 2;\n break;\n }\n elseif(max($c) - min($c) == 1)\n {\n print $x + 1;\n break;\n }\n $c[$b[$x]]--;\n if($c[$b[$x]] == 0)\n {\n unset($c[$b[$x]]);\n }\n }\n }\n}\nelseif(max($c) - min($c) == 1)\n{\n print $a;\n}\nelse\n{\n for($x = $a - 1; $x >= 0; $x--)\n {\n if(max($c) - min($c) == 0)\n {\n print $x + 2;\n break;\n }\n elseif(max($c) - min($c) == 1)\n {\n print $x + 1;\n break;\n }\n $c[$b[$x]]--;\n if($c[$b[$x]] == 0)\n {\n unset($c[$b[$x]]);\n }\n }\n}\n?>"}, {"source_code": "= $ans && $t){\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\t\n\t//print_r($cur);\n\techo (count($cur) == 1 ? ($n == 1 ? 1 : $ans) : $ans+1);\n?>"}, {"source_code": "= $ans && $t){\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\t\n\t//print_r($cur);\n\techo (count($cur) == 1 ? ($n == 1 ? 1 : $ans) : $ans+1);\n?>"}, {"source_code": "= $ans && $t){\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\t\n\t//print_r($cur);\n\techo $ans+1;\n?>"}, {"source_code": "= $ans && $t){\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\t\n\t//print_r($cur);\n\techo (count($cur) == 1 ? ($n == 1 ? 1 : $ans) : $ans+1);\n?>"}, {"source_code": "= $ans && $t){\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\t\n\t//print_r($cur);\n\techo (count($cur) == 1 ? ($n == 1 ? 1 : $ans) : $ans+1);\n?>"}, {"source_code": "= $ans && $t){\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\t\n\t//print_r($cur);\n\techo (count($cur) == 1 ? $ans : $ans+1);\n?>"}], "src_uid": "2d020e6c3000836e8b903a12ae39dd9b"} {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$x]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nprint implode(\" \", $f);\n?>", "positive_code": [{"source_code": "$v)\n{\n if($check==0)\n {\n $last=$v;\n $check=1;\n }else\n {\n $map[$k]+=$last;\n $last=$map[$k];\n }\n}$mapt=[];\nforeach ($map as $k=>$v)\n{\n $mapt[]=$k;\n}\nfor ($i=0;$i<$t[1];$i++)\n{\n $check=0;\n $left = 0;\n $right = sizeof($mapt) - 1;\n\n $count = 0;\n while ($left <= $right) {\n $mid =(int) (($right + $left) / 2);\n\n if ($mapt[$mid] <= $b[$i]) {\n $count = $mid + 1;\n $left = $mid + 1;\n }\n else\n $right = $mid - 1;\n }\n if($count==0)\n {\n echo '0'.\" \";\n }else\n {\n echo $map[$mapt[$count-1]].\" \";\n }\n}"}], "negative_code": [{"source_code": "= $c[$j]) && ($j == $a - 1))\n {\n $i++;\n $j++;\n $g[$f[$h]] = $i;\n break;\n }\n elseif($d[$h] >= $c[$j])\n {\n $i++;\n $j++;\n }\n else\n {\n $g[$f[$h]] = $i;\n $h++;\n }\n if($h == $b)\n {\n break;\n }\n}\nksort($g);\nif($a == 107329)\n{\n $k = array_slice($g, 4900, 50);\n print implode(\" \", $k);\n}\nelse\n{\n print implode(\" \", $g);\n}\n?>"}, {"source_code": "= $c[$j]) && ($j == $a - 1))\n {\n $i++;\n $j++;\n $g[$f[$h]] = $i;\n break;\n }\n elseif($d[$h] >= $c[$j])\n {\n $i++;\n $j++;\n }\n else\n {\n $g[$f[$h]] = $i;\n $h++;\n }\n if($h == $b)\n {\n break;\n }\n}\nksort($g);\nprint implode(\" \", $g);\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nprint implode(\" \", $f);\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nif($a == 107329)\n{\n $k = array_slice($g, 4900, 50);\n print implode(\" \", $k);\n}\nelse\n{\n print implode(\" \", $f);\n}\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nprint implode(\" \", $f);\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nprint implode(\" \", $f);\n?>"}, {"source_code": "= $c[$j]) && ($j == $a - 1))\n {\n $i++;\n $j++;\n $g[$f[$h]] = $i;\n break;\n }\n elseif($d[$h] >= $c[$j])\n {\n $i++;\n $j++;\n }\n else\n {\n $g[$f[$h]] = $i;\n $h++;\n }\n if($h == $b)\n {\n break;\n }\n}\nksort($g);\nif($a == 10739)\n{\n $k = array_slice($g, 4900, 50);\n print implode(\" \", $k);\n}\nelse\n{\n print implode(\" \", $g);\n}\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nif($a == 107329)\n{\n $j = array_slice($f, 4900, 50);\n print implode(\" \", $k);\n}\nelse\n{\n print implode(\" \", $f);\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nprint implode(\" \", $f);\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n if($a != 10739)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nprint implode(\" \", $f);\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nif($a == 10739)\n{\n $j = array_slice($f, 4900, 50);\n print_r($j);\n}\nelse\n{\n print implode(\" \", $f);\n}\n?>"}, {"source_code": "= $c[$j]) && ($j == $a - 1))\n {\n $i++;\n $j++;\n $g[$f[$h]] = $i;\n break;\n }\n elseif($d[$h] >= $c[$j])\n {\n $i++;\n $j++;\n }\n else\n {\n $g[$f[$h]] = $i;\n $h++;\n }\n if($h == $b)\n {\n break;\n }\n}\nksort($g);\nif($a == 10739)\n{\n print count($g);\n}\nelse\n{\n print implode(\" \", $g);\n}\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n if($a != 10739)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nprint implode(\" \", $f);\n?>"}, {"source_code": "= $c[$h])\n {\n $g++;\n $h++;\n if($h == $a)\n {\n for($x = $i; $x < $b; $x++)\n {\n $f[$e[$i]] = $g;\n }\n break;\n }\n }\n else\n {\n $f[$e[$i]] = $g;\n $i++;\n if($i == $b)\n {\n break;\n }\n }\n}\nksort($f);\nif($a == 107329)\n{\n $j = array_slice($f, 4900, 50);\n print_r($j);\n}\nelse\n{\n print implode(\" \", $f);\n}\n?>"}, {"source_code": "$v)\n{\n if($check==0)\n {\n $last=$v;\n $check=1;\n }else\n {\n $map[$k]+=$last;\n $last=$map[$k];\n }\n}\nkrsort($map);\nfor ($i=0;$i<$t[1];$i++)\n{\n foreach ($map as $k=>$m)\n {\n if($k<=$b[$i])\n {\n echo $m.\" \";\n break;\n }\n }\n}"}, {"source_code": "$v)\n{\n if($check==0)\n {\n $last=$v;\n $check=1;\n }else\n {\n $map[$k]+=$last;\n $last=$map[$k];\n }\n}\nkrsort($map);\nfor ($i=0;$i<$t[1];$i++)\n{\n $check=0;\n foreach ($map as $k=>$m)\n {\n if($k<=$b[$i])\n {\n echo $m.\" \";\n $check=1;\n break;\n }\n }\n if($check==0)\n {\n echo '0'.\" \";\n }\n}"}, {"source_code": "$v)\n{\n if($check==0)\n {\n $last=$v;\n $check=1;\n }else\n {\n $map[$k]+=$last;\n $last=$map[$k];\n }\n}\nkrsort($map);\nvar_dump($map);\nfor ($i=0;$i<$t[1];$i++)\n{\n $check=0;\n foreach ($map as $k=>$m)\n {\n if($k<=$b[$i])\n {\n echo $m.\" \";\n $check=1;\n break;\n }\n }\n if($check==0)\n {\n echo '0'.\" \";\n }\n}"}], "src_uid": "e9a519be33f25c828bae787330c18dd4"} {"source_code": " $i)\n {\n $i = $h[$x];\n }\n}\nprint $i + $c[count($c) - 1];\n?>", "positive_code": [{"source_code": "= 0; $i--) {\n if($f > $a[$i][0]){\n $t += ($f - $a[$i][0]);\n $f = $a[$i][0];\n }\n if($t < $a[$i][1]){\n $t = $a[$i][1];\n }\n }\n $t += $f;\n fprintf(STDOUT,\"%d\",$t);\n?>\n"}, {"source_code": "\n//$input = fopen(\"input.txt\",\"r\");\n//$output = fopen(\"output.txt\",\"w\");\n//fscanf(STDIN,\"%d %d\",$n, $s);\n//fprintf(STDOUT,\"%d\",$t);\n\n$in = fopen(\"php://stdin\",\"r\");\nlist($n,$s) = explode(\" \",trim(fgets($in)));\nfor($i = 0; $i <$n; $i++){\n list($f,$t) = explode(\" \",trim(fgets($in)));\n $fl[$i] = $f; \n $ti[$i] = $t; \n $flag[$i] = false; \n}\n\n\n$time = 0; $tf = $s;\nfor($i = 0; $i <$n; $i++){\n $idx = -1; $temp = -1;\n for($r = 0; $r <$n; $r++){\n if($flag[$r]==false && $fl[$r] > $temp )\n\t{\n\t $idx = $r;\n\t $temp = $fl[$r]; \t \n\t}\t\n }\n $flag[$idx] = true;\n while($tf > $fl[$idx])\n {\n $time++;\n $tf--; \n }\n while( $ti[$idx] > $time) \n $time++; \n}\nwhile($tf >0)\n{\n $time++;\n $tf--;\n}\n\necho $time;"}, {"source_code": "\n$in = fopen(\"php://stdin\",\"r\");\nlist($n,$s) = explode(\" \",trim(fgets($in)));\nfor($i = 0; $i <$n; $i++){\n list($f,$t) = explode(\" \",trim(fgets($in)));\n $fl[$i] = $f; \n $ti[$i] = $t; \n $flag[$i] = false; \n}\n\n\n$time = 0; $tf = $s;\nfor($i = 0; $i <$n; $i++){\n $idx = -1; $temp = -1;\n for($r = 0; $r <$n; $r++){\n if($flag[$r]==false && $fl[$r] > $temp )\n\t{\n\t $idx = $r;\n\t $temp = $fl[$r]; \t \n\t}\t\n }\n $flag[$idx] = true;\n while($tf > $fl[$idx])\n {\n $time++;\n $tf--; \n }\n while( $ti[$idx] > $time) \n $time++; \n}\nwhile($tf >0)\n{\n $time++;\n $tf--;\n}\n\necho $time;"}], "negative_code": [{"source_code": " $n)\n {\n $n = $j[$x];\n }\n $m = 1;\n $o++;\n }\n elseif(($k[$x] == TRUE) && ($m == 1))\n {\n $n += $i[$l[$o - 1]] - $i[$l[$o]];\n if($j[$x] > $n)\n {\n $n = $j[$x];\n }\n $o++;\n }\n }\n print $n + $i[$x - 1];\n}\n?>"}, {"source_code": " $n)\n {\n $n = $j[$x];\n }\n $m = 1;\n $o++;\n }\n elseif(($k[$x] == TRUE) && ($m == 1))\n {\n $n += $i[$l[$o - 1]] - $i[$l[$o]];\n if($j[$x] > $n)\n {\n $n = $j[$x];\n }\n $o++;\n }\n }\n print $n + $i[$x - 1];\n}\n?>"}, {"source_code": " $n)\n {\n $n = $j[$x];\n }\n $m = 1;\n $o++;\n }\n elseif(($k[$x] == TRUE) && ($m == 1))\n {\n $n += $i[$l[$o - 1]] - $i[$l[$o]];\n if($j[$x] > $n)\n {\n $n = $j[$x];\n }\n $o++;\n }\n }\n print $n + $i[$x - 1];\n}\n?>"}, {"source_code": " $n)\n {\n $n = $j[$x];\n }\n $m = 1;\n $o++;\n }\n elseif(($k[$x] == TRUE) && ($m == 1))\n {\n $n += $i[$l[$o - 1]] - $i[$l[$o]];\n if($j[$x] > $n)\n {\n $n = $j[$x];\n }\n $o++;\n }\n }\n print $n + $i[$x - 1];\n}\n?>"}, {"source_code": " $n)\n {\n $n = $j[$x];\n }\n $m = 1;\n $o++;\n }\n elseif(($k[$x] == TRUE) && ($m == 1))\n {\n $n += $i[$l[$o - 1]] - $i[$l[$o]];\n if($j[$x] > $n)\n {\n $n = $j[$x];\n }\n $o++;\n }\n}\nprint $n + $i[$x - 1];\n?>"}], "src_uid": "5c12573b3964ee30af0349c11c0ced3b"} {"source_code": " $e)\r\n {\r\n $d--;\r\n $e++;\r\n $g++;\r\n }\r\n elseif($e > $f)\r\n {\r\n $e--;\r\n $f++;\r\n $g++;\r\n }\r\n elseif($f > $d)\r\n {\r\n $f--;\r\n $d++;\r\n $g++;\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n }\r\n print $g . \"\\n\";\r\n}\r\n?>", "positive_code": [{"source_code": " 0) {\r\n $sm += $cnt[$k];\r\n $cnt[($k + 1) % 3] += $cnt[$k];\r\n $cnt[$k] = 0;\r\n }\r\n }\r\n }\r\n echo $sm.PHP_EOL;\r\n}\r\n"}], "negative_code": [], "src_uid": "e0de8a6441614d1e41a53223b5fa576b"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "b17eaccfd447b11c4f9297e3276a3ca9"} {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n//print_r($arr_N);\n\n$n_1 = 0;\n$n_2 = 0;\n$sum = 0;\n\nforeach ($arr_N as $key => $value) {\n $n_tmp = $n_1;\n $n_1 = max($n_1, $n_2 + $key * $value);\n $n_2 = $n_tmp;\n\n if (!(isset($arr_N[$key+1]))) {\n $sum += $n_1;\n $n_1 = 0;\n $n_2 = 0;\n }\n}\n\n$sum += $n_1;\n\necho \"$sum\\n\";\n\n?>", "positive_code": [{"source_code": "=$b) return $a;\n\treturn $b;\n}\nfor($i=2;$i<=$lim;$i++) $dp[$i]=mx($dp[$i-1],$dp[$i-2]+$i*$cnt[$i]);\n\necho $dp[$lim].\"\\n\";\n\n?>"}], "negative_code": [{"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n/* $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n*/\n //$x = (int) $key * $value;\n $x = 0;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n if (!isset($arr_N[$key+1])) {\n break;\n }\n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\nprint_r($arr_N);\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n if (!isset($arr_N[$key-1])) {\n if (isset($arr_N[$key+2])) {\n continue;\n } else {\n $imax =($key * $value > ($key+1) * $arr_N[$key+1])? $key : $key + 1; \n break;\n }\n }\n\n $x = (int) $key * $value;\n $x -= (int) ($key - 1) * $arr_N[$key-1];\n $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($x > 0) {\n $imax = $key;\n } else {\n $imax = $key - 1; \n }\n break; \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\necho \"arrCount=$arrCount \\n\";\nprint_r($arr_N);\n\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n $x = (int) $key * $value;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount --;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n/* $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n*/\n $x = (int) $key * $value;\n //$x = 0;\n //if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n //if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n/* $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n*/\n // $x = (int) $key * $value;\n $x = 0;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n/* $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n*/\n $x = (int) $key * $value;\n //$x = 0;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n if (!isset($arr_N[$key+1])) {\n break;\n }\n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n//print_r($arr_N);\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n $x = (int) $key * $value;\n //$x = 0;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($x > 0) {\n $imax = $key;\n } \n if (!isset($arr_N[$key+1])) {\n break;\n }\n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\nprint_r($arr_N);\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n/* $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n*/\n $x = (int) $key * $value;\n //$x = 0;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n if (!isset($arr_N[$key+1])) {\n break;\n }\n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n//print_r($arr_N);\n\nif ($n == 100) {\n foreach ($arr_N as $key => $value) {\n echo \"key=$key value=$value \";\n }\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n\n reset($arr_N);\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n if (!isset($arr_N[$key-1])) {\n if (isset($arr_N[$key+2])) {\n continue;\n } else {\n $imax =($key * $value > ($key+1) * $arr_N[$key+1])? $key : $key + 1; \n break;\n }\n }\n\n $x = (int) $key * $value;\n $x -= (int) ($key - 1) * $arr_N[$key-1];\n $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($x > 0) {\n $imax = $key;\n } else {\n $imax = $key - 1; \n }\n break; \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n//echo \"arrCount=$arrCount \\n\";\n//print_r($arr_N);\n\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$n_1 = 0;\n$n_2 = 0;\n\nforeach ($arr_N as $key => $value) {\n $n_tmp = $n_1;\n $n_1 = max($n_1, $n_2 + $key * $value);\n $n_2 = $n_tmp;\n}\n\necho \"$n_1\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 2;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n $arrCount --;\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n $x = ((int) $key * $value) - ((int) ($key - 1) * $arr_N[$key-1]) - ((int) ($key + 1) * $arr_N[$key+1]);\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n/*\n $col += $imax * $arr_N[$imax];\n //echo \" imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount --;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n*/\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n//print_r($arr_N);\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n/* $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n*/\n $x = (int) $key * $value;\n //$x = 0;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n if (!isset($arr_N[$key+1])) {\n break;\n }\n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n }\n\n $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n//print_r($arr_N);\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n \n reset($arr_N);\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n if (!isset($arr_N[$key-1])) {\n if (isset($arr_N[$key+2])) {\n continue;\n } else {\n $imax =($key * $value > ($key+1) * $arr_N[$key+1])? $key : $key + 1; \n break;\n }\n }\n\n $x = (int) $key * $value;\n $x -= (int) ($key - 1) * $arr_N[$key-1];\n $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($x > 0) {\n $imax = $key;\n } else {\n $imax = $key - 1; \n }\n break; \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n//echo \"arrCount=$arrCount \\n\";\n//print_r($arr_N);\n\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$n_1 = 0;\n$n_2 = 0;\n\nksort($arr_N);\n\nforeach ($arr_N as $key => $value) {\n $n_tmp = $n_1;\n $n_1 = max($n_1, $n_2 + $key * $value);\n $n_2 = $n_tmp;\n}\n\necho \"$n_1\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n//print_r($arr_N);\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n if (!isset($arr_N[$key-1])) {\n if (isset($arr_N[$key+2])) {\n continue;\n } else {\n $imax =($key * $value > ($key+1) * $arr_N[$key+1])? $key : $key + 1; \n break;\n }\n }\n\n $x = (int) $key * $value;\n $x -= (int) ($key - 1) * $arr_N[$key-1];\n $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($x > 0) {\n $imax = $key;\n } else {\n $imax = $key - 1; \n }\n break; \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n//echo \"arrCount=$arrCount \\n\";\n//print_r($arr_N);\n\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n \n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n\n if (!(isset($arr_N[$key-1]) or isset($arr_N[$key+1]))) {\n $col += $key * $value;\n $arrCount -- ;\n unset($arr_N[$key]);\n continue;\n }\n\n/* $x = (int) $key;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n*/\n $x = (int) $key * $value;\n $x = 0;\n if (isset($arr_N[$key-1])) $x -= (int) ($key - 1) * $arr_N[$key-1];\n if (isset($arr_N[$key+1])) $x -= (int) ($key + 1) * $arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \"\\n imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount -- ;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$n_2 = 0;\n$keys = array_keys($arr_N);\n$n_1 = $arr_N[$keys[0]];\n$n_0 = $n_1; \n\nforeach ($arr_N as $key => $value) {\n\n if ($key = $keys[0]) continue;\n\n $n_tmp = $n_0;\n $n_0 = max($n_1, $n_2 + $value);\n $n_2 = $n_1;\n $n_1 = $n_tmp;\n}\n\necho \"$n_0\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n//print_r($arr_N);\n/*\n$arr_N = array();\n$arr_N[1] = 7;\n$arr_N[2] = 9;\n$arr_N[3] = 6;\n$arr_N[4] = 12;\n$arr_N[5] = 11;\n$arr_N[6] = 10;\n$arr_N[7] = 16;\n$arr_N[8] = 10;\n$arr_N[9] = 10;\n$arr_N[10] = 9;\n*/\n$n_1 = 0;\n$n_2 = 0;\n\nforeach ($arr_N as $key => $value) {\n $n_tmp = $n_1;\n $n_1 = max($n_1, $n_2 + $key * $value);\n $n_2 = $n_tmp;\n //echo \"\\n n_2=$n_2 n_1=$n_1 key=$key value=$value\\n\";\n\n}\n\necho \"$n_1\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\n$n_1 = 0;\n$n_2 = 0;\n\nfunction cmp($a, $b)\n{\n if ((int) $a > (int) $b) {\n return 1;\n } elseif ((int) $a < (int) $b) {\n return -1;\n } elseif ((int) $a == (int) $b) {\n return 0;\n }\n}\n\nuksort($arr_N, \"cmp\");\n\nforeach ($arr_N as $key => $value) {\n $n_tmp = $n_1;\n $n_1 = max($n_1, $n_2 + $key * $value);\n $n_2 = $n_tmp;\n}\n\necho \"$n_1\\n\";\n\n?>"}, {"source_code": " $value) {\n $i = (int) $value;\n $arr_N[$i] ++;\n}\n\necho \"2\\n\";\n/*\n$col = 0;\n$arrCount = count($arr_N);\nwhile ( $arrCount > 0) {\n\n $max = - 2000000000;\n $imax = -1;\n foreach ($arr_N as $key => $value) {\n $x = (int) $key * $value - ($key - 1) * arr_N[$key-1] - ($key + 1) * arr_N[$key+1];\n if ($max < $x) {\n $max = $x;\n $imax = $key;\n } \n }\n\n $col += $imax * $arr_N[$imax];\n //echo \" imax=$imax max=$max col=$col arrCount=$arrCount\\n\";\n\n $arrCount --;\n unset($arr_N[$imax]);\n if (isset($arr_N[$imax-1])) {\n unset($arr_N[$imax-1]);\n $arrCount --;\n }\n if (isset($arr_N[$imax+1])) {\n unset($arr_N[$imax+1]);\n $arrCount --;\n }\n}\n\necho \"$col\\n\";\n*/\n?>"}], "src_uid": "41b3e726b8146dc733244ee8415383c0"} {"source_code": "4126 or $rating[$i]['before']>4126)){ exit();}\n if($rating[$i]['before']!=$rating[$i]['after']){\n\n $rated=1;\n $unrated=0;\n $maybe=0;\n break;\n }\n\n if($i>1){\n\n if($rating[$i]['after']<=$rating[$i-1]['after']){\n $maybe+=1;\n }else{\n $unrated+=1;\n }\n\n }\n}\n\nif($rated >$unrated){\n fwrite($out,'rated');\n}elseif ($unrated>$rated){\n fwrite($out, 'unrated');\n}else{\n fwrite($out,'maybe');\n}\nfclose($out);\nfclose($in);", "positive_code": [{"source_code": " $h)\n {\n $g = 1;\n break;\n }\n $h = min($h, $b[$x + 1]);\n }\n if($g == 1)\n {\n print \"unrated\";\n }\n else\n {\n print \"maybe\";\n }\n}\n?>"}, {"source_code": "0 and $a[$i]>$a[$i-1])\n $flag = true;\n}\n$flag2 = false;\nfor($i=0;$i<$n;$i++)\n if($a[$i]!=$b[$i])\n $flag2 = true;\nif($flag2==true)\n fwrite(STDOUT, \"rated\\n\");\nelse if($flag==true)\n fwrite(STDOUT, \"unrated\\n\");\nelse\n fwrite(STDOUT, \"maybe\\n\");\n\n?>"}], "negative_code": [], "src_uid": "88686e870bd3bfbf45a9b6b19e5ec68a"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "ccb7b8c0c389ea771f666c236c1cba5f"} {"source_code": "", "positive_code": [{"source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\n###### /IO ######\n\nfunction getAnswer($is_test = false, $f = false) {\n\tif ($is_test)\n\t\t$stream = $f;\n\telse\n\t\t$stream = STDIN;\n\t/* begin body */\n\t$n = readNum($stream);\n\t$dayCount = readStringExplodeNum($stream, ' ', true);\n\n\t$dayCheck = 0;\n\t$isFail = false;\n\twhile (isset($dayCount[$dayCheck])) {\n\t\tif ($dayCount[$dayCheck] % 2 == 0) {\n\t\t\t$dayCount[$dayCheck]%=2;\n\t\t} elseif ($dayCount[$dayCheck] > 0 && $dayCount[$dayCheck + 1] > 0) {\n\t\t\t$dayCount[$dayCheck] --;\n\t\t\t$dayCount[$dayCheck + 1] --;\n\t\t} elseif ($dayCount[$dayCheck] > 0) {\n\t\t\t$isFail = true;\n\t\t\techo 'NO';\n\t\t\tbreak;\n\t\t}\n\n\t\tif ($dayCount[$dayCheck] == 0) {\n\t\t\t$dayCheck++;\n\t\t}\n\t}\n\tif ($isFail === false) {\n\t\techo 'YES';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "negative_code": [{"source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\n###### /IO ######\n\nfunction getAnswer($is_test = false, $f = false) {\n\tif ($is_test)\n\t\t$stream = $f;\n\telse\n\t\t$stream = STDIN;\n\t/* begin body */\n\t$n = readNum($stream);\n\t$dayCount = readStringExplodeNum($stream, ' ', true);\n\t$input = array_chunk($dayCount, 100);\n\techo '-----------------' . \"\\n\";\n\tforeach ($input as $in) {\n\t\techo implode(',', $in) . \"\\n\";\n\t}\n\techo '-----------------' . \"\\n\";\n\t$dayCheck = 0;\n\t$isFail = false;\n\twhile (isset($dayCount[$dayCheck])) {\n\t\tif ($dayCount[$dayCheck] >= 2) {\n\t\t\t$dayCount[$dayCheck]-=2;\n\t\t} elseif ($dayCount[$dayCheck] > 0 && $dayCount[$dayCheck + 1] > 0) {\n\t\t\t$dayCount[$dayCheck] --;\n\t\t\t$dayCount[$dayCheck + 1] --;\n\t\t} elseif ($dayCount[$dayCheck] > 0) {\n\t\t\t$isFail = true;\n\t\t\techo 'NO';\n\t\t\tbreak;\n\t\t}\n\n\t\tif ($dayCount[0] == 0) {\n\t\t\t$dayCheck++;\n\t\t}\n\t}\n\tif ($isFail === false) {\n\t\techo 'YES';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\n###### /IO ######\n\nfunction getAnswer($is_test = false, $f = false) {\n\tif ($is_test)\n\t\t$stream = $f;\n\telse\n\t\t$stream = STDIN;\n\t/* begin body */\n\t$n = readNum($stream);\n\t$dayCount = readStringExplodeNum($stream, ' ', true);\n\t$dayCheck = 0;\n\t$isFail = false;\n\twhile (isset($dayCount[$dayCheck])) {\n\t\tif ($dayCount[$dayCheck] > 0 && $dayCount[$dayCheck + 1] > 0) {\n\t\t\t$dayCount[$dayCheck] --;\n\t\t\t$dayCount[$dayCheck + 1] --;\n\t\t} elseif ($dayCount[$dayCheck] >= 2) {\n\t\t\t$dayCount[$dayCheck]-=2;\n\t\t} elseif ($dayCount[$dayCheck] > 0) {\n\t\t\t$isFail = true;\n\t\t\techo 'NO';\n\t\t\tbreak;\n\t\t}\n\n\t\tif ($dayCount[0] == 0) {\n\t\t\t$dayCheck++;\n\t\t}\n\t}\n\tif ($isFail === false) {\n\t\techo 'YES';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\n###### /IO ######\n\nfunction getAnswer($is_test = false, $f = false) {\n\tif ($is_test)\n\t\t$stream = $f;\n\telse\n\t\t$stream = STDIN;\n\t/* begin body */\n\t$n = readNum($stream);\n\t$dayCount = readStringExplodeNum($stream, ' ', true);\n\tif ($n > 1000) {\n\t\t$input = array_chunk($dayCount, 100);\n\t\techo '-----------------' . \"\\n\";\n\t\tforeach ($input as $in) {\n\t\t\techo implode(',', $in) . \"\\n\";\n\t\t}\n\t\techo '-----------------' . \"\\n\";\n\t}\n\t$dayCheck = 0;\n\t$isFail = false;\n\twhile (isset($dayCount[$dayCheck])) {\n\t\tif ($dayCount[$dayCheck] >= 2) {\n\t\t\t$dayCount[$dayCheck]-=2;\n\t\t} elseif ($dayCount[$dayCheck] > 0 && $dayCount[$dayCheck + 1] > 0) {\n\t\t\t$dayCount[$dayCheck] --;\n\t\t\t$dayCount[$dayCheck + 1] --;\n\t\t} elseif ($dayCount[$dayCheck] > 0) {\n\t\t\t$isFail = true;\n\t\t\techo 'NO';\n\t\t\tbreak;\n\t\t}\n\n\t\tif ($dayCount[0] == 0) {\n\t\t\t$dayCheck++;\n\t\t}\n\t}\n\tif ($isFail === false) {\n\t\techo 'YES';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\n###### /IO ######\n\nfunction getAnswer($is_test = false, $f = false) {\n\tif ($is_test)\n\t\t$stream = $f;\n\telse\n\t\t$stream = STDIN;\n\t/* begin body */\n\t$n = readNum($stream);\n\t$dayCount = readStringExplodeNum($stream, ' ', true);\n\t$dayCheck = 0;\n\t$isFail = false;\n\twhile (isset($dayCount[$dayCheck])) {\n\t\tif ($dayCount[$dayCheck] >= 2) {\n\t\t\t$dayCount[$dayCheck]-=2;\n\t\t} elseif ($dayCount[$dayCheck] > 0 && $dayCount[$dayCheck + 1] > 0) {\n\t\t\t$dayCount[$dayCheck] --;\n\t\t\t$dayCount[$dayCheck + 1] --;\n\t\t} elseif ($dayCount[$dayCheck] > 0) {\n\t\t\t$isFail = true;\n\t\t\techo 'NO';\n\t\t\tbreak;\n\t\t}\n\n\t\tif ($dayCount[0] == 0) {\n\t\t\t$dayCheck++;\n\t\t}\n\t}\n\tif ($isFail === false) {\n\t\techo 'YES';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "src_uid": "97697eba87bd21ae5c979a5ea7a81cb7"} {"source_code": " $c)\n {\n $d = $b - $c;\n if($d % 2 == 0)\n {\n print \"1\\n\";\n }\n else\n {\n print \"2\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " 0) {\n if ($a%2 == 0) {\n if ($b % 2 == 0) {\n echo \"1\\n\";\n } else {\n echo \"2\\n\";\n }\n } else {\n if ($b% 2 == 0) {\n echo \"2\\n\";\n } else {\n echo \"1\\n\";\n }\n }\n } else {\n if ($a%2 == 0) {\n if ($b % 2 == 0) {\n echo \"2\\n\";\n } else {\n echo \"1\\n\";\n }\n } else {\n if ($b% 2 == 0) {\n echo \"1\\n\";\n } else {\n echo \"2\\n\";\n }\n }\n }\n }\n // echo \"k = $k\\n\";\n}"}, {"source_code": " $b) {\n $c = $a - $b;\n if($c%2 == 0) {\n $n++;\n $a = $a - $c;\n } else {\n $n++;\n $a = $a - $c - 1;\n }\n \n } else {\n $c = $b - $a;\n if($c%2 == 1) {\n $n++;\n $a = $a + $c;\n } else {\n $n++;\n $a = $a + $c - 1;\n }\n } \n }\n \n echo $n . \"\\n\";\n }\n "}, {"source_code": " $a) {\n \tif (($b-$a)%2 == 1) {\n \t\t$n = 1;\n \t} else {\n \t\t$n = 2;\n \t}\n } else if ($a > $b) {\n \tif (($a-$b)%2 == 1) {\n \t\t$n = 2;\n \t} else {\n \t\t$n = 1;\n \t}\n }\n else if ($a == $b) {\n \t$n = 0;\n }\n \n echo $n . PHP_EOL;\n \n}"}, {"source_code": " $a && $diff % 2 == 0 ? 2 : $ans;\n $ans = $b < $a && $diff % 2 == 1 ? 2 : $ans;\n \n return $ans;\n}"}, {"source_code": " $a[1]){\n $c = $a[0] - $a[1];\n } else {\n $c = $a[1] - $a[0];\n $b = false;\n }\n \n if($c == 0){\n echo \"0\\n\";\n } elseif ($c % 2 == 1) {\n if($b){\n echo \"2\\n\";\n } else {\n echo \"1\\n\";\n }\n } else {\n if($b){\n echo \"1\\n\";\n } else {\n echo \"2\\n\";\n }\n }\n }\n\n \n\n "}, {"source_code": "$a[1] && (($a[0]%2==0 && $a[1]%2==0) || ($a[0]%2!=0 && $a[1]%2!=0) ))\n {\n echo '1'.\"\\n\";\n }else\n {\n echo '2'.\"\\n\";\n }\n}\n\n\n\n"}], "negative_code": [{"source_code": " $a) {\n if ($aFlag == $bFlag && $bFlag) {\n echo \"2\\n\";\n } elseif ($aFlag == $bFlag && !$bFlag) {\n echo \"1\\n\";\n } else {\n if ($aFlag) {\n echo \"1\\n\";\n } else {\n echo \"2\\n\";\n }\n }\n } else {\n if ($aFlag == $bFlag && $bFlag) {\n echo \"2\\n\";\n } elseif ($aFlag == $bFlag && !$bFlag) {\n echo \"1\\n\";\n } else {\n if ($aFlag) {\n echo \"1\\n\";\n } else {\n echo \"2\\n\";\n }\n }\n }\n }\n // echo \"k = $k\\n\";\n}"}, {"source_code": " 0) {\n if ($a%2 == 0) {\n if ($b % 2 == 0) {\n echo \"1\\n\";\n } else {\n echo \"2\\n\";\n }\n } else {\n if ($b% 2 == 0) {\n echo \"2\\n\";\n } else {\n echo \"1\\n\";\n }\n }\n } else {\n if ($a%2 == 0) {\n if ($b % 2 == 0) {\n echo \"2\\n\";\n } else {\n echo \"1\\n\";\n }\n } else {\n if ($b% 2 == 0) {\n echo \"2\\n\";\n } else {\n echo \"1\\n\";\n }\n }\n }\n }\n // echo \"k = $k\\n\";\n}"}], "src_uid": "fcd55a1ca29e96c05a3b65b7a8103842"} {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "90125e9d42c6dcb0bf3b2b5e4d0f845e"} {"source_code": "\n$f = fopen( 'input.txt', 'r' );\n$out = fopen( 'output.txt', 'w' );\nfscanf($f,\"%d %d\", &$m, &$fm);\n\nif($m < $fm){\n for($i = 0; $i < $m; $i++){\n fprintf($out,\"%s\", \"GB\"); \n }\n for($i = 0; $i < $fm - $m; $i++){\n fprintf($out,\"%s\", \"G\"); \n }\n}\nif($fm < $m){\n for($i = 0; $i < $fm; $i++){\n fprintf($out,\"%s\", \"BG\"); \n }\n for($i = 0; $i < $m - $fm; $i++){\n fprintf($out,\"%s\", \"B\"); \n }\n}\nif($fm == $m){\n for($i = 0; $i < $fm; $i++){\n fprintf($out,\"%s\", \"BG\"); \n }\n}\nfclose( $f );\nfclose( $out );\n?>", "positive_code": [{"source_code": "0 && $m>0) {\n if ($n>$m) {\n fwrite($out,\"BG\");\n } else {\n fwrite($out,\"GB\");\n }\n $n--;\n $m--;\n }\n while($n>0) {\n fwrite($out,\"B\");\n $n--;\n }\n while($m>0) {\n fwrite($out,\"G\");\n $m--;\n }\n fclose($out);\n?>"}, {"source_code": " $m)\n {\n fprintf($fout, \"B\");\n for ($i = 1; $i <= $m; $i++)\n fprintf($fout, \"GB\");\n for ($i = 1; $i <= $n-$m-1; $i++)\n fprintf($fout, \"B\");\n }\n else\n {\n for ($i = 1; $i <= $n; $i++)\n fprintf($fout, \"GB\");\n }\n?>"}], "negative_code": [{"source_code": "\n$f = fopen( 'php://stdin', 'r' );\nfscanf($f,\"%d %d\", &$m, &$fm);\n\nif($m < $fm){\n for($i = 0; $i < $m; $i++){\n echo 'GB'; \n }\n for($i = 0; $i < $fm - $m; $i++){\n echo 'G'; \n }\n}\nif($fm < $m){\n for($i = 0; $i < $fm; $i++){\n echo 'BG'; \n }\n for($i = 0; $i < $m - $fm; $i++){\n echo 'B'; \n }\n}\nif($fm == $m){\n for($i = 0; $i < $fm; $i++){\n echo 'GB'; \n }\n}\n\n?>"}, {"source_code": "\n$f = fopen( 'php://stdin', 'r' );\nfscanf($f,\"%d %d\", &$m, &$fm);\n\nif($m < $fm){\n for($i = 0; $i < $m; $i++){\n echo 'BG'; \n }\n for($i = 0; $i < $fm - $m; $i++){\n echo 'G'; \n }\n}\nif($fm < $m){\n for($i = 0; $i < $fm; $i++){\n echo 'GB'; \n }\n for($i = 0; $i < $m - $fm; $i++){\n echo 'B'; \n }\n}\nif($fm == $m){\n for($i = 0; $i < $fm; $i++){\n echo 'GB'; \n }\n}\n\n?>"}, {"source_code": " $m)\n {\n echo \"B\";\n for ($i = 1; $i <= $m; $i++)\n echo \"GB\";\n for ($i = 1; $i <= $n-$m-1; $i++)\n echo \"B\";\n }\n else\n {\n for ($i = 1; $i <= $n; $i++)\n echo \"GB\";\n }\n?>"}, {"source_code": " $m)\n {\n echo \"B\";\n for ($i = 1; $i <= $m; $i++)\n echo \"GB\";\n for ($i = 1; $i <= $n-$m-1; $i++)\n echo \"B\";\n }\n else\n {\n for ($i = 1; $i <= $n; $i++)\n echo \"GB\";\n }\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $m)\n {\n echo \"B\";\n for ($i = 1; $i <= $m; $i++)\n echo \"GB\";\n for ($i = 1; $i <= $n-$m-1; $i++)\n echo \"B\";\n }\n else\n {\n for ($i = 1; $i <= $n; $i++)\n echo \"GB\";\n }\n?>"}, {"source_code": " $m)\n {\n echo \"B\";\n for ($i = 1; $i <= $m; $i++)\n echo \"GB\";\n for ($i = 1; $i <= $n-$m-1; $i++)\n echo \"B\";\n }\n else\n {\n for ($i = 1; $i <= $n; $i++)\n echo \"GB\";\n }\n?>"}], "src_uid": "5392996bd06bf52b48fe30b64493f8f5"} {"source_code": "$ufin) { // \u0432\u043d\u0438\u0437 \u0436\u0434\u0435\u043c\n $j= (($utime - 2*$m +$ust+1)/(2*$m-2));\n $j = (j<0)?0:ceil($j);\n $check2 = 2*$m-$ust-1+$j*(2*$m-2);\n \n echo ($check2+($ust-$ufin)).\"\\n\";\n \n } elseif ($ust<$ufin){ //\u0432\u0432\u0435\u0440\u0445 \u0436\u0434\u0435\u043c\n $j = ceil(($utime - $ust+1)/(2*$m-2));\n $check1 = $ust-1+$j*(2*$m-2);\n echo ($check1+($ufin-$ust)).\"\\n\";\n }\n}\n?>", "positive_code": [{"source_code": "$ufin) { // \u0432\u043d\u0438\u0437 \u0436\u0434\u0435\u043c\n $j= (($utime - 2*$m +$ust+1)/(2*$m-2));\n $j = (j<0)?0:ceil($j);\n $check2 = 2*$m-$ust-1+$j*(2*$m-2);\n echo ($check2+($ust-$ufin)).\"\\n\";\n } elseif ($ust<$ufin){ //\u0432\u0432\u0435\u0440\u0445 \u0436\u0434\u0435\u043c\n $j = ceil(($utime - $ust+1)/(2*$m-2));\n $check1 = $ust-1+$j*(2*$m-2);\n echo ($check1+($ufin-$ust)).\"\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": "=$utime)\n if ($i==$ust)\n $startcount = true;\n \n if (($startcount)&&($i==$ufin)){ \n echo $time.\"\\n\";\n break;\n } \n \n \n $i += $step;\n if ($i==$m)\n $step = -1;\n elseif ($i==1)\n $step = 1;\n \n $time++;\n }\n }\n}\n?>"}, {"source_code": "(2*$m-1)){\n $time = floor($utime/(2*$m-1))*(2*$m-1);\n } else{\n $time = 0;\n }\n \n $i = 1;\n $step = 1;\n $elapsed = 0;\n $startcount = false;\n \n \n if ($ufin==$ust){\n echo $utime.\"\\n\"; \n } else {\n \n while (true){\n \n if ($time>=$utime)\n if ($i==$ust)\n $startcount = true;\n \n if (($startcount)&&($i==$ufin)){ \n echo $time.\"\\n\";\n break;\n } \n \n \n $i += $step;\n if ($i==$m)\n $step = -1;\n elseif ($i==1)\n $step = 1;\n \n $time++;\n }\n }\n}\n?>"}, {"source_code": "$ufin) { // \u0432\u043d\u0438\u0437 \u0436\u0434\u0435\u043c\n $j= (($utime - 2*$m +$ust+1)/(2*$m-2));\n $j = (j<0)?0:ceil($j);\n $check2 = 2*$m-$ust-1+$j*(2*$m-2);\n \n echo ($check2+($ust-$ufin)).\"\\n\";\n \n } elseif ($ust<$ufin){ //\u0432\u0432\u0435\u0440\u0445 \u0436\u0434\u0435\u043c\n $j = ceil(($utime - $ust+1)/(2*$m-2));\n $check1 = $ust-1+$j*(2*$m-2);\n echo ($check1+($ufin-$ust)).\"\\n\";\n }\n}\n?>"}, {"source_code": "(2*$m-1)){\n $time = floor($utime/(2*$m-1))*(2*$m-1);\n } else{\n $time = 0;\n }\n \n $i = 1;\n $step = 1;\n $elapsed = 0;\n $startcount = false;\n \n \n if ($ufin==$ust){\n echo $utime.\"\\n\"; \n } else {\n \n while (true){\n \n if ($time>=$utime)\n if ($i==$ust)\n $startcount = true;\n \n if (($startcount)&&($i==$ufin)){ \n echo $time.\"\\n\";\n break;\n } \n \n \n $i += $step;\n if ($i==$m)\n $step = -1;\n elseif ($i==1)\n $step = 1;\n \n $time++;\n }\n }\n}\n?>"}], "src_uid": "b8321b0a3fc8c295182a4c2c8d2e9d01"} {"source_code": "", "positive_code": [{"source_code": "count($A))\n return false;\n \n $sum=0;\n for($i=0;$i<$len;$i++)\n { \n $val = $A[$i+$pos];\n $sum += (int)$val;\n }\n return $sum % 2 == 0;\n}\n\n?>\n"}, {"source_code": " $v) {\n if ($sum > 0 && $sum % 2 === 0) {\n break;\n } elseif ($v % 2 === 0) {\n echo 1 . \"\\n\";\n echo (($k + 1) . \"\\n\");\n break;\n } else {\n $sum += $v;\n ++$f;\n $p .= (($k + 1) . ' ');\n }\n }\n if ($l == 1 && $sum % 2 != 0)\n echo -1 . \"\\n\";\n if ($sum > 0 && $sum % 2 === 0) {\n echo $f . \"\\n\";\n echo $p . \"\\n\";\n }\n}\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "count($A))\n return false;\n \n $sum=0;\n for($i=0;$i<$len;$i++)\n { \n $val = $A[$i+$pos];\n $sum += (int)$val;\n }\n return $sum % 2 == 0;\n}\n\n?>\n"}, {"source_code": " $v) {\n if ($sum > 0 && $sum % 2 === 0) {\n echo $f . \"\\n\";\n echo $p . \"\\n\";\n break;\n } elseif ($v % 2 === 0) {\n echo 1 . \"\\n\";\n echo (($k + 1) . \"\\n\");\n break;\n } else {\n $sum += $v;\n ++$f;\n $p .= (($k + 1) . ' ');\n }\n }\n if ($l == 1 && $sum % 2 != 0)\n echo -1 . \"\\n\";\n if ($sum > 0 && $sum % 2 === 0) {\n echo $f . \"\\n\";\n echo $p . \"\\n\";\n }\n}\n"}], "src_uid": "3fe51d644621962fe41c32a2d90c7f94"} {"source_code": "$a[1])\n {\n $new=0;\n $sum=$sum+$a[1];\n }\n else\n {\n $sum=$sum+$ans;\n $new=$a[1]-$ans;\n }\n\n $ans1=(int)($new/2);\n if($ans1>$a[0])\n {\n $new1=0;\n $sum=$sum+$a[0];\n }else\n {\n $sum=$sum+$ans1;\n }\n echo $sum*3;\n echo \"\\n\";\n }\n}\n\nsolve();\n?>", "positive_code": [{"source_code": " 0)\n {\n $e += 3;\n $b--;\n $c -= 2;\n }\n else\n {\n $e += 3;\n $c--;\n $d -= 2;\n }\n }\n elseif($c > $d)\n {\n if($b > 0)\n {\n $e += 3;\n $b--;\n $c -= 2;\n }\n elseif($d >= 2)\n {\n $e += 3;\n $c--;\n $d -= 2;\n }\n else\n {\n break;\n }\n }\n }\n print $e . \"\\n\";\n}\n?>"}, {"source_code": "=2 && $v[1]>=1){\n $k+=3;\n $v[2]-=2;\n $v[1]-=1;\n goto again;\n }\n \n again_1:\n if($v[1]>=2 && $v[0]>=1){\n $k+=3;\n $v[1]-=2;\n $v[0]-=1;\n goto again_1;\n }\n \n echo $k;\n if($i!=$arr[0]-1) echo \"\\n\";\n \n}\n\n?>"}], "negative_code": [{"source_code": "$a[1])\n {\n $new=0;\n $sum=$sum+$a[1];\n }else\n {\n $sum=$sum+$ans;\n $new=$a[1]-$ans;\n }\n $ans1=(int)($new/2);\n if($ans1>$a[0])\n {\n $new1=0;\n $sum=$sum+$ans1;\n }else\n {\n $sum=$sum+$ans1;\n }\n echo $sum*3;\n echo \"\\n\";\n }\n}\n\nsolve();\n?>"}], "src_uid": "14fccd50d5dfb557dd53f2896ed844c3"} {"source_code": " $l/2) return true; \n\n\tif ($j > 1 and $s[$j+1] != 0) return true;\n\n\tif ($j == 1 and $s[$j+1] != 0) return ($s[0] >= $s[1]); \n\n\t$k = $j+1; \n\twhile ($s[$k] == '0') { $k++; if ($k >= $l) break; }\n\t$zero = $k-$j-1; \n\n\tif ($j <= $zero) return false;\n\n\tif ($j > $zero+1) return true; \n\n\treturn ($s[0] >= $s[$j]);\n}\n", "positive_code": [{"source_code": " 0; $x--)\n {\n if(($b[$x - 1] >= $b[$x]) && ($b[$x] == 0) && ($x == 1))\n {\n $f = $c - $e + 1;\n $d += $f;\n $c = 0;\n $e = 0;\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c == 0))\n {\n $d += 2;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c == 0))\n {\n $d += 1;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c != 0))\n {\n $f = $c - $e + 1;\n $d += $f;\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($c == 0))\n {\n $c = 0;\n $e = 0;\n $d += 1;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] != 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h >= $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] != 0) && ($c == 0))\n {\n $g = $b[$x];\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h >= $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] == 0) && ($e == 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h >= $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] == 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h >= $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h >= $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\"; \n }\n else\n {\n $g = $b[$x] . $g;\n $c++;\n if($b[$x] == 0)\n {\n $e++;\n }\n }\n }\n print $d;\n}\n?>"}], "negative_code": [{"source_code": " 0; $x--)\n {\n if(($b[$x - 1] >= $b[$x]) && ($b[$x] == 0) && ($x == 1))\n {\n $f = $c - $e + 1;\n $d += $f;\n $c = 0;\n $e = 0;\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c == 0))\n {\n $d += 2;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c == 0))\n {\n $d += 1;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c != 0))\n {\n $f = $c - $e + 1;\n $d += $f;\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($c == 0))\n {\n $c = 0;\n $e = 0;\n $d += 1;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] != 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] != 0) && ($c == 0))\n {\n $g = $b[$x];\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] == 0) && ($e == 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] == 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\"; \n }\n else\n {\n $g = $b[$x] . $g;\n $c++;\n if($b[$x] == 0)\n {\n $e++;\n }\n }\n }\n print $d;\n}\n?>"}, {"source_code": " 0; $x--)\n{\n if(($b[$x - 1] >= $b[$x]) && ($b[$x] == 0) && ($x == 1))\n {\n $f = $c - $e + 1;\n $d += $f;\n $c = 0;\n $e = 0;\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c == 0))\n {\n $d += 2;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c == 0))\n {\n $d += 1;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($x == 1) && ($c != 0))\n {\n $f = $c - $e + 1;\n $d += $f;\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($c == 0))\n {\n $c = 0;\n $e = 0;\n $d += 1;\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] != 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] != 0) && ($c == 0))\n {\n $g = $b[$x];\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] == 0) && ($e == 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] < $b[$x]) && ($b[$x] != 0) && ($b[$x - 1] == 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\";\n }\n elseif(($b[$x - 1] >= $b[$x]) && ($b[$x] != 0) && ($c != 0))\n {\n $g = $b[$x] . $g;\n $h = substr($a, 0, $x);\n if(strlen($h) > strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif(strlen($h) < strlen($g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n }\n elseif((strlen($h) == strlen($g)) && ($h > $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n }\n elseif((strlen($h) == strlen($g)) && ($h < $g))\n {\n $d += 1;\n $c = 0;\n $e = 0;\n break;\n } \n $g = \"\";\n $h = \"\"; \n }\n else\n {\n $g = $b[$x] . $g;\n $c++;\n if($b[$x] == 0)\n {\n $e++;\n }\n }\n}\nprint $d;\n?>"}, {"source_code": " $l/2) return true; \n\n\tif ($j > 1 and $s[$j+1] != 0) return true;\n\n\tif ($j == 1 and $s[$j+1] != 0) return ($s[0] > $s[1]); \n\n\t$k = $j+1; \n\twhile ($s[$k] == '0') { $k++; if ($k >= $l) break; }\n\t$zero = $k-$j-1; \n\n\tif ($j <= $zero) return false;\n\n\tif ($j > $zero+1) return true; \n\n\treturn ($s[0] >= $s[$j]);\n}\n"}, {"source_code": " $l/2) return true; \n\n\tif ($j > 1 and $s[$j+1] != 0) return true;\n\n\tif ($j == 1 and $s[$j+1] != 0) return ($s[0] > $s[1]);\n\n\t$k = $j+1; \n\twhile ($s[$k] == '0') { $k++; if ($k >= $l) break; }\n\t$zero = $k-$j-1; \n\n\tif ($j <= $zero) return false; \n\n\tif ($j > $zero+1) return true; \n\n\treturn ($s[0] > $s[$j]);\n}\n"}, {"source_code": " $l/2) return true; \n\n\tif ($j > 1 and $s[$j+1] != 0) return true;\n\n\tif ($j == 1 and $s[$j+1] != 0) return ($s[0] > $s[1]);\n\n\t$k = $j+1;\n\twhile ($s[$k] == '0') { $k++; if ($k+1 >= $l) break; }\n\t$zero = $k-$j;\n\n\tif ($j <= $zero) return false;\n\n\tif ($j > $zero+1) return true;\n\n\treturn ($s[0] > $s[$j]);\n}\n"}], "src_uid": "4e00fe693a636316d478978abf21d976"} {"source_code": "= 1 ) {\n\t\t$flomasters[ $cap[1] ][ $cap[0] ] --;\n\t\t$v++;\n\t\t$flomastersAll[ $cap[1] ]--;\n\t} else {\n\t\t$nonFormat[ $cap[1] ]++;\n\t}\n}\n\n$u = $v;\nforeach( $nonFormat as $key => $value ){\n\t$u += min( $flomastersAll[ $key ], $value);\n}\necho $u . \" \" . $v;\n\nfclose($fp);\n?>", "positive_code": [{"source_code": ""}, {"source_code": " $val)\n{\n if(isset($kolp[$k]['cnt']))\n {\n $u += min($val['cnt'],$kolp[$k]['cnt']);\n foreach($val['color'] as $k1 => $v1)\n if(isset($kolp[$k]['color'][$k1]))\n $v += min($v1,$kolp[$k]['color'][$k1]); \n }\n}\nfputs(STDOUT, $u.\" \".$v); \n?>\n"}, {"source_code": " 0) {\n\t\t--$pens[$diameter][$color];\n\t\t--$penCount[$diameter];\n\t\t++$nice;\n\t}\n}\n\n$total = $nice;\nforeach($penCount as $diameter => $count) {\n\tif (isset($fail[$diameter])) {\n\t\t$total += ($count > $fail[$diameter]) ? $fail[$diameter] : $count;\n\t}\n}\n\n\necho \"$total $nice\\n\";\n?>"}, {"source_code": " 0) {\n $beautiful++;\n $closed++;\n $markers[$size][$color]--;\n $markers[$size][\"closed\"]--;\n unset($caps[$i]);\n }\n\n}\n\nforeach($caps as $cap) {\n if( $markers[$cap[1]][\"closed\"] > 0 ) {\n $closed++;\n $markers[$cap[1]][\"closed\"]--;\n }\n}\n\necho $closed. \" \".$beautiful;\n\n\n\n\n\n\n\n?>"}, {"source_code": " 0){\n $curr[$exp[1]][$exp[0]]--;\n $CountColor[$exp[1]]--; \n $CountMarker[0]++;\n $CountMarker[1]++;\n } else{\n if(isset($StackBad[$exp[1]]))\n $StackBad[$exp[1]]++;\n else\n $StackBad[$exp[1]] = 1; \n }\n}\nforeach($StackBad AS $key => $value){\n if($CountColor[$key] >= $value)\n $CountMarker[0]+= $value;\n else\n $CountMarker[0]+= $CountColor[$key];\n}\necho $CountMarker[0]. ' '. $CountMarker[1] . \"\\n\";"}, {"source_code": " $aMarkerColors) {\n\tforeach ($aMarkerColors as $iMarkerColor => $iTheMarkers) {\n\t\t\n\t\tif (isset($aCaps[$iMarkerDiameter][$iMarkerColor]) && $aCaps[$iMarkerDiameter][$iMarkerColor] > 0) {\n\t\t\t$iTheCaps = $aCaps[$iMarkerDiameter][$iMarkerColor];\n\t\t\t$iCapped = min($iTheCaps, $iTheMarkers);\n\t\t\t\n\t\t\t$iBeautifulCappedMarkers += $iCapped;\n\t\t}\n\t}\n}\n\nforeach ($aUnbeautifulMarkers as $iMarkerDiameter => $iTheMarkers) {\n\tif (isset($aUnbeautifulCaps[$iMarkerDiameter]) && $aUnbeautifulCaps[$iMarkerDiameter] > 0) {\n\t\t$iTheCaps = $aUnbeautifulCaps[$iMarkerDiameter];\n\t\t\n\t\t$iCapped = min($iTheCaps, $iTheMarkers);\n\t\t\n\t\t$iCappedMarkers += $iCapped;\n\t}\n}\n\necho $iCappedMarkers . ' ' . $iBeautifulCappedMarkers;"}, {"source_code": " $value) {\n if (isset($capdiameters[$key])) {\n $tmp = array();\n $tmp[] = $capdiameters[$key];\n $tmp[] = $markerdiameters[$key];\n $capped += min($tmp);\n }\n}\n\n$mhashcount = array_count_values($markerhash);\n$chashcount = array_count_values($caphash);\n\nforeach ($mhashcount as $key => $value) {\n if (isset($chashcount[$key])) {\n $tmp = array();\n $tmp[] = $chashcount[$key];\n $tmp[] = $mhashcount[$key];\n $beautifully += min($tmp);\n }\n}\n\necho $capped.\" \".$beautifully;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n $beautiful++;\n $closed++;\n $markers[ $caps[$i][1] ][ $caps[$i][0] ]--;\n $markers[ $caps[$i][1] ][\"closed\"]--;\n }\n elseif( $markers[ $caps[$i][1] ][\"closed\"] > 0 ) {\n $closed++;\n $markers[ $caps[$i][1] ][ $caps[$i][0] ]--;\n $markers[ $caps[$i][1] ][\"closed\"]--;\n }\n}\n\n\n\necho $closed. \" \".$beautiful;\n\n\n\n\n/*\n5 5\n1 5\n2 4\n1 5\n3 4\n1 6\n3 4\n2 4\n6 4\n8 5\n1 6\n\n5: [1]\n4: [2,3]\n6: [1]\n*/\n\n/*\n\n5 5\n1 2\n1 3\n1 2\n1 3\n1 3\n1 2\n1 2\n1 3\n1 2\n1 2\n\n*/\n\n\n?>"}], "src_uid": "3c9fb72577838f54b1670e84b4b60c61"} {"source_code": " \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\nfor($x = 0; $x < $b; $x++)\n{\n list($e, $f) = explode(\" \", trim(fgets(STDIN)));\n $g = $d[$e];\n $h = $d[$f];\n $d[$e] = $h;\n $d[$f] = $g;\n}\n$i = array_flip($d);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$x] = $i[$c[$x]];\n}\nprint $c;\n?>", "positive_code": [{"source_code": " $pArray) {\n if (count($pArray)==0) {\n continue;\n }\n foreach ($pArray as $p) {\n $o[$p] = chr($c);\n }\n}\nfor ($i = 0; $i < $n; $i++) {\n echo $o[$i];\n}"}], "negative_code": [{"source_code": " \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$e = array(\"a\" => \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$j = array();\nfor($x = 0; $x < $b; $x++)\n{\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n array_push($j, $f);\n array_push($j, $g);\n array_push($j, \" \");\n $h = $d[$e[$f]];\n $i = $d[$e[$g]];\n $d[$e[$f]] = $i;\n $d[$e[$g]] = $h;\n $e[$f] = $g;\n $e[$g] = $f;\n}\nif($b == 100)\n{\n print implode(\" \", $j);\n}\nelse\n{\n for($x = 0; $x < $a; $x++)\n {\n $c[$x] = $d[$c[$x]];\n }\n print $c;\n}\n?>"}, {"source_code": " \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$e = array(\"a\" => \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$j = array();\nfor($x = 0; $x < $b; $x++)\n{\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n array_push($j, $f);\n array_push($j, $g);\n array_push($j, \" \");\n $h = $d[$e[$f]];\n $i = $d[$e[$g]];\n $d[$e[$f]] = $i;\n $d[$e[$g]] = $h;\n $e[$f] = $g;\n $e[$g] = $f;\n}\nprint implode(\" \", $j);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$x] = $d[$c[$x]];\n}\nprint $c;\n?>"}, {"source_code": " \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$e = array(\"a\" => \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$j = array();\nfor($x = 0; $x < $b; $x++)\n{\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n array_push($j, $f);\n array_push($j, $g);\n $h = $d[$e[$f]];\n $i = $d[$e[$g]];\n $d[$e[$f]] = $i;\n $d[$e[$g]] = $h;\n $e[$f] = $g;\n $e[$g] = $f;\n}\nif($b == 100)\n{\n print implode(\" \", $j);\n}\nelse\n{\n for($x = 0; $x < $a; $x++)\n {\n $c[$x] = $d[$c[$x]];\n }\n print $c;\n}\n?>"}, {"source_code": " \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$e = array(\"a\" => \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\nfor($x = 0; $x < $b; $x++)\n{\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n $h = $d[$e[$f]];\n $i = $d[$e[$g]];\n $d[$e[$f]] = $i;\n $d[$e[$g]] = $h;\n $e[$f] = $g;\n $e[$g] = $f;\n}\nfor($x = 0; $x < $a; $x++)\n{\n $c[$x] = $d[$c[$x]];\n}\nprint $c;\n?>"}, {"source_code": " \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\n$e = array(\"a\" => \"a\", \"b\" => \"b\", \"c\" => \"c\", \"d\" => \"d\", \"e\" => \"e\", \"f\" => \"f\", \"g\" => \"g\", \"h\" => \"h\", \"i\" => \"i\", \"j\" => \"j\", \"k\" => \"k\", \"l\" => \"l\", \"m\" => \"m\", \"n\" => \"n\", \"o\" => \"o\", \"p\" => \"p\", \"q\" => \"q\", \"r\" => \"r\", \"s\" => \"s\", \"t\" => \"t\", \"u\" => \"u\", \"v\" => \"v\", \"w\" => \"w\", \"x\" => \"x\", \"y\" => \"y\", \"z\" => \"z\");\nfor($x = 0; $x < $b; $x++)\n{\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n if((($j[$f] == FALSE) && ($j[$g] == FALSE)) || ($f == $g))\n {\n continue;\n }\n else\n {\n $h = $d[$e[$f]];\n $i = $d[$e[$g]];\n $d[$e[$f]] = $i;\n $d[$e[$g]] = $h;\n $e[$f] = $g;\n $e[$g] = $f;\n }\n}\nfor($x = 0; $x < $a; $x++)\n{\n $c[$x] = $d[$c[$x]];\n}\nprint $c;\n?>"}], "src_uid": "67a70d58415dc381afaa74de1fee7215"} {"source_code": "", "positive_code": [{"source_code": " ord($a[$i - 1][$j])) {\n $nStillEq[$i] = false;\n } elseif (ord($a[$i][$j]) < ord($a[$i - 1][$j])) {\n $dels++;\n $ok = false;\n break;\n }\n }\n if ($ok) {\n $stillEq = $nStillEq;\n }\n}\n\necho \"$dels\\n\";\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $a[$i - 1][$j]) {\n unset($stillEq[$i]);\n } elseif ($a[$i][$j] < $a[$i - 1][$j]) {\n $ok = false;\n break;\n }\n }\n\n if ($ok) {\n $j++;\n } else {\n for ($i = 0; $i < $n; $i++) {\n $a[$i] = substr($a[$i], 0, $j) . substr($a[$i], $j + 1);\n }\n $m--;\n $dels++;\n }\n}\n\nif ($dels == $origM - 1) { // kostyl\n $ok = true;\n for ($i = 1; $i < $n; $i++) {\n if ($a[$i][0] < $a[$i - 1][0]) {\n $ok = false;\n }\n }\n if (! $ok) {\n $dels++;\n }\n}\n\necho \"$dels\\n\";\n"}, {"source_code": ""}], "src_uid": "a45cfc2855f82f162133930d9834a9f0"} {"source_code": " $a[$index])\r\n {\r\n $openL = true;\r\n $openLValue = $a[$index];\r\n }\r\n\r\n if ($openL && $openLValue != $a[$index])\r\n {\r\n $openL = false;\r\n $openLValue = 0;\r\n }\r\n\r\n if ($openL && ($index == $n - 1 || $a[$index + 1] > $a[$index]))\r\n {\r\n $openL = false;\r\n $openLValue = 0;\r\n\r\n $valeyCount++;\r\n }\r\n }\r\n\r\n $results[$test] = $valeyCount == 1 ? \"YES\" : \"NO\";\r\n}\r\n\r\necho(implode(PHP_EOL, $results));\r\n\r\n\r\n// Helpers\r\n\r\nfunction getLineInt()\r\n{\r\n return (int) trim(fgets(STDIN));\r\n}\r\n\r\nfunction getLineInts()\r\n{\r\n return array_map(\"intval\", explode(' ', trim(fgets(STDIN))));\r\n}\r\n\r\nfunction getLine()\r\n{\r\n return trim(fgets(STDIN));\r\n}\r\n\r\nfunction getLineWords()\r\n{\r\n return explode(' ', trim(fgets(STDIN)));\r\n}\r\n\r\nfunction max2(array $array)\r\n{\r\n $max1 = $max2 = 0;\r\n\r\n for ($index = 0; $index < count($array); $index++)\r\n {\r\n if ($array[$index] > $max1)\r\n {\r\n $max2 = $max1;\r\n $max1 = $array[$index];\r\n }\r\n\r\n else if ($array[$index] > $max2)\r\n {\r\n $max2 = $array[$index];\r\n }\r\n }\r\n\r\n return array($max1, $max2);\r\n}\r\n", "positive_code": [{"source_code": " 0; $i--)\r\n if ($ary[$i-1] < $ary[$i])\r\n $can = false;\r\n for($i = $mn; $i < $n-1; $i++)\r\n if ($ary[$i] > $ary[$i+1])\r\n $can = false;\r\n echo ($can ? \"YES\" : \"NO\") . PHP_EOL;\r\n}\r\n"}], "negative_code": [], "src_uid": "7b6a3de5ad0975e4c43f097d4648c9c9"} {"source_code": "", "positive_code": [{"source_code": "\n\nclass DllItem{\n\tprotected $val = null;\n\tprotected $next = null;\n\tprotected $prev = null;\n\t\n\tfunction __construct($val){\n\t\t$this->val = $val;\n\t}\n\t\n\tfunction setNext(DllItem $next){\n\t\t$this->next = $next;\n\t}\n\t\n\tfunction setPrev(DllItem $prev){\n\t\t$this->prev = $prev;\n\t}\n\t\n\tfunction getNext(){\n\t\treturn $this->next;\n\t}\n\t\n\tfunction getPrev(){\n\t\treturn $this->prev;\n\t}\n\t\n\tfunction getValue(){\n\t\treturn $this->val;\n\t}\n\t\n\tfunction deleteNext(){\n\t\t$this->next = null;\n\t}\n\t\n\tfunction deletePrev(){\n\t\t$this->prev = null;\n\t}\n\t\n\t\n\t\n}\n\nclass DLL{\n\tprotected $head = null;\n\tprotected $tail = null;\n\t//protected $key = null;\n\tprotected $current = null;\n\t\n\tprotected function getCurrentNode(){\n\t\treturn $this->current;\n\t}\n\t\n\tpublic function current(){\n\t\treturn $this->current;\n\t}\n\t\n\tpublic function valid(){\n\t\treturn !is_null($this->current);\n\t}\n\t\n\tpublic function next(){\n\t\tif($this->valid()){\n\t\t\t$this->current = $this->current->getNext();\n\t\t}\t\t\n\t}\n\tpublic function prev(){\n\t\tif($this->valid()){\n\t\t\t$this->current = $this->current->getPrev();\n\t\t}\t\t\n\t}\n\t\n\tpublic function rewind(){\t\t\n\t\t$this->current = $this->head;\t\t\n\t}\n\t\n\tpublic function append($value){\n\t\t$item = new DllItem($value);\n\t\tif (is_null($this->head)){\t\t\t\n\t\t\t$this->head = $item;\n\t\t\t$this->tail = $item;\n\t\t\t$this->current = $item;\n\t\t}else{\n\t\t\t$item->setPrev($this->tail);\n\t\t\t$this->tail->setNext($item);\n\t\t\t$this->tail = $item;\n\t\t\t$this->current = $item;\n\t\t}\n\t}\n\t\n\tpublic function appendLeft($value){\n\t\t$item = new DllItem($value);\n\t\tif (is_null($this->head)){\t\t\t\n\t\t\t$this->head = $item;\n\t\t\t$this->tail = $item;\n\t\t\t$this->current = $item;\n\t\t}else{\n\t\t\t$item->setNext($this->head);\n\t\t\t$this->head->setPrev($item);\n\t\t\t$this->head = $item;\n\t\t\t$this->current = $item;\n\t\t}\n\t}\n\t\n\tpublic function insert($value){\n\t\tif ($this->current!=$this->tail){\n\t\t\t$item = new DllItem($value);\n\t\t\t$next = $this->current->getNext();\n\t\t\t$next->setPrev($item);\n\t\t\t$item->setNext($next);\n\t\t\t$this->current->setNext($item);\n\t\t\t$this->current = $item;\n\t\t}else{\n\t\t\t$this->append($value);\n\t\t}\n\t}\n\t\n\tpublic function pop(){\n\t\tif(!is_null($this->tail)){\n\t\t\t$tail = $this->tail;\n\t\t\t$prev = $tail->getPrev();\n\t\t\tif(!is_null($prev)){\n\t\t\t\t$prev->deleteNext();\n\t\t\t\t$this->tail = $prev;\n\t\t\t}else{\n\t\t\t\t$this->tail = null;\n\t\t\t\t$this->head = null;\n\t\t\t\t$this->current = null;\n\t\t\t}\n\t\t\treturn $tail->getValue();\n\t\t}else{\n\t\t\t//exception\n\t\t}\n\t}\n\t\n\tpublic function popLeft(){\n\t\tif(!is_null($this->head)){\n\t\t\t$head = $this->head;\n\t\t\t$next = $head->getNext();\n\t\t\tif(!is_null($next)){\n\t\t\t\t$next->deletePrev();\n\t\t\t\t$this->head = $next;\n\t\t\t}else{\n\t\t\t\t$this->tail = null;\n\t\t\t\t$this->head = null;\n\t\t\t\t$this->current = null;\n\t\t\t}\n\t\t\treturn $head->getValue();\n\t\t}else{\n\t\t\t//exception\n\t\t}\n\t}\n\t\n\tpublic function delete(){\n\t\tif($this->valid()){\n\t\t\t$cur = $this->current;\n\t\t\t$next = $cur->getNext();\n\t\t\t$prev = $cur->getPrev();\n\t\t\t\n\t\t\tif(!is_null($next)&&!is_null($prev)){\n\t\t\t\t$next->setPrev($prev);\n\t\t\t\t$prev->setNext($next);\n\t\t\t\t$this->current = $next;\n\t\t\t\t\n\t\t\t}elseif(!is_null($prev)&&is_null($next)){\n\t\t\t\t$this->pop();\n\t\t\t\t$this->current = $prev;\n\t\t\t}elseif(!is_null($next)&&is_null($prev)){\n\t\t\t\t$this->popLeft();\n\t\t\t\t$this->current = $next;\n\t\t\t}else{\n\t\t\t\t$this->pop();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic function print(){\n\t\t$cur = $this->head;\n\t\tif(!is_null($cur)){\n\t\t\techo \" \".$cur->getValue().\" \";\n\t\t\twhile(!is_null($cur->getNext())){\n\t\t\t\t\n\t\t\t\t$cur = $cur->getNext();\n\t\t\t\techo \" \".$cur->getValue().\" \";\n\t\t\t}\n\t\t}\n\t\techo \"\\n\";\n\t}\t\n\t\n}\n\n$dll = new DLL();\n\n\n$sarr = str_split(trim(fgets(STDIN)));\nforeach($sarr as $char){\n\t$dll->append($char);\n}\n$dll->rewind();\n\nfunction canPlay(&$dll){\n\t//echo $dll->count().\" cnt \\n\";\n\t//print_r($dll);\n\t$iter_n = 1;\n\tif(!$dll->valid()){\n\t\t$dll->rewind();\n\t}\n\twhile ($dll->valid()){\n\t\t//echo \"!\";\n\t\t//Print current node's value\n\t\t$cur = $dll->current();\n\t\t$next = $cur->getNext();\n\t\tif(!is_null($next)){\n\t\t\t\n\t\t\tif($cur->getValue()==$next->getValue()){\n\t\t\t\t$dll->delete();\n\t\t\t\t$dll->delete();\n\t\t\t\tif($dll->valid()&&!is_null($dll->current()->getPrev())){\n\t\t\t\t\t$dll->prev();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//Turn the cursor to next node\n\t\t$dll->next();\n\t\t/*\n\t\tif(!$dll->valid()&&$iter_n>0){\n\t\t\t$dll->rewind();\n\t\t\t$iter_n--;\n\t\t}*/\n\t\t\n\t}\n\treturn false;\n}\n\n$res = 2;\nwhile(true){\n\t$cp = canPlay($dll);\n\t//echo \"cp \".$cp.\"\\n\";\n\tif($cp==true){\n\t\tif($res==2){\n\t\t\t$res=1;\n\t\t}else{\n\t\t\t$res=2;\n\t\t}\n\t}else{\n\t\tbreak;\n\t}\n}\n\nif($res==1){\n\techo \"Yes\";\n}else{\n\techo \"No\";\n}\n"}], "negative_code": [{"source_code": "\n$sarr = str_split(trim(fgets(STDIN)));\n$dll = new SplDoublyLinkedList();\nforeach($sarr as $char){\n\t$dll->push($char);\n}\n\n\nfunction canPlay(&$dll){\n\tif($dll->count()<2){\n\t\treturn false;\n\t}\n\twhile ($dll->valid()){\n\t\t//Print current node's value\n\t\t$cur = $dll->current();\n\t\tif($dll->offsetExists($dll->key()+1)){\n\t\t\t\n\t\t\t$next = $dll->offsetGet($dll->key()+1);\n\t\t\techo $dll->current().\"\\n\";\n\t\t\tif ($next == $cur){\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t$dll->rewind();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//Turn the cursor to next node\n\t\t$dll->next();\n\t}\n\treturn false;\n}\n\n$res = 2;\nwhile(canPlay($dll)){\n\tif($res==2){\n\t\t$res=1;\n\t}else{\n\t\t$res=2;\n\t}\n}\n\nif($res==1){\n\techo \"Yes\";\n}else{\n\techo \"No\";\n}"}, {"source_code": "\n\nclass DllItem{\n\tprotected $val = null;\n\tprotected $next = null;\n\tprotected $prev = null;\n\t\n\tfunction __construct($val){\n\t\t$this->val = $val;\n\t}\n\t\n\tfunction setNext(DllItem $next){\n\t\t$this->next = $next;\n\t}\n\t\n\tfunction setPrev(DllItem $prev){\n\t\t$this->prev = $prev;\n\t}\n\t\n\tfunction getNext(){\n\t\treturn $this->next;\n\t}\n\t\n\tfunction getPrev(){\n\t\treturn $this->prev;\n\t}\n\t\n\tfunction getValue(){\n\t\treturn $this->val;\n\t}\n\t\n\tfunction deleteNext(){\n\t\t$this->next = null;\n\t}\n\t\n\tfunction deletePrev(){\n\t\t$this->prev = null;\n\t}\n\t\n\t\n\t\n}\n\nclass DLL{\n\tprotected $head = null;\n\tprotected $tail = null;\n\t//protected $key = null;\n\tprotected $current = null;\n\t\n\tprotected function getCurrentNode(){\n\t\treturn $this->current;\n\t}\n\t\n\tpublic function current(){\n\t\treturn $this->current;\n\t}\n\t\n\tpublic function valid(){\n\t\treturn !is_null($this->current);\n\t}\n\t\n\tpublic function next(){\n\t\tif($this->valid()){\n\t\t\t$this->current = $this->current->getNext();\n\t\t}\t\t\n\t}\n\t\n\tpublic function rewind(){\t\t\n\t\t$this->current = $this->head;\t\t\n\t}\n\t\n\tpublic function append($value){\n\t\t$item = new DllItem($value);\n\t\tif (is_null($this->head)){\t\t\t\n\t\t\t$this->head = $item;\n\t\t\t$this->tail = $item;\n\t\t\t$this->current = $item;\n\t\t}else{\n\t\t\t$item->setPrev($this->tail);\n\t\t\t$this->tail->setNext($item);\n\t\t\t$this->tail = $item;\n\t\t\t$this->current = $item;\n\t\t}\n\t}\n\t\n\tpublic function appendLeft($value){\n\t\t$item = new DllItem($value);\n\t\tif (is_null($this->head)){\t\t\t\n\t\t\t$this->head = $item;\n\t\t\t$this->tail = $item;\n\t\t\t$this->current = $item;\n\t\t}else{\n\t\t\t$item->setNext($this->head);\n\t\t\t$this->head->setPrev($item);\n\t\t\t$this->head = $item;\n\t\t\t$this->current = $item;\n\t\t}\n\t}\n\t\n\tpublic function insert($value){\n\t\tif ($this->current!=$this->tail){\n\t\t\t$item = new DllItem($value);\n\t\t\t$next = $this->current->getNext();\n\t\t\t$next->setPrev($item);\n\t\t\t$item->setNext($next);\n\t\t\t$this->current->setNext($item);\n\t\t\t$this->current = $item;\n\t\t}else{\n\t\t\t$this->append($value);\n\t\t}\n\t}\n\t\n\tpublic function pop(){\n\t\tif(!is_null($this->tail)){\n\t\t\t$tail = $this->tail;\n\t\t\t$prev = $tail->getPrev();\n\t\t\tif(!is_null($prev)){\n\t\t\t\t$prev->deleteNext();\n\t\t\t\t$this->tail = $prev;\n\t\t\t}else{\n\t\t\t\t$this->tail = null;\n\t\t\t\t$this->head = null;\n\t\t\t\t$this->current = null;\n\t\t\t}\n\t\t\treturn $tail->getValue();\n\t\t}else{\n\t\t\t//exception\n\t\t}\n\t}\n\t\n\tpublic function popLeft(){\n\t\tif(!is_null($this->head)){\n\t\t\t$head = $this->head;\n\t\t\t$next = $head->getNext();\n\t\t\tif(!is_null($next)){\n\t\t\t\t$next->deletePrev();\n\t\t\t\t$this->head = $next;\n\t\t\t}else{\n\t\t\t\t$this->tail = null;\n\t\t\t\t$this->head = null;\n\t\t\t\t$this->current = null;\n\t\t\t}\n\t\t\treturn $head->getValue();\n\t\t}else{\n\t\t\t//exception\n\t\t}\n\t}\n\t\n\tpublic function delete(){\n\t\tif($this->valid()){\n\t\t\t$cur = $this->current;\n\t\t\t$next = $cur->getNext();\n\t\t\t$prev = $cur->getPrev();\n\t\t\t\n\t\t\tif(!is_null($next)&&!is_null($prev)){\n\t\t\t\t$next->setPrev($prev);\n\t\t\t\t$prev->setNext($next);\n\t\t\t\t$this->current = $next;\n\t\t\t\t\n\t\t\t}elseif(!is_null($prev)&&is_null($next)){\n\t\t\t\t$this->pop();\n\t\t\t\t$this->current = $prev;\n\t\t\t}elseif(!is_null($next)&&is_null($prev)){\n\t\t\t\t$this->popLeft();\n\t\t\t\t$this->current = $next;\n\t\t\t}else{\n\t\t\t\t$this->pop();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic function print(){\n\t\t$cur = $this->head;\n\t\tif(!is_null($cur)){\n\t\t\techo \" \".$cur->getValue().\" \";\n\t\t\twhile(!is_null($cur->getNext())){\n\t\t\t\t\n\t\t\t\t$cur = $cur->getNext();\n\t\t\t\techo \" \".$cur->getValue().\" \";\n\t\t\t}\n\t\t}\n\t\techo \"\\n\";\n\t}\t\n\t\n}\n\n$dll = new DLL();\n\n\n$sarr = str_split(trim(fgets(STDIN)));\nforeach($sarr as $char){\n\t$dll->append($char);\n}\n$dll->rewind();\n\nfunction canPlay(&$dll){\n\t//echo $dll->count().\" cnt \\n\";\n\t//print_r($dll);\n\t$iter_n = 1;\n\tif(!$dll->valid()){\n\t\t$dll->rewind();\n\t}\n\twhile ($dll->valid()){\n\t\t//echo \"!\";\n\t\t//Print current node's value\n\t\t$cur = $dll->current();\n\t\t$next = $cur->getNext();\n\t\tif(!is_null($next)){\n\t\t\t\n\t\t\tif($cur->getValue()==$next->getValue()){\n\t\t\t\t$dll->delete();\n\t\t\t\t$dll->delete();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//Turn the cursor to next node\n\t\t$dll->next();\n\t\t/*\n\t\tif(!$dll->valid()&&$iter_n>0){\n\t\t\t$dll->rewind();\n\t\t\t$iter_n--;\n\t\t}*/\n\t\t\n\t}\n\treturn false;\n}\n\n$res = 2;\nwhile(true){\n\t$cp = canPlay($dll);\n\t//echo \"cp \".$cp.\"\\n\";\n\tif($cp==true){\n\t\tif($res==2){\n\t\t\t$res=1;\n\t\t}else{\n\t\t\t$res=2;\n\t\t}\n\t}else{\n\t\tbreak;\n\t}\n}\n\nif($res==1){\n\techo \"Yes\";\n}else{\n\techo \"No\";\n}\n"}, {"source_code": "\n\n$sarr = str_split(trim(fgets(STDIN)));\n$dll = new SplDoublyLinkedList();\nforeach($sarr as $char){\n\t$dll->push($char);\n}\n$dll->rewind();\n//print_r($dll);\n\n\nfunction canPlay(&$dll){\n\t//echo $dll->count().\" cnt \\n\";\n\t//print_r($dll);\n\t$iter_n = 1;\n\twhile ($dll->valid()){\n\t\t//echo \"!\";\n\t\t//Print current node's value\n\t\t$cur = $dll->current();\n\t\t//echo $cur.\"\\n\";\n\t\tif($dll->offsetExists($dll->key()+1)){\n\t\t\t\n\t\t\t$next = $dll->offsetGet($dll->key()+1);\n\t\t\t//echo $dll->current().\"\\n\";\n\t\t\tif ($next == $cur){\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t//print_r($dll);\n\t\t\t\tif ($iter_n <=1 ) {\n\t\t\t\t\t$iter_n++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//Turn the cursor to next node\n\t\t$dll->next();\n\t\tif(!$dll->valid()&&$iter_n>=0){\n\t\t\t$dll->rewind();\n\t\t\t$iter_n--;\n\t\t}\n\t\t\n\t}\n\treturn false;\n}\n\n$res = 2;\nwhile(true){\n\t$cp = canPlay($dll);\n\tif($cp){\n\t\tif($res==2){\n\t\t\t$res=1;\n\t\t}else{\n\t\t\t$res=2;\n\t\t}\n\t}else{\n\t\tbreak;\n\t}\n}\n\nif($res==1){\n\techo \"Yes\";\n}else{\n\techo \"No\";\n}\n"}, {"source_code": "\n$sarr = str_split(trim(fgets(STDIN)));\n$dll = new SplDoublyLinkedList();\nforeach($sarr as $char){\n\t$dll->push($char);\n}\n\nprint_r($dll);\n\n\nfunction canPlay(&$dll){\n\tif($dll->count()<2){\n\t\treturn false;\n\t}\n\twhile ($dll->valid()){\n\t\t//Print current node's value\n\t\t$cur = $dll->current();\n\t\tif($dll->offsetExists($dll->key()+1)){\n\t\t\t\n\t\t\t$next = $dll->offsetGet($dll->key()+1);\n\t\t\techo $dll->current().\"\\n\";\n\t\t\tif ($next == $cur){\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t$dll->rewind();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//Turn the cursor to next node\n\t\t$dll->next();\n\t}\n\treturn false;\n}\n\n$res = 2;\nwhile(canPlay($dll)){\n\tif($res==2){\n\t\t$res=1;\n\t}else{\n\t\t$res=2;\n\t}\n}\n\nif($res==1){\n\techo \"Yes\";\n}else{\n\techo \"No\";\n}"}, {"source_code": "\n\n$sarr = str_split(trim(fgets(STDIN)));\n$dll = new SplDoublyLinkedList();\nforeach($sarr as $char){\n\t$dll->push($char);\n}\n\n//print_r($dll);\n\n\nfunction canPlay(&$dll){\n\t//echo $dll->count().\" cnt \\n\";\n\t$iter_n = 0;\n\twhile ($dll->valid()){\n\t\t//echo \"!\";\n\t\t//Print current node's value\n\t\t$cur = $dll->current();\n\t\t//echo $cur.\"\\n\";\n\t\tif($dll->offsetExists($dll->key()+1)){\n\t\t\t\n\t\t\t$next = $dll->offsetGet($dll->key()+1);\n\t\t\t//echo $dll->current().\"\\n\";\n\t\t\tif ($next == $cur){\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t//print_r($dll);\n\t\t\t\tif ($iter_n == 0 ) {\n\t\t\t\t\t$iter_n = 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//Turn the cursor to next node\n\t\t$dll->next();\n\t\tif(!$dll->valid()&&$iter_n>0){\n\t\t\t$dll->rewind();\n\t\t}\n\t\t\n\t}\n\treturn false;\n}\n\n$res = 2;\nwhile(true){\n\t$cp = canPlay($dll);\n\tif($cp){\n\t\tif($res==2){\n\t\t\t$res=1;\n\t\t}else{\n\t\t\t$res=2;\n\t\t}\n\t}else{\n\t\tbreak;\n\t}\n}\n\nif($res==1){\n\techo \"Yes\";\n}else{\n\techo \"No\";\n}\n"}, {"source_code": "\n\n$sarr = str_split(trim(fgets(STDIN)));\n$dll = new SplDoublyLinkedList();\nforeach($sarr as $char){\n\t$dll->push($char);\n}\n\n//print_r($dll);\n\n\nfunction canPlay(&$dll){\n\t//echo $dll->count().\" cnt \\n\";\n\t$iter_n = 1;\n\twhile ($dll->valid()){\n\t\t//echo \"!\";\n\t\t//Print current node's value\n\t\t$cur = $dll->current();\n\t\t//echo $cur.\"\\n\";\n\t\tif($dll->offsetExists($dll->key()+1)){\n\t\t\t\n\t\t\t$next = $dll->offsetGet($dll->key()+1);\n\t\t\t//echo $dll->current().\"\\n\";\n\t\t\tif ($next == $cur){\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t$dll->offsetUnset($dll->key());\n\t\t\t\t//print_r($dll);\n\t\t\t\tif ($iter_n <=1 ) {\n\t\t\t\t\t$iter_n++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t//Turn the cursor to next node\n\t\t$dll->next();\n\t\tif(!$dll->valid()&&$iter_n>0){\n\t\t\t$dll->rewind();\n\t\t\t$iter_n--;\n\t\t}\n\t\t\n\t}\n\treturn false;\n}\n\n$res = 2;\nwhile(true){\n\t$cp = canPlay($dll);\n\tif($cp){\n\t\tif($res==2){\n\t\t\t$res=1;\n\t\t}else{\n\t\t\t$res=2;\n\t\t}\n\t}else{\n\t\tbreak;\n\t}\n}\n\nif($res==1){\n\techo \"Yes\";\n}else{\n\techo \"No\";\n}\n"}], "src_uid": "8fd51c391728b433cc94923820e908ff"} {"source_code": "1){\nif ($rdh[0] != 0)\n$rfyjmd []= 2*$rdh[0];\nif ($rdh[$nn-1] != $l)\n$rfyjmd []= 2*($l-$rdh[$nn-1]);\nfor ($i=0;$i<$nn-1;$i++){\n$rfyjmd []= abs($rdh[$i+1]-$rdh[$i]);\n}\n\n$val = max($rfyjmd)/2;\n}else{\n$val = max($l-$rdh[0],$rdh[0]);\n}\nprintf(\"%0.10f\",$val);\n?>", "positive_code": [{"source_code": ""}, {"source_code": " 1) {\n $d = array();\n if ($arr[0] != 0)\n $d[]= 2*$arr[0];\n if ($arr[$n-1] != $l)\n $d[]= 2*($l-$arr[$n-1]);\n for ($i = 0; $i < $n-1; $i++) {\n $d[]= abs($arr[$i+1]-$arr[$i]);\n }\n $res = max($d)/2;\n} else {\n $res = max($l-$arr[0], $arr[0]);\n}\nprintf(\"%0.10f\", $res);\n?>"}, {"source_code": " $v){\n $v = $l - $arr[$n - 1];\n }\n if ($v /2 <= $arr[0] || $v / 2 <= ($l - $arr[$n - 1])){\n printf(\"%.10f\", max(($l - $arr[$n - 1]), $arr[0]));\n }\n else\n printf(\"%.10f\", ($v / 2));"}, {"source_code": " $v){\n $v = $l - $arr[$n - 1];\n }\n if ($v /2 <= $arr[0] || $v / 2 <= ($l - $arr[$n - 1])){\n printf(\"%.10f\", max(($l - $arr[$n - 1]), $arr[0]));\n }\n else\n printf(\"%.10f\", ($v / 2));"}, {"source_code": "1){\n\t\tif ($A[0] != 0)\n\t\t\t$B []= 2*$A[0];\n\t\tif ($A[$n-1] != $l)\n\t\t\t$B []= 2*($l-$A[$n-1]);\n\t\tfor ($i=0;$i<$n-1;$i++){\n\t\t\t$B []= abs($A[$i+1]-$A[$i]);\n\t\t}\n\t\t\n\t\t$ans = max($B)/2;\n\t}else{\n\t\t$ans = max($l-$A[0],$A[0]);\n\t}\n\tprintf(\"%0.10f\",$ans);\n?>"}, {"source_code": "1){\nif ($rdh[0] != 0)\n$rfyjmd []= 2*$rdh[0];\nif ($rdh[$nnnnnn-1] != $l)\n$rfyjmd []= 2*($l-$rdh[$nnnnnn-1]);\nfor ($i=0;$i<$nnnnnn-1;$i++){\n$rfyjmd []= abs($rdh[$i+1]-$rdh[$i]);\n}\n\n$ololol = max($rfyjmd)/2;\n}else{\n$ololol = max($l-$rdh[0],$rdh[0]);\n}\nprintf(\"%0.10f\",$ololol);\n?>"}, {"source_code": " $f_start && $max_distanse > $f_finish) {\n echo $max_distanse;\n } elseif ($f_start > $max_distanse && $f_start > $f_finish){\n echo $f_start;\n } else {\n echo $f_finish;\n }"}, {"source_code": " $maxLen) {\n $maxLen = $arrN[$i+1] - $arrN[$i];\n }\n} \n\nif ((($arrN[0] - 0) * 2) > $maxLen) {\n $maxLen = $arrN[0] * 2;\n}\n\nif ((($l - $arrN[$n-1]) * 2) > $maxLen) {\n $maxLen = ($l - $arrN[$n-1]) * 2;\n}\n\necho $maxLen / 2;\n\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": ""}, {"source_code": "$d = readline();\n$fonari = readline();\n//$d = '2 5';\n$d = explode(' ',$d);\n$n = $d[0];\n$l = $d[1];\n//$fonari = '2 5';\n$fonari = explode(' ',$fonari); // 2 5\nsort($fonari);\n$summa = array();\n$i = 0;\n$f_start = min($fonari);\n$f_finish = $l - max($fonari);\n foreach ($fonari as $v){\n $summa[] = $fonari[$i + 1] - $v;\n $i += 1;\n if ($i == count($fonari) - 1) {\n break;\n }\n }\n $max_distanse = max($summa)/2;\n if ($max_distanse > $f_start && $max_distanse > $f_finish) {\n echo $max_distanse;\n } elseif ($f_start > $max_distanse && $f_start > $f_finish){\n echo $f_start;\n } else {\n echo $f_finish;\n }\n"}], "src_uid": "d79166497eb61d81fdfa4ef80ec1c8e8"} {"source_code": "", "positive_code": [{"source_code": "';\n\n$t = intval(fgets($handle));\n\nfor ($tI = 0; $tI < $t; $tI++) {\n list($n, $c0, $c1, $h) = sscanf(fgets($handle), \"%d %d %d %d\");\n $s = fgets($handle);\n\n $minCoins = 0;\n\n for ($i = 0; $i < $n; $i++) {\n $defaultAmountNeeded = ($s{$i} == '0' ? $c0 : $c1);\n $amountNeededIfChange = ($s{$i} == '0' ? $c1 : $c0) + $h;\n\n $minCoins += $defaultAmountNeeded <= $amountNeededIfChange ? $defaultAmountNeeded : $amountNeededIfChange;\n }\n\n\n echo $minCoins;\n echo \"\\n\";\n}"}, {"source_code": "$c1[$k] && $c0[$k]>$h[$k]){\nfor($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==0){\n $coin1[$k]++;\n }\n}\n$r[$k]=($n[$k]*$c1[$k])+($coin1[$k]*$h[$k]);\n}\n\nelse if($c1[$k]>$c0[$k] && $c1[$k]>$h[$k]){\n for($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==1){\n $coin0[$k]++;\n }\n} \n$r[$k]=($n[$k]*$c0[$k])+($coin0[$k]*$h[$k]);\n}\nelse if($c1[$k]==$c0[$k])\n$r[$k]=($n[$k]*$c1[$k]);\nelse{\n for($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==0){\n $coin0[$k]++;\n }\n else{\n $coin1[$k]++;\n }\n}\n$r[$k]=($coin0[$k]*$c0[$k])+($coin1[$k]*$c1[$k]);\n\n}\n\necho $r[$k].PHP_EOL;\n}"}, {"source_code": "$c1[$k] && $c0[$k]>$h[$k]){\n$coin0[$k]=0;\n$coin1[$k]=0;\nfor($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==0){\n $coin1[$k]++;\n }\n}\n$r[$k]=($n[$k]*$c1[$k])+($coin1[$k]*$h[$k]);\n}\n\nelse if($c1[$k]>$c0[$k] && $c1[$k]>$h[$k]){\n$coin0[$k]=0;\n$coin1[$k]=0;\n for($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==1){\n $coin0[$k]++;\n }\n} \n$r[$k]=($n[$k]*$c0[$k])+($coin0[$k]*$h[$k]);\n}\nelse if($c1[$k]==$c0[$k])\n$r[$k]=($n[$k]*$c1[$k]);\nelse{\n$coin0[$k]=0;\n$coin1[$k]=0;\n for($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==0){\n $coin0[$k]++;\n }\n else{\n $coin1[$k]++;\n }\n}\n$r[$k]=($coin0[$k]*$c0[$k])+($coin1[$k]*$c1[$k]);\n\n}\n\necho $r[$k].PHP_EOL;\n}"}, {"source_code": "$c1[$k] && $c0[$k]>2*$h[$k]){\nfor($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==0){\n $coin1[$k]++;\n }\n}\n$r[$k]=($n[$k]*$c1[$k])+($coin1[$k]*$h[$k]);\n}\n\nelse if($c1[$k]>$c0[$k] && $c1[$k]>2*$h[$k]){\n for($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==1){\n $coin0[$k]++;\n }\n} \n$r[$k]=($n[$k]*$c0[$k])+($coin0[$k]*$h[$k]);\n}\nelse if($c1[$k]==$c0[$k])\n$r[$k]=($n[$k]*$c1[$k]);\nelse{\n for($i=0;$i<$n[$k];$i++){\n if($scoin[$k][$i]==0){\n $coin0[$k]++;\n }\n else{\n $coin1[$k]++;\n }\n}\n$r[$k]=($coin0[$k]*$c0[$k])+($coin1[$k]*$c1[$k]);\n\n}\n\necho $r[$k].PHP_EOL;\n}"}, {"source_code": "';\n\n$t = intval(fgets($handle));\n\nfor ($tI = 0; $tI < $t; $tI++) {\n list($n, $c0, $c1, $h) = sscanf(fgets($handle), \"%d %d %d %d\");\n $s = fgets($handle);\n\n $minCoins = 0;\n\n for ($i = 0; $i < $n; $i++) {\n $defaultAmountNeeded = ($s{$i} == '0' ? $c0 : $c1);\n $amountNeededIfChange = ($s{$i} == '0' ? $c1 : $c0) + $h;\n\n $minCoins += $defaultAmountNeeded <= $amountNeededIfChange ? $defaultAmountNeeded : $amountNeededIfChange;\n }\n\n\n echo $minCoins;\n echo \"\\n\";\n}"}], "src_uid": "7cc0a6df601e3dcf4e1d9578dd599a36"} {"source_code": " 2) { //needs to divide into the num of statues and also be >= 3 after that.\n $sums = array();\n $leftstanding = $n / $i;\n for ($k = 0; $k < $i; $k++) {\n $sum = 0;\n for ($j = $k; $j < $n; $j += $i) {\n $sum += $t[$j];\n }\n $sums[] = $sum;\n }\n rsort($sums);\n $total[] = $sums[0]; //only the top dogs need to move to the next round\n }\n}\nrsort($total);\necho $total[0];\n?>", "positive_code": [{"source_code": "= 3))\n {\n for($y = 0; $y < $x; $y++)\n {\n $j = 0;\n for($z = $y; $z < $a; $z += $x)\n {\n $j += $b[$z];\n }\n array_push($c, $j);\n }\n }\n}\nprint max($c);\n?>"}, {"source_code": " $val)\n{\n $kv = $n / $val;\n for($i=0;$i<$kv;$i++)\n {\n for($j=0;$j<$val;$j++)\n {\n $sum[$i] += (int)$t[$i+$kv*$j];\n } \n } \n $sum[] = $lastMax;\n $lastMax = max($sum); \n unset($sum);\n}\nfputs(STDOUT, $lastMax);\n?>"}, {"source_code": " intval($lines[0]),\n 'items' => $lines[1],\n );\n }\n\n public static function set($data)\n {\n file_put_contents('php://stdout', $data);\n }\n }\n?>"}, {"source_code": "\\r\\n\":'';\n if(!isset($sum[$j.'_'.$item]))\n $sum[$j.'_'.$item] = 0;\n $sum[$j.'_'.$item] += (int)$points[$i];\n }\n }\n }\n }*/\n\n\n /*foreach($d as $item) {\n for($i = 0; $i < $len; $i+=$item) {\n $j = 0;\n foreach($d as $temp) {\n if($j<$item && isset($points[$i+$j])) {\n echo $item===2 && $j==1 ?'<'.$points[$i+$j].'|'.$item.'|'.$j.\">\\r\\n\":'';\n if(!isset($sum[$j.'_'.$item]))\n $sum[$j.'_'.$item] = 0;\n $sum[$j.'_'.$item]+=$points[$i+$j];\n }\n $j = $temp;\n }\n }\n }*/\n\n foreach($d as $ter => $item) {\n for($i = 0; $i < $len; $i+=$item) {\n for($j = 0; $j<$d[$ter]; $j++) {\n if(isset($points[$i+$j])) {\n //echo $item===8 && $j==1 ?'<'.$points[$i+$j].'|'.$item.'|'.$j.\">\\r\\n\":'';\n if(!isset($sum[$item.'_'.$j]))\n $sum[$item.'_'.$j] = 0;\n $sum[$item.'_'.$j]+=$points[$i+$j];\n }\n }\n }\n }\n\n //var_dump($sum);\n\n return max(array_sum($points), max($sum));\n};\n\nfunction findDel($ch) {\n $arr = array();\n for($s = 2; $s < $ch; $s++) {\n if ($s< floor($ch/2) && $ch % $s==0) {\n $arr[] = $s;\n }\n if($s>floor($ch/2))\n break;\n }\n return $arr;\n}\n\n//$line1 = 9;\n//$line2 = '';\n$lineArray2 = explode(' ', $line2);\n\necho $f($line1, $lineArray2);\n\n//echo \"\\r\\n|=>\", (time() - $t2), \"\\r\\n\";"}, {"source_code": "=3)\n{\n if($n/$i==floor($n/$i))\n {\n for($sdvig=0;$sdvig<$i;$sdvig++)\n {\n for($ii=$sdvig;$ii<$n;$ii=$ii+$i)\n {\n $rating+=$array[$ii];\n }\n if(isset($ratingMax))\n {\n if($rating>$ratingMax)\n {\n $ratingMax=$rating;\n }\n }\n else\n {\n $ratingMax=$rating;\n }\n $rating=0;\n }\n }\n $i++;\n}\necho $ratingMax;\n?>"}, {"source_code": " $max) $max = $c;\n\t\t}\n\t}\n}\nprintf(\"%d\", $max);"}, {"source_code": "=3 ){\n for ($j = 0; $j < $i; $j++)\n $max=max($max, sum($arr,$j, $i));\n }\n}\nfprintf(STDOUT, \"%.0f\", $max);"}, {"source_code": " $val)\n{\n $kv = $n / $val;\n for($i=0;$i<$kv;$i++)\n {\n for($j=0;$j<$val;$j++)\n {\n $sum[$i] += (int)$t[$i+$kv*$j];\n } \n } \n $sum[] = $lastMax;\n $lastMax = max($sum); \n unset($sum);\n}\nfputs(STDOUT, $lastMax);\n?>\n"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = (int)(fgets($fp));\n$rating = explode(\" \", str_replace( \"\\r\\n\", '', fgets($fp) ) );\n\n$group = searchGroup( $count );\n\n$maxFind = array();\nforeach( $group as $key => $val ){\n\t$max = searchMax( $rating, $key );\n\t$maxFind[] = max( $max );\n}\n\necho max( $maxFind );\n\nfclose($fp);\n\nfunction searchMax( $rating, $period )\n{\n\t$groupSum = array();\n\t$i = 1;\n\tforeach( $rating as $value ){\n\t\t$groupSum[$i] += $value;\n\t\t$i++;\n\t\tif( $i > $period )\n\t\t{\n\t\t\t$i = 1;\n\t\t}\n\t}\n\treturn $groupSum;\n}\n\nfunction searchGroup( $number )\n{\n\t$aResult = array();\n\t$middle = $number / 2;\n\t$i = 1;\n\twhile( $i <= $middle )\n\t{\n\t\tif( $number % $i == 0 ){\n\t\t\tif( $number / $i > 2 )\n\t\t\t{\n\t\t\t\t$aResult[$i] = true;\n\t\t\t}\n\t\t\tif( $i > 2 )\n\t\t\t{\n\t\t\t\t$aResult[$number / $i] = true;\n\t\t\t}\n\t\t}\n\t\t$i++;\n\t}\n\t\n\treturn $aResult;\n}\n?>"}, {"source_code": " $max){\n $max = $sum;\n }\n }\n }\n}\necho $max.\"\\n\";\n?>"}, {"source_code": ""}, {"source_code": " $ans) $ans = $tmp;\n\t}\n}\necho $ans;\n?>"}, {"source_code": "$valueA) $r = $r + $valueA;\n return $r;\n}\n\n$aP = sumP($values);\n\n$i = count($del);\nwhile ($i>0)\n{\n $ugolnik = $del[$i-1];\n $countUgolnik = $n / $ugolnik;\n while ($countUgolnik>0)\n {\n $sx = $countUgolnik-1;\n \n $summa = 0;\n while ($sx<=$n)\n {\n $summa = $summa + $values[$sx];\n $sx = $sx + ($n/$ugolnik); \n }\n \n// echo $summa.\"\\n\";\n \n if ($aP<$summa) $aP = $summa;\n $countUgolnik--;\n } \n \n $i--;\n}\n\necho $aP;\n \n?>"}, {"source_code": " intval($lines[0]),\n 'items' => $lines[1],\n );\n $i = 0;\n $sums = array();\n $n = $input['n'];\n for ($i = 1; $i <= $n / 3; $i++) {\n if ($n % $i) { continue; }\n for($k = 1; $k <= $i; $k++) {\n $sums[] = getSum($k, $i);\n }\n }\n function getSum($start, $step)\n {\n global $input;\n $sum = 0;\n for($i = $start - 1; $i < count($input['items']); $i = $i+$step) {\n $sum += $input['items'][$i];\n }\n return $sum;\n }\n\n file_put_contents('php://stdout', max($sums));\n ?>"}, {"source_code": "$item) {\n if (!isset($sum[$key])) {\n $sum[$key] = 0;\n }\n $sum[$key] += $item;\n }\n }\n \n rsort($sum);\n \n if ($max_sum === false || $max_sum < $sum[0]) {\n $max_sum = $sum[0];\n }\n }\n \n $sum = array_sum($columns);\n if ($max_sum === false || $sum > $max_sum) {\n echo $sum;\n } else {\n echo $max_sum;\n }\n?>"}, {"source_code": ""}, {"source_code": "0) or ($n/$i<3)) {continue;}\n for ($t=0; $t<=$i-1; $t++){ \n $j=$t; $count=$ball[$j];\n while ($j<$n){\n \n $j=$j+$i; \n \n $count=$count+$ball[$j];\n \n \n }\n if ($min<=$count) $min=$count;\n } \n }\n print($min);\n\n?>"}, {"source_code": "$max){$max=$sum;} \n }\n }\n } \n \n echo $max; \n?>"}, {"source_code": "\nfscanf(STDIN, \"%d\\n\", $number);\n$line=trim(fgets(STDIN));\n$t=explode(\" \",$line);\n$count=count($t);\nif($count!=$number||$number<3||$number>20000)exit();\n$res=array();\nfor($i=1;$i<$count;$i++){\n\tif($count%$i!=0 || ($count/$i)<3)continue;\n\t$count/$i;\n\tfor($n=0;$n<$i;$n++){\n\t\tfor($a=$n;$a<$count;$a+=$i){\n\t\t\t$val=$t[$a];\n\t\t\tif($val<-1000||$val>1000)exit();\n\t\t\t$res[$i.$n]+=$val;\n\t\t}\n\t}\n}\necho max($res);\n?>\n"}, {"source_code": " 20000) {\n\tdie;\n}\n\nforeach ($aRates as &$iRate) {\n\t$iRate = (int) $iRate;\n\t\n\tif ($iRate < 0) {\n\t\t$bHaveNegative = true;\n\t}\n}\n\n$iIterations = floor($iSculptures / 3);\n\nfor ($i = 1; $i <= $iIterations; $i ++) {\n\n\t$aTempRates = $aRates;\n\tif ($iSculptures % $i == 0) {\n\t\tfor ($fi = 1; $fi <= $i; $fi ++) {\n\t\t\t\n\t\t\t$iReplaced = $aTempRates[$fi - 1];\n\t\t\tarray_push($aTempRates, $iReplaced);\n\n\t\t\t$iCurRate = 0;\n\t\t\t$iTop = $iSculptures + $fi;\n\t\t\t\n\t\t\tfor ($j = $fi; $j < $iTop ; $j += $i) {\n\t\t\t\t$iCurRate += $aTempRates[$j];\n\t\t\t}\n\t\t\t\n\t\t\tif (!isset($iMaxRate)) {\n\t\t\t\t$iMaxRate = $iCurRate;\n\t\t\t\t\n\t\t\t\tif (!isset($bHaveNegative)) {\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$iMaxRate = max($iCurRate, $iMaxRate);\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $iMaxRate;\n\n"}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n$points=trim($lines[0]);\n$dots=explode(\" \", $lines[1]);\n\n\n\n\n$max=array_sum($dots);\nif ($points>5)\n{\n $dels=del($points);\n foreach ($dels as $d)\n {\n for ($c=1; $c<=$d; $c++)\n {\n $tmp=0;\n $n=0;\n for ($i=0+$c; $i<=$points; $i=$i+$d)\n {\n $tmp+=$dots[$i-1];\n $n++;\n //echo \"{$dots[$i-1]} \";\n }\n //echo \" = $tmp
\";\n if($n>=3)\n if ($tmp>$max)\n $max=$tmp;\n }\n }\n}\n\necho $max;\n\nfunction del($chislo)\n{\n for($i = 1; $i < $chislo; $i++)\n {\n if(($chislo % $i)==0)\n $dels[]=$i;\n }\n return $dels;\n}\n?>"}, {"source_code": "= 3) {\n $delitels[] = $i;\n }\n}\n\nfor ($i=0; $i<$number; $i++) {\n $summa += $array[$i];\n}\n\n//1 - \u0415\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 - \u0442\u043e \u043e\u0442\u0432\u0435\u0442 - \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430\n\nif (!empty($delitels)) {\n foreach ($delitels as $del) {\n for ($j=0; $j<$del; $j++) { //\u041f\u0440\u043e\u0439\u0434\u0451\u043c \u043f\u043e \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044e \u0441 \u0448\u0430\u0433\u043e\u043c = 1\n $sum = 0;\n for ($i=$j; $i<$number; $i+=$del) {\n $sum += $array[$i];\n }\n if ($sum > $summa) {\n $summa = $sum;\n }\n }\n }\n}\n\n fputs(STDOUT, $summa);\n?> "}], "negative_code": [{"source_code": "\\r\\n\":'';\n if(!isset($sum[$j.'_'.$item]))\n $sum[$j.'_'.$item] = 0;\n $sum[$j.'_'.$item] += (int)$points[$i];\n }\n }\n }\n }*/\n\n\n /*foreach($d as $item) {\n for($i = 0; $i < $len; $i+=$item) {\n $j = 0;\n foreach($d as $temp) {\n if($j<$item && isset($points[$i+$j])) {\n echo $item===2 && $j==1 ?'<'.$points[$i+$j].'|'.$item.'|'.$j.\">\\r\\n\":'';\n if(!isset($sum[$j.'_'.$item]))\n $sum[$j.'_'.$item] = 0;\n $sum[$j.'_'.$item]+=$points[$i+$j];\n }\n $j = $temp;\n }\n }\n }*/\n\n foreach($d as $ter => $item) {\n for($i = 0; $i < $len; $i+=$item) {\n for($j = 0; $j<$d[$ter]; $j++) {\n if(isset($points[$i+$j])) {\n //echo $item===5 && $j=0 ?'<'.$points[$i+$j].'|'.$item.'|'.$j.\">\\r\\n\":'';\n if(!isset($sum[$j.'_'.$item]))\n $sum[$j.'_'.$item] = 0;\n $sum[$j.'_'.$item]+=$points[$i+$j];\n }\n }\n }\n }\n\n //var_dump($sum);\n\n return max(array_sum($points), max($sum));\n};\n\nfunction findDel($ch) {\n $arr = array();\n for($s = 2; $s < $ch; $s++) {\n if ($s< floor($ch/2) && $ch % $s==0) {\n $arr[] = $s;\n }\n if($s>floor($ch/2))\n break;\n }\n return $arr;\n}\n\n//$line1 = 9;\n//$line2 = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20';\n$lineArray2 = explode(' ', $line2);\n\necho $f($line1, $lineArray2);\n\n//echo \"\\r\\n|=>\", (time() - $t2), \"\\r\\n\";"}, {"source_code": "=3)\n{\n for($sdvig=0;$sdvig<=$i;$sdvig++)\n {\n for($ii=$sdvig;$ii<$n;$ii=$ii+$i)\n {\n $rating+=$array[$ii];\n \n }\n if($rating>$ratingMax)\n {\n $ratingMax=$rating;\n }\n $rating=0;\n }\n $i++;\n}\n\necho $ratingMax;\n?>"}, {"source_code": "=3)\n{\n for($sdvig=0;$sdvig<=$i;$sdvig++)\n {\n for($ii=$sdvig;$ii<$n;$ii=$ii+$i)\n {\n $rating+=$array[$ii];\n \n }\n if(!empty($ratingMax))\n {\n if($rating>$ratingMax)\n {\n $ratingMax=$rating;\n }\n }\n else\n {\n $ratingMax=$rating;\n }\n $rating=0;\n }\n $i++;\n}\necho $ratingMax;\n?>"}, {"source_code": " $max) $max = $c;\n\t\t}\n\t}\n}\nprintf(\"%d\", $max);"}, {"source_code": " $val)\n{\n $kv = $n / $val;\n for($i=0;$i<$kv;$i++)\n {\n for($j=0;$j<$val;$j++)\n {\n $sum[$i] += (int)$t[$i+$kv*$j];\n } \n } \n $sum[] = $lastMax;\n $lastMax = max($sum); \n unset($sum);\n}\nfputs(STDOUT, $lastMax);\n?>\n"}, {"source_code": "5){\n $res[]=$a/2;\n $a=$a/2;\n }\n return $res;\n }elseif($n%4==0){\n while($a>4){\n $res[]=$a/2;\n $a=$a/2;\n }\n return $res;\n }elseif($n%3==0){\n while($a>3){\n $res[]=$a/2;\n $a=$a/2;\n }\n return $res;\n }else{\n return $n;\n }\n \n}\n\n$n= trim(fgets(STDIN));\n$balls=explode(' ',trim(fgets(STDIN)));\n\n$max=array_sum($balls);\n$variants=getVariants($n);\n\n$c=count($variants);\nif($c==1){\n echo array_sum($balls);\n}else{\n for($i=1;$i<$c;$i++){\n $maxEven=0;\n $maxOdd=0;\n for($j=0;$j<$n;$j=$j+$n/$variants[$i]){\n $maxOdd+=$balls[$j];\n }\n for($j=1;$j<$n;$j=$j+$n/$variants[$i]){\n $maxEven+=$balls[$j];\n }\n if($maxEven>$max){\n $max=$maxEven;\n }\n if($maxOdd>$max){\n $max=$maxOdd;\n }\n }\n echo $max;\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $ans) $ans = $tmp;\n\t}\n}\necho $ans;\n?>"}, {"source_code": "$item) {\n if (!isset($sum[$key])) {\n $sum[$key] = 0;\n }\n $sum[$key] += $item;\n }\n }\n \n rsort($sum);\n if ($max_sum < $sum[0]) {\n $max_sum = $sum[0];\n }\n }\n \n $sum = array_sum($columns);\n if ($sum > $max_sum) {\n echo $sum;\n } else {\n echo $max_sum;\n }\n?>"}, {"source_code": "$item) {\n if (!isset($sum[$key])) {\n $sum[$key] = 0;\n }\n $sum[$key] += $item;\n }\n }\n \n rsort($sum);\n if ($max_sum < $sum[0]) {\n $max_sum = $sum[0];\n }\n }\n \n $sum = array_sum($columns);\n if ($sum > $max_sum) {\n echo $sum;\n } else {\n echo $max_sum;\n }\n?>"}, {"source_code": "0) or ($n/$i<3)) {continue;}\n for ($t=0; $t<=$i; $t++){ \n $j=$t; $count=$ball[$j];\n while ($j<=$n){\n $j=$j+$i; \n $count=$count+$ball[$j];\n \n if ($min<=$count) $min=$count;\n }\n } \n }\n print($min);\n\n?>"}, {"source_code": "0) or ($n/$i<3)) {continue;}\n for ($t=0; $t<=$i-1; $t++){ \n $j=$t; $count=$ball[$j];\n while ($j<$n){\n \n $j=$j+$i; \n \n $count=$count+$ball[$j];\n \n \n }\n if ($min<=$count) $min=$count;\n } \n }\n print($min);\n\n?>"}, {"source_code": "$max){$max=$sum;} \n }\n }\n } \n \n echo $max; \n?>"}, {"source_code": "\nfscanf(STDIN, \"%d\\n\", $number);\n$line=trim(fgets(STDIN));\n$t=explode(\" \",$line);\n$count=count($t);\nif($count!=$number||$number<3||$number>20000)exit();\n$res=array();\nfor($i=1;$i<$count;$i++){\n\tif($count%$i!=0)continue;\n\tfor($n=0;$n<=$i;$n++){\n\t\tfor($a=$n;$a<$count;$a+=$i){\n\t\t\t$val=$t[$a];\n\t\t\tif($val<-1000||$val>1000)exit();\n\t\t\t$res[$i.$n]+=$val;\n\t\t}\n\t}\n}\necho max($res);\n?>\n"}, {"source_code": "\nfscanf(STDIN, \"%d\\n\", $number);\n$line=trim(fgets(STDIN));\n$t=explode(\" \",$line);\n$count=count($t);\nif($count!=$number||$number<3||$number>20000)exit();\n$res=array();\nfor($i=1;$i<$count;$i++){\n\tif($count%$i!=0 && $count/$i<3)continue;\n\tfor($n=0;$n<$i;$n++){\n\t\tfor($a=$n;$a<$count;$a+=$i){\n\t\t\t$val=$t[$a];\n\t\t\tif($val<-1000||$val>1000)exit();\n\t\t\t$res[$i.$n]+=$val;\n\t\t}\n\t}\n}\necho max($res);\n?>\n"}, {"source_code": "\nfscanf(STDIN, \"%d\\n\", $number);\n$line=trim(fgets(STDIN));\n$t=explode(\" \",$line);\n$count=count($t);\nif($count!=$number||$number<3||$number>20000)exit();\n$res=array();\nfor($i=1;$i<$count;$i++){\n\tif($count%$i!=0 && $count/$i<3)continue;\n\tfor($n=0;$n<$i;$n++){\n\t\tfor($a=$n;$a<$count;$a+=$i){\n\t\t\t$val=$t[$a];\n\t\t\tif($val<-1000||$val>1000)exit();\n\t\t\t$res[$i.$n]+=$val;\n\t\t}\n\t}\n}\nvar_dump($res);\necho max($res);\n?>\n"}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n$points=trim($lines[0]);\n$dots=explode(\" \", $lines[1]);\n\n\n\n\n$max=array_sum($dots);\nif ($points%2==0)\n{\n $dels=del($points);\n foreach ($dels as $d)\n {\n for ($c=1; $c<=$d; $c++)\n {\n $tmp=0;\n for ($i=0+$c; $i<=$points; $i=$i+$d)\n {\n $tmp+=$dots[$i-1];\n //echo \"{$dots[$i-1]} \";\n }\n //echo \" = $tmp
\";\n if ($tmp>$max)\n $max=$tmp;\n }\n }\n}\n\necho $max;\n\nfunction del($chislo)\n{\n for($i = 2; $i < $chislo; $i++)\n {\n if(($chislo % $i)==0)\n $dels[]=$i;\n }\n return $dels;\n}\n\n?>"}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n$points=trim($lines[0]);\n$dots=explode(\" \", $lines[1]);\n\n\n//$points=44;\n$dels=del($points);\n\n\n$max=array_sum($dots);\n\n\nforeach ($dels as $d)\n{\n for ($c=1; $c<=$d; $c++)\n {\n $tmp=0;\n for ($i=0+$c; $i<=$points; $i=$i+$d)\n {\n $tmp+=$dots[$i-1];\n \n }\n if ($tmp>$max)\n $max=$tmp;\n }\n}\n\n\necho $max;\n\nfunction del($chislo)\n{\n for($i = 2; $i < $chislo; $i++)\n {\n if(($chislo % $i)==0)\n $dels[]=$i;\n }\n return $dels;\n}\n?>"}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n$points=trim($lines[0]);\n$dots=explode(\" \", $lines[1]);\n\n\n\n\n$max=array_sum($dots);\nif ($points%2==0 and $points>5)\n{\n $dels=del($points);\n foreach ($dels as $d)\n {\n for ($c=1; $c<=$d; $c++)\n {\n $tmp=0;\n for ($i=0+$c; $i<=$points; $i=$i+$d)\n {\n $tmp+=$dots[$i-1];\n //echo \"{$dots[$i-1]} \";\n }\n //echo \" = $tmp
\";\n if ($tmp>$max)\n $max=$tmp;\n }\n }\n}\n\necho $max;\n\nfunction del($chislo)\n{\n for($i = 2; $i < $chislo; $i++)\n {\n if(($chislo % $i)==0)\n $dels[]=$i;\n }\n return $dels;\n}\n?>"}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n$points=trim($lines[0]);\n$dots=explode(\" \", $lines[1]);\n\n\n\n\n$max=array_sum($dots);\nif ($points%2==0 and $points>5)\n{\n $dels=del($points);\n foreach ($dels as $d)\n {\n for ($c=1; $c<=$d; $c++)\n {\n $tmp=0;\n $n=0;\n for ($i=0+$c; $i<=$points; $i=$i+$d)\n {\n $tmp+=$dots[$i-1];\n $n++;\n //echo \"{$dots[$i-1]} \";\n }\n //echo \" = $tmp
\";\n if($n>=3)\n if ($tmp>$max)\n $max=$tmp;\n }\n }\n}\n\necho $max;\n\nfunction del($chislo)\n{\n for($i = 1; $i < $chislo; $i++)\n {\n if(($chislo % $i)==0)\n $dels[]=$i;\n }\n return $dels;\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$max){\n$max=$sums[$h];}\n}\n}\n$output=$max;\n}\nfputs($tr, $output );"}, {"source_code": "\\r\\n\":'';\n if(!isset($sum[$j.'_'.$item]))\n $sum[$j.'_'.$item] = 0;\n $sum[$j.'_'.$item] += (int)$points[$i];\n }\n }\n }\n }*/\n\n\n foreach($d as $item) {\n for($i = 0; $i < $len; $i+=$item) {\n for($j = 0; $j <= count($d); $j++) {\n if($j<$item) {\n if(isset($points[$i+$j])) {\n //echo $item===4 && $j==0 ?'<'.$points[$i+$j].'|'.$item.'|'.$j.\">\\r\\n\":'';\n if(!isset($sum[$j.'_'.$item]))\n $sum[$j.'_'.$item] = 0;\n $sum[$j.'_'.$item]+=$points[$i+$j];\n }\n }\n }\n }\n }\n\n //var_dump($sum);\n\n return max(array_sum($points), max($sum));\n};\n\nfunction findDel($ch) {\n $arr = array();\n for($s = 2; $s < $ch; $s++) {\n if ($s< floor($ch/2) && $ch % $s==0) {\n $arr[] = $s;\n }\n if($s>floor($ch/2))\n break;\n }\n return $arr;\n}\n\n//$line1 = 9;\n//$line2 = '';\n$lineArray2 = explode(' ', $line2);\n\necho $f($line1, $lineArray2);\n\n//echo \"\\r\\n|=>\", (time() - $t2), \"\\r\\n\";"}], "src_uid": "0ff4ac859403db4e29554ca7870f5490"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "422cbf106fac3216d58bdc8411c0bf9f"} {"source_code": "= $e)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif($d == $e)\n {\n print \"YES\\n\";\n }\n elseif($d > $e)\n {\n if($c >= $e)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " $a[3]) {\n if($a[3] % $a[2] <= $a[1]) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n } else {\n if($a[3] - ($a[0] * $a[2]) <= $a[1]){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n }\n \n \n }\n \n"}, {"source_code": "= $aArray[3]){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n } elseif ($iAvg > $aArray[0]) {\n if(($aArray[0]*$aArray[2] + $aArray[1]) >= $aArray[3]){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": "= $S ? 'YES':'NO');\n\t} else {\n\t\tprintf(\"%s\\n\", $b >= $S % $n ? 'YES':'NO');\n\t}\n}\n\n\n\n\n"}, {"source_code": " $a && $s - ($a * $n) <= $b) {\n $status = true;\n }\n /*if ($a == 0 && $b >= $s) {\n $status = true;\n } elseif ($b == 0 && $s%$n == 0 && intval($s/$n) <= $a) {\n $status = true;\n } else {\n if ($s % $n <= $b && intval($s / $n) <= $a) {\n $status = true;\n }\n }*/\n\n if ($status) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": "= $aArray[3]){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": "= $aArray[3]){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": "= $s) {\n $status = true;\n } elseif ($b == 0 && $s%$n == 0 && intval($s/$n) <= $a) {\n $status = true;\n } else {\n if ($s % $n <= $b && intval($s / $n) <= $a) {\n $status = true;\n }\n }*/\n\n if ($status) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": "= $s) {\n $status = true;\n } elseif ($b == 0 && bcmod($s,$n) == 0 && bcdiv($s,$n) <= $a) {\n $status = true;\n } else {\n for ($j = 1; $j <= $a; $j ++) {\n $count1 = intval(bcdiv ($s, bcmul($n, $j)));\n $count2 = bcmod ($s,bcmul ($n, $j)) ;\n if ( bccomp($count1, $a) !=1 && bccomp($count2, $b) !=1) {\n $status = true;\n break;\n }\n }\n }\n\n if ($status) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $s) {\n $status = true;\n } elseif ($b == 0 && bcmod($s,$n) == 0 && bcdiv($s,$n) <= $a) {\n $status = true;\n } else {\n if ($s % $n <= $b && intval($s / $n) <= $a) {\n $status = true;\n }\n }\n\n if ($status) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $s) {\n $status = true;\n } elseif ($b == 0 && $s%$n == 0 && intval($s/$n) <= $a) {\n $status = true;\n } else {\n if ($s % $n <= $b && intval($s / $n) <= $a) {\n $status = true;\n }\n }\n\n if ($status) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n?>"}], "src_uid": "e2434fd5f9d16d59e646b6e69e37684a"} {"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n $d2 .= $a[$x];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n $d2 = \"\";\n }\n else\n {\n if($d >= 3)\n {\n if(($d2[strlen($d2) - 1] == $d2[strlen($d2) - 2]) && ($d2[strlen($d2) - 1] == $d2[strlen($d2) - 3]) && ($d2[strlen($d2) - 2] == $d2[strlen($d2) - 3]))\n {\n continue;\n }\n else\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $x = -1;\n }\n }\n }\n}\nif(count($c) == 0)\n{\n print $a;\n}\nelseif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>", "positive_code": [{"source_code": " 3000 || $inputStringLength < 1) {\n echo $answer;\n} else {\n $stringAsArray = str_split($inputString);\n $vowels = array(\"a\" => \"a\", \"e\" => \"e\", \"i\" => \"i\", \"o\" => \"o\", \"u\" => \"u\", \" \" => \" \");\n\n $indexOfTypos = array();\n\t$indexOfAddSpace = array();\n $lastChar = 0;\n $consecutiveConsonants = 0;\n\t$consecutiveConsonantsArray = array();\n foreach ($stringAsArray as $k => $v) {\n $lastChar = $v;\n if (isset($vowels[$v])) {\n\t\t\t$consecutiveConsonants = 0;\n\t\t\t$consecutiveConsonantsArray = array();\n } else {\n // insert space as late as possible\n if (count($consecutiveConsonantsArray) == 1) { \n if (!isset($consecutiveConsonantsArray[$v]) && $consecutiveConsonants >= 2) {\n // add space\n $indexOfAddSpace[$k-1] = $k-1;\n $consecutiveConsonants = 0;\n $consecutiveConsonantsArray = array();\t\t\t\t\t\t\n }\n } else if (count($consecutiveConsonantsArray) > 1) {\n $indexOfAddSpace[$k-1] = $k-1;\n $consecutiveConsonants = 0;\n $consecutiveConsonantsArray = array();\t\t\t\t\t\n }\n\t\t\t\t\n\t\t\t$consecutiveConsonantsArray[$v] = $v;\n $consecutiveConsonants++;\n }\n }\n \n\tif(!empty($indexOfAddSpace)) {\n\t\tforeach($stringAsArray as $fk => $fv) {\n\t\t\techo $fv . (isset($indexOfAddSpace[$fk])?\" \":\"\");\n\t\t}\n\t} else {\n\t\techo $inputString;\n }\n \n}\n\n?>"}, {"source_code": " 3000 || $inputStringLength < 1) {\n echo $answer;\n} else {\n $stringAsArray = str_split($inputString);\n $vowels = array(\"a\" => \"a\", \"e\" => \"e\", \"i\" => \"i\", \"o\" => \"o\", \"u\" => \"u\", \" \" => \" \");\n\n $lastChar = \"\";\n $consecutiveConsonants = 0;\n $consecutiveSameConsonantsInARow = 0;\n foreach ($stringAsArray as $k => $v) {\n echo $lastChar;\n \n if (isset($vowels[$v])) {\n\t\t\t$consecutiveConsonants = 0;\n $consecutiveSameConsonantsInARow = 0;\n } else {\n \n if ($consecutiveConsonants >= 2) {\n if ($consecutiveSameConsonantsInARow == 1 || $lastChar != $v) {\n echo \" \";\n $consecutiveConsonants = 0;\n $consecutiveSameConsonantsInARow = 0; \n }\n }\n\t\t\t\t\n if ($lastChar == $v)\n $consecutiveSameConsonantsInARow++;\n else\n $consecutiveSameConsonantsInARow = 1;\n \n $consecutiveConsonants++;\n }\n \n $lastChar = $v;\n }\n echo $lastChar;\n \n}\n\n?>"}], "negative_code": [{"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n }\n else\n {\n if($d == 3)\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $x = -1;\n }\n }\n}\nif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>"}, {"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n $d2 .= $a[$x];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n $d2 = 0;\n }\n else\n {\n if($d == 3)\n {\n if(($d2[0] == $d2[1]) && ($d2[0] == $d2[2]) && ($d2[1] == $d2[2]))\n {\n continue;\n }\n else\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $d2 = 0;\n $x = -1;\n }\n }\n }\n}\nif(count($c) == 0)\n{\n print $a;\n}\nelseif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>"}, {"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n $d2 .= $a[$x];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n $d2 = \"\";\n }\n else\n {\n if($d == 3)\n {\n if(($d2[0] == $d2[1]) && ($d2[0] == $d2[2]) && ($d2[1] == $d2[2]))\n {\n continue;\n }\n else\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $d2 = \"\";\n $x = -1;\n }\n }\n }\n}\nif(count($c) == 0)\n{\n print $a;\n}\nelseif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>"}, {"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n $d2 .= $a[$x];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n }\n else\n {\n if($d == 3)\n {\n if(($d2[0] == $d2[1]) && ($d2[0] == $d2[2]) && ($d2[1] == $d2[2]))\n {\n continue;\n }\n else\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $x = -1;\n }\n }\n }\n}\nif(count($c) == 0)\n{\n print $a;\n}\nelseif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>"}, {"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n $d2 += $a[$x];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n }\n else\n {\n if($d == 3)\n {\n if(($d2[0] != $d2[1]) && ($d2[1] != $d2[2]))\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $x = -1;\n }\n }\n }\n}\nif(count($c) == 0)\n{\n print $a;\n}\nelseif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>"}, {"source_code": " 3000 || $inputStringLength < 1) {\n echo $answer;\n} else {\n $stringAsArray = str_split($inputString);\n// $binaryInterpretation = array(); // do I need this at all?\n $vowels = array(\"a\" => \"a\", \"e\" => \"e\", \"i\" => \"i\", \"o\" => \"o\", \"u\" => \"u\", \" \" => \" \");\n /*\n * create $binaryInterpretation\n * 1 - for vowels\n * 2 - for consonants\n * 3 - for space\n */\n \n $indexOfTypos = array();\n\t$indexOfAddSpace = array();\n $lastCharType = 0;\n $lastChar = 0;\n $consecutiveConsonants = 0;\n\t$consecutiveConsonantsArray = array();\n foreach ($stringAsArray as $k => $v) {\n $lastChar = $v;\n $code = 2;\n if (isset($vowels[$v])) {\n $code = 1;\n if($v==\" \"){\n $code = 3;\n }\n\t\t\t$consecutiveConsonants = 0;\n\t\t\t$consecutiveConsonantsArray = array();\n } else {\n\t\t\tif ($consecutiveConsonants==2) {\n\t\t\t\t\n\t\t\t\tif(count($consecutiveConsonantsArray) == 1) { \n\t\t\t\t\tif(!isset($consecutiveConsonantsArray[$v])){\n\t\t\t\t\t\t// add space\n\t\t\t\t\t\t$indexOfAddSpace[$k-1] = $k-1;\n\t\t\t\t\t\t$consecutiveConsonants = 0;\n\t\t\t\t\t\t$consecutiveConsonantsArray = array();\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$indexOfAddSpace[$k-1] = $k-1;\n\t\t\t\t\t$consecutiveConsonants = 0;\n\t\t\t\t\t$consecutiveConsonantsArray = array();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t$consecutiveConsonantsArray[$v] = $v;\n $consecutiveConsonants++;\n }\n// $binaryInterpretation[$k] = $code;\n $lastCharType = $code;\n }\n \n\tif(!empty($indexOfAddSpace)) {\n\t\tforeach($stringAsArray as $fk => $fv) {\n\t\t\techo $fv . (isset($indexOfAddSpace[$fk])?\" \":\"\");\n\t\t}\n\t} else {\n\t\techo $inputString;\n }\n \n}\n\n?>"}, {"source_code": " 3000 || $inputStringLength < 1) {\n echo $answer;\n} else {\n $stringAsArray = str_split($inputString);\n $binaryInterpretation = array(); // do I need this at all?\n $vowels = array(\"a\" => \"a\", \"e\" => \"e\", \"i\" => \"i\", \"0\" => \"o\", \" \" => \" \");\n /*\n * create $binaryInterpretation\n * 1 - for vowels\n * 2 - for consonants\n * 3 - for space\n */\n \n $indexOfTypos = array();\n\t$indexOfAddSpace = array();\n $lastCharType = 0;\n $lastChar = 0;\n $consecutiveConsonants = 0;\n\t$consecutiveConsonantsArray = array();\n foreach ($stringAsArray as $k => $v) {\n $lastChar = $v;\n $code = 2;\n if (isset($vowels[$v])) {\n $code = 1;\n if($v==\" \"){\n $code = 3;\n }\n\t\t\t$consecutiveConsonants = 0;\n\t\t\t$consecutiveConsonantsArray = array();\n } else {\n\t\t\tif ($consecutiveConsonants==2) {\n\t\t\t\t\n\t\t\t\tif(count($consecutiveConsonantsArray) == 1) { \n\t\t\t\t\tif(!isset($consecutiveConsonantsArray[$v])){\n\t\t\t\t\t\t// add space\n\t\t\t\t\t\t$indexOfAddSpace[$k-1] = $k-1;\n\t\t\t\t\t\t$consecutiveConsonants = 0;\n\t\t\t\t\t\t$consecutiveConsonantsArray = array();\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$indexOfAddSpace[$k-1] = $k-1;\n\t\t\t\t\t$consecutiveConsonants = 0;\n\t\t\t\t\t$consecutiveConsonantsArray = array();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t$consecutiveConsonantsArray[$v] = $v;\n $consecutiveConsonants++;\n }\n $binaryInterpretation[$k] = $code;\n $lastCharType = $code;\n }\n \n\tif(!empty($indexOfAddSpace)) {\n\t\tforeach($stringAsArray as $fk => $fv) {\n\t\t\techo $fv . (isset($indexOfAddSpace[$fk])?\" \":\"\");\n\t\t}\n\t} else {\n\t\techo $inputString;\n }\n}\n\n?>"}, {"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n $d2 .= $a[$x];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n }\n else\n {\n if($d == 3)\n {\n if(($d2[0] != $d2[1]) && ($d2[1] != $d2[2]))\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $x = -1;\n }\n }\n }\n}\nif(count($c) == 0)\n{\n print $a;\n}\nelseif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>"}, {"source_code": " 0, b => 1, c => 1, d => 1, e => 0, f => 1, g => 1, h => 1, i => 0, j => 1, k => 1, l => 1, m => 1, n => 1, o => 0, p => 1, q => 1, r => 1, s => 1, t => 1, u => 0, v => 1, w => 1, x => 1, y => 1, z => 1);\n$c = array();\n$d = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $d += $b[$a[$x]];\n $d2 .= $a[$x];\n if($b[$a[$x]] == 0)\n {\n $d = 0;\n }\n else\n {\n if($d == 3)\n {\n if(($d2[0] != $d2[1]) && ($d2[0] != $d2[2]))\n {\n $e = substr($a, 0, $x);\n $c[count($c)] = $e;\n $a = substr($a, $x);\n $d = 0;\n $x = -1;\n }\n }\n }\n}\nif(count($c) == 0)\n{\n print $a;\n}\nelseif($a == NULL)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print implode(\" \", $c) . \" \" . $a;\n}\n?>"}], "src_uid": "436c00c832de8df739fc391f2ed6dac4"} {"source_code": ""}, {"source_code": "= $q[1]){\n echo $q[1].\"\\n\"; \n } else {\n $n = $q[1] - $q[0];\n $p = floor($q[1] / $q[0]);\n $l = $q[1] % $q[0];\n $r = array();\n for($j = 0; $j < $q[0]; $j++){\n $r[$j] = $p;\n if($j < $l){\n $r[$j]++;\n }\n }\n $x = 0;\n foreach($r as $sK => $sV){\n $x += $sV * $sV;\n }\n echo $x.\"\\n\";\n }\n \n}"}, {"source_code": ""}, {"source_code": "=(int)$v[1]) {echo (int)$v[1];}\n else{\n $r_1=floor($v[1]/$v[0]);\n $r_2=($v[1]%$v[0]);\n \n for($j=0; $j<$v[0]; $j++){\n if($j<$r_2){\n $sum+=(($r_1+1)**2);\n } else{\n $sum+=$r_1**2;\n }\n } echo $sum;\n }\n if($i!=$arr[0]) echo\"\\n\";\n \n}\n?>"}], "negative_code": [{"source_code": "\ufeff=$v[1]) {echo (int)$v[1];}\n else{\n $r_1=floor($v[1]/$v[0]);\n $r_2=($v[1]%$v[0]);\n \n for($j=0; $j<$v[0]; $j++){\n if($j<$r_2){\n $sum+=(($r_1+1)**2);\n } else{\n $sum+=$r_1**2;\n }\n } echo $sum;\n }\n if($i!=$arr[0]) echo\"\\n\";\n \n}\n?>"}, {"source_code": "= $q[1]){\n echo $q[0].\"\\n\"; \n } else {\n $n = $q[1] - $q[0];\n $p = floor($q[1] / $q[0]);\n $l = $q[1] % $q[0];\n $r = array();\n for($j = 0; $j < $q[0]; $j++){\n $r[$j] = $p;\n if($j < $l){\n $r[$j]++;\n }\n }\n $x = 0;\n foreach($r as $sK => $sV){\n $x += $sV * $sV;\n }\n echo $x.\"\\n\";\n }\n \n}"}], "src_uid": "0ec973bf4ad209de9731818c75469541"} {"source_code": "= $c)\n {\n $e[count($e)] = 2;\n break;\n }\n }\n if(floor($c / $d[0]) > 0)\n {\n $e[count($e)] = floor($c / $d[0]) + 1;\n }\n print min($e) . \"\\n\";\n}\n?>"}, {"source_code": " $sV) {\n $aTest[] = $sV;\n }\n foreach ($aTest as $sK => $sV) {\n if ($sV == $b) {\n $iAnswer = 1;\n $bFlag = true;\n break;\n }\n }\n if (!$bFlag) {\n $iAnswer = max($aTest);\n if ($b < $iAnswer) {\n $iAnswer = 2;\n $bFlag = true;\n }\n }\n if ($bFlag) {\n echo $iAnswer .\"\\n\";\n } else {\n echo ceil($b/$iAnswer) .\"\\n\";\n }\n}"}], "negative_code": [{"source_code": "= $c)\n {\n $e[count($e)] = 2;\n break;\n }\n }\n print min($e) . \"\\n\";\n}\n?>"}, {"source_code": " $sV) {\n $aTest[] = $sV;\n }\n foreach ($aTest as $sK => $sV) {\n if ($sK == $b) {\n $iAnswer = 1;\n $bFlag = true;\n break;\n }\n }\n $iAnswer = max($aTest);\n if ($b < $iAnswer) {\n $iAnswer = 2;\n $bFlag = true;\n }\n if ($bFlag) {\n echo $iAnswer .\"\\n\";\n } else {\n echo ceil($b/$iAnswer) .\"\\n\";\n }\n}"}, {"source_code": " $x) {\n if($j == 0 ){\n $j++;\n }\n $n = $j+1;\n break;\n }\n if($ar[$j] > $max) {\n $max = $ar[$j];\n }\n }\n \n if($count >= $x) {\n echo $n.\"\\n\";\n } else {\n $s = $x - $count;\n if($s < $max) {\n $n = $n + 2;\n }elseif($s == $max) {\n $n = $n + 1;\n } else {\n $n1 = ceil($s / $max);\n $n = $n + $n1;\n }\n echo $n .\"\\n\";\n \n } \n \n }\n \n\n "}, {"source_code": " $max) {\n $max = $ar[$j];\n }\n }\n \n if($count >= $x) {\n echo $n.\"\\n\";\n } else {\n $s = $x - $count;\n \n $n1 =ceil($s / $max);\n echo $n + $n1.\"\\n\";\n } \n \n }\n \n\n "}, {"source_code": " $x) {\n if($j == 0 ){\n $j++;\n }\n $n = $j+1;\n break;\n }\n if($ar[$j] > $max) {\n $max = $ar[$j];\n }\n }\n \n if($count >= $x) {\n echo $n.\"\\n\";\n } else {\n $s = $x - $count;\n if($s < $max) {\n $n = $n + 2;\n }elseif($s == $max) {\n $n = $n + 1;\n } else {\n $n1 = ceil($s / $max);\n $n = $n + $n1;\n }\n echo $n .\"\\n\";\n \n } \n }\n \n \n }\n \n\n "}, {"source_code": "= $x) {\n $n = $j+1;\n break;\n }\n if($ar[$j] > $max) {\n $max = $ar[$j];\n }\n }\n \n if($count >= $x) {\n echo $n.\"\\n\";\n } else {\n $s = $x - $count;\n if($s < $max) {\n $n = $n + 2;\n }elseif($s == $max) {\n $n = $n + 1;\n } else {\n $n1 = ceil($s / $max);\n $n = $n + $n1;\n }\n echo $n .\"\\n\";\n \n } \n \n }\n \n\n "}, {"source_code": " $max) {\n $max = $ar[$j];\n }\n }\n \n if($count >= $x) {\n echo $n.\"\\n\";\n } else {\n $s = $x - $count;\n \n $n1 =ceil($s / $max);\n echo $n + $n1.\"\\n\";\n } \n \n }\n \n\n "}, {"source_code": " $max) {\n $max = $ar[$j];\n }\n }\n \n if($count >= $x) {\n echo $n.\"\\n\";\n } else {\n $s = $x - $count;\n if($s < $max) {\n $n = $n + 2;\n }elseif($s == $max) {\n $n = $n + 1;\n } else {\n $n1 = ceil($s / $max);\n $n = $n + $n1;\n }\n echo $n .\"\\n\";\n \n } \n \n }\n \n\n "}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " $max) {\n\t\t$max = $n[$i];\n\t}\n}\nif ($max < $min*2) $max = $min*2;\nforeach ($m as $value) {\n\tif ($value + 0 <= $max) {\n\t\tfwrite($f2, '-1');\n\t\tfclose($f2);\n\t\tdie;\t\n\t}\n}\nfwrite($f2, $max);\nfclose($f2);"}, {"source_code": " 2*$p0){\n\t\tif ($p1 < $p2){\n\t\t\techo $p1;\n\t\t} else {\n\t\t\techo \"-1\";\n\t\t}\n\t} else {\n\t\techo (2*$p0);\n\t}\n} else {\n\techo \"-1\";\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 2*$p0){\n\t\techo $p1;\n\t} else {\n\t\techo (2*$p0);\n\t}\n} else {\n\techo \"-1\";\n}\n\n?>"}, {"source_code": " 2*$p0){\n\t\tif ($p1 < $p2){\n\t\t\techo $p1;\n\t\t} else {\n\t\t\techo \"-1\";\n\t\t}\n\t} else {\n\t\techo (2*$p0);\n\t}\n} else {\n\techo \"-1\";\n}\n\n?>"}], "src_uid": "49c47ebfd710a3733ce7ecb3a3c134a7"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $f)\n{\n for($x = 0; $x < count($d); $x++)\n {\n $l = 0;\n $h = array();\n for($y = 0; $y < count($d); $y++)\n {\n $j = $d[$x] + $l;\n array_push($h, $j);\n $l++;\n } \n array_push($i, $h); \n }\n for($x = 0; $x < count($i); $x++)\n {\n $m = 0;\n for($y = 0; $y < count($i); $y++)\n {\n for($z = 0; $z < count($d); $z++)\n {\n if($i[$x][$y] == $d[$z])\n {\n $m++;\n }\n }\n }\n array_push($n, $m);\n }\n rsort($n);\n print count($d) - $n[0];\n}\n?>"}], "src_uid": "0fce263a9606fbfc3ec912894ab1a8f8"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "0){\n \n $minimum_cash = max($cash);\n }\n if($minimum_cash==0)\n return 1;\n else \n return $minimum_cash;\n}\n \n\n\n\n\n$visitors = trim(fgets(STDIN));\n$visiting_time = array();\nfor($i=0;$i<$visitors;$i++){\n $time = trim(fgets(STDIN));\n $visiting_time[] = explode(\" \",$time);\n}\n\necho FindMinimumCash($visitors, $visiting_time);"}, {"source_code": "\n\nerror_reporting(false);\n//error_reporting(E_ALL);\n\n$handle = fopen('php://stdin', 'r');\n\nif (file_exists(\"in.txt\")) {\n $handle = fopen('in.txt', 'r');\n set_time_limit(2);\n};\n\n$nums = trim(fgets($handle));\n$min = 0;\n\n\nfor($i=0; $i<$nums; $i++) {\n list($h, $m) = explode(\" \", trim(fgets($handle)));\n $a[$h.\"_\".$m]++;\n}\n\necho max($a);\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$l){\n\t\t\t$l++;\n\t\t}\n\t}else{\n\t\t$k = 0;\n\t}\n\t$p = $j;\n}\necho $l+1;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $max) $max = $time[$h][$m];\n}\n\necho $max;\n"}, {"source_code": ""}, {"source_code": " $max) \n $max = $k;\n $k = 1; }\n \n}\necho $max;"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0){\n $common_cash = array_count_values($cash);\n $minimum_cash = max($common_cash);\n }\n if($minimum_cash==0)\n return 1;\n else \n return $minimum_cash;\n}\n \n\n\n\n\n$visitors = trim(fgets(STDIN));\n$visiting_time = array();\nfor($i=0;$i<$visitors;$i++){\n $time = trim(fgets(STDIN));\n $visiting_time[] = explode(\" \",$time);\n}\n\necho FindMinimumCash($visitors, $visiting_time);"}, {"source_code": "0){\n $common_cash = array_count_values($cash);\n $minimum_cash = max($common_cash);\n }\n if($minimum_cash==0)\n return 1;\n else \n return $minimum_cash;\n}\n \n\n\n\n\n$visitors = trim(fgets(STDIN));\n$visiting_time = array();\nfor($i=0;$i<$visitors;$i++){\n $time = trim(fgets(STDIN));\n $visiting_time[] = explode(\" \",$time);\n}\n\necho FindMinimumCash($visitors, $visiting_time);"}, {"source_code": "0){\n $common_cash = array_count_values($cash);\n $minimum_cash = max($common_cash);\n }\n if($minimum_cash==0)\n return 1;\n else \n return $minimum_cash;\n}\n \n\n\n\n\n$visitors = trim(fgets(STDIN));\n$visiting_time = array();\nfor($i=0;$i<$visitors;$i++){\n $time = trim(fgets(STDIN));\n $visiting_time[] = explode(\" \",$time);\n}\n\necho FindMinimumCash($visitors, $visiting_time);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0)\n{\n for($i=0; $i<$a; ++$i)\n {\n $b = trim(fgets(STDIN));\n $e = explode(\" \", $b);\n $c[$i] = $e[0]*60+$e[1];\n }\n for($i=0; $i<$a; ++$i)\n {\n if($c[$i] == $c[$i+1])\n {\n $d += 1;\n if($d >= 2)\n {\n $f += 1;\n $d = 0;\n }\n }\n \n }\n}else{$f=0;}\necho $f;\n?>"}, {"source_code": "= 1)\n {\n $f += 1;\n $d = 0;\n }\n }\n \n}\necho $f;\n?>"}, {"source_code": " $max )$max = $k;\n $k = 0;\n}\necho $max;"}, {"source_code": "= $max ){$max = $k;}\n $k = 0;\n}\necho $max;"}], "src_uid": "cfad2cb472e662e037f3415a84daca57"} {"source_code": "= $c[$e])\n {\n printf(\"%.0f\", $c[1]);\n print \"\\n\";\n $c[1] += $f;\n }\n else\n {\n \n printf(\"%.0f\", $c[$e]);\n print \"\\n\";\n $c[1] = $c[$e] + $f;\n }\n}\n?>", "positive_code": [{"source_code": " $max_h)\n $max_h = $arr[$j];\n }\n $max_w = $size[0];\n }\n echo $max_h.\"\\n\";\n $max_h += $size[1];\n $arr[0] = $max_h;\n }\n?>\n"}, {"source_code": ""}], "negative_code": [{"source_code": " $max_h)\n $max_h = $arr[$j];\n }\n echo $max_h.\"\\n\";\n $max_h += $size[1];\n $arr[$j] = $max_h;\n }\n?>\n"}], "src_uid": "fb0e6a573daa0ee7c20d20b0d2b83756"} {"source_code": " 0, n => 0, e => 0);\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] == \"o\")\n {\n $c[$b[$x]]++;\n unset($b[$x]);\n }\n elseif($b[$x] == \"n\")\n {\n $c[$b[$x]]++;\n unset($b[$x]);\n }\n elseif($b[$x] == \"e\")\n {\n $c[$b[$x]]++;\n unset($b[$x]);\n }\n}\n$d = min($c);\n$c[o] -= $d;\n$c[n] -= $d;\n$c[e] -= $d;\n$e = array_fill(0, $c[o], \"o\");\n$b = array_merge($b, $e);\n$e = array_fill(0, $c[n], \"n\");\n$b = array_merge($b, $e);\n$e = array_fill(0, $c[e], \"e\");\n$b = array_merge($b, $e);\nsort($b);\n$e = array(z => 0, e => 0, r => 0, o => 0);\nfor($x = 0; $x < count($b); $x++)\n{\n if($b[$x] == \"z\")\n {\n $e[z]++;\n }\n elseif($b[$x] == \"e\")\n {\n $e[e]++;\n }\n elseif($b[$x] == \"r\")\n {\n $e[r]++;\n }\n elseif($b[$x] == \"o\")\n {\n $e[o]++;\n }\n}\n$f = min($e);\n$g = \"\";\nfor($x = 1; $x <= $d; $x++)\n{\n $g .= \"1 \";\n}\nfor($x = 1; $x <= $f; $x++)\n{\n $g .= \"0 \";\n}\nprint $g;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $v){\n if($v == 'n'){\n $n .= '1 ';\n }\n if($v == 'z'){\n $z.= '0 ';\n }\n}\necho $n.$z;\n"}], "negative_code": [{"source_code": "= 2) {\n\tif ($b[$lb][3] > $c[$lc][3]) {\n\t\tif ($lb == $lengb - 1 && $w % 2 == 0) {\n\t\t\t$temp = $w;\n\t\t\t$temp1 = $temp2 = 0;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp1 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$temp2 = $b[$lb][2];\n\t\t\t$temp = $w - 1;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp2 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($temp1 >= $temp2) {\n\t\t\t\t$tong += $c[$lc][2];\n\t\t\t\t$w -= 2;\n\t\t\t\t$result[] = $c[$lc++][0];\n\t\t\t\t$lb++;\n\t\t\t} else {\n\t\t\t\t$tong += $b[$lb][2];\n\t\t\t\t$w--;\n\t\t\t\t$result[] = $b[$lb++][0];\n\t\t\t}\n\t\t} else {\n\t\t\t$tong += $b[$lb][2];\n\t\t\t$w--;\n\t\t\t$result[] = $b[$lb++][0];\n\t\t}\n\t} else {\n\t\t$tong += $c[$lc][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$lc++][0];\n\t}\n}\n\nfor ($i = $lb; $i < $lengb; $i++) {\n\tif ($w >= 1) {\n\t\t$tong += $b[$i][2];\n\t\t$w--;\n\t\t$result[] = $b[$i][0];\n\t}\n}\n\nfor ($i = $lc; $i < $lengc; $i++) {\n\tif ($w >= 2) {\n\t\t$tong += $c[$i][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$i][0];\n\t}\n}\n\nprintf(\"%d\\n\", $tong);\nif ($tong > 0) {\n\t$leng = count($result);\n\tfor ($i = 0; $i < $leng - 1; $i++) {\n\t\tprintf(\"%d \", $result[$i]);\n\t}\n\tprintf(\"%d\", $result[$leng - 1]);\n}\n", "positive_code": [{"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if($n == 2)\n {\n $i2 = $i;\n $j2 = $j;\n $l--;\n $i2 -= $d[$l];\n $j2 = array_slice($j2, 0, -1);\n if($c[$k] == TRUE)\n {\n $i2 += $c[$k];\n $j2[count($j2)] = $g[$k];\n }\n $i3 = $i;\n $j3 = $j;\n $k--;\n $i3 -= $c[$k];\n for($x = count($j3) - 1; $x >= 0; $x--)\n {\n if($j3[$x] == $g[$k])\n {\n array_splice($j3, $x, 1);\n break;\n }\n }\n if($i2 >= $i3)\n {\n print $i2 . \"\\n\";\n print implode(\" \", $j2);\n }\n else\n {\n print $i3 . \"\\n\";\n print implode(\" \", $j3);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " $e[$r]) && ($c[$p + 1] == TRUE))\n {\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $o += 2;\n $y = $s;\n }\n elseif($c[$p] > $e[$r])\n {\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $o += 1;\n $y = $s;\n }\n else\n {\n $n[$s] = $m[$r] + 1;\n $t += $e[$r];\n $s++;\n $r++;\n $o += 2;\n $z = $s;\n }\n }\n elseif($o == $b)\n {\n break;\n }\n elseif($o > $b)\n {\n if(count($c) == 0)\n {\n $r--;\n $t -= $e[$r];\n $z--;\n unset($n[$z]);\n }\n elseif(count($d) == 0)\n {\n $p--;\n $t -= $e[$r];\n $y--;\n unset($n[$y]);\n }\n else\n {\n $u = $n;\n $w = $t;\n $p--;\n $w -= $c[$p];\n $y--;\n unset($u[$y]);\n $uu = $n;\n $ww = $t;\n $r--;\n $ww -= $e[$r];\n $z--;\n unset($uu[$z]);\n $p++;\n $ww += $c[$p];\n $y++;\n $uu[$y] = $k[$p] + 1;\n if($w >= $ww)\n {\n $n = $u;\n $t = $w;\n }\n else\n {\n $n = $uu;\n $t = $ww;\n }\n break;\n } \n }\n}\nprint $t . \"\\n\";\nprint implode(\" \", $n);\n?>"}, {"source_code": "= $c[$g[$m]] + $c[$g[$m + 1]])\n {\n $b -= 2;\n $i += $d[$h[$l]];\n $j[$k] = $h[$l] + 1;\n $k++;\n $l++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $n = $c[$g[$m - 1]] + $c[$g[$m]];\n if($d[$h[$l + 1]] > $n)\n {\n $i -= $c[$g[$m - 1]];\n array_splice($j, $o, 1);\n $i += $d[$h[$l + 1]];\n $j[$k] = $h[$l + 1] + 1;\n break;\n }\n else\n {\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n break;\n } \n }\n }\n else\n {\n $b -= 2;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $k++;\n $m++;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $o = $k;\n $k++;\n $m++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $n = $c[$g[$m - 1]] + $c[$g[$m]];\n if($d[$h[$l + 1]] > $n)\n {\n $i -= $c[$g[$m - 1]];\n array_splice($j, $o, 1);\n $i += $d[$h[$l + 1]];\n $j[$k] = $h[$l + 1] + 1;\n break;\n }\n else\n {\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n break;\n } \n }\n }\n }\n print $i . \"\\n\";\n print implode(\" \", $j);\n}\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if(($a == 5000) && ($b == 3649) && ($n == 2))\n {\n print $c[$k - 3] . \" \" . $c[$k - 2] . \" \" . $c[$k - 1] . \" \" . $c[$k] . \" \" . $c[$k + 1] . \" \" . $c[$k + 2] . \" \" . $c[$k + 3] . \"\\n\";\n print $d[$l - 1] . \" \" . $d[$l - 2] . \" \" . $d[$l - 3] . \"\\n\";\n }\n if($n == 2)\n {\n $l--;\n $i -= $d[$l];\n $j = array_slice($j, 0, -1);\n if($c[$k] == TRUE)\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": "= 2) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n break;\n }\n else\n {\n if(($c[$m] + $c[$m + 1]) > $e[$n])\n {\n $p += 2;\n $r += $c[$m];\n $r += $c[$m + 1];\n array_push($o, $j[$m]);\n array_push($o, $j[$m + 1]);\n $m += 2;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n }\n elseif(($s == 0) && ($t == 0))\n {\n break;\n }\n elseif(($s >= 1) && ($t == 0))\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n elseif(($s == 1) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n if($c[$m] > $e[$n])\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n } \n }\n elseif(($s == 0) && ($t >= 1))\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n elseif($p > $b)\n {\n $v = $m;\n $v--;\n $w = $r;\n $w -= $c[$v];\n $y = $o;\n unset($y[$m]); \n $i = $n;\n $i--;\n $k = $r;\n $k -= $e[$i];\n $z = $o;\n unset($z[$n]);\n $k += $c[$m];\n array_push($z, $j[$m]);\n if($w >= $k)\n {\n $r = $w;\n $o = $y;\n }\n else\n {\n $r = $w;\n $o = $z;\n }\n break; \n }\n}\nprint $r . \"\\n\";\nprint implode(\" \", $o);\n?>"}, {"source_code": "= 2) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n break;\n }\n else\n {\n if(($c[$m] + $c[$m + 1]) > $e[$n])\n {\n $p += 2;\n $r += $c[$m];\n $r += $c[$m + 1];\n $o .= $j[$m] . \" \" . $j[$m + 1] . \" \";\n $m += 2;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n $o .= $l[$n] . \" \";\n $n++;\n }\n }\n }\n elseif(($s == 0) && ($t == 0))\n {\n break;\n }\n elseif(($s >= 1) && ($t == 0))\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n }\n elseif(($s == 1) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n }\n else\n {\n if($c[$m] > $e[$n])\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n $o .= $l[$n] . \" \";\n $n++;\n }\n } \n }\n elseif(($s == 0) && ($t >= 1))\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n }\n }\n}\nprint $r . \"\\n\";\nprint trim($o);\n?>"}, {"source_code": "= $c[$g[$m]] + $c[$g[$m + 1]])\n {\n $b -= 2;\n $i += $d[$h[$l]];\n $j[$k] = $h[$l] + 1;\n $k++;\n $l++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n break;\n }\n }\n else\n {\n $b -= 2;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $k++;\n $m++;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $k++;\n $m++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $i += $c[$g[$m + 1]];\n $j[$k] = $g[$m] + 1;\n break;\n }\n }\n }\n print $i . \"\\n\";\n print implode(\" \", $j);\n}\n?>"}, {"source_code": "= 2) {\n\tif ($b[$lb][3] > $c[$lc][3]) {\n\t\tif ($lb == $lengb - 1 && $w % 2 == 0) {\n\t\t\t$temp = $w;\n\t\t\t$temp1 = $temp2 = 0;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($w >= 2) {\n\t\t\t\t\t$temp1 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$temp2 = $b[$lb][2];\n\t\t\t$temp = $w - 1;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($w >= 2) {\n\t\t\t\t\t$temp2 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($temp1 >= $temp2) {\n\t\t\t\t$tong += $c[$lc][2];\n\t\t\t\t$w -= 2;\n\t\t\t\t$result[] = $c[$lc++][0];\n\t\t\t\t$lb++;\n\t\t\t} else {\n\t\t\t\t$tong += $b[$lb][2];\n\t\t\t\t$w--;\n\t\t\t\t$result[] = $b[$lb++][0];\n\t\t\t}\n\t\t} else {\n\t\t\t$tong += $b[$lb][2];\n\t\t\t$w--;\n\t\t\t$result[] = $b[$lb++][0];\n\t\t}\n\t} else {\n\t\t$tong += $c[$lc][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$lc++][0];\n\t}\n}\n\nfor ($i = $lb; $i < $lengb; $i++) {\n\tif ($w >= 1) {\n\t\t$tong += $b[$i][2];\n\t\t$w--;\n\t\t$result[] = $b[$i][0];\n\t}\n}\n\nfor ($i = $lc; $i < $lengc; $i++) {\n\tif ($w >= 2) {\n\t\t$tong += $c[$i][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$i][0];\n\t}\n}\n\nprintf(\"%d\\n\", $tong);\n$leng = count($result);\nfor ($i = 0; $i < $leng - 1; $i++) {\n\tprintf(\"%d \", $result[$i]);\n}\nprintf(\"%d\", $result[$leng - 1]);"}, {"source_code": "= 2) {\n\tif ($b[$lb][3] > $c[$lc][3]) {\n\t\tif ($lb == $lengb - 1 && $w % 2 == 0) {\n\t\t\t$temp = $w;\n\t\t\t$temp1 = $temp2 = 0;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp1 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$temp2 = $b[$lb][2];\n\t\t\t$temp = $w - 1;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp2 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($temp1 >= $temp2) {\n\t\t\t\t$tong += $c[$lc][2];\n\t\t\t\t$w -= 2;\n\t\t\t\t$result[] = $c[$lc++][0];\n\t\t\t\t$lb++;\n\t\t\t} else {\n\t\t\t\t$tong += $b[$lb][2];\n\t\t\t\t$w--;\n\t\t\t\t$result[] = $b[$lb++][0];\n\t\t\t}\n\t\t} else {\n\t\t\t$tong += $b[$lb][2];\n\t\t\t$w--;\n\t\t\t$result[] = $b[$lb++][0];\n\t\t}\n\t} else {\n\t\t$tong += $c[$lc][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$lc++][0];\n\t}\n}\n\nfor ($i = $lb; $i < $lengb; $i++) {\n\tif ($w >= 1) {\n\t\t$tong += $b[$i][2];\n\t\t$w--;\n\t\t$result[] = $b[$i][0];\n\t}\n}\n\nfor ($i = $lc; $i < $lengc; $i++) {\n\tif ($w >= 2) {\n\t\t$tong += $c[$i][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$i][0];\n\t}\n}\n\nprintf(\"%d\\n\", $tong);\n$leng = count($result);\nfor ($i = 0; $i < $leng - 1; $i++) {\n\tprintf(\"%d \", $result[$i]);\n}\nprintf(\"%d\", $result[$leng - 1]);"}, {"source_code": "= 2) {\n\tif ($b[$lb][3] > $c[$lc][3]) {\n\t\tif ($lb == $lengb - 1 && $w % 2 == 0) {\n\t\t\t$temp = $w;\n\t\t\t$temp1 = $temp2 = 0;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp1 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$temp2 = $b[$lb][2];\n\t\t\t$temp = $w - 1;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp2 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($temp1 >= $temp2) {\n\t\t\t\t$tong += $c[$lc][2];\n\t\t\t\t$w -= 2;\n\t\t\t\t$result[] = $c[$lc++][0];\n\t\t\t\t$lb++;\n\t\t\t} else {\n\t\t\t\t$tong += $b[$lb][2];\n\t\t\t\t$w--;\n\t\t\t\t$result[] = $b[$lb++][0];\n\t\t\t}\n\t\t} else {\n\t\t\t$tong += $b[$lb][2];\n\t\t\t$w--;\n\t\t\t$result[] = $b[$lb++][0];\n\t\t}\n\t} else {\n\t\t$tong += $c[$lc][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$lc++][0];\n\t}\n}\n\nfor ($i = $lb; $i < $lengb; $i++) {\n\tif ($w >= 1) {\n\t\t$tong += $b[$i][2];\n\t\t$w--;\n\t\t$result[] = $b[$i][0];\n\t}\n}\n\nfor ($i = $lc; $i < $lengc; $i++) {\n\tif ($w >= 2) {\n\t\t$tong += $c[$i][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$i][0];\n\t}\n}\n\nprintf(\"%d\\n\", $tong);\nif ($tong == 0) {\n\t$leng = count($result);\n\tfor ($i = 0; $i < $leng - 1; $i++) {\n\t\tprintf(\"%d \", $result[$i]);\n\t}\n\tprintf(\"%d\", $result[$leng - 1]);\n}\n"}, {"source_code": "= 2) {\n\tif ($b[$lb][3] > $c[$lc][3]) {\n\t\tif ($lb == $lengb - 1 && $w % 2 == 0) {\n\t\t\t$temp = $w;\n\t\t\t$temp1 = $temp2 = 0;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp1 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$temp2 = $b[$lb][2];\n\t\t\t$temp = $w - 1;\n\t\t\tfor ($i = $lc; $i < $lengc; $i++) {\n\t\t\t\tif ($temp >= 2) {\n\t\t\t\t\t$temp2 += $c[$i][2];\n\t\t\t\t\t$temp -= 2;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}var_dump($temp1, $temp2);\n\t\t\tif ($temp1 >= $temp2) {\n\t\t\t\t$tong += $c[$lc][2];\n\t\t\t\t$w -= 2;\n\t\t\t\t$result[] = $c[$lc++][0];\n\t\t\t\t$lb++;\n\t\t\t} else {\n\t\t\t\t$tong += $b[$lb][2];\n\t\t\t\t$w--;\n\t\t\t\t$result[] = $b[$lb++][0];\n\t\t\t}\n\t\t} else {\n\t\t\t$tong += $b[$lb][2];\n\t\t\t$w--;\n\t\t\t$result[] = $b[$lb++][0];\n\t\t}\n\t} else {\n\t\t$tong += $c[$lc][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$lc++][0];\n\t}\n}\n\nfor ($i = $lb; $i < $lengb; $i++) {\n\tif ($w >= 1) {\n\t\t$tong += $b[$i][2];\n\t\t$w--;\n\t\t$result[] = $b[$i][0];\n\t}\n}\n\nfor ($i = $lc; $i < $lengc; $i++) {\n\tif ($w >= 2) {\n\t\t$tong += $c[$i][2];\n\t\t$w -= 2;\n\t\t$result[] = $c[$i][0];\n\t}\n}\n\nprintf(\"%d\\n\", $tong);\n$leng = count($result);\nfor ($i = 0; $i < $leng - 1; $i++) {\n\tprintf(\"%d \", $result[$i]);\n}\nprintf(\"%d\", $result[$leng - 1]);"}, {"source_code": "= $a[$i][0]) {\n\t\t\t$b[$i][$j] = max($b[$i - 1][$j - $a[$i][0]] + $a[$i][0], $b[$i - 1][$j]);\n\t\t} else {\n\t\t\t$b[$i][$j] = $b[$i - 1][$j];\n\t\t}\n\t}\n}\n\n// echo \"
\";\n\n// for ($i = 1; $i <= $n; $i++) { \n// \techo $a[$i][0].\"___\";\n// \tfor ($j = 1; $j <= $w ; $j++) { \n// \t\techo $b[$i][$j].\".....\";\n// \t}\n// \techo \"
\";\n// }\n\n\n$chon = array();\n$t = $w;\nwhile ($t > 0) {\n\tfor ($i = $n; $i > 0; $i--) { \n\t\tif ($b[$i][$t] > $b[$i - 1][$t]) {\n\t\t\t$chon[$i] = 1;\n\t\t\t$t = $b[$i][$t] - $a[$i][0];\n\t\t} else {\n\t\t\t$chon[$i] = 0;\n\t\t}\n\t}\n}\n\n$tong = 0;\n\nfor ($i = 1; $i <= $n; $i++) { \n\tif ($chon[$i] == 1) {\n\t\t$tong += $a[$i][1];\n\t}\n}\n\nprintf(\"%d\\n\", $tong);\n\n\n\nfor ($i = 1; $i <= $n; $i++) { \n\tif ($chon[$i] == 1) {\n\t\tprintf(\"%d \", $a[$i][0]);\n\t}\n}"}, {"source_code": "= $a[$i][0]) {\n\t\t\t$b[$i][$j] = max($b[$i - 1][$j - $a[$i][0]] + $a[$i][0], $b[$i - 1][$j]);\n\t\t\t$c[$i][$j] = max($c[$i - 1][$j - $a[$i][0]] + $a[$i][1], $c[$i - 1][$j]);\n\t\t} else {\n\t\t\t$b[$i][$j] = $b[$i - 1][$j];\n\t\t\t$c[$i][$j] = $c[$i - 1][$j];\n\t\t}\n\t}\n}\n\n// echo \"
\";\n\n// for ($i = 1; $i <= $n; $i++) { \n// \techo $a[$i][0].\"___\";\n// \tfor ($j = 1; $j <= $w ; $j++) { \n// \t\techo $b[$i][$j].\".....\";\n// \t}\n// \techo \"
\";\n// }\n\n// echo \"
\";\n\n// for ($i = 1; $i <= $n; $i++) { \n// \techo $a[$i][0].\"___\";\n// \tfor ($j = 1; $j <= $w ; $j++) { \n// \t\techo $c[$i][$j].\".....\";\n// \t}\n// \techo \"
\";\n// }\n\n\n$chon = array();\n$t = $w;\nwhile ($t > 0) {\n\tfor ($i = $n; $i > 0; $i--) { \n\t\tif ($c[$i][$t] > $c[$i - 1][$t]) {\n\t\t\t$chon[$i] = 1;\n\t\t\t$t = $b[$i][$t] - $a[$i][0];\n\t\t} else {\n\t\t\t$chon[$i] = 0;\n\t\t}\n\t}\n}\n\n$tong = 0;\n\nfor ($i = 1; $i <= $n; $i++) { \n\tif ($chon[$i] == 1) {\n\t\t$tong += $a[$i][1];\n\t}\n}\n\nprintf(\"%d\\n\", $tong);\n\n\n\nfor ($i = 1; $i <= $n; $i++) { \n\tif ($chon[$i] == 1) {\n\t\tprintf(\"%d \", $i);\n\t}\n}"}, {"source_code": " $g_2)\n{\n print $l . \"\\n\" . $m;\n}\nelse\n{\n print $g_2 . \"\\n\" . $h_2;\n}\n?>"}, {"source_code": "= 2) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $w = $r;\n $w += $c[$m];\n $y = $o;\n array_push($y, $j[$m]); \n $v = $m;\n $v--;\n $k = $r;\n $k -= $c[$v];\n $z = $o;\n unset($z[$m]);\n $k += $e[$n];\n array_push($z, $l[$n]);\n if($w >= $k)\n {\n $r = $w;\n $o = $y;\n }\n else\n {\n $r = $k;\n $o = $z;\n }\n break; \n }\n else\n {\n if(($c[$m] + $c[$m + 1]) > $e[$n])\n {\n $p += 2;\n $r += $c[$m];\n $r += $c[$m + 1];\n array_push($o, $j[$m]);\n array_push($o, $j[$m + 1]);\n $m += 2;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n }\n elseif(($s == 0) && ($t == 0))\n {\n break;\n }\n elseif(($s >= 1) && ($t == 0))\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n elseif(($s == 1) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n if($c[$m] > $e[$n])\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n } \n }\n elseif(($s == 0) && ($t >= 1))\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n elseif($p > $b)\n {\n $v = $m;\n $v--;\n $w = $r;\n $w -= $c[$v];\n $y = $o;\n unset($y[$m]); \n $i = $n;\n $i--;\n $k = $r;\n $k -= $e[$i];\n $z = $o;\n unset($z[$n]);\n $k += $c[$m];\n array_push($z, $j[$m]);\n if($w >= $k)\n {\n $r = $w;\n $o = $y;\n }\n else\n {\n $r = $k;\n $o = $z;\n }\n break; \n }\n}\nprint $r . \"\\n\";\nprint implode(\" \", $o);\n?>"}, {"source_code": " $e[$r]) && ($c[$p + 1] == TRUE))\n {\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $o += 2;\n $y = $s;\n }\n elseif($c[$p] > $e[$r])\n {\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $o += 1;\n $y = $s;\n }\n else\n {\n $n[$s] = $m[$r] + 1;\n $t += $e[$r];\n $s++;\n $r++;\n $o += 2;\n $z = $s;\n }\n }\n elseif($o == $b)\n {\n break;\n }\n elseif($o > $b)\n {\n if(count($c) == 0)\n {\n $r--;\n $t -= $e[$r];\n $z--;\n unset($n[$z]);\n }\n elseif(count($d) == 0)\n {\n $p--;\n $t -= $e[$r];\n $y--;\n unset($n[$y]);\n }\n else\n {\n $u = $n;\n $w = $t;\n $p--;\n $w -= $c[$p];\n $y--;\n unset($u[$y]);\n $uu = $n;\n $ww = $t;\n $r--;\n $ww -= $e[$r];\n $z--;\n unset($uu[$z]);\n $p++;\n $ww += $c[$p];\n $y++;\n $uu[$y] = $k[$p] + 1;\n if($w >= $ww)\n {\n $n = $u;\n $t = $w;\n }\n else\n {\n $n = $uu;\n $t = $ww;\n }\n break;\n } \n }\n}\nsort($n);\nprint $t . \"\\n\";\nprint implode(\" \", $n);\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if($n == 2)\n {\n $i2 = $i;\n $j2 = $j;\n $l--;\n $i2 -= $d[$l];\n $j2 = array_slice($j2, 0, -1);\n if($c[$k] == TRUE)\n {\n $i2 += $c[$k];\n $j2[count($j2)] = $g[$k];\n }\n $i3 = $i;\n $j3 = $j;\n $k -= 2;\n $i3 -= $c[$k];\n for($x = count($j3) - 1; $x >= 0; $x--)\n {\n if($j3[$x] == $g[$k])\n {\n array_splice($j3, $x, 1);\n break;\n }\n }\n if($i2 >= $i3)\n {\n print $i2 . \"\\n\";\n print implode(\" \", $j2);\n }\n else\n {\n print $i3 . \"\\n\";\n print implode(\" \", $j3);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if($n == 2)\n {\n $l--;\n $i -= $d[$l];\n $j = array_slice($j, 0, -1);\n if($c[$k] == TRUE)\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $e[$r]) && ($c[$p + 1] == TRUE))\n {\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $o += 2;\n $y = $s;\n }\n elseif($c[$p] > $e[$r])\n {\n $n[$s] = $k[$p] + 1;\n $t += $c[$p];\n $s++;\n $p++;\n $o += 1;\n $y = $s;\n }\n else\n {\n $n[$s] = $m[$r] + 1;\n $t += $e[$r];\n $s++;\n $r++;\n $o += 2;\n $z = $s;\n }\n }\n elseif($o == $b)\n {\n break;\n }\n elseif($o > $b)\n {\n if(count($c) == 0)\n {\n $r--;\n $t -= $e[$r];\n $z--;\n unset($n[$z]);\n }\n elseif(count($d) == 0)\n {\n $p--;\n $t -= $e[$r];\n $y--;\n unset($n[$y]);\n }\n else\n {\n $u = $n;\n $w = $t;\n $p--;\n $w -= $c[$p];\n $y--;\n unset($u[$y]);\n $uu = $n;\n $ww = $t;\n $r--;\n $ww -= $e[$r];\n $z--;\n unset($uu[$z]);\n $p++;\n $ww += $c[$p];\n $uu[$y] = $k[$p] + 1;\n if($w >= $ww)\n {\n $n = $u;\n $t = $w;\n }\n else\n {\n $n = $uu;\n $t = $ww;\n }\n break;\n } \n }\n}\nprint $t . \"\\n\";\nprint implode(\" \", $n);\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if($n == 2)\n {\n $i2 = $i;\n $j2 = $j;\n $l--;\n $i2 -= $d[$l];\n $j2 = array_slice($j2, 0, -1);\n if($c[$k] == TRUE)\n {\n $i2 += $c[$k];\n $j2[count($j2)] = $g[$k];\n }\n $i3 = $i;\n $j3 = $j;\n $k -= 2;\n $i3 -= $c[$k];\n for($x = count($j3) - 1; $x >= 0; $x--)\n {\n if($j3[$x] == $h[$k])\n {\n array_splice($j3, $x, 1);\n break;\n }\n }\n if($i2 >= $i3)\n {\n print $i2 . \"\\n\";\n print implode(\" \", $j2);\n }\n else\n {\n print $i3 . \"\\n\";\n print implode(\" \", $j3);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}, {"source_code": "= 2) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $w = $r;\n $w += $c[$m];\n $y = $o;\n array_push($y, $j[$m]); \n $v = $m;\n $v--;\n $k = $r;\n $k -= $c[$v];\n $z = $o;\n unset($z[$m]);\n $k += $e[$n];\n array_push($z, $l[$n]);\n if($w >= $k)\n {\n $r = $w;\n $o = $y;\n }\n else\n {\n $r = $k;\n $o = $z;\n }\n break; \n }\n else\n {\n if(($c[$m] + $c[$m + 1]) > $e[$n])\n {\n $p += 2;\n $r += $c[$m];\n $r += $c[$m + 1];\n array_push($o, $j[$m]);\n array_push($o, $j[$m + 1]);\n $m += 2;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n }\n elseif(($s == 0) && ($t == 0))\n {\n break;\n }\n elseif(($s >= 1) && ($t == 0))\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n elseif(($s == 1) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n if($c[$m] > $e[$n])\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n } \n }\n elseif(($s == 0) && ($t >= 1))\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n elseif($p > $b)\n {\n $v = $m;\n $v--;\n $w = $r;\n $w -= $c[$v];\n $y = $o;\n unset($y[$m]); \n $i = $n;\n $i--;\n $k = $r;\n $k -= $e[$i];\n $z = $o;\n unset($z[$n]);\n $k += $c[$m];\n array_push($z, $j[$m]);\n if($w >= $k)\n {\n $r = $w;\n $o = $y;\n }\n else\n {\n $r = $k;\n $o = $z;\n }\n break; \n }\n}\nprint $r . \"\\n\";\nprint implode(\" \", $o);\n?>"}, {"source_code": ""}, {"source_code": "= $c[$g[$m]] + $c[$g[$m + 1]])\n {\n $b -= 2;\n $i += $d[$h[$l]];\n $j[$k] = $h[$l] + 1;\n $k++;\n $l++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n break;\n }\n }\n else\n {\n $b -= 2;\n $i += $c[$g[$m]];\n $i += $c[$g[$m + 1]];\n $j[$k] = $g[$m] + 1;\n $k++;\n $m++;\n $j[$k] = $g[$m + 1] + 1;\n $k++;\n $m++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $i += $c[$g[$m + 2]];\n $j[$k] = $g[$m] + 1;\n break;\n }\n }\n}\nprint $i . \"\\n\";\nprint implode(\" \", $j);\n?>"}, {"source_code": ""}, {"source_code": "= 2) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n break;\n }\n else\n {\n if(($c[$m] + $c[$m + 1]) > $e[$n])\n {\n $p += 2;\n $r += $c[$m];\n $r += $c[$m + 1];\n $o .= $j[$m] . \" \" . $j[$m + 1] . \" \";\n $m += 2;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n $o .= $l[$n] . \" \";\n $n++;\n }\n }\n }\n elseif(($s == 0) && ($t == 0))\n {\n break;\n }\n elseif(($s >= 1) && ($t == 0))\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n }\n elseif(($s == 1) && ($t >= 1))\n {\n if($c[$m] > $e[$n])\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n $o .= $l[$n] . \" \";\n $n++;\n }\n }\n elseif(($s == 0) && ($t >= 1))\n {\n $p++;\n $r += $c[$m];\n $o .= $j[$m] . \" \";\n $m++;\n }\n }\n}\nprint $r . \"\\n\";\nprint trim($o);\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if(($a == 5000) && ($b == 3649))\n {\n print $n . \"\\n\";\n }\n if($n == 2)\n {\n $l--;\n $i -= $d[$l];\n $j = array_slice($j, 0, -1);\n if($c[$k] == TRUE)\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if(($a == 5000) && ($b == 3649) && ($n == 2))\n {\n print $d[$l - 1] . \"\\n\";\n print $c[$k] . \"\\n\";\n }\n if($n == 2)\n {\n $l--;\n $i -= $d[$l];\n $j = array_slice($j, 0, -1);\n if($c[$k] == TRUE)\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if(($a == 5000) && ($b == 3649) && ($n == 2))\n {\n print $d[$l - 1] . \"\\n\";\n print $c[$k] . \"\\n\";\n }\n if($n == 2)\n {\n $i2 = $i;\n $j2 = $j;\n $l--;\n $i2 -= $d[$l];\n $j2 = array_slice($j2, 0, -1);\n if($c[$k] == TRUE)\n {\n $i2 += $c[$k];\n $j2[count($j2)] = $g[$k];\n }\n $i3 = $i;\n $j3 = $j;\n $k -= 2;\n $i3 -= $c[$k];\n for($x = count($j3) - 1; $x >= 0; $x--)\n {\n if($j3[$x] == $h[$k])\n {\n array_splice($j3, $x, 1);\n break;\n }\n }\n if($i2 >= $i3)\n {\n print $i2 . \"\\n\";\n print implode(\" \", $j2);\n }\n else\n {\n print $i3 . \"\\n\";\n print implode(\" \", $j3);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}, {"source_code": "= 2) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $w = $r;\n $w += $c[$m];\n $y = $o;\n array_push($y, $j[$m]);\n $k = $r;\n $k -= $c[$v];\n $z = $o;\n unset($z[$m]);\n $k += $e[$n];\n array_push($z, $l[$n]);\n if($w >= $k)\n {\n $r = $w;\n $o = $y;\n }\n else\n {\n $r = $k;\n $o = $z;\n }\n break; \n }\n else\n {\n if(($c[$m] + $c[$m + 1]) > $e[$n])\n {\n $p += 2;\n $r += $c[$m];\n $r += $c[$m + 1];\n array_push($o, $j[$m]);\n array_push($o, $j[$m + 1]);\n $m += 2;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n }\n elseif(($s == 0) && ($t == 0))\n {\n break;\n }\n elseif(($s >= 1) && ($t == 0))\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n elseif(($s == 1) && ($t >= 1))\n {\n $u = $b - $p;\n if($u == 1)\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n if($c[$m] > $e[$n])\n {\n $p++;\n $r += $c[$m];\n array_push($o, $j[$m]);\n $m++;\n }\n else\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n } \n }\n elseif(($s == 0) && ($t >= 1))\n {\n $p += 2;\n $r += $e[$n];\n array_push($o, $l[$n]);\n $n++;\n }\n }\n elseif($p > $b)\n {\n $v = $m;\n $v--;\n $w = $r;\n $w -= $c[$v];\n $y = $o;\n unset($y[$m]); \n $i = $n;\n $i--;\n $k = $r;\n $k -= $e[$i];\n $z = $o;\n unset($z[$n]);\n $k += $c[$m];\n array_push($z, $j[$m]);\n if($w >= $k)\n {\n $r = $w;\n $o = $y;\n }\n else\n {\n $r = $k;\n $o = $z;\n }\n break; \n }\n}\nprint $r . \"\\n\";\nprint implode(\" \", $o);\n?>"}, {"source_code": "= $c[$g[$m]] + $c[$g[$m + 1]])\n {\n $b -= 2;\n $i += $d[$h[$l]];\n $j[$k] = $h[$l] + 1;\n $k++;\n $l++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n if($d[$h[$l + 1]] > $c[$g[$m - 1]])\n {\n $i -= $c[$g[$m - 1]];\n array_splice($j, $o, 1);\n $i += $d[$h[$l + 1]];\n $j[$k] = $h[$l + 1] + 1;\n break;\n }\n else\n {\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n break;\n } \n }\n }\n else\n {\n $b -= 2;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $k++;\n $m++;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $o = $k;\n $k++;\n $m++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n if($d[$h[$l]] > $c[$g[$m - 1]])\n {\n $i -= $c[$g[$m - 1]];\n array_splice($j, $o, 1);\n $i += $d[$h[$l]];\n $j[$k] = $h[$l] + 1;\n break;\n }\n else\n {\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n break;\n } \n }\n }\n }\n print $i . \"\\n\";\n print implode(\" \", $j);\n}\n?>"}, {"source_code": "= $c[$g[$m]] + $c[$g[$m + 1]])\n {\n $b -= 2;\n $i += $d[$h[$l]];\n $j[$k] = $h[$l] + 1;\n $k++;\n $l++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n break;\n }\n }\n else\n {\n $b -= 2;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $k++;\n $m++;\n $i += $c[$g[$m]];\n $j[$k] = $g[$m] + 1;\n $k++;\n $m++;\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $i += $c[$g[$m + 1]];\n $j[$k] = $g[$m] + 1;\n break;\n }\n }\n}\nprint $i . \"\\n\";\nprint implode(\" \", $j);\n?>"}, {"source_code": "= (count($c) + count($d)))\n {\n $m = 1;\n break;\n }\n elseif((($l * 2) + $k) == $b)\n {\n $m = 2;\n break;\n }\n elseif((($l * 2) + $k) > $b)\n {\n $m = 3;\n break;\n }\n else\n {\n if($c[$k] > $d[$l])\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n $k++;\n $n = 1;\n }\n elseif($d[$l] >= $c[$k] + $c[$k + 1])\n {\n $i += $d[$l];\n $j[count($j)] = $h[$l];\n $l++;\n $n = 2;\n }\n elseif($c[$k] + $c[$k + 1] > $d[$l])\n {\n $i += $c[$k];\n $i += $c[$k + 1];\n $j[count($j)] = $g[$k];\n $j[count($j)] = $g[$k + 1];\n $k += 2;\n $n = 3;\n }\n }\n }\n if(($m == 1) || ($m == 2))\n {\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n elseif($m == 3)\n {\n if($n == 2)\n {\n $l--;\n $i -= $d[$l];\n $j = array_slice($j, 0, -1);\n if($c[$k] == TRUE)\n {\n $i += $c[$k];\n $j[count($j)] = $g[$k];\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n elseif($n == 3)\n {\n $k--;\n $i -= $c[$k];\n $j = array_slice($j, 0, -1);\n print $i . \"\\n\";\n print implode(\" \", $j);\n }\n }\n}\n?>"}], "src_uid": "a1f98b06650a5755e784cd6ec6f3b211"} {"source_code": "= 2020) {\r\n for($i = 0; $i < 10000; $i ++) {\r\n $c = $n - ($b * $i);\r\n if($c < 0 ) {\r\n break; \r\n }\r\n if($c == 0 || ($c >= 2020 && $c % $a == 0)) {\r\n $res = 1;\r\n break;\r\n }\r\n }\r\n \r\n \r\n \r\n }\r\n \r\n echo $res == 1 ? \"YES\\n\" : \"NO\\n\";\r\n \r\n \r\n }"}, {"source_code": " 0)) { echo 'YES'.PHP_EOL; }\r\n else { echo 'NO'.PHP_EOL; }\r\n }\r\n }\r\n }\r\n}\r\n?>"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $s = $n % 2020;\r\n $r = floor($n / 2020);\r\n\r\n if ($s > $r) {\r\n IO::no();\r\n } else {\r\n IO::yes();\r\n }\r\n}\r\n"}, {"source_code": "= $d % 2020) {\r\n echo 'YES'. PHP_EOL;\r\n } else {\r\n echo 'NO'. PHP_EOL;\r\n }\r\n}"}, {"source_code": " 0) {\r\n $k = $m - (2020*$d);\r\n if ($d >= $k) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n\r\n}"}], "negative_code": [{"source_code": "\r\n = 2020) {\r\n $c = $n - ($b * $bn);\r\n \r\n if($c == 0 || ($c >= 2020 && $c % $a == 0)) {\r\n $res = 1;\r\n }\r\n }\r\n \r\n echo $res == 1 ? \"YES\\n\" : \"NO\\n\";\r\n \r\n \r\n }"}], "src_uid": "3ec1b7027f487181dbdfb12f295f11ae"} {"source_code": "\n", "positive_code": [{"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}], "negative_code": [], "src_uid": "9fd9bc0a037b2948d60ac2bd5d57740f"} {"source_code": " $max)\r\n $max = $list[$i];\r\n if($list[$i] < $min)\r\n $min = $list[$i];\r\n }\r\n echo $max - $min . \"\\n\";\r\n}\r\n \r\n \r\n \r\n?>", "positive_code": [{"source_code": " 0; $t--) {\r\n\r\n\t$n = intval(fgets(STDIN));\r\n\t$a = array_map('intval', explode(' ', fgets(STDIN)));\r\n\r\n\techo $solve($n, $a);\r\n\techo \"\\n\";\r\n\r\n}\r\n"}, {"source_code": ""}], "negative_code": [], "src_uid": "cf3cfcae029a6997ee62701eda959a60"} {"source_code": "", "positive_code": [{"source_code": " $shortest) {\n $movetall = $tallest;\n $shortest++;\n $moveshort = count($line) - 1 - $shortest;\n} else {\n $movetall = $tallest;\n $moveshort = count($line) - 1 - $shortest;\n}\necho $movetall + $moveshort;\n?>"}, {"source_code": "= 1; $x--)\n{\n if($b[$x] == $c[count($c) - 1])\n {\n $e = $x;\n break;\n }\n}\n$f = array_unique($b);\nif(count($f) == 1)\n{\n print \"0\"; \n}\nelseif($e < $d)\n{\n print $d - 1 + (count($b) - $e) - 1;\n}\nelse\n{\n print $d - 1 + (count($b) - $e);\n}\n?>"}, {"source_code": " $max) { $max = $soldiers[$i]; $maxPos = $i; }\n\t\tif ($soldiers[$i] <= $min) { $min = $soldiers[$i]; $minPos = $i; }\n\t}\n\tif ($minPos > $maxPos) echo (((sizeof($soldiers) - 1) - $minPos) + $maxPos) . \"\\n\";\n\telse if ($minPos < $maxPos) echo (((sizeof($soldiers) - 1) - $minPos) + $maxPos) - 1 . \"\\n\";\n\telse echo 0 . \"\\n\";\n?>"}, {"source_code": " 0; $i--) {\n swap($arr[$i], $arr[$i - 1]);\n $ans++;\n }\n for ($i = $n - 1 ; $i > 0; $i--){\n if ($min_elem > $arr[$i]) {\n $min_elem = $arr[$i];\n $id2 = $i;\n } \n }\n for ($i = $id2; $i < $n - 1; $i++) {\n swap($arr[$i + 1], $arr[$i]);\n $ans++;\n }\n echo $ans;\n "}, {"source_code": "$min) $sek--;\necho $sek;\n?>"}, {"source_code": " $may) {\n $may = $t;\n $i_may = $i;\n }\n if($t <= $men) {\n $men = $t;\n $i_men = $i;\n }\n $i++;\n }\n //print \"$n \" . \"$i_may \" . \"$i_men\\n\";\n if($i_men > $i_may) print $i_may + $n - 1 - $i_men;\n else print $i_may + $n - $i_men - 2;\n?>\n"}, {"source_code": " $max_h){\n $max_h = $squad[$i];\n $max_h_i = $i;\n }\n if($squad[$i] <= $min_h){\n $min_h =$squad[$i];\n $min_h_i = $i;\n }\n}\nif($max_h_i == $min_h_i){\n echo 0;\n}elseif($max_h_i > $min_h_i){\n echo $max_h_i + $n - $min_h_i - 2;\n}else{\n echo $max_h_i + $n - $min_h_i -1;\n}\necho PHP_EOL;\n"}, {"source_code": "-1;$i--)\n{\n if($column[$i]>=$max)\n {\n $max=$column[$i];\n $m=$i;\n }\n}\n$d=$m+(count($column)-1-$n);\nif ($m>$n)echo $d-1;\nelse echo $d;"}, {"source_code": " $str[$i + 1]) {\n $buf = $str[$i + 1];\n $str[$i + 1] = $str[$i];\n $str[$i] = $buf;\n } \n}\n $max = $str[count($str)-1];\n $buf = 0;\nfor ($i = count($str)-1; $i >= 0; $i--) {\n if ($str[$i] < $str[$i - 1]) {\n $buf = $str[$i - 1];\n $str[$i - 1] = $str[$i];\n $str[$i] = $buf;\n } \n}\n$min = $str[0];\nfor ($i = count($str2)-1; $i >=0 ; $i--) {\n if ($str2[$i] == $max) {\n $max_position = $i;\n }\n}\n\nfor ($i = 0; $i < count($str2) ; $i++) {\n if ($str2[$i] == $min) {\n $min_position = $i;\n }\n}\n\nif ($max_position < $min_position) {\n $reshuffle = $max_position + count($str2)-1-$min_position; \n} else {\n $reshuffle = ($max_position + count($str2)-1-$min_position) - 1;\n}\n\nprint($reshuffle);"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n $nowMid = (int)($solder[$i]);\n $nowHead = (int)($solder[$endIndex]);\n \n if( $nowMid > $maxNumber )\n {\n $maxNumber = $nowMid;\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $nowHead < $minNumber )\n {\n $minNumber = $nowHead;\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n echo ($maxStep + $minStep - 1);\n} else {\n echo ($maxStep + $minStep);\n}\n/*\necho \"result \\n\";\necho 'max ' . $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho 'min ' . $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n*/\nfclose($fp);\n?>"}, {"source_code": " $min) {$ret--;} \n\techo $ret;\n?>"}, {"source_code": " $min) {$r--;} \necho $r;"}, {"source_code": " &$value) {\n $value = (int) $value;\n if ($value > $max) {\n $max = $value;\n $nmax = $key;\n }\n if ($value <= $min) {\n $min = $value;\n $nmin = $key;\n }\n}\n\nif ($nmax < $nmin) {\n echo $nmax + $n - $nmin - 1;\n} else {\n echo $nmax + $n - $nmin - 2;\n}\n\n?>"}, {"source_code": "=$b[$i]) $min=$i; \n } \n if ($max>$min) print($max-$min+$a-2); else print($max-$min+$a-1);\n?>"}, {"source_code": "$min ) { $step--;} \n echo $step;\n\n \n?>"}, {"source_code": " $max) {\n $max = $arr[$i];\n $pos['max'] = $i + 1;\n }\n if (intVal($arr[$i]) <= $min) {\n $min = $arr[$i];\n $pos['min'] = $i + 1;\n }\n }\n return $pos;\n}\n\nfscanf(STDIN, '%d', $n);\n$in = explode(' ', fgets(STDIN));\n\n$arr = findMaxMinAndPos($in, $n);\n//print_r($arr);\n\n$wynik = ($arr['min'] > $arr['max']) ? $arr['max'] - 1 + $n - $arr['min'] : $arr['max'] - 1 + $n - $arr['min'] - 1;\n\necho $wynik;\n\n"}, {"source_code": " $max) {$imax = $i; $max = $a[$i];}\n}\n\n\nprint ($imin < $imax) ? $imax + $n - $imin - 2 : $imax + $n - $imin - 1;\n?>"}, {"source_code": "= $arr_items[ $i ] ){\n\t\t\t$min_index = $i;\n\t\t\t$min = $arr_items[ $i ];\n\t\t}\n\t\n\t\tif( $max < $arr_items[ $i ] ){\n\t\t\t$max_index = $i;\n\t\t\t$max = $arr_items[ $i ];\n\t\t}\n\t}\n\t\n//echo \"\\n min=$min min_index=$min_index\";\t\n//echo \"\\n max=$max max_index=$max_index\";\t\n\t\n\t\n\t\n\tif ( $min_index < $max_index ) {\n\t\t$result = count( $arr_items ) - $min_index + $max_index - 2;\n\t} else {\n\t\t$result = count( $arr_items ) - $min_index + $max_index -1;\n\t}\t\t\n\t\n//\techo \"\\n\\n result is \" . $result;\n\n\necho $result;\t\n\t\n\t\n//echo \"\\n\\n\\n\";\n//print_r( $num_items );\n\t\n//echo \"\\n\\n\\n\";\n//print_r( $arr_items );\n\t\n\t\n\t\n\t\n\t\n\t\n//echo \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\";"}, {"source_code": "= $arr_items[ $i ] ){\n\t\t\t$min_index = $i;\n\t\t\t$min = $arr_items[ $i ];\n\t\t}\n\t\n\t\tif( $max < $arr_items[ $i ] ){\n\t\t\t$max_index = $i;\n\t\t\t$max = $arr_items[ $i ];\n\t\t}\n\t}\n\t\n//echo \"\\n min=$min min_index=$min_index\";\t\n//echo \"\\n max=$max max_index=$max_index\";\t\n\t\n\t\n\t\n\tif ( $min_index < $max_index ) {\n\t\t$result = count( $arr_items ) - $min_index + $max_index - 2;\n\t} else {\n\t\t$result = count( $arr_items ) - $min_index + $max_index -1;\n\t}\t\t\n\t\n//\techo \"\\n\\n result is \" . $result;\n\n\necho $result;\t\n\t\n\t\n//echo \"\\n\\n\\n\";\n//print_r( $num_items );\n\t\n//echo \"\\n\\n\\n\";\n//print_r( $arr_items );\n\t\n\t\n\t\n\t\n\t\n\t\n//echo \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\";"}], "negative_code": [{"source_code": "$min) $sek--;\necho $sek;\n?>"}, {"source_code": "$min) $sek--;\necho $sek;\n?>\n"}, {"source_code": "=$max){$max=$column[$i];$m=$i;};\n if($column[$i]<=$min){$min=$column[$i];$n=$i;};\n}\n$d=$m+(count($column)-1-$n);\nif ($m>$n)echo $d-1;\nelse echo $d;\n"}, {"source_code": " $str[$i + 1]) {\n $buf = $str[$i + 1];\n $str[$i + 1] = $str[$i];\n $str[$i] = $buf;\n } \n}\n $max = $str[count($str)-1];\n $buf = 0;\nfor ($i = count($str)-1; $i >= 0; $i--) {\n if ($str[$i] < $str[$i - 1]) {\n $buf = $str[$i - 1];\n $str[$i - 1] = $str[$i];\n $str[$i] = $buf;\n } \n}\n$min = $str[0];\nfor ($i = count($str2)-1; $i >=0 ; $i--) {\n if ($str2[$i] == $max) {\n $max_position = $i;\n }\n}\n\nfor ($i = 0; $i < count($str2) ; $i++) {\n if ($str2[$i] == $min) {\n $min_position = $i;\n }\n}\n\nif ($max_position < $min_position) {\n $reshuffle = $max_position + count($str2)-1-$min_position; \n} else {\n $reshuffle = ($max_position + count($str2)-1-$min_position) - 1;\n}\n\nprint($reshuffle);"}, {"source_code": " $str[$i + 1]) {\n $buf = $str[$i + 1];\n $str[$i + 1] = $str[$i];\n $str[$i] = $buf;\n } \n}\n $max = $str[count($str)-1];\n $buf = 0;\necho \" max = \" . $max;\nfor ($i = count($str)-1; $i >= 0; $i--) {\n if ($str[$i] < $str[$i - 1]) {\n $buf = $str[$i - 1];\n $str[$i - 1] = $str[$i];\n $str[$i] = $buf;\n } \n}\n$min = $str[0];\necho \" min = \" . $min;\nfor ($i = count($str2)-1; $i >=0 ; $i--) {\n if ($str2[$i] == $max) {\n $max_position = $i;\n }\n}\n\nfor ($i = 0; $i < count($str2) ; $i++) {\n if ($str2[$i] == $min) {\n $min_position = $i;\n }\n}\n\nif ($max_position < $min_position) {\n $reshuffle = $max_position + count($str2)-1-$min_position; \n} else {\n $reshuffle = ($max_position + count($str2)-1-$min_position) - 1;\n}\n\nprint($reshuffle);"}, {"source_code": "error_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n if( $solder[$i] > $maxNumber )\n {\n $maxNumber = $solder[$i];\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $solder[$endIndex] < $minNumber )\n {\n $minNumber = $solder[$endIndex];\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n print (int)($maxStep + $minStep - 1);\n} else {\n print (int)($maxStep + $minStep);\n}\n/*\necho \"result \\n\";\necho $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n*/\nfclose($fp);"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n $nowMid = (int)($solder[$i]);\n $nowHead = (int)($solder[$endIndex]);\n \n if( $nowMid > $maxNumber )\n {\n $maxNumber = $nowMid;\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $nowHead < $minNumber )\n {\n $minNumber = $nowHead;\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n echo ($maxStep + $minStep - 1);\n} else {\n echo ($maxStep + $minStep);\n}\n\necho \"result \\n\";\necho 'max ' . $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho 'min ' . $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n\nfclose($fp);\n?>"}, {"source_code": "\ufeff\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n if( $solder[$i] > $maxNumber )\n {\n $maxNumber = $solder[$i];\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $solder[$endIndex] < $minNumber )\n {\n $minNumber = $solder[$endIndex];\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n echo ($maxStep + $minStep - 1);\n} else {\n echo ($maxStep + $minStep);\n}\n/*\necho \"result \\n\";\necho $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n*/\nfclose($fp);\n?>"}, {"source_code": "\ufeff\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\necho \"2\";\ndie();\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n if( $solder[$i] > $maxNumber )\n {\n $maxNumber = $solder[$i];\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $solder[$endIndex] < $minNumber )\n {\n $minNumber = $solder[$endIndex];\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n print (int)($maxStep + $minStep - 1);\n} else {\n print (int)($maxStep + $minStep);\n}\n/*\necho \"result \\n\";\necho $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n*/\nfclose($fp);\n?>"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n if( $solder[$i] > $maxNumber )\n {\n $maxNumber = $solder[$i];\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $solder[$endIndex] < $minNumber )\n {\n $minNumber = $solder[$endIndex];\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n print (int)($maxStep + $minStep - 1);\n} else {\n print (int)($maxStep + $minStep);\n}\n/*\necho \"result \\n\";\necho $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n*/\nfclose($fp);\n?>"}, {"source_code": "\ufeff\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n if( $solder[$i] > $maxNumber )\n {\n $maxNumber = $solder[$i];\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $solder[$endIndex] < $minNumber )\n {\n $minNumber = $solder[$endIndex];\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n echo (int)($maxStep + $minStep - 1);\n} else {\n echo (int)($maxStep + $minStep);\n}\n/*\necho \"result \\n\";\necho $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n*/\nfclose($fp);\n?>"}, {"source_code": "\ufeff\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = fgets($fp);\n$solder = explode(\" \", fgets($fp));\n\n$maxNumber = -1;\n$minNumber = 1000;\n$maxIndex = -1;\n$minIndex = -1;\n$maxStep = -1;\n$minStep = -1;\n\n$i = 0;\nwhile( $i < $count )\n{\n $endIndex = $count - $i - 1;\n if( $solder[$i] > $maxNumber )\n {\n $maxNumber = $solder[$i];\n $maxIndex = $i;\n $maxStep = $i;\n }\n \n if( $solder[$endIndex] < $minNumber )\n {\n $minNumber = $solder[$endIndex];\n $minIndex = $endIndex;\n $minStep = $i;\n }\n \n $i++;\n}\nif( $maxIndex > $minIndex )\n{\n print (int)($maxStep + $minStep - 1);\n} else {\n print (int)($maxStep + $minStep);\n}\n/*\necho \"result \\n\";\necho $maxNumber . ' - ' . $maxIndex . ' ' . $maxStep . \"\\n\";\necho $minNumber . ' - ' . $minIndex . ' ' . $minStep . \"\\n\";\n*/\nfclose($fp);\n?>"}, {"source_code": "max(array_keys($result, min($result))) ) { $step = $step-1;} \n echo $step;\n\n?>"}, {"source_code": "$kmin ) { $step = $step-1;} \n print_r ( $step);\n }\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n print_r ( $step);\n\n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n unset($key_min, $key_max);\n echo $step;\n\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n print_r ( $step);\n\n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n print_r ( $step);\n\n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n print_r ( $step);\n// }\n// else {\n// echo \"0!\"; \n// }\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n $step = $step-1+1;\n print_r ( $step);\n\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n echo $step;\n }\n \n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n \n echo $step;\n\n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n echo $step;\n\n\n?>"}, {"source_code": "$key_min ) { $step_min = $step_min-1;} \n $step_all = $step_max+$step_min;\n \n// for ($i = 0; $i < $step_all; $i++) \n// {\n// if (!isset($key)) {$key = $key_max; $check = false;}\n// if ($key == 0 AND $check == false) { $key = array_search($min, $result); $check = true; } \n// if ( $result[0] ==$max AND $result[$n-1]==$min ) { break; }\n// if ( $check == true ){$next = $key+1; } else { $next = $key-1; }\n// $change = $result[$next];\n// $result[$next] = $result[$key];\n// $result[$key] = $change;\n// $key = $next;\n// }\n echo $step_all;\n\n\n?>"}, {"source_code": "$key_min ) { $step_min = $step_min-1;} \n $step_all = $step_max+$step_min;\n for ($i = 0; $i < $step_all; $i++) \n {\n if (!isset($key)) {$key = $key_max; $check = false;}\n if ($key == 0 AND $check == false) { $key = array_search($min, $result); $check = true; } \n if ( $result[0] ==$max AND $result[$n-1]==$min ) { break; }\n if ( $check == true ){$next = $key+1; } else { $next = $key-1; }\n $change = $result[$next];\n $result[$next] = $result[$key];\n $result[$key] = $change;\n $key = $next;\n }\n echo $step_all;\n\n\n?>"}, {"source_code": "$min ) $step--; \n echo $step;\n \n?>"}, {"source_code": "$key_min ) { $step_min = $step_min-1;} \n $step_all = $step_max+$step_min;\n for ($i = 0; $i < $step_all; $i++) \n {\n if (!isset($key)) {$key = $key_max; $check = false;}\n if ($key == 0 AND $check == false) { $key = array_search($min, $result); $check = true; } \n if ( $result[0] ==$max AND $result[$n-1]==$min ) { break; }\n if ( $check == true ){$next = $key+1; } else { $next = $key-1; }\n $change = $result[$next];\n $result[$next] = $result[$key];\n $result[$key] = $change;\n $key = $next;\n }\n echo $step_all;\n\n\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n var_dump ($step, $max, $min);\n\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n echo sprintf('%.0f', $step);\n\n?>"}, {"source_code": "$min ) $step--; \n echo $step;\n \n?>"}, {"source_code": "$key_min ) { $step_min = $step_min-1;} \n $step_all = $step_max+$step_min;\n echo $step_all;\n\n\n?>"}, {"source_code": "$key_min ) { $step_min = $step_min-1;} \n $step_all = $step_max+$step_min;\n for ($i = 0; $i < $step_all; $i++) \n {\n if (!isset($key)) {$key = $key_max; $check = false;}\n if ($key == 0 AND $check == false) { $key = array_search($min, $result); $check = true; } \n if ( $result[0] ==$max AND $result[$n-1]==$min ) { break; }\n if ( $check == true ){$next = $key+1; } else { $next = $key-1; }\n $change = $result[$next];\n $result[$next] = $result[$key];\n $result[$key] = $change;\n $key = $next;\n }\n echo $step_all;\n\n\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n print_r ( $step);\n\n?>"}, {"source_code": "$kmin ) { $step = $step-1;} \n print_r ( $step);\n }\n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n echo $step;\n\n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n print_r ( $step);\n }\n else {\n echo \"0\"; \n }\n?>"}, {"source_code": "$key_min ) { $step = $step-1;} \n var_dump($step);\n //echo $step;\n\n?>"}, {"source_code": "$min ) { $step = $step-1;} \n echo $step;\n }\n else {echo \"0\"; }\n \n \n?>"}], "src_uid": "ef9ff63d225811868e786e800ce49c92"} {"source_code": "", "positive_code": [{"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $xi; $i--) {\n if ((($i > $yi) || ($i > $xi && $i < $yi)) && $digit[$i] === '1') {\n $result++;\n } elseif($i === $yi && $digit[$i] === '0') {\n $result++;\n }\n}\n\necho $result;\n"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "= 0; $x--)\n{\n if($g[$x] != $d[strlen($d) - $i])\n {\n $h++;\n }\n $i++;\n}\nprint $h;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $n-$x; $i--) {\n if ($s[$i] == 1){\n $count++;\n }\n }\n \n if($s[$n-$y] == 1) {\n $count--; \n } \n \n echo $count;\n\n?>"}, {"source_code": "= 0; $i--) {\n if($s[$i] == 0) {\n $s[$i] = 1;\n } else {\n $s[$i] = 0;\n }\n $iteration++;\n if ( bcmod ($s,bcpow(10, $x)) == bcpow (10, $y)) {\n echo $iteration;\n exit;\n }\n }\n \n \n?>"}, {"source_code": "\n = 0; $i--) {\n if($s[$i] == 0) {\n $s[$i] = 1;\n } else {\n $s[$i] = 0;\n }\n $iteration++;\n if ( bcmod ($s,bcpow(10, $x)) == bcpow (10, $y)) {\n echo $iteration;\n exit;\n }\n }\n \n \n?>"}], "src_uid": "075988685fa3f9b20bd215037c504a4f"} {"source_code": "", "positive_code": [{"source_code": " /* BismiLahi Rahmani Rahim */ ?>\n\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "180*($j-2)) $j++;\n\tif ($a*$j==180*($j-2)) echo \"YES\";\n\telse echo \"NO\";\n\techo \"\\n\";\n}\n?>"}, {"source_code": ""}, {"source_code": "// BismiLahi Rahmani Rahim ?>\n\n"}, {"source_code": "0){\n$n = trim(fgets(STDIN));\nif(is_integer((360/(180-$n)))){\necho \"YES\".PHP_EOL;}\nelse{ echo \"NO\".PHP_EOL;}\n$var--;\n}"}, {"source_code": "0){\n $a=trim(fgets(STDIN));\n $b=180-$a;\n if(360%$b==0)\n print \"YES\\n\";\n else {\n print \"NO\\n\";\n }\n}\n?>\n"}, {"source_code": "0){\n\t$n=trim(fgets(STDIN));\n\tif(is_integer(360/(180-$n))){\n\t\techo \"YES\";\n\t}\n\telse echo \"NO\";\n\techo PHP_EOL;\n\t$t--;\n}\n?>\n"}], "negative_code": [{"source_code": "180*($j-2)) $j++;\n\tif ($a*$j==180*($j-2)) echo \"YES\";\n\telse echo \"NO\";\n\techo \"
\";\n}\n?>"}, {"source_code": "180*($j-2)) $j++;\n\tif ($a*$j==180*($j-2)) echo \"YES\";\n\telse echo \"NO\";\n\techo \"
\";\n}\n?>"}, {"source_code": ""}, {"source_code": "0){\n$n = trim(fgets(STDIN));\nif(is_integer((360/(180-$n)))){\necho \"YES\";}\nelse{ echo \"NO\";}\n$var--;\n}"}, {"source_code": "0){\n $a=trim(fgets(STDIN));\n if($a>=60)\n echo \"YES\\n\";\n else {\n echo \"NO\\n\";\n }\n}\n?>\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "9037f487a426ead347baa803955b2c00"} {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " $cols) {\n\n foreach ($cols as $col) {\n\n $numCount = 0;\n\n for ($i = -1; $i < 2; $i++) {\n\n for ($j = -1; $j < 2; $j++) {\n\n if ($i != 0 || $j != 0) {\n\n if (isset($field[$row + $i][$col + $j])) {\n\n $val = $field[$row + $i][$col + $j];\n\n if ($val == '.' || ($val != '*' && $val == 0)) {\n\n $result = 'NO';\n break;\n } elseif ($val != '*') {\n\n $numCount++;\n $field[$row + $i][$col + $j]--;\n $totalSum--;\n }\n }\n }\n }\n }\n }\n\n if ($result == 'NO') {\n break;\n }\n}\n\nif ($totalSum != 0) {\n $result = 'NO';\n}\n\necho $result;\n\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $cols) {\n\n foreach ($cols as $col) {\n\n $numCount = 0;\n\n for ($i = -1; $i < 2; $i++) {\n\n for ($j = -1; $j < 2; $j++) {\n\n if ($i != 0 || $j != 0) {\n\n if (isset($field[$row + $i][$col + $j])) {\n\n $val = $field[$row + $i][$col + $j];\n\n if ($val == '.' || ($val != '*' && $val == 0)) {\n\n $result = 'NO';\n break;\n } elseif ($val != '*') {\n\n $numCount++;\n $field[$row + $i][$col + $j]--;\n $totalSum--;\n }\n }\n\n }\n }\n\n if ($numCount == 0) {\n\n $result = 'NO';\n break;\n }\n }\n }\n\n if ($numCount == 0) {\n\n $result = 'NO';\n break;\n }\n}\n\nif ($totalSum != 0) {\n $result = 'NO';\n}\n\necho $result;\n\n"}, {"source_code": " $cols) {\n\n foreach ($cols as $col) {\n\n $numCount = 0;\n\n for ($i = -1; $i < 2; $i++) {\n\n for ($j = -1; $j < 2; $j++) {\n\n if ($i != 0 || $j != 0) {\n\n if (isset($field[$row + $i][$col + $j])) {\n\n $val = $field[$row + $i][$col + $j];\n\n if ($val == '.' || ($val != '*' && $val == 0)) {\n\n $result = 'NO';\n break;\n } elseif ($val != '*') {\n\n $numCount++;\n $field[$row + $i][$col + $j]--;\n $totalSum--;\n }\n }\n }\n }\n }\n\n if ($numCount == 0) {\n\n $result = 'NO';\n break;\n }\n }\n\n if ($result == 'NO') {\n break;\n }\n}\n\nif ($totalSum != 0) {\n $result = 'NO';\n}\n\necho $result;\n\n"}], "src_uid": "0d586ba7d304902caaeb7cd9e6917cd6"} {"source_code": " $val) {\n if (isset($list2[$key])) {\n $sub = min($list1[$key], $list2[$key]);\n $list1[$key] -= $sub;\n $list2[$key] -= $sub;\n }\n}\nforeach ($list2 as $key => $val) {\n if (isset($list1[$key])) {\n $sub = min($list1[$key], $list2[$key]);\n $list1[$key] -= $sub;\n $list2[$key] -= $sub;\n }\n}\n\necho array_sum($list1), \"\\n\";\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $val) {\n $ans += abs($list1[$key] - $list2[$key]);\n}\n\necho $ans;\n"}], "src_uid": "c8321b60a6ad04093dee3eeb9ee27b6f"} {"source_code": "$m) {\n return;\n }\n }else{\n $cN = 0;\n }\n if ($c == 1 && $map[$cur][0] == $dest) {\n $result++;\n return;\n }\n\n for ($i = 0; $i < $c; $i++) {\n if ($map[$cur][$i] == $dest) {\n continue;\n }\n solve($cur, $map[$cur][$i], $cN);\n }\n\n}\n\nsolve(0, 1, 0);\necho $result;", "positive_code": [{"source_code": "$m) {\n return;\n }\n }else{\n $cN = 0;\n }\n for ($i = 0; $i < $c; $i++) {\n if ($map[$cur][$i] == $dest) {\n continue;\n }\n solve($cur, $map[$cur][$i], $cN, $mCN);\n }\n\n}\n\nsolve(0, 1, 0, 0);\necho $result;"}], "negative_code": [{"source_code": "$m) {\n return;\n }\n }else{\n $cN = 0;\n }\n for ($i = 0; $i < $c; $i++) {\n if ($map[$cur][$i] == $dest) {\n continue;\n }\n solve($cur, $map[$cur][$i], $cN);\n }\n\n}\n\nsolve(0, 1, 0);\necho $result;"}, {"source_code": "$m) {\n return;\n }\n }else{\n $cN = 0;\n }\n for ($i = 0; $i < $c; $i++) {\n if ($map[$cur][$i] == $dest) {\n continue;\n }\n solve($cur, $map[$cur][$i], $cN, $mCN);\n }\n\n}\n\nsolve(0, 1, 0, 0);\necho $result;"}, {"source_code": "", "positive_code": [{"source_code": " $k))\n {\n print \"0\" . \"\\n\";\n }\n}\nlist($d, $e) = explode(\" \", trim(fgets(STDIN)));\n $j = $e - $d + 1;\n if((($j % 2) == 0) && (($j / 2) <= $k))\n {\n print \"1\";\n }\n elseif((($j % 2) != 0) || (($j / 2) > $k))\n {\n print \"0\";\n }\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "deeb49969ac4bc4f1c7d76b89ac1402f"} {"source_code": " $time){\n if ($mes[$num+1] - $time > $maxTime){\n $sum = 0;\n }else{\n $sum++;\n }\n \n}\necho ($sum);\n\n?>", "positive_code": [{"source_code": ""}, {"source_code": " $c)\n\t\t$count = 1;\n\n\t$a = $data[$i];\n}\n\nwrite($count);\n\n"}], "negative_code": [{"source_code": " $c)\n\t\t$count = 1;\n\n\t$a = $data[$i];\n}\n\nwrite($count);\n\n"}], "src_uid": "fb58bc3be4a7a78bdc001298d35c6b21"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $a[$i]){\n $ans += $b[$n - 1 - $i];\n $k--;\n }\n else $ans += $a[$i];\n }\n echo $ans . \"\\n\";\n }\n"}, {"source_code": " $arrA[$i]){\n $arrA[$i]=$arrB[$n-$i-1];\n }else break;\n }\n $sum=0;\n for ($i=0; $i < $n; $i++) { \n $sum+=$arrA[$i];\n }\n echo $sum.\"\\n\";\n}\n\n$T=inputInt($stdin);\nwhile($T--){\n slove($stdin);\n}"}], "negative_code": [], "src_uid": "7c2337c1575b4a62e062fc9990c0b098"} {"source_code": " $b)\n{\n print \">\";\n}\n?>", "positive_code": [{"source_code": " $b) echo \">\";\nif ($a < $b) echo \"<\";\nif ($a == $b) echo \"=\";\n?>"}, {"source_code": "\n $str2)\n print \">\";\n\n?>"}], "negative_code": [{"source_code": "//Br34k\n $str2)\n print \">\";\n\n?>"}], "src_uid": "fd63aeefba89bef7d16212a0d9e756cd"} {"source_code": " 1)\n return FALSE;\n } else if($tmp != 0){\n return FALSE;\n }\n }\n return TRUE;\n}", "positive_code": [{"source_code": " 1) {\n\t\t\t$s = $a[$i];\n\t\t} else {\n\t\t\t$k += strlen($a[$i]) - 1;\n\t\t}\n\t}\n\techo (!$chk) ? $s.str_repeat('0',(int) $k) : '0'\n?> "}, {"source_code": " 1 ){\n $head = $t;\n }else{\n $et = false;\n for($i = 0 ; $i < strlen($t);$i++){\n if($t[$i] != '0' and $t[$i] != '1'){\n $head = $t;\n $et = true;\n }\n }\n\n if(!$et)\n $res += strlen($t) - 1;\n }\n }\n if($flag){\n fprintf(STDOUT,0);\n }else{\n if(isset($head)) {\n fprintf(STDOUT,\"%s\",$head);\n }else{\n fprintf(STDOUT,1);\n }\n for($i = 0 ; $i < count($res) ; $i++){\n for($zeroNum = 0 ; $zeroNum < $res ; $zeroNum++){\n fprintf(STDOUT,\"0\");\n }\n }\n }\n exit();\n}"}, {"source_code": " 1)\n {\n define(h, $b[$x]);\n $g -= $g2;\n $i = h;\n break;\n }\n }\n elseif($b[$x][$y] < 1)\n {\n $g++;\n $g2++;\n }\n else\n {\n define(h, $b[$x]);\n $g -= $g2;\n $i = h;\n break;\n }\n }\n }\n}\nif($c == 0)\n{\n if($i == \"\")\n {\n $i = 1;\n }\n for($x = 1; $x <= $g; $x++)\n {\n $i .= 0;\n }\n print $i;\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": " 1) {\n\t\t\t$s = $a[$i];\n\t\t} else {\n\t\t\t$k += strlen($a[$i]) - 1;\n\t\t}\n\t}\n\t$chk = false;\n\tfor ($i = 0; $i < $n; $i++) if ($a[$i] == '0') {\n\t\t$chk = true;\n\t\tbreak;\n\t}\n\techo (!$chk) ? $s.str_repeat('0',(int) $k) : '0'\n?> "}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1)\n {\n define(h, $b[$x]);\n $g = 0;\n $i = h;\n break;\n }\n }\n elseif($b[$x][$y] < 1)\n {\n $g++;\n }\n else\n {\n define(h, $b[$x]);\n $g = 0;\n $i = h;\n break;\n }\n }\n }\n}\nif($c == 0)\n{\n if($i == \"\")\n {\n $i = 1;\n }\n for($x = 1; $x <= $g; $x++)\n {\n $i .= 0;\n }\n print $i;\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 1)\n {\n define(h, $b[$x]);\n break;\n }\n }\n elseif($b[$x][$y] < 1)\n {\n $g++;\n }\n else\n {\n define(h, $b[$x]);\n $i = h;\n break;\n }\n }\n }\n}\nif($c == 0)\n{\n for($x = 1; $x <= $g; $x++)\n {\n $i .= 0;\n }\n print $i;\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 1)\n {\n define(h, $b[$x]);\n break;\n }\n }\n elseif($b[$x][$y] < 1)\n {\n $g++;\n }\n else\n {\n define(h, $b[$x]);\n break;\n }\n }\n }\n}\nif($c == 0)\n{\n $i = h;\n for($x = 1; $x <= $g; $x++)\n {\n $i .= 0;\n }\n print $i;\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1)\n {\n define(h, $b[$x]);\n $i = h;\n break;\n }\n }\n elseif($b[$x][$y] < 1)\n {\n $g++;\n }\n else\n {\n define(h, $b[$x]);\n $i = h;\n break;\n }\n }\n }\n}\nif($c == 0)\n{\n if($i == \"\")\n {\n $i = 1;\n }\n for($x = 1; $x <= $g; $x++)\n {\n $i .= 0;\n }\n print $i;\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 1)\n {\n define(h, $b[$x]);\n $i = h;\n break;\n }\n }\n elseif($b[$x][$y] < 1)\n {\n $g++;\n }\n else\n {\n define(h, $b[$x]);\n $i = h;\n break;\n }\n }\n }\n}\nif($c == 0)\n{\n if($i == \"\")\n {\n $i = 1;\n }\n for($x = 1; $x <= $g; $x++)\n {\n $i .= 0;\n }\n print $i;\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1)\n {\n define(h, $b[$x]);\n $i = h;\n break;\n }\n }\n elseif($b[$x][$y] < 1)\n {\n $g++;\n }\n else\n {\n define(h, $b[$x]);\n $i = h;\n break;\n }\n }\n }\n}\nif($c == 0)\n{\n if($i == \"\")\n {\n $i = 1;\n }\n for($x = 1; $x <= $g; $x++)\n {\n $i .= 0;\n }\n print $i;\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 1)\n return FALSE;\n } else if($tmp != 0){\n return FALSE;\n }\n }\n return TRUE;\n}"}, {"source_code": " 1)\n return FALSE;\n } else if($tmp != 0){\n return FALSE;\n }\n }\n return TRUE;\n}"}, {"source_code": " 1)\n return FALSE;\n } else if($tmp != 0){\n return FALSE;\n }\n }\n return TRUE;\n}"}, {"source_code": " 1)\n return FALSE;\n } else if($tmp != 0){\n return FALSE;\n }\n }\n return TRUE;\n}"}, {"source_code": " 1) {\n\t\t\t$s = $a[$i];\n\t\t} else {\n\t\t\t$k += strlen($a[$i]) - 1;\n\t\t}\n\t}\n\techo (strpos($b,'0') !== true) ? $s.str_repeat('0',(int) $a) : '0'\n?> "}, {"source_code": " 1 ){\n $head = $t;\n }else{\n $et = false;\n for($i = 0 ; $i < strlen($t);$i++){\n if($t[$i] != '0' and $t[$i] != '1'){\n $head = $t;\n $et = true;\n }\n }\n\n if(!$et)\n $res += strlen($t) - 1;\n }\n }\n if($flag){\n fprintf(STDOUT,0);\n }else{\n if(isset($head)) {\n fprintf(STDOUT,\"%s\",$head);\n }else{\n fprintf(STDOUT,1);\n }\n for($i = 0 ; $i < count($res) ; $i++){\n for($zeroNum = 0 ; $zeroNum < $res ; $zeroNum++){\n fprintf(STDOUT,\"0\");\n }\n }\n }\n exit();\n}"}, {"source_code": " 1){\n $head = $t;\n }else{\n $et = false;\n for($i = 0 ; $i < strlen($t);$i++){\n if($t[$i] != '0' and $t[$i] != '1'){\n $head = $t;\n $et = true;\n }\n }\n\n if(!$et)\n $res += strlen($t) - 1;\n }\n }\n if($flag){\n fprintf(STDOUT,0);\n }else{\n if(isset($head)) {\n fprintf(STDOUT,\"%s\",$head);\n }else{\n fprintf(STDOUT,1);\n }\n for($i = 0 ; $i < count($res) ; $i++){\n for($zeroNum = 0 ; $zeroNum < $res ; $zeroNum++){\n fprintf(STDOUT,\"0\");\n }\n }\n }\n exit();\n}"}, {"source_code": " 1){\n $head = $t;\n }else{\n $res += strlen($t) - 1;\n }\n }\n if($flag){\n fprintf(STDOUT,0);\n }else{\n if(isset($head)) {\n fprintf(STDOUT,\"%s\",$head);\n }else{\n fprintf(STDOUT,1);\n }\n for($i = 0 ; $i < count($res) ; $i++){\n for($zeroNum = 0 ; $zeroNum < $res ; $zeroNum++){\n fprintf(STDOUT,\"0\");\n }\n }\n }\n exit();\n}"}, {"source_code": "= $try / 2) &&\n\t\t($y % $try >= $try / 2)\n\t) {\n\t\techo 'YES' . PHP_EOL;\n\t} else {\n\t\techo 'NO' . PHP_EOL;\n\t}\n}", "positive_code": [{"source_code": "= 2 * $l) {\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n }\n}"}], "negative_code": [], "src_uid": "5172d358f1d451b42efff1019219a54d"} {"source_code": "", "positive_code": [{"source_code": "\nsscanf(fgets($k=STDIN),$h='%d%d',$n,$m);\n$u=explode(\" \",fgets($k));\nwhile($i++<$m)sscanf(fgets($k),$h.'%d',$a,$b,$c)|$z=max($z,($u[$a-1]+$u[$b-1])/$c);\necho $z+0;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "ba4304e79d85d13c12233bcbcce6d0a6"} {"source_code": "", "positive_code": [{"source_code": "=$b)\n\t\t\t $x=bcsub($x,$b);\n\t\t else\n\t\t\t $ans++;\n\t }\n }\n print $x.\" \".$ans.\"\\n\";\n ?>"}, {"source_code": ""}, {"source_code": "= $num)) {\n $ic -= $num;\n }\n}\nprint $ic . \" \" . $c;\n?>\n\n\n"}, {"source_code": ""}, {"source_code": "\n\n\nfunction addIce(&$ice_cnt,$count){\n\t$ice_cnt+=$count;\n}\n\nfunction getIce(&$ice_cnt,$count){\n\tif($ice_cnt>=$count){\n\t\t$ice_cnt-=$count;\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n$stdin = fopen('php://stdin', 'r');\n$s = trim(fgets($stdin));\n$cards = explode(\" \",$s);\n$ice_cnt = $cards[1];\n$people_cnt=$cards[0];\n$sad =0;\nwhile (!feof($stdin)) {\n\t\n\t$s = trim(fgets($stdin));\n\t$cards = explode(\" \",$s);\n\tif($cards[0]==\"+\"){\n\t\taddIce($ice_cnt,$cards[1]);\n\t}elseif($cards[0]==\"-\"){\n\t\tif(!getIce($ice_cnt,$cards[1])){\n\t\t\t$sad+=1;\n\t\t}\n\t\t\n\t}\n\t\n}\n\necho $ice_cnt.\" \".$sad; \n\n"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 5)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] == $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>", "positive_code": [{"source_code": " $lena) and ($lenc > $lena)) {\n echo \"$a\\n\";\n exit;\n}\n\n$arr_a = $arr_b = $arr_c = array();\n\nfor ($i=0; $i < $lena; $i++) { \n $k = $a[$i];\n $arr_a[$k] ++;\n}\n\nfor ($i=0; $i < $lenb; $i++) { \n $k = $b[$i];\n $arr_b[$k] ++;\n}\n\nfor ($i=0; $i < $lenc; $i++) { \n $k = $c[$i];\n $arr_c[$k] ++;\n}\n\n$max_b = $lena;\nforeach ($arr_b as $key => $value) {\n if (!isset($arr_a[$key]) or ($arr_a[$key] < $value)) {\n $max_b = 0;\n break;\n } elseif ($max_b > intval($arr_a[$key] / $value)) {\n $max_b = intval($arr_a[$key] / $value);\n }\n}\n\n$max = 0;\n$col_b = $col_c = 0;\n$arr_x = $arr_a;\nfor ($i=0; $i <= $max_b ; $i++) { \n\n $max_c = $lena;\n foreach ($arr_c as $key => $value) {\n if (!isset($arr_x[$key]) or ($arr_x[$key] < $value)) {\n $max_c = 0;\n break;\n } elseif ($max_c > intval($arr_x[$key] / $value)) {\n $max_c = intval($arr_x[$key] / $value);\n }\n }\n\n if ($max < ($i + $max_c)) {\n $max = $i + $max_c;\n $col_b = $i;\n $col_c = $max_c;\n }\n\n foreach ($arr_b as $key => $value) {\n $arr_x[$key] -= $value;\n } \n}\n\n$out = '';\n\nfor ($i=1; $i <= $col_b ; $i++) { \n $out .= $b;\n// echo \"$b\";\n foreach ($arr_b as $key => $value) {\n $arr_a[$key] -= $value;\n } \n}\n\nfor ($i=1; $i <= $col_c ; $i++) { \n $out .= $c;\n// echo \"$c\";\n foreach ($arr_c as $key => $value) {\n $arr_a[$key] -= $value;\n } \n}\n\nforeach ($arr_a as $key => $value) {\n if ($value !== 0) {\n $out .= str_repeat(\"$key\", $value);\n// echo str_repeat(\"$key\", $value);\n }\n}\n\necho \"$out\\n\";\n\n?> "}], "negative_code": [{"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 20) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 39) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 39;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 35) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 35;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print \"1\";\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print \"2\";\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 50) * $f[$h[$x]]);\n $l -= 50;\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 51) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 51;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n if($a[0] == \"i\")\n {\n print implode(\" \", $r) . \"\\n\";\n }\n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $c . \"\\n\";\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelseif(($l == 0) && ($o != 0))\n{\n $p = \"\";\n for($x = 1; $x <= $o; $x++)\n {\n $p .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelseif(($l != 0) && ($o == 0))\n{\n $p = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $p .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelse\n{\n $p = array($l);\n $q = array(0);\n $r = array($l + 0);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n $j = $e;\n $l--;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n }\n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($x = 1; $x <= $p[$x]; $x++)\n {\n $v .= $b;\n }\n for($x = 1; $x <= $q[$x]; $x++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= (($l - 1) * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] === TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] === TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] === TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] === TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] === TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] === TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] === TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] === TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n if($a[0] == \"i\")\n {\n print $x . \"\\n\";\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelseif(($l == 0) && ($o != 0))\n{\n $p = \"\";\n for($x = 1; $x <= $o; $x++)\n {\n $p .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelseif(($l != 0) && ($o == 0))\n{\n $p = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $p .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $j = $e;\n $l--;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 49) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 49;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 1) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 1;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] == $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelseif(($l == 0) && ($o != 0))\n{\n \n}\nelseif(($l != 0) && ($o == 0))\n{\n \n}\nelse\n{\n \n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 1) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n if($a[0] == \"i\")\n {\n print \"0\";\n }\n else\n {\n print $u . implode($v); \n }\n }\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 21) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print implode(\" \", $u);\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n if($a[0] == \"i\")\n {\n print \"0\";\n }\n else\n {\n print $u . implode($v); \n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 50) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$l -= 50;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 78) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 78;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 40) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 40;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 52) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 52;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelseif(($l == 0) && ($o != 0))\n{\n $p = \"\";\n for($x = 1; $x <= $o; $x++)\n {\n $p .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelseif(($l != 0) && ($o == 0))\n{\n $p = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $p .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n $j = $e;\n $l--;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 78) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 78;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 35) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 35;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelseif(($l == 0) && ($o != 0))\n{\n $p = \"\";\n for($x = 1; $x <= $o; $x++)\n {\n $p .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelseif(($l != 0) && ($o == 0))\n{\n $p = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $p .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 60) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 60;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 5) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 5;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n if($a[0] == \"i\")\n {\n print $p[$x] . \"\\n\";\n print $q[$x] . \"\\n\";\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 53) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 53;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 78) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 78;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 129) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 129;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n if($a[0] == \"i\")\n {\n print implode(\" \", $q) . \"\\n\";\n }\n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $b . \"\\n\";\n print $c . \"\\n\";\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 49) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 49;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelseif(($l == 0) && ($o != 0))\n{\n $p = \"\";\n for($x = 1; $x <= $o; $x++)\n {\n $p .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelseif(($l != 0) && ($o == 0))\n{\n $p = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $p .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 100)\n {\n break;\n }\n $j = $e;\n $l--;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelseif(($l == 0) && ($o != 0))\n{\n $p = \"\";\n for($x = 1; $x <= $o; $x++)\n {\n $p .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelseif(($l != 0) && ($o == 0))\n{\n $p = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $p .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $p .= $h[$x];\n }\n }\n print $p;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n $j = $e;\n $l--;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] > 0)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] > 0)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print implode(\" \", $t);\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 70) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 70;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 10) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 10;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 70) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 70;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 30) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 30;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 55) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 55;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($g[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $t[$h[$x]] -= (($s - 1) * $g[$h[$x]]);\n }\n else\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $s -= 1;\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 50) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\nif($a[0] == \"i\")\n{\n $l -= 50;\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n if($a[0] == \"i\")\n {\n print $u . \"\\n\";\n }\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n strlen($a) . \" \" . strlen($w);\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$j = $e;\n$i = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$m = $e;\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n}\n$o = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n}\n$n2 = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n2[$x] = $k;\n }\n}\n$o2 = 0;\n$o2 = min($n2);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o2 * $g[$h[$x]]);\n }\n}\nif(($l == 0) && ($o == 0))\n{\n print $a;\n}\nelse\n{\n $p = array($l);\n $q = array($o2);\n $r = array($l + $o2);\n $s = array($j);\n $t = 1;\n $u = $l;\n for($y = 1; $y <= $u; $y++)\n {\n if(strlen($b) < 10)\n {\n break;\n }\n $l--;\n $j = $e;\n for($x = 0; $x < 26; $x++)\n {\n if($f[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n }\n $n = array();\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($j[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $k;\n }\n }\n $o = min($n);\n for($x = 0; $x < 26; $x++)\n {\n if($g[$h[$x]] == TRUE)\n {\n $j[$h[$x]] -= ($o * $g[$h[$x]]);\n }\n }\n $p[$t] = $l;\n $q[$t] = $o;\n $r[$t] = $l + $o;\n $s[$t] = $j;\n $t++;\n } \n if($a[0] == \"i\")\n {\n print implode(\" \", $p) . \"\\n\";\n print implode(\" \", $q) . \"\\n\";\n print implode(\" \", $r) . \"\\n\";\n }\n $u = max($r);\n for($x = 0; $x < count($r); $x++)\n {\n if($r[$x] = $u)\n {\n break;\n }\n }\n $v = \"\";\n for($y = 1; $y <= $p[$x]; $y++)\n {\n $v .= $b;\n }\n for($y = 1; $y <= $q[$x]; $y++)\n {\n $v .= $c;\n }\n $j = $s[$x];\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $j[$h[$x]]; $y++)\n {\n $v .= $h[$x];\n }\n }\n print $v;\n}\n?>"}, {"source_code": " 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($h); $x++)\n {\n $u .= $b;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($s == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($k); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\nelseif($r == $p)\n{\n if($t == 1)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $b;\n }\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 2)\n {\n $u = \"\";\n for($x = 1; $x <= min($m); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n elseif($t == 3)\n {\n $u = \"\";\n for($x = 1; $x <= min($l); $x++)\n {\n $u .= $c;\n }\n $v = str_split($a);\n $w = array();\n for($x = 0; $x < strlen($u); $x++)\n {\n $w[$u[$x]]++;\n }\n $q = count($v);\n for($x = 0; $x < $q; $x++)\n {\n if($w[$v[$x]] > 0)\n {\n $w[$v[$x]]--;\n unset($v[$x]);\n }\n }\n print $u . implode($v); \n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if(($f[$h[$x]] == TRUE) && ($a[0] == \"i\"))\n {\n $m[$h[$x]] -= (($l - 20) * $f[$h[$x]]);\n }\n else\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print $l . \" \" . $p . \" \" . $s . \" \" . $v;\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$h = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n$e = $d;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $e[$a[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($e[$h[$x]] == 0)\n {\n unset($e[$h[$x]]);\n }\n}\n$f = $d;\nfor($x = 0; $x < strlen($b); $x++)\n{\n $f[$b[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == 0)\n {\n unset($f[$h[$x]]);\n }\n}\n$g = $d;\nfor($x = 0; $x < strlen($c); $x++)\n{\n $g[$c[$x]]++;\n}\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == 0)\n {\n unset($g[$h[$x]]);\n }\n}\n$i = array();\n$j = $g;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $f[$h[$x]]);\n $i[$x] = $k;\n }\n}\n$l = min($i);\n$m = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($l * $f[$h[$x]]);\n }\n}\n$n = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $o = floor($m[$h[$x]] / $g[$h[$x]]);\n $n[$x] = $o;\n }\n}\n$p = min($n);\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $m[$h[$x]] -= ($p * $g[$h[$x]]);\n }\n}\n$r = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $k = floor($e[$h[$x]] / $g[$h[$x]]);\n $r[$x] = $k;\n }\n}\n$s = min($r);\n$t = $e;\nfor($x = 0; $x < 26; $x++)\n{\n if($g[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($s * $g[$h[$x]]);\n }\n}\n$u = array();\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $o = floor($t[$h[$x]] / $f[$h[$x]]);\n $u[$x] = $o;\n }\n}\n$v = min($u);\nfor($x = 0; $x < 26; $x++)\n{\n if($f[$h[$x]] == TRUE)\n {\n $t[$h[$x]] -= ($v * $f[$h[$x]]);\n }\n}\nif(($l + $p) >= ($s + $v))\n{\n $w = \"\";\n for($x = 1; $x <= $l; $x++)\n {\n $w .= $b;\n }\n for($x = 1; $x <= $p; $x++)\n {\n $w .= $c;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $m[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n print $w;\n}\nelse\n{\n $w = \"\";\n for($x = 1; $x <= $s; $x++)\n {\n $w .= $c;\n }\n for($x = 1; $x <= $v; $x++)\n {\n $w .= $b;\n }\n for($x = 0; $x < 26; $x++)\n {\n for($y = 0; $y < $t[$h[$x]]; $y++)\n {\n $w .= $h[$x];\n }\n }\n if($a[0] == \"i\")\n {\n print strlen($a) . \" \" . strlen($w);\n }\n else\n {\n print $w;\n }\n}\n?>"}, {"source_code": " $lenc) {\n $x = $b;\n $b = $c;\n $c = $x;\n $x = $lenb;\n $lenb = $lenc;\n $lenc = $x;\n}\n\n$n = 0;\n\nwhile ( $n <= $lena ) {\n\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n if (strpos ($str, $b[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenb) {\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $b[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n if ($n >= $lena) {\n break;\n }\n\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n if (strpos ($str, $c[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenc) {\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $c[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n break;\n}\n\necho $a;\n\n?> "}, {"source_code": " $lena) and ($lenc > $lena)) {\n echo \"$a\\n\";\n exit;\n}\n\n$arr_a = $arr_b = $arr_c = array();\n\nfor ($i=0; $i < $lena; $i++) { \n $k = $a[$i];\n $arr_a[$k] ++;\n}\n\nfor ($i=0; $i < $lenb; $i++) { \n $k = $b[$i];\n $arr_b[$k] ++;\n}\n\nfor ($i=0; $i < $lenc; $i++) { \n $k = $c[$i];\n $arr_c[$k] ++;\n}\n\n$max_b = $lena;\nforeach ($arr_b as $key => $value) {\n if (!isset($arr_a[$key]) or ($arr_a[$key] < $value)) {\n $max_b = 0;\n break;\n } elseif ($max_b > intval($arr_x[$key] / $value)) {\n $max_b = intval($arr_a[$key] / $value);\n }\n}\n\n$max = 0;\n$col_b = $col_c = 0;\n$arr_x = $arr_a;\nfor ($i=0; $i <= $max_b ; $i++) { \n\n $max_c = $lena;\n foreach ($arr_c as $key => $value) {\n if (!isset($arr_x[$key]) or ($arr_x[$key] < $value)) {\n $max_c = 0;\n break;\n } elseif ($max_c > intval($arr_x[$key] / $value)) {\n $max_c = intval($arr_x[$key] / $value);\n }\n }\n\n if ($max < ($i + $max_c)) {\n $max = $i + $max_c;\n $col_b = $i;\n $col_c = $max_c;\n }\n\n foreach ($arr_b as $key => $value) {\n $arr_x[$key] -= $value;\n } \n}\n\n$out = '';\n\nfor ($i=1; $i <= $col_b ; $i++) { \n $out .= $b;\n foreach ($arr_b as $key => $value) {\n $arr_a[$key] -= $value;\n } \n}\n\nfor ($i=1; $i <= $col_c ; $i++) { \n $out .= $c;\n foreach ($arr_c as $key => $value) {\n $arr_a[$key] -= $value;\n } \n}\n\nforeach ($arr_a as $key => $value) {\n if ($value !== 0) {\n $out .= str_repeat(\"$key\", $value);\n }\n}\n\necho \"$out\\n\";\n\n?> "}, {"source_code": " $lena) or ($lenc > $lena)) {\n echo \"$a\\n\";\n exit;\n}\n\nif ($lenb > $lenc) {\n $x = $b;\n $b = $c;\n $c = $x;\n $x = $lenb;\n $lenb = $lenc;\n $lenc = $x;\n}\n\n$n = 0;\n\nwhile ( $n < $lena ) {\n\n $str = substr($a, $n);\n for ($i=0; $i < $lenb; $i++) { \n if (strpos ($str, $b[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenb) {\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $b[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $b[$i];\n $n ++; \n }\n continue;\n }\n\n if ($n >= $lena) {\n break;\n }\n\n $str = substr($a, $n);\n for ($i=0; $i < $lenc; $i++) { \n if (strpos ($str, $c[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenc) {\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $c[$i]);\n// $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $c[$i];\n $n ++; \n }\n continue;\n }\n\n break;\n}\n\necho \"$a\\n\";\n\n?> "}, {"source_code": " $lena) and ($lenc > $lena)) {\n echo \"$a\\n\";\n exit;\n}\n\n$arr_a = $arr_b = $arr_c = array();\n\nfor ($i=0; $i < $lena; $i++) { \n $k = $a[$i];\n $arr_a[$k] ++;\n}\n\nfor ($i=0; $i < $lenb; $i++) { \n $k = $b[$i];\n $arr_b[$k] ++;\n}\n\nfor ($i=0; $i < $lenc; $i++) { \n $k = $c[$i];\n $arr_c[$k] ++;\n}\n\n$max_b = $lena;\nforeach ($arr_b as $key => $value) {\n if (!isset($arr_a[$key]) or ($arr_a[$key] < $value)) {\n $max_b = 0;\n break;\n } elseif ($max_b > intval($arr_x[$key] / $value)) {\n $max_b = intval($arr_a[$key] / $value);\n }\n}\n\n$max = 0;\n$col_b = $col_c = 0;\n$arr_x = $arr_a;\nfor ($i=0; $i <= $max_b ; $i++) { \n\n $max_c = $lena;\n foreach ($arr_c as $key => $value) {\n if (!isset($arr_x[$key]) or ($arr_x[$key] < $value)) {\n $max_c = 0;\n break;\n } elseif ($max_c > intval($arr_x[$key] / $value)) {\n $max_c = intval($arr_x[$key] / $value);\n }\n }\n\n if ($max < ($i + $max_c)) {\n $max = $i + $max_c;\n $col_b = $i;\n $col_c = $max_c;\n }\n\n foreach ($arr_b as $key => $value) {\n $arr_x[$key] -= $value;\n } \n}\n\n$out = '';\n\nfor ($i=1; $i <= $col_b ; $i++) { \n// $out .= $b;\n echo \"$b\";\n foreach ($arr_b as $key => $value) {\n $arr_a[$key] -= $value;\n } \n}\n\nfor ($i=1; $i <= $col_c ; $i++) { \n// $out .= $c;\n echo \"$c\";\n foreach ($arr_c as $key => $value) {\n $arr_a[$key] -= $value;\n } \n}\n\nforeach ($arr_a as $key => $value) {\n if ($value !== 0) {\n// $out .= str_repeat(\"$key\", $value);\n echo str_repeat(\"$key\", $value);\n }\n}\n\necho \"$out\\n\";\n\n?> "}, {"source_code": " $lenc) {\n $x = $b;\n $b = $c;\n $c = $x;\n $x = $lenb;\n $lenb = $lenc;\n $lenc = $x;\n}\n\n$n = 0;\n\nwhile ( $n <= $lena ) {\n\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n if (strpos ($str, $b[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenb) {\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $b[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n if ($n >= $lena) {\n break;\n }\n\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n if (strpos ($str, $c[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenc) {\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $c[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n break;\n}\n\necho \"$a\\n\";\n\n?> "}, {"source_code": " $lena) or ($lenc > $lena)) {\n echo \"$a\\n\";\n exit;\n}\n\nif ($lenb > $lenc) {\n $x = $b;\n $b = $c;\n $c = $x;\n $x = $lenb;\n $lenb = $lenc;\n $lenc = $x;\n}\n\n$n = 0;\n\nwhile ( $n < $lena ) {\n\n $str = substr($a, $n);\n for ($i=0; $i < $lenb; $i++) { \n if (strpos ($str, $b[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenb) {\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $b[$i]);\n// $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $b[$i];\n $n ++; \n }\n continue;\n }\n\n if ($n >= $lena) {\n break;\n }\n\n $str = substr($a, $n);\n for ($i=0; $i < $lenc; $i++) { \n if (strpos ($str, $c[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenc) {\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $c[$i]);\n// $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $c[$i];\n $n ++; \n }\n continue;\n }\n\n break;\n}\n\necho \"$a\\n\";\n\n?> "}, {"source_code": " $lenc) {\n $x = $b;\n $b = $c;\n $c = $x;\n $x = $lenb;\n $lenb = $lenc;\n $lenc = $x;\n}\n\n$flag = true;\n$n = 0;\n\nwhile ( $n <= $lena ) {\n\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n if (strpos ($str, $b[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenb) {\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $b[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n if ($n >= $lena) {\n break;\n }\n\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n if (strpos ($str, $c[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenc) {\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $c[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n break;\n}\n\necho $a;\n\n?> "}, {"source_code": " $lena) or ($lenc > $lena)) {\n echo \"$a\\n\";\n exit;\n}\n\nif ($lenb > $lenc) {\n $x = $b;\n $b = $c;\n $c = $x;\n $x = $lenb;\n $lenb = $lenc;\n $lenc = $x;\n}\n\n$n = 0;\n\nwhile ( $n < $lena ) {\n\n $str = substr($a, $n);\n for ($i=0; $i < $lenb; $i++) { \n if (strpos ($str, $b[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenb) {\n for ($i=0; $i < $lenb; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $b[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n if ($n >= $lena) {\n break;\n }\n\n $str = substr($a, $n);\n for ($i=0; $i < $lenc; $i++) { \n if (strpos ($str, $c[$i]) === false) {\n break;\n } \n }\n\n if ($i === $lenc) {\n for ($i=0; $i < $lenc; $i++) { \n $str = substr($a, $n);\n $pos = strpos ($str, $c[$i]);\n $x = substr($a, $n+$pos, 1);\n $a[$n+$pos] = $a[$n];\n $a[$n] = $x;\n $n ++; \n }\n continue;\n }\n\n break;\n}\n\necho \"$a\\n\";\n\n?> "}], "src_uid": "9dc956306e2826229e393657f2d0d9bd"} {"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "c457b77b16d94c6c4c95b7403a1dd0c7"} {"source_code": " $c - $d)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>", "positive_code": [{"source_code": " $iSum - $iMax){\n echo \"NO\";\n } else {\n echo \"YES\";\n }\n}\n\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " $c - $d)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " $c - $d)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " $c - $d)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " array_sum($d))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " $c - $b[0])\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " $c - $d)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": " $e)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": " $c - $d)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $a) || ($b == 1))\n{\n print \"-1\";\n}\nelse\n{\n $d = $b - 2;\n $e = implode(array_slice($c, 2, $d));\n $f = \"ab\";\n $g = $a - strlen($e);\n $h = $g / 2;\n $i = \"\";\n $j = floor($h);\n if($g % 2 == 0)\n {\n for($x = 1; $x <= $j + 1; $x++)\n {\n if($x == $j + 1)\n {\n $i .= $e;\n }\n else\n {\n $i .= $f;\n }\n }\n }\n else\n {\n for($x = 1; $x <= $j + 1; $x++)\n {\n if($x == $j + 1)\n {\n $i = $i . \"a\" . $e;\n }\n else\n {\n $i .= $f;\n }\n }\n }\n print $i;\n}\n?>"}], "negative_code": [{"source_code": " $a) || ($b == 1))\n{\n print \"-1\";\n}\nelseif($a == $b)\n{\n print implode(array_slice($c, 0, $a));\n}\nelse\n{\n $d = $b - 2;\n $e = implode(array_slice($c, 2, $d));\n $f = \"ab\";\n $g = $a - strlen($e);\n $h = $g / 2;\n $i = \"\";\n $j = floor($h);\n if($g % 2 == 0)\n {\n for($x = 1; $x <= $j; $x++)\n {\n if($x == $j)\n {\n $i .= $e;\n }\n else\n {\n $i .= $f;\n }\n }\n }\n else\n {\n for($x = 1; $x <= $j + 1; $x++)\n {\n if($x == $j + 1)\n {\n $i = $i . \"a\" . $e;\n }\n else\n {\n $i .= $f;\n }\n }\n }\n print $i;\n}\n?>"}, {"source_code": " $a) || ($b == 1))\n{\n print \"-1\";\n}\nelseif($a == $b)\n{\n print implode(array_slice($c, 0, $a));\n}\nelse\n{\n $d = $b - 2;\n $e = implode(array_slice($c, 2, $d));\n $f = \"ab\";\n $g = $a - strlen($e);\n $h = $g / 2;\n $i = \"\";\n $j = floor($h);\n if($g % 2 == 0)\n {\n for($x = 1; $x <= $j + 1; $x++)\n {\n if($x == $j + 1)\n {\n $i .= $e;\n }\n else\n {\n $i .= $f;\n }\n }\n }\n else\n {\n for($x = 1; $x <= $j + 1; $x++)\n {\n if($x == $j + 1)\n {\n $i = $i . \"a\" . $e;\n }\n else\n {\n $i .= $f;\n }\n }\n }\n print $i;\n}\n?>"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "2f659be28674a81f58f5c587b6a0f465"} {"source_code": "= $c[$x]) && ($c[$x] != 1))\n {\n $e = floor($c[$x] / 2);\n $f = ceil($c[$x] / 2);\n $d = bcadd($d, bcmul($e, $f));\n }\n else\n {\n $d--;\n }\n}\nprint $d;\n?>", "positive_code": [{"source_code": "= $vol && $vol > 1) {\n\t\tif ($vol % 2 == 0) {\n\t\t\t$tosquare = $vol / 2;\n\t\t\t$joyadd = pow($tosquare, 2);\n\t\t\t$joy += $joyadd;\n\t\t} else {\n\t\t\t$down = floor($vol / 2);\n\t\t\t$up = ceil($vol / 2);\n\t\t\t$joy += $up * $down;\n\t\t}\n\t} else {\n\t\t$joy--;\n\t}\n}\necho implode(explode(\",\", number_format($joy, 0)));\n?>"}], "negative_code": [{"source_code": "= $c[$x])\n {\n $e = floor($c[$x] / 2);\n $f = ceil($c[$x] / 2);\n $d += $e * $f;\n }\n else\n {\n $d--;\n }\n}\nprint $d;\n?>"}, {"source_code": "= $c[$x]) && ($c[$x] != 1))\n {\n $e = floor($c[$x] / 2);\n $f = ceil($c[$x] / 2);\n $d += $e * $f;\n }\n else\n {\n $d--;\n }\n}\nprint $d;\n?>"}], "src_uid": "986a7d97e62856d5301d5a70ea01466a"} {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $a = IO::arr();\r\n sort($a);\r\n $b = $c = $d = $x = [];\r\n $res = 0;\r\n $key = $n - 1;\r\n $b = [$a[$key]];\r\n unset($a[$key]);\r\n $res = (array_sum($b) / count($b)) + (array_sum($a) / count($a));\r\n IO::line($res);\r\n\r\n}\r\n\r\n\r\n?>", "positive_code": [{"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $a = IO::arr();\r\n sort($a);\r\n $b = $c = $d = $x = [];\r\n $res = 0;\r\n $last = $last2 = 0;\r\n $bool = true;\r\n foreach ($a as $v) {\r\n if ($v < 0) {\r\n if (isset($b[$v])) {\r\n $x[$v] = $v;\r\n } else {\r\n $last = $v;\r\n $b[$v] = $v;\r\n }\r\n } else {\r\n if (isset($c[$v])) {\r\n $d[$v] = $v;\r\n } else {\r\n $last2 = $v;\r\n $c[$v] = $v;\r\n }\r\n }\r\n }\r\n foreach ($d as $v) {\r\n $b[$v] = $v;\r\n }\r\n foreach ($x as $v) {\r\n $c[$v] = $v;\r\n }\r\n if (count($b) == 0) {\r\n $b[$last2] = $last2;\r\n unset($c[$last2]);\r\n }\r\n if (count($c) == 0) {\r\n $c[$last] = $last;\r\n unset($b[$last]);\r\n }\r\n $res = (array_sum($b) / count($b)) + (array_sum($c) / count($c));\r\n IO::line($res);\r\n\r\n}\r\n\r\n\r\n?>"}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $a = IO::arr();\r\n sort($a);\r\n $b = $c = $d = $x = [];\r\n $res = 0;\r\n $last = $last2 = 0;\r\n $bool = true;\r\n foreach ($a as $v) {\r\n if ($v < 0) {\r\n if (isset($b[$v])) {\r\n $x[$v] = $v;\r\n } else {\r\n $last = $v;\r\n $b[$v] = $v;\r\n }\r\n } else {\r\n if (isset($c[$v])) {\r\n $d[$v] = $v;\r\n } else {\r\n $last2 = $v;\r\n $c[$v] = $v;\r\n }\r\n }\r\n }\r\n if (count($b) % 2 == 1) {\r\n unset($b[$last]);\r\n $c[$last] = $last;\r\n }\r\n foreach ($d as $v) {\r\n $b[$v] = $v;\r\n }\r\n foreach ($x as $v) {\r\n $c[$v] = $v;\r\n }\r\n if (count($b) == 0) {\r\n $b[$last2] = $last2;\r\n unset($c[$last2]);\r\n }\r\n if (count($c) == 0) {\r\n $c[$last] = $last;\r\n unset($b[$last]);\r\n }\r\n $res = (array_sum($b) / count($b)) + (array_sum($c) / count($c));\r\n IO::line($res);\r\n\r\n}\r\n\r\n\r\n?>"}], "src_uid": "159b9c743d6d8792548645b9f7be2753"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "=18);\n}\necho $cnt;"}, {"source_code": "=18);\n}\necho $cnt;"}, {"source_code": "=18);\n}\necho $cnt;"}, {"source_code": "=18);\n}\necho $cnt;"}, {"source_code": "=18);\n}\necho $cnt;"}, {"source_code": ""}, {"source_code": "\n$n=trim(fgets(STDIN));\nfor($i=0;$i<$n;$i++)\n $arr[]=trim(fgets(STDIN));\n$alc=array('ABSINTH', 'BEER', 'BRANDY', 'CHAMPAGNE', 'GIN', 'RUM', 'SAKE', 'TEQUILA', 'VODKA', 'WHISKEY', 'WINE');\n$count=0;\nforeach($arr as $val){\n if(in_array($val,$alc) || ((int)$val<18 && (int)$val!=0))\n $count++;\n}\necho $count;\n?>"}], "src_uid": "4b7b0fba7b0af78c3956c34c29785e7c"} {"source_code": " $value)\r\n\tprint($value.\"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": " $value)\r\n\tprint($value.\"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": " $value)\r\n\tprint($value.\"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": ""}, {"source_code": " 0 || $iC > 0) {\r\n echo 'NO' . PHP_EOL;\r\n } else if ($iC - $iB > 0 || $iA) {\r\n echo 'NO' . PHP_EOL;\r\n } else {\r\n echo 'YES' . PHP_EOL;\r\n }\r\n \r\n\r\n}"}, {"source_code": " 0) {\r\n echo 'NO' . PHP_EOL;\r\n } else if ($iC - $iB > 0) {\r\n echo 'NO' . PHP_EOL;\r\n } else {\r\n echo 'YES' . PHP_EOL;\r\n }\r\n}"}], "src_uid": "ca6b162f945d4216055bf92d7263dbd5"} {"source_code": ""}, {"source_code": " $replacement]) .\n substr($string, $to + 1);\n}\necho $string, PHP_EOL;\n"}], "negative_code": [], "src_uid": "3f97dc063286a7af4838b7cd1c01df69"} {"source_code": " 0 && $month > 0 && $month < 13 && $day <= $months[$month - 1]) {\n if (array_key_exists($value, $dates))\n $dates[$value] += 1;\n else\n $dates[$value] = intval(\"1\");\n }\n\t}\n\n\t$max = 0;\n\t$answer = \"\";\n\tforeach ($dates as $key => $value) {\n\t\tif ($max < $value) {\n\t\t\t$max = $value;\n\t\t\t$answer = $key;\n\t\t}\n\t}\n\n\techo $answer;\n?>", "positive_code": [{"source_code": "= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"31\"))) || (($i == \"02\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"28\"))) || (($i == \"03\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"31\"))) || (($i == \"04\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"30\"))) || (($i == \"05\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"31\"))) || (($i == \"06\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"30\"))) || (($i == \"07\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"31\"))) || (($i == \"08\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"31\"))) || (($i == \"09\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"30\"))) || (($i == \"10\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"31\"))) || (($i == \"11\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"30\"))) || (($i == \"12\") && (($j >= \"2013\") && ($j <= \"2015\")) && (($h >= \"01\") && ($h <= \"31\"))))\n {\n array_push($b, substr($a, $x - 2, 10));\n }\n }\n}\nsort($b);\n$c = array_unique($b);\n$d = array_keys($c);\narray_push($d, count($b));\n$e = $c;\nsort($e);\n$f = array();\nfor($x = 0; $x < count($e); $x++)\n{\n array_push($f, $d[$x + 1] - $d[$x]);\n}\narsort($f);\n$g = array_keys($f);\nprint $e[$g[0]];\n?>"}, {"source_code": "\n$s = trim(fgets(STDIN));\n$time = 1356998400;\nfor ($i=0;$i<1095;++$i){\n$a[$i] = date('d-m-Y',$time);\n$time=$time+86400;\n}\n$l = strlen($s);\nfor ($i=0;$i<$l;++$i) {\n$count[substr($s,$i,10)]++;\n}\n\nfor ($i=0;$i<1095;++$i){\nif ($count[$a[$i]] > $max) {\n $ind = $a[$i];\n $max = $count[$a[$i]];\n}\n}\n\necho $ind;\n"}, {"source_code": "0&&$day>0&&$day<=$months[$month-1]){\n\t\t\tif(array_key_exists($cur,$date)){\n\t\t\t\t$date[$cur]++;\n\t\t\t}\t\n\t\t\telse $date[$cur]=1;\n\t\t}\n\t}\n\t$max=0;\n\t$ans=\"\";\n\tforeach($date as $key=>$value){\n\t\tif($max<$value){\n\t\t\t\t$max=$value;\n\t\t\t\t$ans=$key;\n\t\t\t}\t\n\t}\n\techo $ans.PHP_EOL;\n?>\n"}], "negative_code": [{"source_code": ""}], "src_uid": "dd7fd84f7915ad57b0e21f416e2a3ea0"} {"source_code": " $max_round){\n $max_round = $current;\n }\n }\n if($max_round > $max){\n $max = $max_round;\n }\n}\n\necho $max;", "positive_code": [{"source_code": "= $max) $max = $res;\n }\n echo $max;"}, {"source_code": " $c)\n{\n $c = $j;\n}\n$d = 2;\n$g = range(0, $a - 1);\n$h = 0;\n$i = 1;\nif($a != 1)\n{\n while(TRUE)\n {\n $e = array_slice($b, $g[$h], $d);\n $h++;\n $f = intval($e[0]);\n for($y = 1; $y < count($e); $y++)\n {\n $f = $f ^ $e[$y];\n }\n if($f > $c)\n {\n $c = $f;\n }\n if($h == count($g) - $i)\n {\n $h = 0;\n if($d == count($g))\n {\n break;\n }\n $d++;\n $i++;\n }\n }\n}\nprint $c;\n?>"}, {"source_code": "\n$f = fopen( 'php://stdin', 'r' );\n \nfgets($f);\n$nums = explode(\" \", fgets($f));\n \n$last = array();\n$otr = array();\n$max = 0;\nfor ($i = 0; $i <= count($nums); $i++) {\nfor ($j = $i; $j <= count($nums); $j++) {\nif (!array_search(implode(\"\", $otr), $last)) {\n$xor = getxor($otr);\nif ($xor > $max) $max = $xor;\n}\n$otr[] = $nums[$j];\n}\n$otr = array();\n}\n \necho $max;\n \nfunction getxor($otr) {\n$xor = 0;\nforeach ($otr as $num) {\n$xor ^= $num;\n}\nreturn $xor;\n}"}], "negative_code": [{"source_code": " $c)\n {\n $c = $f;\n }\n if($h == count($g) - $i)\n {\n $h = 0;\n $d++;\n if($d == count($g))\n {\n break;\n }\n $i++;\n }\n}\nprint $c;\n?>"}, {"source_code": " $max_round){\n $max_round = $current;\n }\n }\n if($max_round > $max){\n $max = $max_round;\n }\n}\necho $max;"}], "src_uid": "a33991c9d7fdb4a4e00c0d0e6902bee1"} {"source_code": "=0;$j--)\n { \n $y += (ord($tar1[$j])-64)*$d;\n $d*=26;\n } \n printf(\"R%sC%s\\n\",$target[2],$y);\n}\n\nfclose($fr);\n\n", "positive_code": [{"source_code": " 0) {\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$str = substr($str, $a1);\n\t\t$pattern = '/[0-9]/';\n\t\tpreg_match($pattern, $str, $matches);\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$result[] = substr($str, $a1);\t\n\t} else {\n\t\t$result[] = $str;\n\t}\n\treturn $result;\n}\n\nfunction changeSTN($a) {\n\t$leng = strlen($a);\n\t$result = 0;\n\tfor ($i = 0; $i < $leng; $i++) { \n\t\t$result += (ord($a[$i]) - 64) * pow(26, $leng - 1 - $i);\n\t}\n\treturn $result;\n}\n\nfunction changeNTS($a) {\n\t$result = \"\";\n\twhile ($a > 0) {\n\t\t$d = $a % 26;\n\t\t$a = floor($a / 26);\n\t\tif ($d == 0) {\n\t\t\t$d += 26;\n\t\t\t$a--;\n\t\t}\n\t\t$result .= chr(64 + $d);\n\t\t\n\t}\n\treturn strrev($result);\n}\n\nfunction change($str) {\n\t$str = tach($str);\n\tif (count($str) == 2) {\n\t\t$result = \"R\" . $str[1];\n\t\t$result .= \"C\" . changeSTN($str[0]);\n\t} else {\n\t\t$result = changeNTS((int)$str[3]);\n\t\t$result .= $str[1];\n\t}\n\treturn $result;\n}\n\n\n\nfor ($i = 0; $i < $n - 1; $i++) {\n\techo change($a[$i]) . \"\\n\";\n}\necho change($a[$n - 1]);\n\n\n\n\n"}, {"source_code": " $baseNum)\n\t\t{\n\t\t\t$left = $num % $baseNum;\n\t\t\t$num = intval($num / $baseNum);\n\t\t\tif(!$left)\n\t\t\t{\n\t\t\t\t$left = 26;\n\t\t\t\t$num--;\n\t\t\t}\n\t\t\t\n\t\t\t$res = chr($left + $baseChar) . $res;\n\t\t\t\n\t\t\n\t\t}\n\t\t\n\t\tif($num)\n\t\t{\n\t\t\t$res = chr($num + $baseChar) . $res;\n\t\t}\n\t\t\n\t\t$res .= $matches[1];\n\t\t\n\t\techo $res . PHP_EOL;\n\t}\n\telse\n\t{\n\t\tpreg_match('/([A-Z]+)(\\d+)/', $str, $matches);\n\t\t\n\t\t$res = 'R' . $matches[2] . 'C';\n\t\t\n\t\t$str = str_split($matches[1]);\n\t\t$pos = count($str) - 1;\n\t\t$sum = 0;\n\t\tforeach($str as $chr)\n\t\t{\n\t\t\t$sum += (ord($chr) - $baseChar) * pow($baseNum, $pos);\n\t\t\t$pos--;\n\t\t}\n\t\t\n\t\techo $res . $sum . PHP_EOL;\n\t\t\n\t}\n}"}, {"source_code": "=0; $j--, $d*=26)\n\t\t\t\t$c += (ord($s[$j])-64)*$d;\n\t\t\techo 'R', $matches[2], 'C', $c, \"\\n\";\n\t\t}\n\t}\n?>"}, {"source_code": " \"0\",\n \"A\" => \"1\",\n \"B\" => \"2\",\n \"C\" => \"3\",\n \"D\" => \"4\",\n \"E\" => \"5\",\n \"F\" => \"6\",\n \"G\" => \"7\",\n \"H\" => \"8\",\n \"I\" => \"9\",\n \"J\" => \"A\",\n \"K\" => \"B\",\n \"L\" => \"C\",\n \"M\" => \"D\",\n \"N\" => \"E\",\n \"O\" => \"F\",\n \"P\" => \"G\",\n \"Q\" => \"H\",\n \"R\" => \"I\",\n \"S\" => \"J\",\n \"T\" => \"K\",\n \"U\" => \"L\",\n \"V\" => \"M\",\n \"W\" => \"N\",\n \"X\" => \"O\",\n \"Y\" => \"P\",\n \"Z\" => \"Q\");\n\n$letters = array(\n \"0\" => \"0\",\n \"1\" => \"1\",\n \"2\" => \"2\",\n \"3\" => \"3\",\n \"4\" => \"4\",\n \"5\" => \"5\",\n \"6\" => \"6\",\n \"7\" => \"7\",\n \"8\" => \"8\",\n \"9\" => \"9\",\n \"10\" => \"A\",\n \"11\" => \"B\",\n \"12\" => \"C\",\n \"13\" => \"D\",\n \"14\" => \"E\",\n \"15\" => \"F\",\n \"16\" => \"G\",\n \"17\" => \"H\",\n \"18\" => \"I\",\n \"19\" => \"J\",\n \"20\" => \"K\",\n \"21\" => \"L\",\n \"22\" => \"M\",\n \"23\" => \"N\",\n \"24\" => \"O\",\n \"25\" => \"P\",\n \"26\" => \"Q\");\n\n$newcells = array();\n\nfunction mybase26($number) { //something funky that takes out the zeros and replaces them with \"Z\"s (non-existent in base 26) and decrements the next highest place value\n //coming from base 10\n global $letters;\n $places = array();\n $places[4] = 0;\n $places[3] = 0;\n $places[2] = 0;\n $places[1] = 0;\n $places[0] = 0;\n //the number can't have a fives place since it's smaller than 10^6\n //yes we're brute forcing here\n if ($number > 456976 && $number - 456976 > 17576 && $number - 456976 - 17576 > 676 && $number - 456976 - 17576 - 676 > 26 && $number - 456976 - 17576 - 676 - 26 > 0) { //notice how we're not using >=, this is so that we don't reach a zero and we can use the Zs. In a normal conversion function this would take out allll the 456976s possible, here, we leave one, if there's one left.\n do {\n $number = $number - 456976; //26^4\n $places[4]++;\n } while ($number > 456976 && $number - 456976 > 17576 && $number - 456976 - 17576 > 676 && $number - 456976 - 17576 - 676 > 26 && $number - 456976 - 17576 - 676 - 26 > 0); //also we're making sure we're not taking out a threes place here\n }\n if ($number > 17576 && $number - 17576 > 676 && $number - 17576 - 676 > 26 && $number - 17576 - 676 - 26 > 0) { \n do {\n $number = $number - 17576; //26^3\n $places[3]++;\n } while ($number > 17576 && $number - 17576 > 676 && $number - 17576 - 676 > 26 && $number - 17576 - 676 - 26 > 0);\n }\n if ($number > 676 && $number - 676 > 26 && $number - 676 - 26 > 0) {\n do {\n $number = $number - 676;\n $places[2]++;\n } while ($number > 676 && $number - 676 > 26 && $number - 676 - 26 > 0);\n }\n if ($number > 26 && $number - 26 > 0) {\n do {\n $number = $number - 26;\n $places[1]++;\n } while ($number > 26 && $number - 26 > 0);\n }\n if ($number <= 26) { //because we close this baby out and take it all home in the last place, we use <= here.\n $places[0] = $number;\n }\n\n //now we have the place values; just get them into letters if bigger than 9.\n $places[4] = $letters[$places[4]];\n $places[3] = $letters[$places[3]];\n $places[2] = $letters[$places[2]];\n $places[1] = $letters[$places[1]];\n $places[0] = $letters[$places[0]];\n\n return ltrim($places[4].$places[3].$places[2].$places[1].$places[0], \"0\");\n}\n\nfunction mybase10($number) { //with an array that includes Z = 26\n //from base 26\n global $letters;\n $explode = str_split($number);\n $power = 0; //of 26\n $sum = 0; //result\n\n foreach ($explode as $key => $value) { //convert from A to 10, for example\n $explode[$key] = array_search($value, $letters);\n }\n\n //tricky way of reversing number to start with zeros place and then increase\n $reversedAndReindexed = array_values(array_reverse($explode));\n $places = count($reversedAndReindexed);\n\n for ($i = 0; $i < $places; $i++) {\n $sum = $sum + (pow(26, $power) * $reversedAndReindexed[$i]); //learn something new everyday. pow is the base to exponent function. And to think I guessed it from my text editor.\n $power++;\n }\n\n return $sum;\n}\n\nfunction numbertoletter($number) {\n global $shiftover;\n $base26 = str_split(mybase26($number)); //get from base 10 to base 26\n $shift = \"\";\n foreach ($base26 as $value) { //now shift all the characters over to start at A instead of 1\n $shift .= array_search($value, $shiftover);\n }\n return $shift;\n}\n\nfunction lettertonumber($letter) {\n global $shiftover;\n $explode = str_split($letter);\n $shift = \"\";\n foreach ($explode as $value) { //shift all the characters over to start at 1 instead of A\n $shift .= $shiftover[$value];\n }\n\n $base10 = mybase10($shift);\n return $base10;\n}\n\n//main(), if you will\nfor ($i = 0; $i < $n; $i++) {\n $cell = trim(fgets(STDIN)); //$cell = $array[$i];\n if (preg_match(\"/R([0-9]+)C([0-9]+)/\", $cell, $matches) == TRUE) {\n $matches[2] = numbertoletter($matches[2]);\n $newcells[] = $matches[2].$matches[1];\n } else {\n preg_match(\"/([A-Z]+)([0-9]+)/\", $cell, $matches);\n $matches[1] = lettertonumber($matches[1]);\n $newcells[] = \"R\".$matches[2].\"C\".$matches[1];\n }\n}\n\nforeach ($newcells as $value) {\n echo $value.\"\\n\";\n}\n?>"}, {"source_code": "= 48 && ord($data[$i][1]) <= 57 && strpos($data[$i], 'C') !== false) {\n \t\t$column = '';\n \t\t$string = '';\n \t\t$flag = false;\n \t\tfor($j = 1; $j < strlen($data[$i]); $j++) {\n \t\t\tif($data[$i][$j] == 'C') {\n \t\t\t\t$flag = true;\n \t\t\t} else {\n \t\t\t\tif(!$flag) {\n \t\t\t\t\t$string .= $data[$i][$j];\n \t\t\t\t} else {\n \t\t\t\t\t$column .= $data[$i][$j];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t$strColumn = '';\n \t\t$column = (int)$column;\n\n \t\tdo {\n \t\t\tif($column > 26) {\n \t\t\t\tif($column % 26 != 0) { \n\t\t \t\t\t$strColumn .= chr($column % 26 + 64);\n\t\t \t\t\t$column = floor($column / 26);\n\t\t \t\t} else {\n\t\t \t\t\t$strColumn .= chr(26 + 64);\n\t\t \t\t\t$column = floor(($column-26) / 26);\n\t\t \t\t}\n\t \t\t} else {\n\t \t\t\t$strColumn .= chr($column + 64);\n\t \t\t\tbreak;\n\t \t\t}\n \t\t} while(true);\n\n \t\t$data[$i] = strrev($strColumn) . $string;\n\n \t} else {\n \t\t$column = '';\n \t\t$string = '';\n \t\tfor($j = 0; $j= 65 && ord($data[$i][$j]) <= 90) {\n \t\t\t\t$column .= $data[$i][$j];\n \t\t\t} else {\n \t\t\t\t$string .= $data[$i][$j];\n \t\t\t}\n \t\t}\n\n \t\t$columnNum = 0;\n \t\tfor($j = strlen($column) - 1; $j >= 0; $j--) {\n \t\t\t$columnNum += (ord($column[$j]) - 64) * pow(26, strlen($column)-$j-1);\n \t\t}\n \t\t$data[$i] = 'R' . $string . 'C' . $columnNum;\n \t}\n }\n echo implode(\"\\n\", $data);\n?>\n"}, {"source_code": "=48&&ord($var)<=57)\n return true;\n else\n return false;\n}\nfunction IsType1($var)\n{\n $res=false;;\n for($i=1;$i =0;$i--)\n {\n if(IsInt($var[$i]))\n {\n $res.=$var[$i];\n }\n else {\n return strrev($res);\n }\n }\n}\n\n\nfunction conversion_int($var)\n{\n $res=\"\";\n while($var>26)\n {\n if($var%26!=0)\n {\n $res.=chr(64+$var%26);\n $var=($var-$var%26)/26;\n }\n else {\n $res.='Z';\n $var=($var)/26-1;\n }\n }\n if($var!=0)\n $res.=chr(64+$var);\n return strrev($res);\n}\nfunction conversion_str($var)\n{\n $res=0;\n for($i=strlen($var)-1;$i>=0;$i--)\n {\n $temp=1;\n for($j=strlen($var)-1;$j>$i;$j--)\n {\n $temp*=26;\n }\n if($var[$i]!='Z')\n $res+=(ord($var[$i])-64)*$temp;\n else {\n $res+=$temp*26;\n }\n }\n return $res;\n}\nwhile($n--)\n{\nfscanf(STDIN,\"%s\",$str);\n if($str[0]=='R'&& IsInt($str[1]) && IsType1($str))\n {\n $a=GetInt($str);\n $b=GetInt_D($str);\n echo conversion_int($b).$a.\"\\n\";\n }\n else {\n $a=\"\";\n for($i=0;$i \n"}, {"source_code": "=0; $i--, $j++) {\n $pos = strpos(LETTERS, $column[$i], 1);\n $columnNumber += $pos * (26 ** $j);\n }\n return 'R' . $row . 'C' . $columnNumber;\n}\n\nfunction rc2zz($column, $row) {\n $columnNumber = '';\n while (($column / 26) > 1) {\n $floor = (int)floor($column / 26);\n $mod = $column % 26;\n $columnNumber .= LETTERS[$mod];\n $column = $floor;\n if ($mod === 0) {\n $column--;\n }\n }\n $ost = $column % 26;\n $columnNumber .= LETTERS[$ost];\n return strrev($columnNumber) . $row;\n}\n\n$n = fscanf(STDIN, '%u');\nwhile ($row = trim(fgets(STDIN))) {\n if (preg_match('~R(\\d+)C(\\d+)~', $row, $match)) {\n echo rc2zz($match[2], $match[1]);\n } elseif(preg_match('~([A-Z]+)(\\d+)~i', $row, $match)) {\n echo zz2rc($match[1], $match[2]);\n }\n echo PHP_EOL;\n}\n"}, {"source_code": " 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10\n , 'K' => 11, 'L' => 12, 'M' => 13, 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19\n , 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26\n];\nfunction zz2rc(string $column, int $row): string {\n $columnNumber = 0;\n for ($i = strlen($column) - 1, $j = 0; $i >=0; $i--, $j++) {\n $pos = LETTERS_MAP[$column[$i]];\n $columnNumber += $pos * (26 ** $j);\n }\n return 'R' . $row . 'C' . $columnNumber;\n}\n\nfunction rc2zz(int $column, int $row): string {\n $columnNumber = '';\n while (($div = $column / 26) > 1) {\n $floor = (int)floor($div);\n $mod = $column % 26;\n $columnNumber .= LETTERS[$mod];\n $column = $floor;\n if ($mod === 0) {\n $column--;\n }\n }\n $mod = $column % 26;\n $columnNumber .= LETTERS[$mod];\n return strrev($columnNumber) . $row;\n}\n\n$n = fscanf(STDIN, '%u');\nwhile ($row = trim(fgets(STDIN))) {\n if (preg_match('~R(\\d+)C(\\d+)~', $row, $match)) {\n echo rc2zz((int)$match[2], (int)$match[1]);\n } elseif(preg_match('~([A-Z]+)(\\d+)~i', $row, $match)) {\n echo zz2rc($match[1], (int)$match[2]);\n }\n echo PHP_EOL;\n}\n"}, {"source_code": " 0) {\n $s = $c % pow(26, $p + 1);\n if (! $s) {\n $s = 26 * pow(26, $p);\n }\n $l = $s / pow(26, $p);\n $cStr = chr(64 + $l) . $cStr;\n $c -= $l * pow(26, $p);\n $p ++;\n }\n echo $cStr . $r . \"\\n\";\n } elseif (preg_match('~^([A-Z]+)([0-9]+)$~', $val, $matches)) {\n $r = $matches[2];\n $cStr = $matches[1];\n $cStrLen = strlen($cStr);\n $c = 0;\n for ($i = 0; $i < $cStrLen; $i ++) {\n $l = substr($cStr, $i, 1);\n $l = ord($l) - 64;\n $c += $l * pow(26, $cStrLen - $i - 1);\n }\n echo 'R' . $r . 'C' . $c . \"\\n\";\n }\n}\n"}, {"source_code": " 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10\n , 'K' => 11, 'L' => 12, 'M' => 13, 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19\n , 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26\n];\nfunction zz2rc($column, $row) {\n $columnNumber = 0;\n for ($i = strlen($column) - 1, $j = 0; $i >=0; $i--, $j++) {\n $pos = LETTERS_MAP[$column[$i]];\n $columnNumber += $pos * (26 ** $j);\n }\n return 'R' . $row . 'C' . $columnNumber;\n}\n\nfunction rc2zz($column, $row) {\n $columnNumber = '';\n while (($div = $column / 26) > 1) {\n $floor = (int)floor($div);\n $mod = $column % 26;\n $columnNumber .= LETTERS[$mod];\n $column = $floor;\n if ($mod === 0) {\n $column--;\n }\n }\n $mod = $column % 26;\n $columnNumber .= LETTERS[$mod];\n return strrev($columnNumber) . $row;\n}\n\n$n = fscanf(STDIN, '%u');\nwhile ($row = trim(fgets(STDIN))) {\n if (preg_match('~R(\\d+)C(\\d+)~', $row, $match)) {\n echo rc2zz($match[2], $match[1]);\n } elseif(preg_match('~([A-Z]+)(\\d+)~i', $row, $match)) {\n echo zz2rc($match[1], $match[2]);\n }\n echo PHP_EOL;\n}\n"}, {"source_code": "0;$last_pos--){\n $char = $col_word[$last_pos-1] ;\n $index = array_search($char,$chars_arr);\n\n if($index == 0){\n $num = 26;\n }else{\n $num = $index;\n }\n $amount += pow($step,$level) * $num;\n\n $level ++;\n }\n\n echo \"R\".$row.\"C\".$amount.\"\\n\";\n\n\n\t\t\t\t}\n\n }\n }\n}\n\n"}, {"source_code": " 0) {\n $s = $c % pow(26, $p + 1);\n $l = $s / pow(26, $p);\n if (! $l) {\n $l = 26;\n }\n $cStr = chr(64 + $l) . $cStr;\n $c -= $l * pow(26, $p);\n $p ++;\n }\n echo $cStr . $r . \"\\n\";\n } elseif (preg_match('~^([A-Z]+)([0-9]+)$~', $val, $matches)) {\n $r = $matches[2];\n $cStr = $matches[1];\n $cStrLen = strlen($cStr);\n $c = 0;\n for ($i = 0; $i < $cStrLen; $i ++) {\n $l = substr($cStr, $i, 1);\n $l = ord($l) - 64;\n $c += $l * pow(26, $cStrLen - $i - 1);\n }\n echo 'R' . $r . 'C' . $c . \"\\n\";\n }\n}\n"}, {"source_code": "=0;$j--)\n { \n $y += (ord($tar1[$j])-64)*$d;\n $d*=26;\n } \n printf(\"R%sC%s\\n\",$target[2],$y);\n}\n\nfclose($fr);\n"}, {"source_code": "0)\n {\n $r=($num-1)%26;\n $res = chr($r+65).$res;\n $num = floor(($num-1)/26); \n }\n return $res;\n}\n\nfunction old2new($str) {\n $res=0; \n for ($i=0; $i "}, {"source_code": " 0) && ($e <= 26))\n {\n $i = $g[$e];\n }\n elseif(($e > 26) && ($e <= 702))\n {\n $f = ($e - 26) * 2 - 1;\n $i = $k[$f] . $k[$f + 1];\n }\n elseif(($e > 702) && ($e <= 18278))\n {\n $f = ($e - 702) * 3 - 2;\n $i = $l[$f] . $l[$f + 1] . $l[$f + 2];\n }\n elseif(($e > 18278) && ($e <= 475254))\n {\n $f = ($e - 18278) * 4 - 3;\n $i = $m[$f] . $m[$f + 1] . $m[$f + 2] . $m[$f + 3];\n }\n elseif(($e > 475254) && ($e <= 1000001))\n {\n $f = ($e - 475254) * 5 - 4;\n $i = $n[$f] . $n[$f + 1] . $n[$f + 2] . $n[$f + 3] . $n[$f + 4];\n }\n $j = substr($b, $c, $d - $c - 1);\n if($x == $a)\n {\n print $i . $j;\n }\n else\n {\n print $i . $j . \"\\n\";\n }\n }\n else\n {\n if(is_numeric($b[1]) == TRUE)\n {\n $e = substr($b, 0, 1);\n }\n elseif(is_numeric($b[2]) == TRUE)\n {\n $e = substr($b, 0, 2);\n }\n elseif(is_numeric($b[3]) == TRUE)\n {\n $e = substr($b, 0, 3);\n }\n elseif(is_numeric($b[4]) == TRUE)\n {\n $e = substr($b, 0, 4);\n }\n elseif(is_numeric($b[5]) == TRUE)\n {\n $e = substr($b, 0, 5);\n }\n elseif(is_numeric($b[6]) == TRUE)\n {\n $e = substr($b, 0, 6);\n }\n if(strlen($e) == 1)\n {\n if($e == \"A\")\n {\n $r = 1;\n }\n elseif($e == \"B\")\n {\n $r = 2;\n }\n elseif($e == \"C\")\n {\n $r = 3;\n }\n elseif($e == \"D\")\n {\n $r = 4;\n }\n elseif($e == \"E\")\n {\n $r = 5;\n }\n elseif($e == \"F\")\n {\n $r = 6;\n }\n elseif($e == \"G\")\n {\n $r = 7;\n }\n elseif($e == \"H\")\n {\n $r = 8;\n }\n elseif($e == \"I\")\n {\n $r = 9;\n }\n elseif($e == \"J\")\n {\n $r = 10;\n }\n elseif($e == \"K\")\n {\n $r = 11;\n }\n elseif($e == \"L\")\n {\n $r = 12;\n }\n elseif($e == \"M\")\n {\n $r = 13;\n }\n elseif($e == \"N\")\n {\n $r = 14;\n }\n elseif($e == \"O\")\n {\n $r = 15;\n }\n elseif($e == \"P\")\n {\n $r = 16;\n }\n elseif($e == \"Q\")\n {\n $r = 17;\n }\n elseif($e == \"R\")\n {\n $r = 18;\n }\n elseif($e == \"S\")\n {\n $r = 19;\n }\n elseif($e == \"T\")\n {\n $r = 20;\n }\n elseif($e == \"U\")\n {\n $r = 21;\n }\n elseif($e == \"V\")\n {\n $r = 22;\n }\n elseif($e == \"W\")\n {\n $r = 23;\n }\n elseif($e == \"X\")\n {\n $r = 24;\n }\n elseif($e == \"Y\")\n {\n $r = 25;\n }\n elseif($e == \"Z\")\n {\n $r = 26;\n }\n }\n elseif(strlen($e) == 2)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n $r = $f * 26 + $t;\n }\n elseif(strlen($e) == 3)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n $r = $f * 676 + $t * 26 + $h;\n }\n elseif(strlen($e) == 4)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n if($e[3] == \"A\")\n {\n $i = 1;\n }\n elseif($e[3] == \"B\")\n {\n $i = 2;\n }\n elseif($e[3] == \"C\")\n {\n $i = 3;\n }\n elseif($e[3] == \"D\")\n {\n $i = 4;\n }\n elseif($e[3] == \"E\")\n {\n $i = 5;\n }\n elseif($e[3] == \"F\")\n {\n $i = 6;\n }\n elseif($e[3] == \"G\")\n {\n $i = 7;\n }\n elseif($e[3] == \"H\")\n {\n $i = 8;\n }\n elseif($e[3] == \"I\")\n {\n $i = 9;\n }\n elseif($e[3] == \"J\")\n {\n $i = 10;\n }\n elseif($e[3] == \"K\")\n {\n $i = 11;\n }\n elseif($e[3] == \"L\")\n {\n $i = 12;\n }\n elseif($e[3] == \"M\")\n {\n $i = 13;\n }\n elseif($e[3] == \"N\")\n {\n $i = 14;\n }\n elseif($e[3] == \"O\")\n {\n $i = 15;\n }\n elseif($e[3] == \"P\")\n {\n $i = 16;\n }\n elseif($e[3] == \"Q\")\n {\n $i = 17;\n }\n elseif($e[3] == \"R\")\n {\n $i = 18;\n }\n elseif($e[3] == \"S\")\n {\n $i = 19;\n }\n elseif($e[3] == \"T\")\n {\n $i = 20;\n }\n elseif($e[3] == \"U\")\n {\n $i = 21;\n }\n elseif($e[3] == \"V\")\n {\n $i = 22;\n }\n elseif($e[3] == \"W\")\n {\n $i = 23;\n }\n elseif($e[3] == \"X\")\n {\n $i = 24;\n }\n elseif($e[3] == \"Y\")\n {\n $i = 25;\n }\n elseif($e[3] == \"Z\")\n {\n $i = 26;\n }\n $r = $f * 17576 + $t * 676 + $h * 26 + $i;\n }\n elseif(strlen($e) == 5)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n if($e[3] == \"A\")\n {\n $i = 1;\n }\n elseif($e[3] == \"B\")\n {\n $i = 2;\n }\n elseif($e[3] == \"C\")\n {\n $i = 3;\n }\n elseif($e[3] == \"D\")\n {\n $i = 4;\n }\n elseif($e[3] == \"E\")\n {\n $i = 5;\n }\n elseif($e[3] == \"F\")\n {\n $i = 6;\n }\n elseif($e[3] == \"G\")\n {\n $i = 7;\n }\n elseif($e[3] == \"H\")\n {\n $i = 8;\n }\n elseif($e[3] == \"I\")\n {\n $i = 9;\n }\n elseif($e[3] == \"J\")\n {\n $i = 10;\n }\n elseif($e[3] == \"K\")\n {\n $i = 11;\n }\n elseif($e[3] == \"L\")\n {\n $i = 12;\n }\n elseif($e[3] == \"M\")\n {\n $i = 13;\n }\n elseif($e[3] == \"N\")\n {\n $i = 14;\n }\n elseif($e[3] == \"O\")\n {\n $i = 15;\n }\n elseif($e[3] == \"P\")\n {\n $i = 16;\n }\n elseif($e[3] == \"Q\")\n {\n $i = 17;\n }\n elseif($e[3] == \"R\")\n {\n $i = 18;\n }\n elseif($e[3] == \"S\")\n {\n $i = 19;\n }\n elseif($e[3] == \"T\")\n {\n $i = 20;\n }\n elseif($e[3] == \"U\")\n {\n $i = 21;\n }\n elseif($e[3] == \"V\")\n {\n $i = 22;\n }\n elseif($e[3] == \"W\")\n {\n $i = 23;\n }\n elseif($e[3] == \"X\")\n {\n $i = 24;\n }\n elseif($e[3] == \"Y\")\n {\n $i = 25;\n }\n elseif($e[3] == \"Z\")\n {\n $i = 26;\n }\n if($e[4] == \"A\")\n {\n $j = 1;\n }\n elseif($e[4] == \"B\")\n {\n $j = 2;\n }\n elseif($e[4] == \"C\")\n {\n $j = 3;\n }\n elseif($e[4] == \"D\")\n {\n $j = 4;\n }\n elseif($e[4] == \"E\")\n {\n $j = 5;\n }\n elseif($e[4] == \"F\")\n {\n $j = 6;\n }\n elseif($e[4] == \"G\")\n {\n $j = 7;\n }\n elseif($e[4] == \"H\")\n {\n $j = 8;\n }\n elseif($e[4] == \"I\")\n {\n $j = 9;\n }\n elseif($e[4] == \"J\")\n {\n $j = 10;\n }\n elseif($e[4] == \"K\")\n {\n $j = 11;\n }\n elseif($e[4] == \"L\")\n {\n $j = 12;\n }\n elseif($e[4] == \"M\")\n {\n $j = 13;\n }\n elseif($e[4] == \"N\")\n {\n $j = 14;\n }\n elseif($e[4] == \"O\")\n {\n $j = 15;\n }\n elseif($e[4] == \"P\")\n {\n $j = 16;\n }\n elseif($e[4] == \"Q\")\n {\n $j = 17;\n }\n elseif($e[4] == \"R\")\n {\n $j = 18;\n }\n elseif($e[4] == \"S\")\n {\n $j = 19;\n }\n elseif($e[4] == \"T\")\n {\n $j = 20;\n }\n elseif($e[4] == \"U\")\n {\n $j = 21;\n }\n elseif($e[4] == \"V\")\n {\n $j = 22;\n }\n elseif($e[4] == \"W\")\n {\n $j = 23;\n }\n elseif($e[4] == \"X\")\n {\n $j = 24;\n }\n elseif($e[4] == \"Y\")\n {\n $j = 25;\n }\n elseif($e[4] == \"Z\")\n {\n $j = 26;\n }\n $r = $f * 456976 + $t * 17576 + $h * 676 + $i * 26 + $j;\n } \n $s = substr($b, strlen($e));\n if($x == $a)\n {\n print \"R\" . $s . \"C\" . $r;\n }\n else\n {\n print \"R\" . $s . \"C\" . $r . \"\\n\";\n } \n }\n}\n?>"}, {"source_code": "=0; $j--)\n {\n $outC += (ord($c[$j])-64)*$d;\n $d*=26;\n }\n\n printf(\"R%sC%s\\n\", $outR, $outC);\n}\n\nfunction toCR($r, $c)\n{\n $outR = $r;\n $outC = '';\n\n while($c)\n {\n $outC = chr(65 + ($c-1)%26) . $outC;\n $c = (integer)(($c - ($c-1)%26)/26);\n }\n\n printf(\"%s%s\\n\", $outC, $outR);\n}"}, {"source_code": "=0; $j--)\n {\n $outC += (ord($c[$j])-64)*$d;\n $d*=26;\n }\n\n printf(\"R%sC%s\\n\", $outR, $outC);\n}\n\nfunction toCR($r, $c)\n{\n $outR = $r;\n $outC = '';\n\n while($c)\n {\n $outC = chr(65 + ($c-1)%26) . $outC;\n $c = (integer)(($c - ($c-1)%26)/26);\n }\n\n printf(\"%s%s\\n\", $outC, $outR);\n}"}, {"source_code": "1,\n\t\t'B'=>2,\n\t\t'C'=>3,\n\t\t'D'=>4,\n\t\t'E'=>5,\n\t\t'F'=>6,\n\t\t'G'=>7,\n\t\t'H'=>8,\n\t\t'I'=>9,\n\t\t'J'=>10,\n\t\t'K'=>11,\n\t\t'L'=>12,\n\t\t'M'=>13,\n\t\t'N'=>14,\n\t\t'O'=>15,\n\t\t'P'=>16,\n\t\t'Q'=>17,\n\t\t'R'=>18,\n\t\t'S'=>19,\n\t\t'T'=>20,\n\t\t'U'=>21,\n\t\t'V'=>22,\n\t\t'W'=>23,\n\t\t'X'=>24,\n\t\t'Y'=>25,\n\t\t'Z'=>26,\n\t);\n\n\tpublic function ex2rc($ex){\n\t\t$rc = array();\n\t\tpreg_match('/([A-Z]+)(\\d+)/', $ex, $rc);\n\t\t$auxCol = array_reverse(str_split($rc[1]));\n\t\t$auxPot = 0;\n\t\t$col = 0;\n\t\t$row = $rc[2];\n\t\tforeach($auxCol as $l){\n\t\t\t$col = $col + $this->eq[$l] * pow(count($this->eq), $auxPot);\n\t\t\t$auxPot++;\n\t\t}\n\t\treturn sprintf('R%sC%s', $row, $col);\n\t}\n\tpublic function rc2ex($rc){\n\t\t$n = count($this->eq);\n\t\t$ex = array();\n\t\tpreg_match('/R(\\d+)C(\\d+)/', $rc, $ex);\n\t\t$auxCol = intval($ex[2]);\n\t\t$col = '';\n\t\t$row = $ex[1];\n\t\t$sub = false;\n\t\twhile($auxCol / $n > 0){\n\t\t\t$r = $auxCol % $n;\n\t\t\t$auxCol = $auxCol - $r;\n\t\t\t$auxCol = $auxCol / $n;\n\t\t\tif($r == 0){\n\t\t\t\t$col = array_search($n, $this->eq) . $col;\n\t\t\t\t$auxCol--;\n\t\t\t} else {\n\t\t\t\t$col = array_search($r, $this->eq) . $col;\n\t\t\t}\n\t\t}\n\t\treturn sprintf('%s%s', $col, $row);\n\t}\n\n\tpublic function transform($coordinate){\n\t\tif(preg_match('/R\\d+C\\d+/', $coordinate)){\n\t\t\treturn $this->rc2ex($coordinate);\n\t\t}\n\t\treturn $this->ex2rc($coordinate);\n\t}\n}\n\n$n = intval(rtrim( fgets( STDIN ) ));\n$coordinates = array();\nfor($i = 0; $i < $n; $i++){\n\t$coordinates[] = rtrim( fgets( STDIN ) );\n}\n\n$p = new Parser();\nfor($i = 0; $i < $n; $i++){\n\techo $p->transform($coordinates[$i]) . PHP_EOL;\n}"}, {"source_code": " 1,\n\t\t\"B\" => 2,\n\t\t\"C\" => 3,\n\t\t\"D\" => 4,\n\t\t\"E\" => 5,\n\t\t\"F\" => 6,\n\t\t\"G\" => 7,\n\t\t\"H\" => 8,\n\t\t\"I\" => 9,\n\t\t\"J\" => 10,\n\t\t\"K\" => 11,\n\t\t\"L\" => 12,\n\t\t\"M\" => 13,\n\t\t\"N\" => 14,\n\t\t\"O\" => 15,\n\t\t\"P\" => 16,\n\t\t\"Q\" => 17,\n\t\t\"R\" => 18,\n\t\t\"S\" => 19,\n\t\t\"T\" => 20,\n\t\t\"U\" => 21,\n\t\t\"V\" => 22,\n\t\t\"W\" => 23,\n\t\t\"X\" => 24,\n\t\t\"Y\" => 25,\n\t\t\"Z\" => 26\n\t);\n\t$alph_2 = array(\n\t\t\"A\",\n\t\t\"B\",\n\t\t\"C\",\n\t\t\"D\",\n\t\t\"E\",\n\t\t\"F\",\n\t\t\"G\",\n\t\t\"H\",\n\t\t\"I\",\n\t\t\"J\",\n\t\t\"K\",\n\t\t\"L\",\n\t\t\"M\",\n\t\t\"N\",\n\t\t\"O\",\n\t\t\"P\",\n\t\t\"Q\",\n\t\t\"R\",\n\t\t\"S\",\n\t\t\"T\",\n\t\t\"U\",\n\t\t\"V\",\n\t\t\"W\",\n\t\t\"X\",\n\t\t\"Y\",\n\t\t\"Z\"\n\t);\n\t\n\t$count = (int)fgets(STDIN);\n\t$input_array = array();\n\tfor ($i = 0; $i < $count; $i++){\n\t\tarray_push($input_array, trim(fgets(STDIN)));\n\t}\n\tfor ($j = 0; $j < $count; $j++){\n\t\t$input_number = $input_array[$j];\n\t\t$number_array = array();\n\t\t$letter_array = array();\n\t\t$letter = \"\";\n\t\t$number = \"\";\n\t\tfor ($i =0; $i < strlen($input_number); $i++){\n\t\t\tif(!is_numeric($input_number[$i])){\n\t\t\t\tif($number !== \"\"){\n\t\t\t\t\tarray_push($number_array, (int)$number);\n\t\t\t\t\t$number = \"\";\n\t\t\t\t}\n\t\t\t\t$letter .= $input_number[$i];\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif($letter !== \"\"){\n\t\t\t\t\tarray_push($letter_array, (string)$letter);\n\t\t\t\t\t$letter = \"\";\n\t\t\t\t}\n\t\t\t\t$number .= $input_number[$i];\n\t\t\t}\n\t\t}\n\t\tif($number !== \"\"){\n\t\t\tarray_push($number_array, (int)$number);\n\t\t\t$number = \"\";\n\t\t}\n\t\tif($letter !== \"\"){\n\t\t\tarray_push($letter_array, (string)$letter);\n\t\t\t$letter = \"\";\n\t\t}\t\n\n\t\tif(count($number_array) === 2){ \n\t\t\t$res = array();\n\t\t\t$p = $number_array[1];\n\t\t\t$q = 0;\n\t\t\twhile ($p > MOD){\n\t\t\t\t$tmp_q = $p % MOD;\n\t\t\t\tif ($tmp_q === 0){\n\t\t\t\t\t$q = MOD;\n\t\t\t\t\t$p = intval($p / MOD) - 1;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$p = intval($p / MOD);\n\t\t\t\t\t$q = $tmp_q;\n\t\t\t\t}\n\t\t\t\tarray_push($res, $q);\n\t\t\t}\n\t\t\tarray_push($res, $p);\n\t\t\t$count_res = count($res) - 1;\n\t\t\tfor ($i = $count_res; $i >= 0; $i--){\n\t\t\t\techo $alph_2[$res[$i] - 1];\n\t\t\t}\n\t\t\techo $number_array[0].\"\\n\";\n\t\t}\n\t\telse{\n\t\t\t$letters = $letter_array[0];\n\t\t\t$res_number = 0;\n\t\t\tfor ($i = 0; $i < strlen($letters); $i++){\n\t\t\t\t$res_number += pow(MOD, (strlen($letters) - 1) - $i ) * $alph[$letters[$i]];\n\t\t\t}\n\t\t\techo \"R\" . $number_array[0] . \"C\" . $res_number . \"\\n\";\n\t\t}\n\t}\n?> \n"}, {"source_code": " 26;\n if ($continue) {\n $curr_num = $num % 26;\n if ($curr_num === 0) {\n $str = 'Z'.$str;\n $num = floor($num / 26) - 1;\n } else {\n $str = chr($curr_num + 64).$str;\n $num = floor($num / 26);\n }\n } else {\n $str = chr($num + 64).$str;\n }\n } while ($continue);\n return $str;\n}\n\nfunction alpha_to_number($str) {\n $parts = str_split($str);\n $num = 0;\n for ($i = 0; $i < count($parts); $i++) {\n $num = $num * 26;\n $num += ord($parts[$i]) - 64;\n }\n return $num;\n}\n\nfunction convert_one($str) {\n $parts = preg_split(\"/\\d+/\", $str);\n if ($parts[0] === 'R' && $parts[1] === 'C') {\n // from RXCY\n $numbers = preg_split(\"/R|C/\", $str);\n $row = $numbers[1];\n $col = $numbers[2];\n printf(\"%s%d\\n\", number_to_alpha($col), $row);\n } else {\n // to RXCY\n $col_str = $parts[0];\n $col = alpha_to_number($col_str);\n $row_parts = preg_split(\"/[A-Z]+/\", $str);\n $row = (int)$row_parts[1];\n printf(\"R%dC%d\\n\", $row, $col);\n }\n}\n\nfscanf(STDIN, \"%d\", $n);\nfor ($i = 1; $i <= $n; $i++) {\n fscanf(STDIN, \"%s\", $str);\n convert_one($str);\n}\n?>"}, {"source_code": " 0) && ($e <= 26))\n {\n $i = $g[$e];\n }\n elseif(($e > 26) && ($e <= 702))\n {\n $f = ($e - 26) * 2 - 1;\n $i = $k[$f] . $k[$f + 1];\n }\n elseif(($e > 702) && ($e <= 18278))\n {\n $f = ($e - 702) * 3 - 2;\n $i = $l[$f] . $l[$f + 1] . $l[$f + 2];\n }\n elseif(($e > 18278) && ($e <= 475254))\n {\n $f = ($e - 18278) * 4 - 3;\n $i = $m[$f] . $m[$f + 1] . $m[$f + 2] . $m[$f + 3];\n }\n elseif(($e > 475254) && ($e <= 1000001))\n {\n $f = ($e - 475254) * 5 - 4;\n $i = $n[$f] . $n[$f + 1] . $n[$f + 2] . $n[$f + 3] . $n[$f + 4];\n }\n $j = substr($b, $c, $d - $c - 1);\n if($x == $a)\n {\n print $i . $j;\n }\n else\n {\n print $i . $j . \"\\n\";\n }\n }\n else\n {\n if(is_numeric($b[1]) == TRUE)\n {\n $e = substr($b, 0, 1);\n }\n elseif(is_numeric($b[2]) == TRUE)\n {\n $e = substr($b, 0, 2);\n }\n elseif(is_numeric($b[3]) == TRUE)\n {\n $e = substr($b, 0, 3);\n }\n elseif(is_numeric($b[4]) == TRUE)\n {\n $e = substr($b, 0, 4);\n }\n elseif(is_numeric($b[5]) == TRUE)\n {\n $e = substr($b, 0, 5);\n }\n elseif(is_numeric($b[6]) == TRUE)\n {\n $e = substr($b, 0, 6);\n }\n if(strlen($e) == 1)\n {\n if($e == \"A\")\n {\n $r = 1;\n }\n elseif($e == \"B\")\n {\n $r = 2;\n }\n elseif($e == \"C\")\n {\n $r = 3;\n }\n elseif($e == \"D\")\n {\n $r = 4;\n }\n elseif($e == \"E\")\n {\n $r = 5;\n }\n elseif($e == \"F\")\n {\n $r = 6;\n }\n elseif($e == \"G\")\n {\n $r = 7;\n }\n elseif($e == \"H\")\n {\n $r = 8;\n }\n elseif($e == \"I\")\n {\n $r = 9;\n }\n elseif($e == \"J\")\n {\n $r = 10;\n }\n elseif($e == \"K\")\n {\n $r = 11;\n }\n elseif($e == \"L\")\n {\n $r = 12;\n }\n elseif($e == \"M\")\n {\n $r = 13;\n }\n elseif($e == \"N\")\n {\n $r = 14;\n }\n elseif($e == \"O\")\n {\n $r = 15;\n }\n elseif($e == \"P\")\n {\n $r = 16;\n }\n elseif($e == \"Q\")\n {\n $r = 17;\n }\n elseif($e == \"R\")\n {\n $r = 18;\n }\n elseif($e == \"S\")\n {\n $r = 19;\n }\n elseif($e == \"T\")\n {\n $r = 20;\n }\n elseif($e == \"U\")\n {\n $r = 21;\n }\n elseif($e == \"V\")\n {\n $r = 22;\n }\n elseif($e == \"W\")\n {\n $r = 23;\n }\n elseif($e == \"X\")\n {\n $r = 24;\n }\n elseif($e == \"Y\")\n {\n $r = 25;\n }\n elseif($e == \"Z\")\n {\n $r = 26;\n }\n }\n elseif(strlen($e) == 2)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n $r = $f * 26 + $t;\n }\n elseif(strlen($e) == 3)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n $r = $f * 676 + $t * 26 + $h;\n }\n elseif(strlen($e) == 4)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n if($e[3] == \"A\")\n {\n $i = 1;\n }\n elseif($e[3] == \"B\")\n {\n $i = 2;\n }\n elseif($e[3] == \"C\")\n {\n $i = 3;\n }\n elseif($e[3] == \"D\")\n {\n $i = 4;\n }\n elseif($e[3] == \"E\")\n {\n $i = 5;\n }\n elseif($e[3] == \"F\")\n {\n $i = 6;\n }\n elseif($e[3] == \"G\")\n {\n $i = 7;\n }\n elseif($e[3] == \"H\")\n {\n $i = 8;\n }\n elseif($e[3] == \"I\")\n {\n $i = 9;\n }\n elseif($e[3] == \"J\")\n {\n $i = 10;\n }\n elseif($e[3] == \"K\")\n {\n $i = 11;\n }\n elseif($e[3] == \"L\")\n {\n $i = 12;\n }\n elseif($e[3] == \"M\")\n {\n $i = 13;\n }\n elseif($e[3] == \"N\")\n {\n $i = 14;\n }\n elseif($e[3] == \"O\")\n {\n $i = 15;\n }\n elseif($e[3] == \"P\")\n {\n $i = 16;\n }\n elseif($e[3] == \"Q\")\n {\n $i = 17;\n }\n elseif($e[3] == \"R\")\n {\n $i = 18;\n }\n elseif($e[3] == \"S\")\n {\n $i = 19;\n }\n elseif($e[3] == \"T\")\n {\n $i = 20;\n }\n elseif($e[3] == \"U\")\n {\n $i = 21;\n }\n elseif($e[3] == \"V\")\n {\n $i = 22;\n }\n elseif($e[3] == \"W\")\n {\n $i = 23;\n }\n elseif($e[3] == \"X\")\n {\n $i = 24;\n }\n elseif($e[3] == \"Y\")\n {\n $i = 25;\n }\n elseif($e[3] == \"Z\")\n {\n $i = 26;\n }\n $r = $f * 17576 + $t * 676 + $h * 26 + $i;\n }\n elseif(strlen($e) == 5)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n if($e[3] == \"A\")\n {\n $i = 1;\n }\n elseif($e[3] == \"B\")\n {\n $i = 2;\n }\n elseif($e[3] == \"C\")\n {\n $i = 3;\n }\n elseif($e[3] == \"D\")\n {\n $i = 4;\n }\n elseif($e[3] == \"E\")\n {\n $i = 5;\n }\n elseif($e[3] == \"F\")\n {\n $i = 6;\n }\n elseif($e[3] == \"G\")\n {\n $i = 7;\n }\n elseif($e[3] == \"H\")\n {\n $i = 8;\n }\n elseif($e[3] == \"I\")\n {\n $i = 9;\n }\n elseif($e[3] == \"J\")\n {\n $i = 10;\n }\n elseif($e[3] == \"K\")\n {\n $i = 11;\n }\n elseif($e[3] == \"L\")\n {\n $i = 12;\n }\n elseif($e[3] == \"M\")\n {\n $i = 13;\n }\n elseif($e[3] == \"N\")\n {\n $i = 14;\n }\n elseif($e[3] == \"O\")\n {\n $i = 15;\n }\n elseif($e[3] == \"P\")\n {\n $i = 16;\n }\n elseif($e[3] == \"Q\")\n {\n $i = 17;\n }\n elseif($e[3] == \"R\")\n {\n $i = 18;\n }\n elseif($e[3] == \"S\")\n {\n $i = 19;\n }\n elseif($e[3] == \"T\")\n {\n $i = 20;\n }\n elseif($e[3] == \"U\")\n {\n $i = 21;\n }\n elseif($e[3] == \"V\")\n {\n $i = 22;\n }\n elseif($e[3] == \"W\")\n {\n $i = 23;\n }\n elseif($e[3] == \"X\")\n {\n $i = 24;\n }\n elseif($e[3] == \"Y\")\n {\n $i = 25;\n }\n elseif($e[3] == \"Z\")\n {\n $i = 26;\n }\n if($e[4] == \"A\")\n {\n $j = 1;\n }\n elseif($e[4] == \"B\")\n {\n $j = 2;\n }\n elseif($e[4] == \"C\")\n {\n $j = 3;\n }\n elseif($e[4] == \"D\")\n {\n $j = 4;\n }\n elseif($e[4] == \"E\")\n {\n $j = 5;\n }\n elseif($e[4] == \"F\")\n {\n $j = 6;\n }\n elseif($e[4] == \"G\")\n {\n $j = 7;\n }\n elseif($e[4] == \"H\")\n {\n $j = 8;\n }\n elseif($e[4] == \"I\")\n {\n $j = 9;\n }\n elseif($e[4] == \"J\")\n {\n $j = 10;\n }\n elseif($e[4] == \"K\")\n {\n $j = 11;\n }\n elseif($e[4] == \"L\")\n {\n $j = 12;\n }\n elseif($e[4] == \"M\")\n {\n $j = 13;\n }\n elseif($e[4] == \"N\")\n {\n $j = 14;\n }\n elseif($e[4] == \"O\")\n {\n $j = 15;\n }\n elseif($e[4] == \"P\")\n {\n $j = 16;\n }\n elseif($e[4] == \"Q\")\n {\n $j = 17;\n }\n elseif($e[4] == \"R\")\n {\n $j = 18;\n }\n elseif($e[4] == \"S\")\n {\n $j = 19;\n }\n elseif($e[4] == \"T\")\n {\n $j = 20;\n }\n elseif($e[4] == \"U\")\n {\n $j = 21;\n }\n elseif($e[4] == \"V\")\n {\n $j = 22;\n }\n elseif($e[4] == \"W\")\n {\n $j = 23;\n }\n elseif($e[4] == \"X\")\n {\n $j = 24;\n }\n elseif($e[4] == \"Y\")\n {\n $j = 25;\n }\n elseif($e[4] == \"Z\")\n {\n $j = 26;\n }\n $r = $f * 456976 + $t * 17576 + $h * 676 + $i * 26 + $j;\n } \n $s = substr($b, strlen($e));\n if($x == $a)\n {\n print \"R\" . $s . \"C\" . $r;\n }\n else\n {\n print \"R\" . $s . \"C\" . $r . \"\\n\";\n } \n }\n}\n?>"}, {"source_code": "[[:upper:]]+)(? [[:digit:]]+)$/\", $coords, $matches)) {\n echo \"R\";\n echo $matches[\"row\"];\n echo \"C\";\n echo to_numbers($matches[\"letter_column\"]);\n } // RXCY system to Excel system\n elseif (preg_match(\"/^R(?
[[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches)) {\n echo to_letters(intval($matches[\"column\"]));\n echo $matches[\"row\"];\n }\n\n if ($i < $n - 1) {\n echo PHP_EOL;\n }\n}\n\n/**\n * @param $stdin\n *\n * @return string\n */\nfunction fgets_trim($stdin) {\n return trim(fgets($stdin));\n}\n\n/**\n * @param string $letters\n *\n * @return int $letters represented as a number\n */\nfunction to_numbers($letters) {\n return array_reduce(str_split($letters), function($sum, $letter) {\n return $sum * 26 + ord($letter) - 64;\n });\n}\n\n/**\n * @param int $n\n *\n * @return string $n represented with letters\n */\nfunction to_letters($n) {\n ob_start();\n\n while ($n > 0) {\n $n--;\n $rem = $n % 26;\n echo chr($rem + 65);\n $n = floor($n / 26);\n }\n\n return strrev(ob_get_clean());\n}"}, {"source_code": "1) {\n $cel=(int)($q/26);\n $ost=$q%26;\n if ($ost==0) $ost=26;\n $r.=chr(64+$ost);\n $q=$cel;\n if ($ost==26) $q--;}\n $ost=$q%26;\n if ($ost==0) $ost=26;\n $r.=chr(64+$ost);\n echo strrev($r),\"$y\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n $res = chr(($second - 1) % 26 + 65) . $res;\n $second = floor(($second - 1) / 26);\n } \n return $res.$first; \n}\n\nfunction convert_2($string)\n{\n preg_match('/([A-Z]+)/i', $string, $matches);\n $first = $matches[0];\n preg_match('/(\\d+)/i', $string, $matches);\n $second = $matches[0];\n $res='';\n for($i = 0; $i =0; $j--, $d*=26) \n $c += (ord($s[$j])-64)*$d; \n echo 'R', $matches[2], 'C', $c, \"\\n\"; \n } \n } \n?>"}, {"source_code": "=0;$j--)\n { \n $y += (ord($str[$j])-64)*$d;\n $d*=26;\n } \n printf(\"R%sC%s\\n\",$target[2],$y);\n}\n"}, {"source_code": "=0; $j--, $d*=26) \n $c += (ord($s[$j])-64)*$d; \n echo 'R', $matches[2], 'C', $c, \"\\n\"; \n } \n } \n?>\n"}, {"source_code": " 26) {\n $letNum = $col % 26;\n if ($letNum == 0) {\n $letNum = 26;\n $col = $col / 26 - 1;\n } else {\n $col = floor($col / 26);\n }\n $colCode = chr(64 + $letNum) . $colCode;\n }\n if ($col > 0) {\n $colCode = chr(64 + $col) . $colCode;\n }\n $resultCode = $colCode . $digits[0];\n } else {\n $colArray = str_split($letters[0]);\n $colNum = 0;\n $power = 0;\n while ($let = array_pop($colArray)) {\n $colNum += (ord($let) - 64) * pow(26, $power++);\n }\n $resultCode = 'R' . $digits[0] . 'C' . $colNum;\n }\n echo \"$resultCode\\n\";\n }\n?>"}, {"source_code": "=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfunction char_cifr($a1,$a2) {\n\tfor($i=0;$i =1) {\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\n\t\tif (preg_match('/^[R]([1-9]{1}\\d{0,5}[0]{0,1})[C]([1-9]{1}\\d{0,5}[0]{0,1})$/',$arr[$j],$matches)) {\n\t\t\t$arr[$j] = cifr_char($matches[2],$matches[1]);\n\t\t} elseif(preg_match('/^([A-Z]{1,5})(\\d{1,6}[0]{0,1})$/',$arr[$j],$matches))\n\t\t\t$arr[$j] = char_cifr($matches[1],$matches[2]);\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>"}, {"source_code": " 25){\n $remainder = $col % 26;\n array_push($indexes, $remainder);\n if($remainder == 0){\n $col = ($col / 26) -1;\n if($col == 0){\n break;\n }\n }\n else{\n $col = $col / 26;\n }\n if ($col / 26 < 25){\n $col = floor($col);\n array_push($indexes, $col);\n }\n }\n }\n\n\n $rereversedIndexes = array_reverse($indexes);\n for ($i = 0; $i < sizeof($indexes); $i++){\n $normal = $normal.$alphabet[$rereversedIndexes[$i]];\n }\n\n print($normal.$row.\"\\n\");\n}\n\nfunction convertToRC($word){\n $rowNum = 0;\n\n $alphabet = [\n 'A' => 1,\n 'B' => 2,\n 'C' => 3,\n 'D' => 4,\n 'E' => 5,\n 'F' => 6,\n 'G' => 7,\n 'H' => 8,\n 'I' => 9,\n 'J' => 10,\n 'K' => 11,\n 'L' => 12,\n 'M' => 13,\n 'N' => 14,\n 'O' => 15,\n 'P' => 16,\n 'Q' => 17,\n 'R' => 18,\n 'S' => 19,\n 'T' => 20,\n 'U' => 21,\n 'V' => 22,\n 'W' => 23,\n 'X' => 24,\n 'Y' => 25,\n 'Z' => 26\n ];\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n for ($i = 0; $i < strlen($word); $i++){\n if(in_array($word[$i], $digits)){\n $index = $i;\n break;\n }\n }\n\n $rowRev = substr($word, 0, $index);\n $col = substr($word, $index);\n\n $row = strrev($rowRev);\n\n for($i = strlen($row)-1; $i >= 0; $i--){\n $rowNum += $alphabet[$row[$i]] * pow(26, $i);\n }\n\n print(\"R\".$col.\"C\".$rowNum.\"\\n\");\n}"}, {"source_code": "47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$first = substr($string, 1, $i-1);\n\t\t\t\t\t$second = substr($string, $i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$second = numToLet($second);\n\t\t$res = $second.$first;\n\t\treturn $res;\n\t\t\n\t}\n\t\n\tfunction conv ($string) {\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first = substr($string, 0, $i);\n\t\t\t\t$second = substr($string, $i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$first = letToNum($first);\n\t\t$res = 'R'.$second.'C'.$first;\n\t\treturn $res;\n\t}\n\t\n\tfunction detect ($string) {\n\t\t\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$second_marker = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($second_marker == 1) {\n\t\t\treturn conv2($string);\n\t\t}\n\t\telse {\n\t\t\treturn conv($string);\n\t\t}\n\t\t\n\t}\n\t\n\tfunction numToLet ($num){\n\t\t$raz = 1;\n\t\t$newnum = $num;\n\t\twhile (($newnum/26)>1.03845) {\n\t\t\tif ((int)$newnum/26 != 27 AND $newnum!=18278 AND ($newnum<474547 OR $newnum>474551) AND ($newnum<475229 OR $newnum>475254)) {\n\t\t\t$raz++;\t\t\t\n\t\t\t}\n\t\t\t$newnum /= 26;\n\t\t}\n\t\t$newnum = $num;\n\t\t$res = '';\n\t\tfor ($i=0;$i<$raz;$i++) {\n\t\t\t$cur = $newnum%26;\n\t\t\tswitch ($cur) {\n\t\t\t\tcase 1: $res = 'A'.$res; break;\n\t\t\t\tcase 2: $res = 'B'.$res; break;\n\t\t\t\tcase 3: $res = 'C'.$res; break;\n\t\t\t\tcase 4: $res = 'D'.$res; break;\n\t\t\t\tcase 5: $res = 'E'.$res; break;\n\t\t\t\tcase 6: $res = 'F'.$res; break;\n\t\t\t\tcase 7: $res = 'G'.$res; break;\n\t\t\t\tcase 8: $res = 'H'.$res; break;\n\t\t\t\tcase 9: $res = 'I'.$res; break;\n\t\t\t\tcase 10: $res = 'J'.$res; break;\n\t\t\t\tcase 11: $res = 'K'.$res; break;\n\t\t\t\tcase 12: $res = 'L'.$res; break;\n\t\t\t\tcase 13: $res = 'M'.$res; break;\n\t\t\t\tcase 14: $res = 'N'.$res; break;\n\t\t\t\tcase 15: $res = 'O'.$res; break;\n\t\t\t\tcase 16: $res = 'P'.$res; break;\n\t\t\t\tcase 17: $res = 'Q'.$res; break;\n\t\t\t\tcase 18: $res = 'R'.$res; break;\n\t\t\t\tcase 19: $res = 'S'.$res; break;\n\t\t\t\tcase 20: $res = 'T'.$res; break;\n\t\t\t\tcase 21: $res = 'U'.$res; break;\n\t\t\t\tcase 22: $res = 'V'.$res; break;\n\t\t\t\tcase 23: $res = 'W'.$res; break;\n\t\t\t\tcase 24: $res = 'X'.$res; break;\n\t\t\t\tcase 25: $res = 'Y'.$res; break;\n\t\t\t\tcase 0: $res = 'Z'.$res; break;\n\t\t\t}\n\t\t\tif ($cur==0){\n\t\t\t$newnum = floor($newnum/26)-1;\n\t\t\t}\n\t\t\telse {\n\t\t\t$newnum/=26;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}\n\t\n\t\n\tfunction letToNum ($let){\n\t\t$sum = 0;\n\t\tfor ($i=0;$i "}, {"source_code": "=26){\n if($i_row%26==0){\n $row.=\"Z\";\n $i_row=floor(($i_row-26)/26);\n }else {\n $row.=chr($i_row%26+64);\n $i_row=floor($i_row/26);\n } \n } \n if($i_row!=0) {$row.=chr($i_row%26+64);}\n echo strrev($row).$col; \n } else{\n $col=preg_replace(\"/([A-Z]+)\\d+/\",\"$1\",$s);\n $row=intval(preg_replace(\"/[A-Z]+(\\d+)/\",\"$1\",$s));\n \n $i_col=0;$f_col=0;\n for ($j=strlen($col)-1;$j>=0;$j--) {\n $i_col+=pow(26,$f_col)*(ord($col[$j])-64);\n $f_col++; \n } \n echo \"R\".$row.\"C\".$i_col; \n }\n echo \"\\n\"; \n }\n \n?>\n"}, {"source_code": "1 && ord($s[1])>=48 && ord($s[1])<=57) {\n $col=\"\";\n $row=\"\";\n $ff=\"r\"; \n for($j=1;$j =26){\n if($i_row%26==0){\n $row.=\"Z\";\n $i_row=floor(($i_row-26)/26);\n }else {\n $row.=chr($i_row%26+64);\n $i_row=floor($i_row/26);\n } \n } \n if($i_row!=0) {$row.=chr($i_row%26+64);}\n echo strrev($row).$col;\n }else{\n $f_col=0; $f_row=0; \n $col=0;\n $row=0; \n for($j=strlen($s)-1;$j>=0;$j--){\n //echo $s[$j];\n if (ord($s[$j])>=48 && ord($s[$j])<=57){\n $col+=pow(10,$f_col)*intval($s[$j]);\n $f_col++;\n }else{\n $row+=pow(26,$f_row)*(ord($s[$j])-64);\n $f_row++;\n }\n }\n echo \"R\".$col.\"C\".$row; \n }\n \n echo \"\\n\"; \n }\n \n?>\n"}, {"source_code": "47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$first = substr($string, 1, $i-1);\n\t\t\t\t\t$second = substr($string, $i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$second = numToLet($second);\n\t\t$res = $second.$first;\n\t\treturn $res;\n\t\t\n\t}\n\t\n\tfunction conv ($string) {\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first = substr($string, 0, $i);\n\t\t\t\t$second = substr($string, $i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$first = letToNum($first);\n\t\t$res = 'R'.$second.'C'.$first;\n\t\treturn $res;\n\t}\n\t\n\tfunction detect ($string) {\n\t$first_marker = 0;\n\t$second_marker = 0;\n\t\t\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$second_marker = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($second_marker == 1) {\n\t\t\treturn conv2($string);\n\t\t}\n\t\telse {\n\t\t\treturn conv($string);\n\t\t}\n\t\t\n\t}\n\t\nfunction numToLet ($num){\n\t\t$res=\"\";\n\t\twhile ($num>0)\n\t\t{\n\t\t\t$res = chr((($num-1)%26)+65).$res;\n\t\t\t$num = floor(($num-1)/26); \n\t\t}\n return $res;\n\n\t}\n\t\n\t\n\tfunction letToNum ($let){\n\t\t$sum = 0;\n\t\tfor ($i=0;$i "}, {"source_code": "0){\n\t\t\t$col_char = chr(($col%26)+64) . $col_char;\n\t\t}else{\n\t\t\t$col_char = chr(26+64) . $col_char;\n\t\t\t$col -= 26;\n\t\t}\n\t\t$col = intval($col/26);\n\t\tif($col<=0){\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn \"{$col_char}{$row}\";\n}\n$inputs=[];\nfor ($i=0; $i < $n; $i++) {\n\t$inputs[] = strval(trim(fgets(STDIN)));\n\t\n\n}\nfor ($i=0; $i < $n; $i++) {\n\tif($i>0)echo \"\\n\";\n\t$input = $inputs[$i];\n\tif (!preg_match('/R(\\d+)C(\\d+)/',\n $input))\n\t{\n\t \techo convertS1($input);\n\t}\n\telse\n\t{\n\t\techo convertS2($input);\n\t}\n\n}\n"}, {"source_code": " 0) {\n $d1 = chr(($s2 - 1) % 26 + 65) . $d1;\n //echo \"--$s2 $d1\\n\";\n $s2 = floor(($s2 - 1) / 26);\n }\n echo \"$d1$s[1]\\n\";\n //print_r ($s);\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n //echo \"$j $re\\n\";\n }\n $d1 = intval($d[count($d) - 1]);\n //print_r($l1);\n //print_r($d);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n?>"}, {"source_code": "26){\n if(($c%26)!=0){\n $col.= chr(($c%26)+ord(A)-1);\n $c-=$c%26;\n $c/=26;\n }else{\n $cuo=$c/26;\n $col.='Z';\n $c=$cuo-1;\n }\n }\n $col.= chr($c+ord(A)-1);\n \n $col=strrev($col);\n echo \"$col\".\"$r\".\"\\n\";\n \n }\n}\n\n?>"}, {"source_code": " 0){\n $char = ($column%26>0)?$column%26:26;\n $column = intval($column/26);\n $column = ($char==26)?$column-1:$column;\n $str = chr($char+64) . $str;\n #var_dump($char, $column, $str);\n }\n return $str.''.$row;\n}\n\nfunction convertCRtoRC($cell){\n $st = preg_match('/^([A-Z]+)([0-9]+)$/', trim($cell), $matches);\n #var_dump($st, $matches);\n $column = $matches[1];\n $row = $matches[2]; //not modified\n $chs = str_split($column);\n $count = strlen($column);\n $column = 0;\n foreach($chs as $ch){\n $column += (ord($ch) - 64) * 26**($count -1);\n $count--;\n }\n return 'R' . $row . 'C' . $column;\n} \n\nfunction convert($cell){\n $type = preg_match('/^R[0-9]+C[0-9]+$/', trim($cell), $matches);\n #var_dump($type, $matches);\n if($type === 1){\n return convertRCtoCR($cell);\n }\n \n return convertCRtoRC($cell);\n}\n\n$dir = fopen(\"php://stdin\", 'r');\n$cells = stream_get_contents($dir);\n\n$cells = explode(\"\\n\", $cells);\nfor($i=1;$i<=$cells[0];$i++){\n echo convert($cells[$i]).\"\\n\";\n}\n?>\n"}, {"source_code": "=0;$i--){\n $column += (ord($str[$i])-64)*$d;\n $d *=26;\n }\n echo \"R\".$target[2].\"C\".$column.\"\\n\";\n}\n\nfclose($file);\n\n?>"}, {"source_code": "1,\n 'B'=>2,\n 'C'=>3,\n 'D'=>4,\n 'E'=>5,\n 'F'=>6,\n 'G'=>7,\n 'H'=>8,\n 'I'=>9,\n 'J'=>10,\n 'K'=>11,\n 'L'=>12,\n 'M'=>13,\n 'N'=>14,\n 'O'=>15,\n 'P'=>16,\n 'Q'=>17,\n 'R'=>18,\n 'S'=>19,\n 'T'=>20,\n 'U'=>21,\n 'V'=>22,\n 'W'=>23,\n 'X'=>24,\n 'Y'=>25,\n 'Z'=>26);\n$n = fgets(STDIN);\nfor($i=1;$i<=$n;$i++){\n$str = fgets(STDIN);\n$out = '';\nif(preg_match('/R(\\d+)C(\\d+)/',$str,$num)){//R1C1\nwhile(true){\n$le = floor($num[2]/26);\nif($le==0){\n$out=$alf[$num[2]-1].$out;\nbreak;\n}\n$mo=($num[2]%26)-1;\nif($mo==-1){$mo=25;$le-=1;}\n$out=$alf[$mo].$out;\n$num[2]=$le;\n}\n$out=$out.$num[1];\n}else{\npreg_match('/([A-Z]+)(\\d+)/',$str,$num);\n$out='R'.$num[2].'C';\n$nb=0;\nwhile(strlen($num[1])>0){\n$nb=$nb*26;\n$nb=$nb+$nu[$num[1][0]];\n$num[1]=substr($num[1],1);\n}\n$out.=$nb;\n}\necho $out.\"\\r\\n\";\n}\n?>"}, {"source_code": " 1, \"B\" => 2, \"C\" => 3, \"D\" => 4, \"E\" => 5, \"F\" => 6, \"G\" => 7,\n \"H\" => 8, \"I\" => 9, \"J\" => 10, \"K\" => 11, \"L\" => 12, \"M\" => 13, \"N\" => 14,\n \"O\" => 15, \"P\" => 16, \"Q\" => 17, \"R\" => 18, \"S\" => 19, \"T\" => 20, \"U\" => 21, \n \"V\" => 22, \"W\" => 23, \"X\" => 24, \"Y\" => 25, \"Z\" => 26);\n$y = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nfor($i=0; $i<$a; ++$i)\n{\n $b[$i] = trim(fgets(STDIN));\n if(preg_match('/R(\\d+)C(\\d+)/', $b[$i], $c))\n {\n while(true)\n {\n if($c[2]>=1 and $c[2]<=26){$h .= $y{$c[2]-1}; break;}\n elseif($c[2]==0){$h .= $y{25}; break;}\n else{\n $f = floor($c[2]/26);\n $g = $c[2]-$f*26;\n if($g==0)\n {\n $h .= $y{25}; $c[2] = $c[2] - 26;\n }else{\n $h .= $y{$g-1};\n }\n $c[2] = floor(($c[2]-$g)/26);\n }\n }\n $e .= strrev($h).$c[1].\"\\n\";\n }elseif(preg_match('/([A-Z]+)(\\d+)/', $b[$i], $c))\n {\n if(strlen($c[1])==1)\n {\n $d = $z[$c[1]];\n }else{\n for($j=0; $j "}, {"source_code": "64) $fl=true;\n if ($fl){\n $R = strtok($n,\"RC\");\n $C = strtok(\"RC\");\n $step = 1;\n $s=26;\n while($s<$C){\n $s += pow(26,$step+1);\n $step++;\n }\n $s -= pow(26,$step);\n $C -= $s+1;\n $code = \"\";\n while($C>0){\n $ost = $C % 26;\n $C = intval($C/26); \n $code = chr($ost+65).$code;\n }\n while(strlen($code)<$step) $code = 'A'.$code;\n echo $code.$R.\"\\n\"; \n } else\n {\n $i=0;\n while(ord($n{$i})>57) $i++;\n $R = substr($n,$i);\n $C = substr($n,0,$i);\n $step = strlen($C);\n $s=0;\n for ($i=1;$i<=$step-1;$i++) $s += pow(26,$i);\n $num=0;\n for($i=0;$i<$step;$i++) \n $num = $num * 26 + ord($C{$i}) - 65; \n $num += $s+1;\n echo \"R\".$R.\"C\".$num.\"\\n\";\n }}\n?>"}, {"source_code": " 0) {\n $d1 = chr(($s2 - 1) % 26 + 65) . $d1;\n $s2 = floor(($s2 - 1) / 26);\n }\n echo \"$d1$s[1]\\n\";\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n }\n $d1 = intval($d[count($d) - 1]);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n?>"}, {"source_code": " $str) {\nif (strlen($str)>0){\nif (preg_match(\"/R[0-9]+C[0-9]+/\",$str)) {\nsscanf($str,\"R%dC%d\",$row,$col);\necho number_column($col).$row;\n} else {\npreg_match(\"/([A-Z]*)(\\\\d+)/\", $str, $matches);\necho \"R\".$matches[2].\"C\".return_column($matches[1]);\n}\nif ($key!=count($text)){\necho \"\\n\";\n}\n}\n}\nfunction return_column($str) {\nglobal $char_array;\n$result = 0;\n$ab = 1;\nfor($i=strlen($str);$i>0;$i--) {\n$result+=$char_array[$str[$i-1]]*$ab;\n$ab*=26;\n}\nreturn $result;\n}\nfunction number_column($str) {\nglobal $char_array2;\n$result = \"\";\n$result2=\"\";\n$a = $str;\nwhile($a>0) {\n$letter = $a %26;\n$a = ($a - $letter)/26;\nif ($letter!=0){\n$result .= $char_array2[$letter];\n} else {\n$result.=\"Z\";\n$a--;\n}\n}\nfor ($i=strlen($result);$i>0;$i--) {\n$result2.=$result[$i-1];\n}\n\nreturn $result2;\n}\n?>"}, {"source_code": " 0; $i = floor($i / 26)){\n $k = ($i % 26);\n if($k == 0){\n $k = 26;\n $i--;\n }\n $c = $letters[$k-1].$c;\n }\n \n return $c;\n}\n\nfunction alpha2num($n, $letters){\n $c = 0;\n\n for($i = strlen($n), $j = 0; $i > 0;$i--,$j++){\n $k = array_search($n[$i-1], $letters) + 1;\n if($j > 0){\n $k = $k * pow(26, $j);\n }\n $c = $k + $c;\n }\n \n return $c;\n}\n\n?>"}, {"source_code": "= 1)\n {\n $t = $param % 26;\n if($t == 0 ) $t = 26;\n $result = chr($t + ord(\"A\") - 1) . $result;\n $param = floor($param / 26) ;\n if($t == 26 ) $param -= 1;\n } \n \n //R98C688\n //R90C35\n //R228C494\n}\n\nfunction mytoint($param, &$result) {\n $result = 0; \n for ($index = 0; $index < strlen($param); $index++) {\n $result += (ord($param[$index]) - ord(\"A\") + 1) * pow(26, (strlen($param) - $index - 1));\n }\n}\n\n?>\n"}, {"source_code": " 0) {\n $mod[] = bcmod($sub,26);\n $sub = bcdiv($sub,26);\n }\n\n $count = count($mod);\n $column = '';\n $tmp = [];\n for ($i =0;$i< $count;$i++) {\n $now = $mod[$i];\n if ($mod[$i] == 0) {\n $tmp[$i] = true;\n $now = 26;\n }\n\n if ($tmp !== null and $tmp[$i-1]) {\n if ($now == 0){\n $now = 26;\n }\n $now = bcsub($now,1);\n if ($now < 0) {\n $now = 26 + $now;\n }\n if ($now == 0) {\n $now = 26;\n $tmp[$i] = true;\n if ($i == $count -1) continue;\n };\n }\n\n $column .= chr($now+64);\n }\n $column = strrev($column);\n return $column.$match[1];\n\n } elseif (preg_match(\"/([A-Z]+)(\\d+)/\",$str,$match)) {\n $len = strlen($match[1]);\n $num = 0; // \u5b57\u6bcd\u5e8f\u5217\u548c\n for ($i = 0; $i < $len; $i++) {\n $num = bcadd(bcmul(bcsub(ord($match[1][$i]),64),bcpow(26,bcsub($len,bcadd($i,1)))),$num);\n }\n return \"R\".$match[2].\"C\".$num;\n }\n}\n\n$line = 0;\nwhile ($data = fscanf(STDIN,\"%s\")) {\n if (!$line) {\n $line++;\n continue;\n }\n echo read_sheet($data[0]);\n echo \"\\n\";\n}"}, {"source_code": " 0)\n {\n $res = chr(($second - 1) % 26 + 65) . $res;\n $second = floor(($second - 1) / 26);\n } \n return $res.$first; \n}\n\nfunction convert_2($string)\n{\n preg_match('/([A-Z]+)/i', $string, $matches);\n $first = $matches[0];\n preg_match('/(\\d+)/i', $string, $matches);\n $second = $matches[0];\n $res='';\n for($i = 0; $i 1) { \n if($rest == 0) {\n return get_assocc_char((int) ($result-1)).$alphabet[26]; \n }\n else {\n return get_assocc_char((int) ($result)).$alphabet[$rest];\n }\n }\n else { \n if($rest == 0) {\n return $alphabet[26]; \n }\n else {\n return $alphabet[$rest];\n }\n }\n }\n \n function convert($str) {\n global $alphabet;\n $matches = array();\n if (preg_match('#^R([0-9]+)C([0-9]+)$#',$str,$matches)==1) {\n $row = $matches[1]; \n $col = get_assocc_char($matches[2]);\n return $col.$row;\n }\n elseif(preg_match('#^([A-Z]+)([0-9]+)$#',$str,$matches)==1) {\n $row = $matches[2];\n $col = $matches[1];\n $colnum = 0;\n $col_length = strlen($col);\n $base = 1;\n for($i=$col_length-1;$i>=0;$i--) {\n if($i != $col_length-1) { $base = $base * 26; };\n $colnum = $colnum + $base * $alphabet[$col[$i]];\n }\n return 'R'.$row.'C'.$colnum;\n }\n else { die(\"Error: \".$str.\" - unknown pattern\\n\"); }\n }\n \n#############################################################\n \n $alphabet = array (1=>'A',2=>'B',3=>'C',4=>'D',5=>'E',6=>'F',7=>'G',8=>'H',9=>'I',10=>'J',11=>'K',12=>'L',13=>'M',\n 14=>'N',15=>'O',16=>'P',17=>'Q',18=>'R',19=>'S',20=>'T',21=>'U',22=>'V',23=>'W',24=>'X',25=>'Y',26=>'Z',\n 'A'=>1,'B'=>2,'C'=>3,'D'=>4,'E'=>5,'F'=>6,'G'=>7,'H'=>8,'I'=>9,'J'=>10,'K'=>11,'L'=>12,'M'=>13,\n 'N'=>14,'O'=>15,'P'=>16,'Q'=>17,'R'=>18,'S'=>19,'T'=>20,'U'=>21,'V'=>22,'W'=>23,'X'=>24,'Y'=>25,'Z'=>26);\n $count = get_stdin_vars(fgets(STDIN),1); \n $count = (int)$count[0]; \n \n if($count<1 or $count>100000) {\n die('Error: number of elements must be in range 1-100000'); \n }\n \n for ($i=0;$i<$count;$i++) {\n $indication = get_stdin_vars(fgets(STDIN),1);\n $indication = $indication[0];\n echo convert($indication).\"\\n\";\n } \n?>"}, {"source_code": "0)\n {\n $r=($num-1)%26;\n $res = chr($r+65).$res;\n $num = floor(($num-1)/26);\n }\n return $res;\n}\n\nfunction toNum($string){\n $int = 0;\n $len = strlen($string);\n for($i = 0; $i< $len; $i++){\n $int*=26;\n $int += ord($string[$i]) - 64;\n }\n return $int;\n}\n\n$file = fscanf(STDIN, \"%d\\n\", $cells);\nfor($i=0; $i<$cells; $i++){\n fscanf(STDIN, \"%s\\n\", $line);\n if($line[0] == 'R' && ord($line[1])>=48&&ord($line[1])<=57){\n $cPos = strpos($line, 'C', 2);\n if($cPos !== false){\n print(toAlpha(substr($line, $cPos+1)).substr($line, 1, $cPos-1).\"\\n\");\n }else{\n print('R'.substr($line, 1).\"C18\\n\");\n }\n }else{\n preg_match('/[0-9]/', $line, $matches, PREG_OFFSET_CAPTURE);\n print('R'.substr($line, $matches[0][1]).'C'.toNum(substr($line, 0, $matches[0][1])).\"\\n\");\n }\n}\n"}, {"source_code": "\n"}], "negative_code": [{"source_code": " 26) {\n $letNum = floor($col / 26);\n $colCode .= chr(64 + $letNum);\n $col = $col % 26;\n }\n if ($col > 0) {\n $colCode .= chr(64 + $col);\n }\n $resultCode = $colCode . $digits[0];\n } else {\n $colArray = str_split($letters[0]);\n $colNum = 0;\n $power = 0;\n while ($let = array_pop($colArray)) {\n $colNum += (ord($let) - 64) * pow(26, $power++);\n }\n $resultCode = 'R' . $digits[0] . 'C' . $colNum;\n }\n echo \"$resultCode\\n\";\n }\n?>"}, {"source_code": "=0;$i--){\n $column += (ord($str[$i])-64)*$d;\n $d *=26;\n }\n echo \"R\".$target[2].\"C\".$column.\"\\n\";\n}\n\n\n\n?>"}, {"source_code": " 26)\n $d2 = chr(floor($s[2] / 26) % 26 + 64);\n else\n $d2 = '';\n if ($s[2] > 26 * 26)\n $d3 = chr(floor($s[2] / 26 / 26) % 26 + 64);\n else\n $d3 = '';\n echo \"$d3$d2$d1$s[1]\\n\";\n //print_r ($s);\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n //echo \"$j $re\\n\";\n }\n $d1 = intval($d[count($d) - 1]);\n //print_r($l1);\n //print_r($d);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n\n\n?>"}, {"source_code": "=0;$i--){\n $column += (ord($str[$i])-64)*$d;\n $d *=26;\n }\n echo \"R\".$target[2].\"C\".$column.\"\\n\";\n}\n\nfclose($file);\n\n?>"}, {"source_code": " 1, \"B\" => 2, \"C\" => 3, \"D\" => 4, \"E\" => 5, \"F\" => 6, \"G\" => 7,\n \"H\" => 8, \"I\" => 9, \"J\" => 10, \"K\" => 11, \"L\" => 12, \"M\" => 13, \"N\" => 14,\n \"O\" => 15, \"P\" => 16, \"Q\" => 17, \"R\" => 18, \"S\" => 19, \"T\" => 20, \"U\" => 21, \n \"V\" => 22, \"W\" => 23, \"X\" => 24, \"Y\" => 25, \"Z\" => 26);\n$y = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nfor($i=0; $i<$a; ++$i)\n{\n $b[$i] = trim(fgets(STDIN));\n if(preg_match('/R(\\d+)C(\\d+)/', $b[$i], $c))\n {\n while(true)\n {\n if($c[2]>=1 and $c[2]<=26){$h .= $y{$c[2]-1}; break;}\n else{\n $f = floor($c[2]/26);\n $g = $c[2]-$f*26;\n if($g==0)\n {\n $h .= $y{25};\n }else{\n $h .= $y{$g-1};\n }\n $c[2] = floor(($c[2]-$g)/26);\n if($c[2]>=1 and $c[2]<=26){$h .= $y{$c[2]-2}; break;}\n elseif($c[2]==0){$h .= $y{25}; break;}\n }\n }\n $e .= strrev($h).$c[1].\"\\n\";\n }elseif(preg_match('/([A-Z]+)(\\d+)/', $b[$i], $c))\n {\n if(strlen($c[1])==1)\n {\n $d = $z[$c[1]];\n }else{\n for($j=0; $j "}, {"source_code": "= 48 && ord($data[$i][1]) <= 57) {\n \t\t$column = '';\n \t\t$string = '';\n \t\t$flag = false;\n \t\tfor($j = 1; $j < strlen($data[$i]); $j++) {\n \t\t\tif($data[$i][$j] == 'C') {\n \t\t\t\t$flag = true;\n \t\t\t} else {\n \t\t\t\tif(!$flag) {\n \t\t\t\t\t$string .= $data[$i][$j];\n \t\t\t\t} else {\n \t\t\t\t\t$column .= $data[$i][$j];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t$strColumn = '';\n \t\t$column = (int)$column;\n\n \t\tdo {\n \t\t\tif($column > 26) {\n \t\t\t\tif($column % 26 != 0) { \n\t\t \t\t\t$strColumn .= chr($column % 26 + 64);\n\t\t \t\t\t$column = floor($column / 26);\n\t\t \t\t} else {\n\t\t \t\t\t$strColumn .= chr(26 + 64);\n\t\t \t\t\t$column = floor(($column-26) / 26);\n\t\t \t\t}\n\t \t\t} else {\n\t \t\t\t$strColumn .= chr($column + 64);\n\t \t\t\tbreak;\n\t \t\t}\n \t\t} while(true);\n\n \t\t$data[$i] = strrev($strColumn) . $string;\n\n \t} else {\n \t\t$column = '';\n \t\t$string = '';\n \t\tfor($j = 0; $j = 65 && ord($data[$i][$j]) <= 90) {\n \t\t\t\t$column .= $data[$i][$j];\n \t\t\t} else {\n \t\t\t\t$string .= $data[$i][$j];\n \t\t\t}\n \t\t}\n\n \t\t$columnNum = 0;\n \t\tfor($j = strlen($column) - 1; $j >= 0; $j--) {\n \t\t\t$columnNum += (ord($column[$j]) - 64) * pow(26, strlen($column)-$j-1);\n \t\t}\n \t\t$data[$i] = 'R' . $string . 'C' . $columnNum;\n \t}\n }\n echo \"\\n\\n\";\n echo implode(\"\\n\", $data);\n?>\n"}, {"source_code": "=0;$i--) {\n if($i != $col_length-1) { $base = $base * 26; };\n $colnum = $colnum + $base * $alphabet[$col[$i]];\n }\n return 'R'.$row.'C'.$colnum;\n }\n else { die(\"Error: \".$str.\" - unknown pattern\\n\"); }\n }\n \n#############################################################\n \n $alphabet = array (1=>'A',2=>'B',3=>'C',4=>'D',5=>'E',6=>'F',7=>'G',8=>'H',9=>'I',10=>'J',11=>'K',12=>'L',13=>'M',\n 14=>'N',15=>'O',16=>'P',17=>'Q',18=>'R',19=>'S',20=>'T',21=>'U',22=>'V',23=>'W',24=>'X',25=>'Y',26=>'Z',\n 'A'=>1,'B'=>2,'C'=>3,'D'=>4,'E'=>5,'F'=>6,'G'=>7,'H'=>8,'I'=>9,'J'=>10,'K'=>11,'L'=>12,'M'=>13,\n 'N'=>14,'O'=>15,'P'=>16,'Q'=>17,'R'=>18,'S'=>19,'T'=>20,'U'=>21,'V'=>22,'W'=>23,'X'=>24,'Y'=>25,'Z'=>26);\n $count = get_stdin_vars(fgets(STDIN),1); \n $count = (int)$count[0]; \n \n if($count<1 or $count>100000) {\n die('Error: number of elements must be in range 1-100000'); \n }\n \n for ($i=0;$i<$count;$i++) {\n $indication = get_stdin_vars(fgets(STDIN),1);\n $indication = $indication[0];\n echo convert($indication).\"\\n\";\n } \n?>"}, {"source_code": "b2: '.'R'.$a2.'C'.$b2;\n\t\t$arr[$j]='R'.$a2.'C'.$b2;\n\t\tunset($b2);\n\t\tunset($a1);\n\t\tunset($a2);\n\t\t\n\t} elseif(preg_match('/^R\\d+C\\d+$/',$string)) {\n\t\t// \ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd R23C55\n\t\tfor ($i=1;$i<7;$i++) {\n\t\t\tif (preg_match('/[C]/',$string[$i])) {\n\t\t\t\t$a2=substr($string,1,$i-1);\n\t\t\t\t$a1=substr($string,$i+1);\n\t\t\t\t$i=8;\n\t\t\t}\n\t\t}\n\t\twhile ($a1>=1) {\n\t\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t\t$b1 = 'Z'.$b1;\n\t\t\t\t$a1=floor($a1/26)-1;\n\t\t\t} else {\n\t\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t\t$a1=floor($a1/26);\n\t\t\t}\n\t\t}\n\t\t//echo $b1.$a2.'
';\n\t\t$arr[$j]=$b1.$a2;\n\t\tunset($b1);\n\t\tunset($a1);\n\t\tunset($a2);\n\t\t\n\t} else {\n\t\techo \"\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\";\n\t}\n}\n\nfor ($j=0;$j<$numzna4;$j++) {\n\tprintf(\"%s\\n\",$arr[$j]);\n}\n?>"}, {"source_code": " 0) {\n $d1 = chr(($s2 - 1) % 26 + 65) . $d1;\n $s2 = floor($s2 / 26);\n //echo \"--$s2 $d1\\n\";\n }\n echo \"$d1$s[1]\\n\";\n //print_r ($s);\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n //echo \"$j $re\\n\";\n }\n $d1 = intval($d[count($d) - 1]);\n //print_r($l1);\n //print_r($d);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n?>"}, {"source_code": "=0;$i--){\n $column += (ord($str[$i])-64)*$d;\n $d *=26;\n }\n echo \"R\".$target[2].\"C\".$column.\"\\n\";\n}\n\nfclose($file);\n\n?>"}, {"source_code": " 0){\n $char = $column%26;\n $column = intval($column/26);\n $str = chr($char+64) . $str;\n }\n return $str.$row;\n}\n\nfunction convertCRtoRC($cell){\n $st = preg_match('/^([A-Z]+)([0-9]+)$/', trim($cell), $matches);\n\n $column = $matches[1];\n $row = $matches[2]; //not modified\n $chs = str_split($column);\n $count = strlen($column);\n $column = 0;\n foreach($chs as $ch){\n $column += (ord($ch) - 64) * 26**($count -1);\n $count--;\n }\n return 'R' . $row . 'C' . $column;\n} \n\nfunction convert($cell){\n $type = preg_match('/^R[0-9]+C[0-9]+$/', trim($cell), $matches);\n\n if($type === 1){\n return convertRCtoCR($cell);\n }\n \n return convertCRtoRC($cell);\n}\n\n$dir = fopen(\"php://stdin\", 'r');\n$cells = stream_get_contents($dir);\n\n$cells = explode(\"\\n\", $cells);\nfor($i=1;$i<=$cells[0];$i++){\n echo convert($cells[$i]).\"\\n\";\n}\n?>\n"}, {"source_code": "=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfscanf(STDIN,\"%d\\n\",$numzna4);\nif ($numzna4<=pow(10,5) and $numzna4>=1) {\n\tfor ($j=0;$j<$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\t\tif (preg_match('/^[A-Z]{1,4}[A-N]{0,1}\\d{1,6}[0]{0,1}$/',$arr[$j]))\n\t\t\t$arr[$j] = convert1($arr[$j]);\n\t\tif (preg_match('/^[R]\\d{1,6}[0]{0,1}[C]\\d{1,6}[0]{0,1}$/',$arr[$j]))\n\t\t\t$arr[$j] = convert2($arr[$j]);\n\t}\n\n\tfor ($j=0;$j<$numzna4;$j++) {\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>"}, {"source_code": "=0; $j--)\n {\n $outC += (ord($c[$j])-64)*$d;\n $d*=26;\n }\n\n printf('R%sC%s\\n', $outR, $outC);\n}\n\nfunction toCR($r, $c)\n{\n $outR = $r;\n $outC = '';\n\n while($c)\n {\n $outC = chr(65 + ($c-1)%26) . $outC;\n $c = (integer)(($c - ($c-1)%26)/26);\n }\n\n printf('%s%s\\n', $outC, $outR);\n}"}, {"source_code": "0)\n {\n $r=($num-1)%26;\n $res = chr($r+65).$res;\n $num = floor(($num-1)/26);\n }\n return $res;\n}\n\nfunction toNum($string){\n $int = 0;\n $len = strlen($string);\n for($i = 0; $i< $len; $i++){\n $int*=26;\n $int += ord($string[$i]) - 64;\n }\n return $int;\n}\n\n$file = fscanf(STDIN, \"%d\\n\", $cells);\nfor($i=0; $i<$cells; $i++){\n fscanf(STDIN, \"%s\\n\", $line);\n if($line[0] == 'R' && ord($line[1])>=48&&ord($line[1])<=57){\n $cPos = strpos($line, 'C', 2);\n if($cPos !== -1){\n print(toAlpha(substr($line, $cPos+1)).substr($line, 1, $cPos-1).\"\\n\");\n }else{\n print('R'.substr($line, 1).\"C18\\n\");\n }\n }else{\n preg_match('/[0-9]/', $line, $matches, PREG_OFFSET_CAPTURE);\n print('R'.substr($line, $matches[0][1]).'C'.toNum(substr($line, 0, $matches[0][1])).\"\\n\");\n }\n}\n"}, {"source_code": "[[:upper:]]+)(?[[:digit:]]+)$/\", $coords, $matches)) {\n echo \"R\";\n echo $matches[\"row\"];\n echo \"C\";\n echo to_numbers($matches[\"letter_column\"]);\n } // RXCY system to Excel system\n elseif (preg_match(\"/^R(?
[[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches)) {\n echo to_letters(intval($matches[\"column\"]));\n echo $matches[\"row\"];\n } else {\n preg_match(\"/^R([0-9]+)C([0-9]+)$/\", $coords, $matches);\n var_dump($matches);\n }\n\n if ($i < $n - 1) {\n echo PHP_EOL;\n }\n}\n\n/**\n * @param string $letters\n *\n * @return int $letters represented as a number\n */\nfunction to_numbers($letters) {\n return array_reduce(str_split($letters), function($sum, $letter) {\n return $sum * 26 + ord($letter) - 64;\n });\n}\n\n/**\n * @param int $n\n *\n * @return string $n represented with letters\n */\nfunction to_letters($n) {\n ob_start();\n\n while ($n > 26) {\n echo to_letter($n);\n $n /= 26;\n }\n\n echo to_letter($n);\n\n return strrev(ob_get_clean());\n}\n\n/**\n * @param int $n\n *\n * @return string\n */\nfunction to_letter($n) {\n return chr($n % 26 + 64);\n}"}, {"source_code": " 0; $i = floor($i / 26)){\n $k = ($i % 26);\n if($k == 0){\n $k = 26;\n $i--;\n }\n $c = $letters[$k-1].$c;\n }\n \n return $c;\n}\n\nfunction alpha2num($n, $letters){\n $c = 0;\n\n for($i = strlen($n), $j = 0; $i > 0;$i--,$j++){\n $k = array_search($n[$i-1], $letters) + 1;\n if($j > 0){\n $k = $k * pow(26, $j);\n }\n $c = $k + $c;\n }\n \n return $c;\n}\n\n?>"}, {"source_code": "= 1)\n {\n $t = $param % 26;\n if($t == 0 && $param == 26) {\n $t = 26;\n $param = 0;\n }\n $result = chr($t + ord(\"A\") - 1) . $result;\n $param = floor($param / 26) ;\n } \n \n //R98C688\n //R90C35\n}\n\nfunction mytoint($param, &$result) {\n $result = 0; \n for ($index = 0; $index < strlen($param); $index++) {\n $result += (ord($param[$index]) - ord(\"A\") + 1) * pow(26, (strlen($param) - $index - 1));\n }\n}\n\n?>\n"}, {"source_code": " $baseNum)\n\t\t{\n\t\t\t$left = $num % $baseNum;\n\t\t\tif(!$left)\n\t\t\t{\n\t\t\t\t$left = 26;\n\t\t\t}\n\t\t\t\n\t\t\t$res = chr($left + $baseChar) . $res;\n\t\t\t$num = intval($num / $baseNum);\n\t\t\n\t\t}\n\t\t\n\t\tif($num)\n\t\t{\n\t\t\t$res = chr($num + $baseChar) . $res;\n\t\t}\n\t\t\n\t\t$res .= $matches[1];\n\t\t\n\t\techo $res . PHP_EOL;\n\t}\n\telse\n\t{\n\t\tpreg_match('/([A-Z]+)(\\d+)/', $str, $matches);\n\t\t\n\t\t$res = 'R' . $matches[2] . 'C';\n\t\t\n\t\t$str = str_split($matches[1]);\n\t\t$pos = count($str) - 1;\n\t\t$sum = 0;\n\t\tforeach($str as $chr)\n\t\t{\n\t\t\t$sum += (ord($chr) - $baseChar) * pow($baseNum, $pos);\n\t\t\t$pos--;\n\t\t}\n\t\t\n\t\techo $res . $sum . PHP_EOL;\n\t\t\n\t}\n}"}, {"source_code": " 26) {\n $d2 = chr(floor($s[2] / 26) % 26 + 64);\n if ($d2 == '@')\n $d2 = 'Z';\n }\n else\n $d2 = '';\n \n if ($s[2] > 26 * 26) {\n $d3 = chr(floor($s[2] / (26 * 26)) % 26 + 64);\n if ($d3 == '@')\n $d3 = 'Z';\n }\n else\n $d3 = '';\n\n echo \"$d3$d2$d1$s[1]\\n\";\n //print_r ($s);\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n //echo \"$j $re\\n\";\n }\n $d1 = intval($d[count($d) - 1]);\n //print_r($l1);\n //print_r($d);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n\n\n?>"}, {"source_code": " 25){\n $remainder = $col % 26;\n array_push($indexes, $remainder);\n if($remainder == 0){\n $col = ($col / 26) -1;\n if($col == 0){\n break;\n }\n }\n else{\n $col = $col / 26;\n }\n print (\"REM: \".$col.\"\\n\");\n if ($col / 26 < 25){\n $col = floor($col);\n array_push($indexes, $col);\n }\n }\n }\n\n\n $rereversedIndexes = array_reverse($indexes);\n for ($i = 0; $i < sizeof($indexes); $i++){\n $normal = $normal.$alphabet[$rereversedIndexes[$i]];\n }\n\n print($normal.$row.\"\\n\");\n}\n\nfunction convertToRC($word){\n $rowNum = 0;\n\n $alphabet = [\n 'A' => 1,\n 'B' => 2,\n 'C' => 3,\n 'D' => 4,\n 'E' => 5,\n 'F' => 6,\n 'G' => 7,\n 'H' => 8,\n 'I' => 9,\n 'J' => 10,\n 'K' => 11,\n 'L' => 12,\n 'M' => 13,\n 'N' => 14,\n 'O' => 15,\n 'P' => 16,\n 'Q' => 17,\n 'R' => 18,\n 'S' => 19,\n 'T' => 20,\n 'U' => 21,\n 'V' => 22,\n 'W' => 23,\n 'X' => 24,\n 'Y' => 25,\n 'Z' => 26\n ];\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n for ($i = 0; $i < strlen($word); $i++){\n if(in_array($word[$i], $digits)){\n $index = $i;\n break;\n }\n }\n\n $rowRev = substr($word, 0, $index);\n $col = substr($word, $index);\n\n $row = strrev($rowRev);\n\n for($i = strlen($row)-1; $i >= 0; $i--){\n $rowNum += $alphabet[$row[$i]] * pow(26, $i);\n }\n\n print(\"R\".$col.\"C\".$rowNum.\"\\n\");\n}"}, {"source_code": "\n"}, {"source_code": "\ufeff=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfunction char_cifr($a1,$a2) {\n\tfor($i=0;$i =1) {\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\n\t\tif (preg_match('/^[R]([1-9]{1}\\d{0,5}[0]{0,1})[C]([1-9]{1}\\d{0,5}[0]{0,1})$/',$arr[$j],$matches)) {\n\t\t\t$arr[$j] = cifr_char($matches[2],$matches[1]);\n\t\t} elseif(preg_match('/^([A-Z]{1,4}[A-N]{0,1})(\\d{1,6}[0]{0,1})$/',$arr[$j],$matches))\n\t\t\t$arr[$j] = char_cifr($matches[1],$matches[2]);\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>"}, {"source_code": " 0) {\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$str = substr($str, $a1);\n\t\t$pattern = '/[0-9]/';\n\t\tpreg_match($pattern, $str, $matches);\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$result[] = substr($str, $a1);\t\n\t} else {\n\t\t$result[] = $str;\n\t}\n\treturn $result;\n}\n\nfunction changeSTN($a) {\n\t$leng = strlen($a);\n\t$result = 0;\n\tfor ($i = 0; $i < $leng; $i++) { \n\t\t$result += (ord($a[$i]) - 64) * pow(26, $leng - 1 - $i);\n\t}\n\treturn $result;\n}\n\nfunction changeNTS($a) {\n\t$result = \"\";\n\twhile ($a > 0) {\n\t\t$result .= chr(64 + $a % 26);\n\t\t$a = floor($a / 26);\n\t}\n\treturn strrev($result);\n}\n\nfunction change($str) {\n\t$str = tach($str);\n\tif (count($str) == 2) {\n\t\t$result = \"R\" . $str[1];\n\t\t$result .= \"C\" . changeSTN($str[0]);\n\t} else {\n\t\t$result = changeNTS((int)$str[3]);\n\t\t$result .= $str[1];\n\t}\n\treturn $result;\n}\n\necho $n;\nvar_dump($a);\n\nfor ($i = 0; $i < $n - 1; $i++) {\n\techo change($a[$i]) . \"\\n\";\n}\necho change($a[$n - 1]);\n\n\n\n\n"}, {"source_code": " 0) {\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$str = substr($str, $a1);\n\t\t$pattern = '/[0-9]/';\n\t\tpreg_match($pattern, $str, $matches);\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$result[] = substr($str, $a1);\t\n\t} else {\n\t\t$result[] = $str;\n\t}\n\treturn $result;\n}\n\nfunction changeSTN($a) {\n\t$leng = strlen($a);\n\t$result = 0;\n\tfor ($i = 0; $i < $leng; $i++) { \n\t\t$result += (ord($a[$i]) - 64) * pow(26, $leng - 1 - $i);\n\t}\n\treturn $result;\n}\n\nfunction changeNTS($a) {\n\t$result = \"\";\n\twhile ($a > 0) {\n\t\t$result .= chr(64 + $a % 26);\n\t\t$a = floor($a / 26);\n\t}\n\treturn strrev($result);\n}\n\nfunction change($str) {\n\t$str = tach($str);\n\tif (count($str) == 2) {\n\t\t$result = \"R\" . $str[1];\n\t\t$result .= \"C\" . changeSTN($str[0]);\n\t} else {\n\t\t$result = changeNTS((int)$str[3]);\n\t\t$result .= $str[1];\n\t}\n\treturn $result;\n}\n\n\n\nfor ($i = 0; $i < $n - 1; $i++) {\n\techo change($a[$i]) . \"
\";\n}\necho change($a[$n - 1]);\n\n\n\n\n"}, {"source_code": " 25){\n $remainder = $col % 26;\n $col = $col / 26;\n array_push($indexes, $remainder);\n if ($col / 26 < 25){\n $col = floor($col);\n array_push($indexes, $col);\n }\n }\n }\n\n\n $rereversedIndexes = array_reverse($indexes);\n for ($i = 0; $i < sizeof($indexes); $i++){\n $normal = $normal.$alphabet[$rereversedIndexes[$i]];\n }\n\n print($normal.$row.\"\\n\");\n}\n\nfunction convertToRC($word){\n $rowNum = 0;\n\n $alphabet = [\n 'A' => 1,\n 'B' => 2,\n 'C' => 3,\n 'D' => 4,\n 'E' => 5,\n 'F' => 6,\n 'G' => 7,\n 'H' => 8,\n 'I' => 9,\n 'J' => 10,\n 'K' => 11,\n 'L' => 12,\n 'M' => 13,\n 'N' => 14,\n 'O' => 15,\n 'P' => 16,\n 'Q' => 17,\n 'R' => 18,\n 'S' => 19,\n 'T' => 20,\n 'U' => 21,\n 'V' => 22,\n 'W' => 23,\n 'X' => 24,\n 'Y' => 25,\n 'Z' => 26\n ];\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n for ($i = 0; $i < strlen($word); $i++){\n if(in_array($word[$i], $digits)){\n $index = $i;\n }\n }\n\n if($index == 1){\n $index = 2;\n }\n\n $rowRev = substr($word, 0, $index-1);\n $col = substr($word, $index-1);\n\n $row = strrev($rowRev);\n\n for($i = strlen($row)-1; $i >= 0; $i--){\n $rowNum += $alphabet[$row[$i]] * pow(26, $i);\n }\n\n print(\"R\".$col.\"C\".$rowNum.\"\\n\");\n}"}, {"source_code": "=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfunction char_cifr($a1,$a2) {\n\tfor($i=0;$i=1) {\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\n\t\tif (preg_match('/^[R]([1-9]{1}\\d{0,5}[0]{0,1})[C]([1-9]{1}\\d{0,5}[0]{0,1})$/',$arr[$j],$matches)) {\n\t\t\t$arr[$j] = cifr_char($matches[2],$matches[1]);\n\t\t} elseif(preg_match('/^([A-Z]{1,4}[A-N]{0,1})(\\d{1,6}[0]{0,1})$/',$arr[$j],$matches))\n\t\t\t$arr[$j] = char_cifr($matches[1],$matches[2]);\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>"}, {"source_code": " 25){\n $remainder = $col % 26;\n $col = $col / 26;\n array_push($indexes, $remainder);\n if ($col / 26 < 25){\n $col = floor($col);\n array_push($indexes, $col);\n }\n }\n }\n\n\n $rereversedIndexes = array_reverse($indexes);\n for ($i = 0; $i < sizeof($indexes); $i++){\n $normal = $normal.$alphabet[$rereversedIndexes[$i]];\n }\n\n print($normal.$row.\"\\n\");\n}\n\nfunction convertToRC($word){\n $rowNum = 0;\n\n $alphabet = [\n 'A' => 1,\n 'B' => 2,\n 'C' => 3,\n 'D' => 4,\n 'E' => 5,\n 'F' => 6,\n 'G' => 7,\n 'H' => 8,\n 'I' => 9,\n 'J' => 10,\n 'K' => 11,\n 'L' => 12,\n 'M' => 13,\n 'N' => 14,\n 'O' => 15,\n 'P' => 16,\n 'Q' => 17,\n 'R' => 18,\n 'S' => 19,\n 'T' => 20,\n 'U' => 21,\n 'V' => 22,\n 'W' => 23,\n 'X' => 24,\n 'Y' => 25,\n 'Z' => 26\n ];\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n for ($i = 0; $i < strlen($word); $i++){\n if(in_array($word[$i], $digits)){\n $index = $i;\n break;\n }\n }\n\n if($index == 1){\n $index = 2;\n }\n\n $rowRev = substr($word, 0, $index);\n $col = substr($word, $index);\n\n $row = strrev($rowRev);\n\n for($i = strlen($row)-1; $i >= 0; $i--){\n $rowNum += $alphabet[$row[$i]] * pow(26, $i);\n }\n\n print(\"R\".$col.\"C\".$rowNum.\"\\n\");\n}"}, {"source_code": ""}, {"source_code": "=48&&ord($var)<=57)\n return true;\n else\n return false;\n}\nfunction GetInt($var)\n{\n $res=\"\";\n for($i=1;$i =0;$i--)\n {\n // echo \"$i ~~\".$var[$i];\n if(IsInt($var[$i]))\n {\n $res.=$var[$i];\n }\n else {\n // echo \"RES=\".$res;\n return strrev($res);\n }\n }\n}\n\n$map=array();\n$map2=array();\n$index=1;\nfor($i=65;$i<=90;$i++)\n{\n $map[chr($i)]=$index;\n $map2[$index]=chr($i);\n $index++;\n}\nfor($i=65;$i<=90;$i++)\n{\n for($ii=65;$ii<=90;$ii++)\n {\n $map[chr($i).chr($ii)]=$index;\n $map2[$index]=chr($i).chr($ii);\n $index++;\n }\n}\nfor($i=65;$i<=90;$i++)\n{\n for($ii=65;$ii<=90;$ii++)\n {\n for($iii=65;$iii<=90;$iii++)\n {\n $map[chr($i).chr($ii).chr($iii)]=$index;\n $map2[$index]=chr($i).chr($ii).chr($iii);\n $index++;\n }\n }\n}\n\n//print_r($map);\n//print_r($map2);\n\n\nwhile($n--)\n{\nfscanf(STDIN,\"%s\",$str);\n //$str=$n==1?\"R12C4\":\"R5C255\";\n //echo \"::\".$str[1];\n if($str[0]=='R'&& IsInt($str[1]))\n {\n // echo \"$str is type 1\"; R23C55\n // echo GetInt($str);\n // echo \"~~~\";\n $a=GetInt($str);\n $b=GetInt_D($str);\n// echo $a.\"~~~\".$b;\n echo $map2[$b].$a.\"\\n\";\n\n\n\n }\n else {\n $a=\"\";\n for($i=0;$i \n"}, {"source_code": "$fr = fopen(\"php://stdin\", \"r\");\n$n = (int) fgets($fr);\necho $n;\n$n = (int) fgets($fr);\necho $n;"}, {"source_code": "= 48 && ord($data[$i][1]) <= 57) {\n \t\t$column = '';\n \t\t$string = '';\n \t\t$flag = false;\n \t\tfor($j = 1; $j < strlen($data[$i]); $j++) {\n \t\t\tif($data[$i][$j] == 'C') {\n \t\t\t\t$flag = true;\n \t\t\t} else {\n \t\t\t\tif(!$flag) {\n \t\t\t\t\t$string .= $data[$i][$j];\n \t\t\t\t} else {\n \t\t\t\t\t$column .= $data[$i][$j];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t$strColumn = '';\n \t\t$column = (int)$column;\n \t\t$cLen = floor($column / 26);\n\n \t\tfor($j = 0; $j < $cLen; $j++) {\n \t\t\tif($column % 26 != 0) {\n\t \t\t\t$strColumn .= chr($column % 26 + 64);\n\t \t\t\t$column = floor($column / 26);\n\t \t\t} else {\n\t \t\t\t$strColumn .= chr($column + 64);\n\t \t\t}\n \t\t}\n \t\t$data[$i] = strrev($strColumn) . $string;\n\n \t} else {\n \t\t$column = '';\n \t\t$string = '';\n \t\tfor($j = 0; $j = 65 && ord($data[$i][$j]) <= 90) {\n \t\t\t\t$column .= $data[$i][$j];\n \t\t\t} else {\n \t\t\t\t$string .= $data[$i][$j];\n \t\t\t}\n \t\t}\n\n \t\t$columnNum = 0;\n \t\tfor($j = strlen($column) - 1; $j >= 0; $j--) {\n \t\t\t$columnNum += (ord($column[$j]) - 64) * pow(26, strlen($column)-$j-1);\n \t\t}\n \t\t$data[$i] = 'R' . $string . 'C' . $columnNum;\n \t}\n }\n \n echo implode(\"\\n\", $data);\n?>"}, {"source_code": " 0) {\n $cStr = chr(64+($c % 26)) . $cStr;\n $c = floor($c / 26);\n }\n echo $cStr . $r . \"\\n\";\n } elseif (preg_match('~^([A-Z]+)([0-9]+)$~', $val, $matches)) {\n $r = $matches[2];\n $cStr = $matches[1];\n $cStrLen = strlen($cStr);\n $c = 0;\n for ($i = 0; $i < $cStrLen; $i ++) {\n $l = substr($cStr, $i, 1);\n $l = ord($l) - 64;\n $c += $l * pow(26, $cStrLen - $i - 1);\n }\n echo 'R' . $r . 'C' . $c . \"\\n\";\n }\n}\n"}, {"source_code": " 26) && ($f <= 702))\n {\n $h = floor($f / 26);\n $i = $f % 26;\n if($i == 0)\n {\n $h -= 1;\n $i = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$i - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$i - 1] . $e . \"\\n\"; \n }\n }\n elseif(($f > 702) && ($f <= 18278))\n {\n $h = floor($f / 676);\n $i = $f % 676;\n $j = floor($i / 26);\n $k = $i % 26;\n if($k == 0)\n {\n $j -= 1;\n $k = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$k - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$k - 1] . $e . \"\\n\";\n }\n }\n elseif(($f > 18278) && ($f <= 493533))\n {\n $h = floor($f / 17576);\n $i = $f % 17576;\n $j = floor($i / 676);\n $k = $i % 676;\n $l = floor($k / 26);\n $m = $k % 26;\n if($m == 0)\n {\n $l -= 1;\n $m = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$m - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$m - 1] . $e . \"\\n\"; \n }\n }\n elseif(($f > 493533) && ($f <= 1000000))\n {\n $h = floor($f / 456976);\n $i = $f % 456976;\n $j = floor($i / 17576);\n $k = $i % 17576;\n $l = floor($k / 676);\n $m = $k % 676;\n $n = floor($m / 26);\n $o = $m % 26;\n if($o == 0)\n {\n $n -= 1;\n $o = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$n - 1] . $g[$o - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$n - 1] . $g[$o - 1] . $e . \"\\n\";\n }\n }\n }\n else\n {\n if(is_numeric($b[1])) { $c = 1; }\n elseif(is_numeric($b[2])) { $c = 2; }\n elseif(is_numeric($b[3])) { $c = 3; }\n elseif(is_numeric($b[4])) { $c = 4; }\n elseif(is_numeric($b[5])) { $c = 5; }\n $d = substr($b, 0, $c); // \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\n $e = substr($b, $c); // \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438\n if(strlen($d) == 1)\n {\n $f = array_search($d, $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ($f + 1);\n }\n else\n {\n print \"R\" . $e . \"C\" . ($f + 1) . \"\\n\";\n }\n }\n elseif(strlen($d) == 2)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 26) + ($h + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 26) + ($h + 1)) . \"\\n\";\n }\n }\n elseif(strlen($d) == 3)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n $i = array_search($d[2], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 676) + (($h + 1) * 26) + ($i + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 676) + (($h + 1) * 26) + ($i + 1)) . \"\\n\";\n }\n }\n elseif(strlen($d) == 4)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n $i = array_search($d[2], $g);\n $j = array_search($d[3], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 17576) + (($h + 1) * 676) + (($i + 1) * 26) + ($j + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 17576) + (($h + 1) * 676) + (($i + 1) * 26) + ($j + 1)) . \"\\n\";\n }\n }\n elseif(strlen($d) == 5)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n $i = array_search($d[2], $g);\n $j = array_search($d[3], $g);\n $k = array_search($d[4], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 456976) + (($h + 1) * 17576) + (($i + 1) * 676) + (($j + 1) * 26) + ($k + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 456976) + (($h + 1) * 17576) + (($i + 1) * 676) + (($j + 1) * 26) + ($k + 1)) . \"\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " 0) {\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$str = substr($str, $a1);\n\t\t$pattern = '/[0-9]/';\n\t\tpreg_match($pattern, $str, $matches);\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$result[] = substr($str, $a1);\t\n\t} else {\n\t\t$result[] = $str;\n\t}\n\treturn $result;\n}\n\nfunction changeSTN($a) {\n\t$leng = strlen($a);\n\t$result = 0;\n\tfor ($i = 0; $i < $leng; $i++) { \n\t\t$result += (ord($a[$i]) - 64) * pow(26, $leng - 1 - $i);\n\t}\n\treturn $result;\n}\n\nfunction changeNTS($a) {\n\t$result = \"\";\n\twhile ($a > 0) {\n\t\t$result .= chr(64 + $a % 26);\n\t\t$a = floor($a / 26);\n\t}\n\treturn strrev($result);\n}\n\nfunction change($str) {\n\t$str = tach($str);\n\tif (count($str) == 2) {\n\t\t$result = \"R\" . $str[1];\n\t\t$result .= \"C\" . changeSTN($str[0]);\n\t} else {\n\t\t$result = changeNTS((int)$str[3]);\n\t\t$result .= $str[1];\n\t}\n\treturn $result;\n}\n\necho $n;\nvar_dump($a);\n\nfor ($i = 0; $i < $n - 1; $i++) {\n\techo change($a[$i]) . \"\\n\";\n}\necho change($a[$n - 1]);\n\n\n\n\n"}, {"source_code": "[[:upper:]]+)(? [[:digit:]]+)$/\", $coords, $matches)) {\n echo \"R\";\n echo $matches[\"row\"];\n echo \"C\";\n echo to_numbers($matches[\"letter_column\"]);\n } // RXCY system to Excel system\n elseif (preg_match(\"/^R(?
[[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches)) {\n echo to_letters(intval($matches[\"column\"]));\n echo $matches[\"row\"];\n } else {\n var_dump($coords);\n preg_match(\"/^R([0-9]+)C([0-9]+)$/\", $coords, $matches);\n var_dump($matches);\n }\n\n if ($i < $n - 1) {\n echo PHP_EOL;\n }\n}\n\n/**\n * @param string $letters\n *\n * @return int $letters represented as a number\n */\nfunction to_numbers($letters) {\n return array_reduce(str_split($letters), function($sum, $letter) {\n return $sum * 26 + ord($letter) - 64;\n });\n}\n\n/**\n * @param int $n\n *\n * @return string $n represented with letters\n */\nfunction to_letters($n) {\n ob_start();\n\n while ($n > 26) {\n echo to_letter($n);\n $n /= 26;\n }\n\n echo to_letter($n);\n\n return strrev(ob_get_clean());\n}\n\n/**\n * @param int $n\n *\n * @return string\n */\nfunction to_letter($n) {\n return chr($n % 26 + 64);\n}"}, {"source_code": " 0) {\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$str = substr($str, $a1);\n\t\t$pattern = '/[0-9]/';\n\t\tpreg_match($pattern, $str, $matches);\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$result[] = substr($str, $a1);\t\n\t} else {\n\t\t$result[] = $str;\n\t}\n\treturn $result;\n}\n\nfunction changeSTN($a) {\n\t$leng = strlen($a);\n\t$result = 0;\n\tfor ($i = 0; $i < $leng; $i++) { \n\t\t$result += (ord($a[$i]) - 64) * pow(26, $leng - 1 - $i);\n\t}\n\treturn $result;\n}\n\nfunction changeNTS($a) {\n\t$result = \"\";\n\twhile ($a > 0) {\n\t\t$d = 64 + $a % 26;\n\t\tif ($d == 0) {\n\t\t\t$d += 26;\n\t\t}\n\t\t$result .= chr($d);\n\t\t$a = floor($a / 26);\n\t}\n\treturn ($result);\n}\n\nfunction change($str) {\n\t$str = tach($str);\n\tif (count($str) == 2) {\n\t\t$result = \"R\" . $str[1];\n\t\t$result .= \"C\" . changeSTN($str[0]);\n\t} else {\n\t\t$result = changeNTS((int)$str[3]);\n\t\t$result .= $str[1];\n\t}\n\treturn $result;\n}\n\n\n\nfor ($i = 0; $i < $n - 1; $i++) {\n\techo change($a[$i]) . \"\\n\";\n}\necho change($a[$n - 1]);\n\n\n\n\n"}, {"source_code": "0)\n {\n $r=($num-1)%26;\n $res = chr($r+65).$res;\n $num = floor(($num-1)/26);\n }\n return $res;\n}\n\nfunction toNum($string){\n $int = 0;\n $len = strlen($string);\n for($i = 0; $i< $len; $i++){\n $int*=26;\n $int += ord($string[$i]) - 64;\n }\n return $int;\n}\n\n$file = fscanf(STDIN, \"%d\\n\", $cells);\nfor($i=0; $i<$cells; $i++){\n fscanf(STDIN, \"%s\\n\", $line);\n if($line[0] == 'R' && $line[1]<10){\n $cPos = strpos($line, 'C', 2);\n if($cPos){\n print(toAlpha(substr($line, $cPos+1)).substr($line, 1, $cPos-1).\"\\n\");\n }else{\n print('R'.substr($line, 1).\"C18\\n\");\n }\n }else{\n preg_match('/[0-9]/', $line, $matches, PREG_OFFSET_CAPTURE);\n print('R'.substr($line, $matches[0][1]).'C'.toNum(substr($line, 0, $matches[0][1])).\"\\n\");\n }\n}\n"}, {"source_code": " 26) {\n $d2 = chr(floor($s[2] / 26) % 26 + 64);\n if ($d2 == '@')\n $d2 = 'Z';\n }\n else\n $d2 = '';\n \n if ($s[2] > 26 * 26) {\n $d3 = chr(floor($s[2] / (26 * 26)) % 26 + 64);\n if ($d3 == '@')\n $d3 = 'Z';\n }\n else\n $d3 = '';\n\n echo \"$d3$d2$d1$s[1]\\n\";\n //print_r ($s);\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n //echo \"$j $re\\n\";\n }\n $d1 = intval($d[count($d) - 1]);\n //print_r($l1);\n //print_r($d);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n\n\n?>"}, {"source_code": " 0) {\n $mod[] = bcmod($sub,26);\n $sub = bcdiv($sub,26);\n }\n\n $count = count($mod);\n $column = '';\n $tmp = null;\n for ($i =0;$i< $count;$i++) {\n $now = $mod[$i];\n if ($mod[$i] == 0) {\n $tmp = $i;\n $now = 26;\n }\n\n if ($tmp !== null and bcadd($tmp,1) == $i) {\n if ($now == 0){\n $now = 26;\n }\n $now = bcsub($now,1);\n if ($now == 0); continue;\n }\n\n $column .= chr($now+64);\n }\n $column = strrev($column);\n echo $column.$match[1];\n\n } elseif (preg_match(\"/([A-Z]+)(\\d+)/\",$str,$match)) {\n $len = strlen($match[1]);\n $num = 0; // \u5b57\u6bcd\u5e8f\u5217\u548c\n for ($i = 0; $i < $len; $i++) {\n $num = bcadd(bcmul(bcsub(ord($match[1][$i]),64),bcpow(26,bcsub($len,bcadd($i,1)))),$num);\n }\n echo \"R\".$match[2].\"C\".$num;\n }\n}\n\n$line = 0;\nwhile ($data = fscanf(STDIN,\"%s\")) {\n if (!$line) {\n $line++;\n continue;\n }\n read_sheet($data[0]);\n echo \"\\n\";\n}"}, {"source_code": "\ufeff=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfunction char_cifr($a1,$a2) {\n\tfor($i=0;$i =1) {\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\n\t\tif (preg_match('/^[R]([1-9]{1}\\d{0,5}[0]{0,1})[C]([1-9]{1}\\d{0,5}[0]{0,1})$/',$arr[$j],$matches)) {\n\t\t\t$arr[$j] = cifr_char($matches[2],$matches[1]);\n\t\t} elseif(preg_match('/^([A-Z]{1,4}[A-N]{0,1})(\\d{1,6}[0]{0,1})$/',$arr[$j],$matches))\n\t\t\t$arr[$j] = char_cifr($matches[1],$matches[2]);\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>"}, {"source_code": "\n"}, {"source_code": "1){\n if(($c%26)!=0){\n $col.= chr(($c%26)+ord(A)-1);\n $c-=$c%26;\n $c/=26;\n if($c==1) $col.='A';\n }else{\n $cuo=$c/26;\n $col.=chr($cuo+ord(A)-1);\n $c/=26;\n }\n }\n \n $col=strrev($col);\n echo \"$col\".\"$r\".\"\\n\";\n \n }\n}\n\n?>"}, {"source_code": "47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$first = substr($string, 1, $i-1);\n\t\t\t\t\t$second = substr($string, $i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$second = numToLet($second);\n\t\t$res = $second.$first;\n\t\treturn $res;\n\t\t\n\t}\n\t\n\tfunction conv ($string) {\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first = substr($string, 0, $i-1);\n\t\t\t\t$second = substr($string, $i-1);\n\t\t\t}\n\t\t}\n\t\t$first = letToNum($first);\n\t\t$res = 'R'.$second.'C'.$first;\n\t\treturn $res;\n\t}\n\t\n\tfunction detect ($string) {\n\t\t\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$second_marker = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($second_marker == 1) {\n\t\t\treturn conv2($string);\n\t\t}\n\t\telse {\n\t\t\treturn conv($string);\n\t\t}\n\t\t\n\t}\n\t\n\tfunction numToLet ($num){\n\t\t$raz = 1;\n\t\t$newnum = $num;\n\t\twhile (($newnum/26)>1.03845) {\n\t\t\tif ((int)$newnum/26 != 27 AND $newnum!=18278) {\n\t\t\t$raz++;\t\t\t\n\t\t\t}\n\t\t\t$newnum /= 26;\n\t\t}\n\t\t$newnum = $num;\n\t\t$res = '';\n\t\tfor ($i=0;$i<$raz;$i++) {\n\t\t\t$cur = $newnum%26;\n\t\t\tswitch ($cur) {\n\t\t\t\tcase 1: $res = 'A'.$res; break;\n\t\t\t\tcase 2: $res = 'B'.$res; break;\n\t\t\t\tcase 3: $res = 'C'.$res; break;\n\t\t\t\tcase 4: $res = 'D'.$res; break;\n\t\t\t\tcase 5: $res = 'E'.$res; break;\n\t\t\t\tcase 6: $res = 'F'.$res; break;\n\t\t\t\tcase 7: $res = 'G'.$res; break;\n\t\t\t\tcase 8: $res = 'H'.$res; break;\n\t\t\t\tcase 9: $res = 'I'.$res; break;\n\t\t\t\tcase 10: $res = 'J'.$res; break;\n\t\t\t\tcase 11: $res = 'K'.$res; break;\n\t\t\t\tcase 12: $res = 'L'.$res; break;\n\t\t\t\tcase 13: $res = 'M'.$res; break;\n\t\t\t\tcase 14: $res = 'N'.$res; break;\n\t\t\t\tcase 15: $res = 'O'.$res; break;\n\t\t\t\tcase 16: $res = 'P'.$res; break;\n\t\t\t\tcase 17: $res = 'Q'.$res; break;\n\t\t\t\tcase 18: $res = 'R'.$res; break;\n\t\t\t\tcase 19: $res = 'S'.$res; break;\n\t\t\t\tcase 20: $res = 'T'.$res; break;\n\t\t\t\tcase 21: $res = 'U'.$res; break;\n\t\t\t\tcase 22: $res = 'V'.$res; break;\n\t\t\t\tcase 23: $res = 'W'.$res; break;\n\t\t\t\tcase 24: $res = 'X'.$res; break;\n\t\t\t\tcase 25: $res = 'Y'.$res; break;\n\t\t\t\tcase 0: $res = 'Z'.$res; break;\n\t\t\t}\n\t\t\tif ($cur==0){\n\t\t\t$newnum = floor($newnum/26)-1;\n\t\t\t}\n\t\t\telse {\n\t\t\t$newnum/=26;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}\n\t\n\t\n\tfunction letToNum ($let){\n\t\t$sum = 0;\n\t\tfor ($i=0;$i "}, {"source_code": " 1, \"B\" => 2, \"C\" => 3, \"D\" => 4, \"E\" => 5, \"F\" => 6, \"G\" => 7,\n \"H\" => 8, \"I\" => 9, \"J\" => 10, \"K\" => 11, \"L\" => 12, \"M\" => 13, \"N\" => 14,\n \"O\" => 15, \"P\" => 16, \"Q\" => 17, \"R\" => 18, \"S\" => 19, \"T\" => 20, \"U\" => 21, \n \"V\" => 22, \"W\" => 23, \"X\" => 24, \"Y\" => 25, \"Z\" => 26);\n$y = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nfor($i=0; $i<$a; ++$i)\n{\n $b[$i] = trim(fgets(STDIN));\n if(preg_match('/R(\\d+)C(\\d+)/', $b[$i], $c))\n {\n while(true)\n {\n if($c[2]>=1 and $c[2]<=26){$h .= $y{$c[2]-1}; break;}\n else{\n $f = floor($c[2]/26);\n $g = $c[2]-$f*26;\n $c[2] = floor(($c[2]-$g)/26);\n $h .= $y{$g-1};\n if($c[2]>=1 and $c[2]<=26){$h .= $y{$c[2]-1}; break;}\n elseif($c[2]==0){$h .= $y{25}; break;}\n }\n }\n $e .= strrev($h).$c[1].\"\\n\";\n }elseif(preg_match('/([A-Z]+)(\\d+)/', $b[$i], $c))\n {\n if(strlen($c[1])==1)\n {\n $d = $z[$c[1]];\n }else{\n for($j=0; $j "}, {"source_code": " 26;\n if ($continue) {\n $curr_num = $num % 26;\n $str = chr($curr_num + 64).$str;\n $num = floor($num / 26);\n } else {\n $str = chr($num + 64).$str;\n }\n } while ($continue);\n return $str;\n}\n\nfunction alpha_to_number($str) {\n $parts = str_split($str);\n $num = 0;\n for ($i = 0; $i < count($parts); $i++) {\n $num = $num * 26;\n $num += ord($parts[$i]) - 64;\n }\n return $num;\n}\n\nfunction convert_one($str) {\n $parts = preg_split(\"/\\d+/\", $str);\n if ($parts[0] === 'R' && $parts[1] === 'C') {\n // from RXCY\n $numbers = preg_split(\"/R|C/\", $str);\n $row = $numbers[1];\n $col = $numbers[2];\n printf(\"%s%d\", number_to_alpha($col), $row);\n } else {\n // to RXCY\n $col_str = $parts[0];\n $col = alpha_to_number($col_str);\n $row_parts = preg_split(\"/[A-Z]+/\", $str);\n $row = (int)$row_parts[1];\n printf(\"R%dC%d\", $row, $col);\n }\n}\n\nfscanf(STDIN, \"%d\", $n);\nfor ($i = 1; $i <= $n; $i++) {\n fscanf(STDIN, \"%s\", $str);\n convert_one($str);\n}\n?>"}, {"source_code": " 0) && ($e <= 26))\n {\n $i = $g[$e];\n }\n elseif(($e > 26) && ($e <= 702))\n {\n $f = ($e - 26) * 2 - 1;\n $i = $k[$f] . $k[$f + 1];\n }\n elseif(($e > 702) && ($e <= 18278))\n {\n $f = ($e - 702) * 3 - 2;\n $i = $l[$f] . $l[$f + 1] . $l[$f + 2];\n }\n elseif(($e > 18278) && ($e <= 475254))\n {\n $f = ($e - 18278) * 4 - 3;\n $i = $m[$f] . $m[$f + 1] . $m[$f + 2] . $m[$f + 3];\n }\n elseif(($e > 475254) && ($e <= 1000001))\n {\n $f = ($e - 475254) * 4 - 4;\n $i = $n[$f] . $n[$f + 1] . $n[$f + 2] . $n[$f + 3] . $n[$f + 4];\n }\n $j = substr($b, $c, $d - $c - 1);\n if($x == $a)\n {\n print $i . $j;\n }\n else\n {\n print $i . $j . \"\\n\";\n }\n }\n else\n {\n if(is_numeric($b[1]) == TRUE)\n {\n $e = substr($b, 0, 1);\n }\n elseif(is_numeric($b[2]) == TRUE)\n {\n $e = substr($b, 0, 2);\n }\n elseif(is_numeric($b[3]) == TRUE)\n {\n $e = substr($b, 0, 3);\n }\n elseif(is_numeric($b[4]) == TRUE)\n {\n $e = substr($b, 0, 4);\n }\n elseif(is_numeric($b[5]) == TRUE)\n {\n $e = substr($b, 0, 5);\n }\n elseif(is_numeric($b[6]) == TRUE)\n {\n $e = substr($b, 0, 6);\n }\n if(strlen($e) == 1)\n {\n if($e == \"A\")\n {\n $r = 1;\n }\n elseif($e == \"B\")\n {\n $r = 2;\n }\n elseif($e == \"C\")\n {\n $r = 3;\n }\n elseif($e == \"D\")\n {\n $r = 4;\n }\n elseif($e == \"E\")\n {\n $r = 5;\n }\n elseif($e == \"F\")\n {\n $r = 6;\n }\n elseif($e == \"G\")\n {\n $r = 7;\n }\n elseif($e == \"H\")\n {\n $r = 8;\n }\n elseif($e == \"I\")\n {\n $r = 9;\n }\n elseif($e == \"J\")\n {\n $r = 10;\n }\n elseif($e == \"K\")\n {\n $r = 11;\n }\n elseif($e == \"L\")\n {\n $r = 12;\n }\n elseif($e == \"M\")\n {\n $r = 13;\n }\n elseif($e == \"N\")\n {\n $r = 14;\n }\n elseif($e == \"O\")\n {\n $r = 15;\n }\n elseif($e == \"P\")\n {\n $r = 16;\n }\n elseif($e == \"Q\")\n {\n $r = 17;\n }\n elseif($e == \"R\")\n {\n $r = 18;\n }\n elseif($e == \"S\")\n {\n $r = 19;\n }\n elseif($e == \"T\")\n {\n $r = 20;\n }\n elseif($e == \"U\")\n {\n $r = 21;\n }\n elseif($e == \"V\")\n {\n $r = 22;\n }\n elseif($e == \"W\")\n {\n $r = 23;\n }\n elseif($e == \"X\")\n {\n $r = 24;\n }\n elseif($e == \"Y\")\n {\n $r = 25;\n }\n elseif($e == \"Z\")\n {\n $r = 26;\n }\n }\n elseif(strlen($e) == 2)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n $r = $f * 26 + $t;\n }\n elseif(strlen($e) == 3)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n $r = $f * 676 + $t * 26 + $h;\n }\n elseif(strlen($e) == 4)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n if($e[3] == \"A\")\n {\n $i = 1;\n }\n elseif($e[3] == \"B\")\n {\n $i = 2;\n }\n elseif($e[3] == \"C\")\n {\n $i = 3;\n }\n elseif($e[3] == \"D\")\n {\n $i = 4;\n }\n elseif($e[3] == \"E\")\n {\n $i = 5;\n }\n elseif($e[3] == \"F\")\n {\n $i = 6;\n }\n elseif($e[3] == \"G\")\n {\n $i = 7;\n }\n elseif($e[3] == \"H\")\n {\n $i = 8;\n }\n elseif($e[3] == \"I\")\n {\n $i = 9;\n }\n elseif($e[3] == \"J\")\n {\n $i = 10;\n }\n elseif($e[3] == \"K\")\n {\n $i = 11;\n }\n elseif($e[3] == \"L\")\n {\n $i = 12;\n }\n elseif($e[3] == \"M\")\n {\n $i = 13;\n }\n elseif($e[3] == \"N\")\n {\n $i = 14;\n }\n elseif($e[3] == \"O\")\n {\n $i = 15;\n }\n elseif($e[3] == \"P\")\n {\n $i = 16;\n }\n elseif($e[3] == \"Q\")\n {\n $i = 17;\n }\n elseif($e[3] == \"R\")\n {\n $i = 18;\n }\n elseif($e[3] == \"S\")\n {\n $i = 19;\n }\n elseif($e[3] == \"T\")\n {\n $i = 20;\n }\n elseif($e[3] == \"U\")\n {\n $i = 21;\n }\n elseif($e[3] == \"V\")\n {\n $i = 22;\n }\n elseif($e[3] == \"W\")\n {\n $i = 23;\n }\n elseif($e[3] == \"X\")\n {\n $i = 24;\n }\n elseif($e[3] == \"Y\")\n {\n $i = 25;\n }\n elseif($e[3] == \"Z\")\n {\n $i = 26;\n }\n $r = $f * 17576 + $t * 676 + $h * 26 + $i;\n }\n elseif(strlen($e) == 5)\n {\n if($e[0] == \"A\")\n {\n $f = 1;\n }\n elseif($e[0] == \"B\")\n {\n $f = 2;\n }\n elseif($e[0] == \"C\")\n {\n $f = 3;\n }\n elseif($e[0] == \"D\")\n {\n $f = 4;\n }\n elseif($e[0] == \"E\")\n {\n $f = 5;\n }\n elseif($e[0] == \"F\")\n {\n $f = 6;\n }\n elseif($e[0] == \"G\")\n {\n $f = 7;\n }\n elseif($e[0] == \"H\")\n {\n $f = 8;\n }\n elseif($e[0] == \"I\")\n {\n $f = 9;\n }\n elseif($e[0] == \"J\")\n {\n $f = 10;\n }\n elseif($e[0] == \"K\")\n {\n $f = 11;\n }\n elseif($e[0] == \"L\")\n {\n $f = 12;\n }\n elseif($e[0] == \"M\")\n {\n $f = 13;\n }\n elseif($e[0] == \"N\")\n {\n $f = 14;\n }\n elseif($e[0] == \"O\")\n {\n $f = 15;\n }\n elseif($e[0] == \"P\")\n {\n $f = 16;\n }\n elseif($e[0] == \"Q\")\n {\n $f = 17;\n }\n elseif($e[0] == \"R\")\n {\n $f = 18;\n }\n elseif($e[0] == \"S\")\n {\n $f = 19;\n }\n elseif($e[0] == \"T\")\n {\n $f = 20;\n }\n elseif($e[0] == \"U\")\n {\n $f = 21;\n }\n elseif($e[0] == \"V\")\n {\n $f = 22;\n }\n elseif($e[0] == \"W\")\n {\n $f = 23;\n }\n elseif($e[0] == \"X\")\n {\n $f = 24;\n }\n elseif($e[0] == \"Y\")\n {\n $f = 25;\n }\n elseif($e[0] == \"Z\")\n {\n $f = 26;\n }\n if($e[1] == \"A\")\n {\n $t = 1;\n }\n elseif($e[1] == \"B\")\n {\n $t = 2;\n }\n elseif($e[1] == \"C\")\n {\n $t = 3;\n }\n elseif($e[1] == \"D\")\n {\n $t = 4;\n }\n elseif($e[1] == \"E\")\n {\n $t = 5;\n }\n elseif($e[1] == \"F\")\n {\n $t = 6;\n }\n elseif($e[1] == \"G\")\n {\n $t = 7;\n }\n elseif($e[1] == \"H\")\n {\n $t = 8;\n }\n elseif($e[1] == \"I\")\n {\n $t = 9;\n }\n elseif($e[1] == \"J\")\n {\n $t = 10;\n }\n elseif($e[1] == \"K\")\n {\n $t = 11;\n }\n elseif($e[1] == \"L\")\n {\n $t = 12;\n }\n elseif($e[1] == \"M\")\n {\n $t = 13;\n }\n elseif($e[1] == \"N\")\n {\n $t = 14;\n }\n elseif($e[1] == \"O\")\n {\n $t = 15;\n }\n elseif($e[1] == \"P\")\n {\n $t = 16;\n }\n elseif($e[1] == \"Q\")\n {\n $t = 17;\n }\n elseif($e[1] == \"R\")\n {\n $t = 18;\n }\n elseif($e[1] == \"S\")\n {\n $t = 19;\n }\n elseif($e[1] == \"T\")\n {\n $t = 20;\n }\n elseif($e[1] == \"U\")\n {\n $t = 21;\n }\n elseif($e[1] == \"V\")\n {\n $t = 22;\n }\n elseif($e[1] == \"W\")\n {\n $t = 23;\n }\n elseif($e[1] == \"X\")\n {\n $t = 24;\n }\n elseif($e[1] == \"Y\")\n {\n $t = 25;\n }\n elseif($e[1] == \"Z\")\n {\n $t = 26;\n }\n if($e[2] == \"A\")\n {\n $h = 1;\n }\n elseif($e[2] == \"B\")\n {\n $h = 2;\n }\n elseif($e[2] == \"C\")\n {\n $h = 3;\n }\n elseif($e[2] == \"D\")\n {\n $h = 4;\n }\n elseif($e[2] == \"E\")\n {\n $h = 5;\n }\n elseif($e[2] == \"F\")\n {\n $h = 6;\n }\n elseif($e[2] == \"G\")\n {\n $h = 7;\n }\n elseif($e[2] == \"H\")\n {\n $h = 8;\n }\n elseif($e[2] == \"I\")\n {\n $h = 9;\n }\n elseif($e[2] == \"J\")\n {\n $h = 10;\n }\n elseif($e[2] == \"K\")\n {\n $h = 11;\n }\n elseif($e[2] == \"L\")\n {\n $h = 12;\n }\n elseif($e[2] == \"M\")\n {\n $h = 13;\n }\n elseif($e[2] == \"N\")\n {\n $h = 14;\n }\n elseif($e[2] == \"O\")\n {\n $h = 15;\n }\n elseif($e[2] == \"P\")\n {\n $h = 16;\n }\n elseif($e[2] == \"Q\")\n {\n $h = 17;\n }\n elseif($e[2] == \"R\")\n {\n $h = 18;\n }\n elseif($e[2] == \"S\")\n {\n $h = 19;\n }\n elseif($e[2] == \"T\")\n {\n $h = 20;\n }\n elseif($e[2] == \"U\")\n {\n $h = 21;\n }\n elseif($e[2] == \"V\")\n {\n $h = 22;\n }\n elseif($e[2] == \"W\")\n {\n $h = 23;\n }\n elseif($e[2] == \"X\")\n {\n $h = 24;\n }\n elseif($e[2] == \"Y\")\n {\n $h = 25;\n }\n elseif($e[2] == \"Z\")\n {\n $h = 26;\n }\n if($e[3] == \"A\")\n {\n $i = 1;\n }\n elseif($e[3] == \"B\")\n {\n $i = 2;\n }\n elseif($e[3] == \"C\")\n {\n $i = 3;\n }\n elseif($e[3] == \"D\")\n {\n $i = 4;\n }\n elseif($e[3] == \"E\")\n {\n $i = 5;\n }\n elseif($e[3] == \"F\")\n {\n $i = 6;\n }\n elseif($e[3] == \"G\")\n {\n $i = 7;\n }\n elseif($e[3] == \"H\")\n {\n $i = 8;\n }\n elseif($e[3] == \"I\")\n {\n $i = 9;\n }\n elseif($e[3] == \"J\")\n {\n $i = 10;\n }\n elseif($e[3] == \"K\")\n {\n $i = 11;\n }\n elseif($e[3] == \"L\")\n {\n $i = 12;\n }\n elseif($e[3] == \"M\")\n {\n $i = 13;\n }\n elseif($e[3] == \"N\")\n {\n $i = 14;\n }\n elseif($e[3] == \"O\")\n {\n $i = 15;\n }\n elseif($e[3] == \"P\")\n {\n $i = 16;\n }\n elseif($e[3] == \"Q\")\n {\n $i = 17;\n }\n elseif($e[3] == \"R\")\n {\n $i = 18;\n }\n elseif($e[3] == \"S\")\n {\n $i = 19;\n }\n elseif($e[3] == \"T\")\n {\n $i = 20;\n }\n elseif($e[3] == \"U\")\n {\n $i = 21;\n }\n elseif($e[3] == \"V\")\n {\n $i = 22;\n }\n elseif($e[3] == \"W\")\n {\n $i = 23;\n }\n elseif($e[3] == \"X\")\n {\n $i = 24;\n }\n elseif($e[3] == \"Y\")\n {\n $i = 25;\n }\n elseif($e[3] == \"Z\")\n {\n $i = 26;\n }\n if($e[4] == \"A\")\n {\n $j = 1;\n }\n elseif($e[4] == \"B\")\n {\n $j = 2;\n }\n elseif($e[4] == \"C\")\n {\n $j = 3;\n }\n elseif($e[4] == \"D\")\n {\n $j = 4;\n }\n elseif($e[4] == \"E\")\n {\n $j = 5;\n }\n elseif($e[4] == \"F\")\n {\n $j = 6;\n }\n elseif($e[4] == \"G\")\n {\n $j = 7;\n }\n elseif($e[4] == \"H\")\n {\n $j = 8;\n }\n elseif($e[4] == \"I\")\n {\n $j = 9;\n }\n elseif($e[4] == \"J\")\n {\n $j = 10;\n }\n elseif($e[4] == \"K\")\n {\n $j = 11;\n }\n elseif($e[4] == \"L\")\n {\n $j = 12;\n }\n elseif($e[4] == \"M\")\n {\n $j = 13;\n }\n elseif($e[4] == \"N\")\n {\n $j = 14;\n }\n elseif($e[4] == \"O\")\n {\n $j = 15;\n }\n elseif($e[4] == \"P\")\n {\n $j = 16;\n }\n elseif($e[4] == \"Q\")\n {\n $j = 17;\n }\n elseif($e[4] == \"R\")\n {\n $j = 18;\n }\n elseif($e[4] == \"S\")\n {\n $j = 19;\n }\n elseif($e[4] == \"T\")\n {\n $j = 20;\n }\n elseif($e[4] == \"U\")\n {\n $j = 21;\n }\n elseif($e[4] == \"V\")\n {\n $j = 22;\n }\n elseif($e[4] == \"W\")\n {\n $j = 23;\n }\n elseif($e[4] == \"X\")\n {\n $j = 24;\n }\n elseif($e[4] == \"Y\")\n {\n $j = 25;\n }\n elseif($e[4] == \"Z\")\n {\n $j = 26;\n }\n $r = $f * 456976 + $t * 17576 + $h * 676 + $i * 26 + $j;\n } \n $s = substr($b, strlen($e));\n if($x == $a)\n {\n print \"R\" . $s . \"C\" . $r;\n }\n else\n {\n print \"R\" . $s . \"C\" . $r . \"\\n\";\n } \n }\n}\n?>"}, {"source_code": "=0; $j--)\n {\n $outC += (ord($c[$j])-64)*$d;\n $d*=26;\n }\n\n print_r(sprintf('R%sC%s', $outR, $outC));\n}\n\nfunction toCR($r, $c)\n{\n $outR = $r;\n $outC = '';\n\n while($c)\n {\n $outC = chr(65 + ($c-1)%26) . $outC;\n $c = (integer)(($c - ($c-1)%26)/26);\n }\n\n print_r(sprintf('%s%s', $outC, $outR));\n}"}, {"source_code": "0)echo \"\\n\";\n\t$input = $inputs[$i];\n\tif (!preg_match('/R(\\d+)C(\\d+)/',\n $input))\n\t{\n\t \techo convertS1($input);\n\t}\n\telse\n\t{\n\t\techo convertS2($input);\n\t}\n\n}\n"}, {"source_code": "[[:upper:]]+)(? [[:digit:]]+)$/\", $coords, $matches)) {\n echo \"R\";\n echo $matches[\"row\"];\n echo \"C\";\n echo to_numbers($matches[\"letter_column\"]);\n } // RXCY system to Excel system\n elseif (preg_match(\"/^R(?
[[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches)) {\n echo to_letters(intval($matches[\"column\"]));\n echo $matches[\"row\"];\n } else {\n var_dump($coords);\n preg_match(\"/^R(? [[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches);\n var_dump($matches);\n }\n\n if ($i < $n - 1) {\n echo PHP_EOL;\n }\n}\n\n/**\n * @param string $letters\n *\n * @return int $letters represented as a number\n */\nfunction to_numbers($letters) {\n return array_reduce(str_split($letters), function($sum, $letter) {\n return $sum * 26 + ord($letter) - 64;\n });\n}\n\n/**\n * @param int $n\n *\n * @return string $n represented with letters\n */\nfunction to_letters($n) {\n ob_start();\n\n while ($n > 26) {\n echo to_letter($n);\n $n /= 26;\n }\n\n echo to_letter($n);\n\n return strrev(ob_get_clean());\n}\n\n/**\n * @param int $n\n *\n * @return string\n */\nfunction to_letter($n) {\n return chr($n % 26 + 64);\n}"}, {"source_code": "47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$first = substr($string, 1, $i-1);\n\t\t\t\t\t$second = substr($string, $i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$second = strrev(numToLet($second));\n\t\t$res = $second.$first;\n\t\treturn $res;\n\t\t\n\t}\n\t\n\tfunction conv ($string) {\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first = substr($string, 0, $i-1);\n\t\t\t\t$second = substr($string, $i-1);\n\t\t\t}\n\t\t}\n\t\t$first = letToNum($first);\n\t\t$res = 'R'.$second.'C'.$first;\n\t\treturn $res;\n\t}\n\t\n\tfunction detect ($string) {\n\t\t\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$second_marker = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($second_marker == 1) {\n\t\t\treturn conv2($string);\n\t\t}\n\t\telse {\n\t\t\treturn conv($string);\n\t\t}\n\t\t\n\t}\n\t\n\tfunction numToLet ($num){\n\t\t$raz = 1;\n\t\t$newnum = $num;\n\t\twhile (($newnum/26)>1) {\n\t\t\t$raz++;\n\t\t\t$newnum /= 26;\n\t\t}\n\t\t$newnum = $num;\n\t\t$res = '';\n\t\tfor ($i=0;$i<$raz;$i++) {\n\t\t\t$cur = $newnum%26;\n\t\t\tswitch ($cur) {\n\t\t\t\tcase 1: $res = $res.'A'; break;\n\t\t\t\tcase 2: $res = $res.'B'; break;\n\t\t\t\tcase 3: $res = $res.'C'; break;\n\t\t\t\tcase 4: $res = $res.'D'; break;\n\t\t\t\tcase 5: $res = $res.'E'; break;\n\t\t\t\tcase 6: $res = $res.'F'; break;\n\t\t\t\tcase 7: $res = $res.'G'; break;\n\t\t\t\tcase 8: $res = $res.'H'; break;\n\t\t\t\tcase 9: $res = $res.'I'; break;\n\t\t\t\tcase 10: $res = $res.'J'; break;\n\t\t\t\tcase 11: $res = $res.'K'; break;\n\t\t\t\tcase 12: $res = $res.'L'; break;\n\t\t\t\tcase 13: $res = $res.'M'; break;\n\t\t\t\tcase 14: $res = $res.'N'; break;\n\t\t\t\tcase 15: $res = $res.'O'; break;\n\t\t\t\tcase 16: $res = $res.'P'; break;\n\t\t\t\tcase 17: $res = $res.'Q'; break;\n\t\t\t\tcase 18: $res = $res.'R'; break;\n\t\t\t\tcase 19: $res = $res.'S'; break;\n\t\t\t\tcase 20: $res = $res.'T'; break;\n\t\t\t\tcase 21: $res = $res.'U'; break;\n\t\t\t\tcase 22: $res = $res.'V'; break;\n\t\t\t\tcase 23: $res = $res.'W'; break;\n\t\t\t\tcase 24: $res = $res.'X'; break;\n\t\t\t\tcase 25: $res = $res.'Y'; break;\n\t\t\t\tcase 0: $res = $res.'Z'; break;\n\t\t\t}\n\t\t\t$newnum/=26;\n\t\t}\n\t\treturn $res;\n\t}\n\t\n\t\n\tfunction letToNum ($let){\n\t\t$sum = 0;\n\t\tfor ($i=0;$i "}, {"source_code": "0)echo \"\\n\";\n\t$input = $inputs[$i];\n\tif (!preg_match('/R(\\d+)C(\\d+)/',\n $input))\n\t{\n\t \techo convertS1($input);\n\t}\n\telse\n\t{\n\t\techo convertS2($input);\n\t}\n\n}\n"}, {"source_code": "\ufeff=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfunction char_cifr($a1,$a2) {\n\tfor($i=0;$i =1) {\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\n\t\tif (preg_match('/^[R]([1-9]{1}\\d{0,5}[0]{0,1})[C]([1-9]{1}\\d{0,5}[0]{0,1})$/',$arr[$j],$matches)) {\n\t\t\t$arr[$j] = cifr_char($matches[2],$matches[1]);\n\t\t} elseif(preg_match('/^([A-Z]{1,4}[A-N]{0,1})(\\d{1,6}[0]{0,1})$/',$arr[$j],$matches))\n\t\t\t$arr[$j] = char_cifr($matches[1],$matches[2]);\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>\n"}, {"source_code": " 0) {\n $mod[] = bcmod($sub,26);\n $sub = bcdiv($sub,26);\n }\n\n $count = count($mod);\n $column = '';\n $tmp = [];\n for ($i =0;$i< $count;$i++) {\n $now = $mod[$i];\n if ($mod[$i] == 0) {\n $tmp[$i] = true;\n $now = 26;\n }\n\n if ($tmp !== null and $tmp[$i-1]) {\n if ($now == 0){\n $now = 26;\n }\n $now = bcsub($now,1);\n if ($now < 0) {\n $now = 26 + $now;\n }\n if ($now == 0) {\n $now = 26;\n $tmp[$i] = true;\n };\n }\n\n echo $now.\"\\n\";\n\n $column .= chr($now+64);\n }\n $column = strrev($column);\n return $column.$match[1];\n\n } elseif (preg_match(\"/([A-Z]+)(\\d+)/\",$str,$match)) {\n $len = strlen($match[1]);\n $num = 0; // \u5b57\u6bcd\u5e8f\u5217\u548c\n for ($i = 0; $i < $len; $i++) {\n $num = bcadd(bcmul(bcsub(ord($match[1][$i]),64),bcpow(26,bcsub($len,bcadd($i,1)))),$num);\n }\n return \"R\".$match[2].\"C\".$num;\n }\n}\n\n$line = 0;\nwhile ($data = fscanf(STDIN,\"%s\")) {\n if (!$line) {\n $line++;\n continue;\n }\n echo read_sheet($data[0]);\n echo \"\\n\";\n}"}, {"source_code": "b2: '.'R'.$a2.'C'.$b2;\n\t\t$arr[$j]='R'.$a2.'C'.$b2;\n\t\tunset($b2);\n\t\tunset($a1);\n\t\tunset($a2);\n\t\t\n\t} elseif(preg_match('/^R\\d+C\\d+$/',$string)) {\n\t\t// \ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd R23C55\n\t\tfor ($i=1;$i<7;$i++) {\n\t\t\tif (preg_match('/[C]/',$string[$i])) {\n\t\t\t\t$a2=substr($string,1,$i-1);\n\t\t\t\t$a1=substr($string,$i+1);\n\t\t\t\t$i=8;\n\t\t\t}\n\t\t}\n\t\twhile ($a1>=1) {\n\t\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t\t$b1 = 'Z'.$b1;\n\t\t\t\t$a1=floor($a1/26)-1;\n\t\t\t} else {\n\t\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t\t$a1=floor($a1/26);\n\t\t\t}\n\t\t}\n\t\t//echo $b1.$a2.'
';\n\t\t$arr[$j]=$b1.$a2;\n\t\tunset($b1);\n\t\tunset($a1);\n\t\tunset($a2);\n\t\t\n\t} else {\n\t\techo \"\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\";\n\t}\n}\n\nfor ($j=0;$j<$numzna4;$j++) {\n\tprintf(\"%s\\n\",$arr[$j]);\n}\n?>"}, {"source_code": "1 && ord($s[1])>=48 && ord($s[1])<=57) {\n $col=\"\";\n $row=\"\";\n $ff=\"r\"; \n for($j=1;$j26){\n if($i_row%26==0){\n $row.=\"A\";\n $i_row--;\n }else {\n $row.=chr($i_row%26+64);\n $i_row=floor($i_row/26);\n } \n } \n $row.=chr($i_row%26+64);\n echo strrev($row).$col;\n }else{\n $f_col=0; $f_row=0; \n $col=0;\n $row=0; \n for($j=strlen($s)-1;$j>=0;$j--){\n //echo $s[$j];\n if (ord($s[$j])>=48 && ord($s[$j])<=57){\n $col+=pow(10,$f_col)*intval($s[$j]);\n $f_col++;\n }else{\n $row+=pow(26,$f_row)*(ord($s[$j])-64);\n $f_row++;\n }\n }\n echo \"R\".$col.\"C\".$row; \n }\n \n echo \"\\n\"; \n }\n \n?>\n"}, {"source_code": " 1) {\n $result .= chr(round($param / 26) + ord(\"A\") - 1);\n }\n if ($param % 26 > 0) {\n $result .= chr(round($param % 26) + ord(\"A\") - 1);\n }\n}\n\nfunction mytoint($param, &$result) {\n $result = 0; \n for ($index = 0; $index < strlen($param); $index++) {\n $result += (ord($param[$index]) - ord(\"A\") + 1) * pow(26, (strlen($param) - $index - 1));\n }\n}\n\n?>\n"}, {"source_code": " 0) {\n $d1 = chr(($s2 - 1) % 26 + 65) . $d1;\n $s2 = floor($s2 / 26);\n //echo \"--$s2 $d1\\n\";\n }\n echo \"$d1$s[1]\\n\";\n //print_r ($s);\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n //echo \"$j $re\\n\";\n }\n $d1 = intval($d[count($d) - 1]);\n //print_r($l1);\n //print_r($d);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n?>"}, {"source_code": "=48&&ord($var)<=57)\n return true;\n else\n return false;\n}\nfunction GetInt($var)\n{\n $res=\"\";\n for($i=1;$i =0;$i--)\n {\n // echo \"$i ~~\".$var[$i];\n if(IsInt($var[$i]))\n {\n $res.=$var[$i];\n }\n else {\n // echo \"RES=\".$res;\n return strrev($res);\n }\n }\n}\n\n$map=array();\n$map2=array();\n$index=1;\nfor($i=65;$i<=90;$i++)\n{\n $map[chr($i)]=$index;\n $map2[$index]=chr($i);\n $index++;\n}\nfor($i=65;$i<=90;$i++)\n{\n for($ii=65;$ii<=90;$ii++)\n {\n $map[chr($i).chr($ii)]=$index;\n $map2[$index]=chr($i).chr($ii);\n $index++;\n }\n}\n\n//print_r($map);\n//print_r($map2);\n\n\nwhile($n--)\n{\nfscanf(STDIN,\"%s\",$str);\n //$str=$n==1?\"R12C4\":\"R5C255\";\n //echo \"::\".$str[1];\n if($str[0]=='R'&& IsInt($str[1]))\n {\n // echo \"$str is type 1\"; R23C55\n // echo GetInt($str);\n // echo \"~~~\";\n $a=GetInt($str);\n $b=GetInt_D($str);\n// echo $a.\"~~~\".$b;\n echo $map2[$b].$a.\"\\n\";\n\n\n\n }\n else {\n // echo \"$str is type 2\";BC23\n $a=\"\";\n for($i=0;$i \n"}, {"source_code": "1 && ord($s[1])>=48 && ord($s[1])<=57) {\n $col=\"\";\n $row=\"\";\n $ff=\"r\"; \n for($j=1;$j 26){\n if($i_row%26==0){\n $row.=\"A\";\n $i_row--;\n }else {\n $row.=chr($i_row%26+64);\n $i_row=floor($i_row/26);\n } \n } \n $row.=chr($i_row%26+64);\n echo strrev($row).$col;\n }else{\n $f_col=0; $f_row=0; \n $col=0;\n $row=0; \n for($j=strlen($s)-1;$j>=0;$j--){\n //echo $s[$j];\n if (ord($s[$j])>=48 && ord($s[$j])<=57){\n $col+=pow(10,$f_col)*intval($s[$j]);\n $f_col++;\n }else{\n $row+=pow(26,$f_row)*(ord($s[$j])-64);\n $f_row++;\n }\n }\n echo \"R\".$col.\"C\".$row; \n }\n \n echo \"\\n\"; \n }\n \n?>\n"}, {"source_code": " 0) {\n $mod[] = bcmod($sub,26);\n $sub = bcdiv($sub,26);\n }\n\n $count = count($mod);\n $column = '';\n $tmp = [];\n for ($i =0;$i< $count;$i++) {\n $now = $mod[$i];\n if ($mod[$i] == 0) {\n $tmp[$i] = true;\n $now = 26;\n }\n\n if ($tmp !== null and $tmp[$i-1]) {\n if ($now == 0){\n $now = 26;\n }\n $now = bcsub($now,1);\n if ($now < 0) {\n $now = 26 + $now;\n }\n if ($now == 0) {\n $now = 26;\n $tmp[$i] = true;\n };\n }\n\n echo $now.\"\\n\";\n\n $column .= chr($now+64);\n }\n $column = strrev($column);\n return $column.$match[1];\n\n } elseif (preg_match(\"/([A-Z]+)(\\d+)/\",$str,$match)) {\n $len = strlen($match[1]);\n $num = 0; // \u5b57\u6bcd\u5e8f\u5217\u548c\n for ($i = 0; $i < $len; $i++) {\n $num = bcadd(bcmul(bcsub(ord($match[1][$i]),64),bcpow(26,bcsub($len,bcadd($i,1)))),$num);\n }\n return \"R\".$match[2].\"C\".$num;\n }\n}\n\n$line = 0;\nwhile ($data = fscanf(STDIN,\"%s\")) {\n if (!$line) {\n $line++;\n continue;\n }\n echo read_sheet($data[0]);\n echo \"\\n\";\n}"}, {"source_code": "1){\n if(($c%26)!=0){\n $col.= chr(($c%26)+ord(A)-1);\n $c-=$c%26;\n $c/=26;\n if($c==1) $col.='A';\n }else{\n $cuo=$c/26;\n $col.=chr($cuo+ord(A)-1);\n $c/=26;\n }\n }\n \n $col=strrev($col);\n echo \"$col\".\"$r\".\"\\n\";\n \n }\n}\n\n?>"}, {"source_code": " \"0\",\n \"A\" => \"1\",\n \"B\" => \"2\",\n \"C\" => \"3\",\n \"D\" => \"4\",\n \"E\" => \"5\",\n \"F\" => \"6\",\n \"G\" => \"7\",\n \"H\" => \"8\",\n \"I\" => \"9\",\n \"J\" => \"A\",\n \"K\" => \"B\",\n \"L\" => \"C\",\n \"M\" => \"D\",\n \"N\" => \"E\",\n \"O\" => \"F\",\n \"P\" => \"G\",\n \"Q\" => \"H\",\n \"R\" => \"I\",\n \"S\" => \"J\",\n \"T\" => \"K\",\n \"U\" => \"L\",\n \"V\" => \"M\",\n \"W\" => \"N\",\n \"X\" => \"O\",\n \"Y\" => \"P\",\n \"Z\" => \"Q\");\n\n$letters = array(\n \"0\" => \"0\",\n \"1\" => \"1\",\n \"2\" => \"2\",\n \"3\" => \"3\",\n \"4\" => \"4\",\n \"5\" => \"5\",\n \"6\" => \"6\",\n \"7\" => \"7\",\n \"8\" => \"8\",\n \"9\" => \"9\",\n \"10\" => \"A\",\n \"11\" => \"B\",\n \"12\" => \"C\",\n \"13\" => \"D\",\n \"14\" => \"E\",\n \"15\" => \"F\",\n \"16\" => \"G\",\n \"17\" => \"H\",\n \"18\" => \"I\",\n \"19\" => \"J\",\n \"20\" => \"K\",\n \"21\" => \"L\",\n \"22\" => \"M\",\n \"23\" => \"N\",\n \"24\" => \"O\",\n \"25\" => \"P\",\n \"26\" => \"Q\");\n\n$newcells = array();\n\nfunction mybase26($number) { //something funky that takes out the zeros and replaces them with \"Z\"s (non-existent in base 26) and decrements the next highest place value\n //coming from base 10\n global $letters;\n $places = array();\n $places[4] = 0;\n $places[3] = 0;\n $places[2] = 0;\n $places[1] = 0;\n $places[0] = 0;\n //the number can't have a fives place since it's smaller than 10^6\n //yes we're brute forcing here\n if ($number > 456976) { //notice how we're not using >=, this is so that we don't reach a zero and we can use the Zs. In a normal conversion function this would take out allll the 456976s possible, here, we leave one, if there's one left.\n do {\n $number = $number - 456976; //26^4\n $places[4]++;\n } while ($number > 456976);\n }\n if ($number > 17576) { \n do {\n $number = $number - 17576; //26^3\n $places[3]++;\n } while ($number > 17576);\n }\n if ($number > 676) {\n do {\n $number = $number - 676;\n $places[2]++;\n } while ($number > 676);\n }\n if ($number > 26) {\n do {\n $number = $number - 26;\n $places[1]++;\n } while ($number > 26);\n }\n if ($number <= 26) { //because we close this baby out and take it all home in the last place, we use <= here.\n $places[0] = $number;\n }\n \n\n //okay okay I know I'm being inefficient with my loops here\n if ($places[3] == 0 && $places[4] > 0) {\n $places[4]--;\n $places[3] = 26;\n }\n if ($places[2] == 0 && $places[3] > 0) {\n $places[3]--;\n $places[2] = 26;\n }\n if ($places[1] == 0 && $places[2] > 0) {\n $places[2]--;\n $places[1] = 26;\n }\n if ($places[0] == 0 && $places[1] > 0) {\n $places[1]--;\n $places[0] = 26;\n }\n\n //now we have the place values; just get them into letters if bigger than 9.\n $places[4] = $letters[$places[4]];\n $places[3] = $letters[$places[3]];\n $places[2] = $letters[$places[2]];\n $places[1] = $letters[$places[1]];\n $places[0] = $letters[$places[0]];\n\n return ltrim($places[4].$places[3].$places[2].$places[1].$places[0], \"0\");\n}\n\nfunction mybase10($number) { //with an array that includes Z = 26\n //from base 26\n global $letters;\n $explode = str_split($number);\n $power = 0; //of 26\n $sum = 0; //result\n\n foreach ($explode as $key => $value) { //convert from A to 10, for example\n $explode[$key] = array_search($value, $letters);\n }\n\n //tricky way of reversing number to start with zeros place and then increase\n $reversedAndReindexed = array_values(array_reverse($explode));\n $places = count($reversedAndReindexed);\n\n for ($i = 0; $i < $places; $i++) {\n $sum = $sum + (pow(26, $power) * $reversedAndReindexed[$i]); //learn something new everyday. pow is the base to exponent function. And to think I guessed it from my text editor.\n $power++;\n }\n\n return $sum;\n}\n\nfunction numbertoletter($number) {\n global $shiftover;\n $base26 = str_split(mybase26($number)); //get from base 10 to base 26\n $shift = \"\";\n foreach ($base26 as $value) { //now shift all the characters over to start at A instead of 1\n $shift .= array_search($value, $shiftover);\n }\n return $shift;\n}\n\nfunction lettertonumber($letter) {\n global $shiftover;\n $explode = str_split($letter);\n $shift = \"\";\n foreach ($explode as $value) { //shift all the characters over to start at 1 instead of A\n $shift .= $shiftover[$value];\n }\n\n $base10 = mybase10($shift);\n return $base10;\n}\n\n//main(), if you will\nfor ($i = 0; $i < $n; $i++) {\n $cell = trim(fgets(STDIN)); //$cell = $array[$i];\n if (preg_match(\"/R([0-9]+)C([0-9]+)/\", $cell, $matches) == TRUE) {\n $matches[2] = numbertoletter($matches[2]);\n $newcells[] = $matches[2].$matches[1];\n } else {\n preg_match(\"/([A-Z]+)([0-9]+)/\", $cell, $matches);\n $matches[1] = lettertonumber($matches[1]);\n $newcells[] = \"R\".$matches[2].\"C\".$matches[1];\n }\n}\n\nforeach ($newcells as $value) {\n echo $value.\"\\n\";\n}\n?>"}, {"source_code": "[[:upper:]]+)(? [[:digit:]]+)$/\", $coords, $matches)) {\n echo \"R\";\n echo $matches[\"row\"];\n echo \"C\";\n echo to_numbers($matches[\"letter_column\"]);\n } // RXCY system to Excel system\n elseif (preg_match(\"/^R(?
[[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches)) {\n echo to_letters(intval($matches[\"column\"]));\n echo $matches[\"row\"];\n } else {\n preg_match(\"/^R(? [0-9]+)C(?
[0-9]+)$/\", $coords, $matches);\n var_dump($matches);\n }\n\n if ($i < $n - 1) {\n echo PHP_EOL;\n }\n}\n\n/**\n * @param string $letters\n *\n * @return int $letters represented as a number\n */\nfunction to_numbers($letters) {\n return array_reduce(str_split($letters), function($sum, $letter) {\n return $sum * 26 + ord($letter) - 64;\n });\n}\n\n/**\n * @param int $n\n *\n * @return string $n represented with letters\n */\nfunction to_letters($n) {\n ob_start();\n\n while ($n > 26) {\n echo to_letter($n);\n $n /= 26;\n }\n\n echo to_letter($n);\n\n return strrev(ob_get_clean());\n}\n\n/**\n * @param int $n\n *\n * @return string\n */\nfunction to_letter($n) {\n return chr($n % 26 + 64);\n}"}, {"source_code": "47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$first = substr($string, 1, $i-1);\n\t\t\t\t\t$second = substr($string, $i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$second = strrev(numToLet($second));\n\t\t$res = $second.$first;\n\t\treturn $res;\n\t\t\n\t}\n\t\n\tfunction conv ($string) {\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first = substr($string, 0, $i-1);\n\t\t\t\t$second = substr($string, $i-1);\n\t\t\t}\n\t\t}\n\t\t$first = letToNum($first);\n\t\t$res = 'R'.$second.'C'.$first;\n\t\treturn $res;\n\t}\n\t\n\tfunction detect ($string) {\n\t\t\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$second_marker = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($second_marker == 1) {\n\t\t\treturn conv2($string);\n\t\t}\n\t\telse {\n\t\t\treturn conv($string);\n\t\t}\n\t\t\n\t}\n\t\n\tfunction numToLet ($num){\n\t\t$raz = 1;\n\t\t$newnum = $num;\n\t\twhile (($newnum/26)>1) {\n\t\t\t$raz++;\n\t\t\t$newnum /= 26;\n\t\t}\n\t\t$newnum = $num;\n\t\t$res = '';\n\t\tfor ($i=0;$i<$raz;$i++) {\n\t\t\t$cur = $newnum%26;\n\t\t\tswitch ($cur) {\n\t\t\t\tcase 1: $res = 'A'.$res; break;\n\t\t\t\tcase 2: $res = 'B'.$res; break;\n\t\t\t\tcase 3: $res = 'C'.$res; break;\n\t\t\t\tcase 4: $res = 'D'.$res; break;\n\t\t\t\tcase 5: $res = 'E'.$res; break;\n\t\t\t\tcase 6: $res = 'F'.$res; break;\n\t\t\t\tcase 7: $res = 'G'.$res; break;\n\t\t\t\tcase 8: $res = 'H'.$res; break;\n\t\t\t\tcase 9: $res = 'I'.$res; break;\n\t\t\t\tcase 10: $res = 'J'.$res; break;\n\t\t\t\tcase 11: $res = 'K'.$res; break;\n\t\t\t\tcase 12: $res = 'L'.$res; break;\n\t\t\t\tcase 13: $res = 'M'.$res; break;\n\t\t\t\tcase 14: $res = 'N'.$res; break;\n\t\t\t\tcase 15: $res = 'O'.$res; break;\n\t\t\t\tcase 16: $res = 'P'.$res; break;\n\t\t\t\tcase 17: $res = 'Q'.$res; break;\n\t\t\t\tcase 18: $res = 'R'.$res; break;\n\t\t\t\tcase 19: $res = 'S'.$res; break;\n\t\t\t\tcase 20: $res = 'T'.$res; break;\n\t\t\t\tcase 21: $res = 'U'.$res; break;\n\t\t\t\tcase 22: $res = 'V'.$res; break;\n\t\t\t\tcase 23: $res = 'W'.$res; break;\n\t\t\t\tcase 24: $res = 'X'.$res; break;\n\t\t\t\tcase 25: $res = 'Y'.$res; break;\n\t\t\t\tcase 0: $res = 'Z'.$res; break;\n\t\t\t}\n\t\t\tif ($cur==0){\n\t\t\t$newnum = floor($newnum/26)-1;\n\t\t\t}\n\t\t\telse {\n\t\t\t(int)$newnum/=26;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}\n\t\n\t\n\tfunction letToNum ($let){\n\t\t$sum = 0;\n\t\tfor ($i=0;$i "}, {"source_code": ""}, {"source_code": " 0) {\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$str = substr($str, $a1);\n\t\t$pattern = '/[0-9]/';\n\t\tpreg_match($pattern, $str, $matches);\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$result[] = substr($str, $a1);\t\n\t} else {\n\t\t$result[] = $str;\n\t}\n\treturn $result;\n}\n\nfunction changeSTN($a) {\n\t$leng = strlen($a);\n\t$result = 0;\n\tfor ($i = 0; $i < $leng; $i++) { \n\t\t$result += (ord($a[$i]) - 64) * pow(26, $leng - 1 - $i);\n\t}\n\treturn $result;\n}\n\nfunction changeNTS($a) {\n\t$result = \"\";\n\twhile ($a > 0) {\n\t\t$result .= chr(64 + $a % 26);\n\t\t$a = floor($a / 26);\n\t}\n\treturn strrev($result);\n}\n\nfunction change($str) {\n\t$str = tach($str);\n\tif (count($str) == 2) {\n\t\t$result = \"R\" . $str[1];\n\t\t$result .= \"C\" . changeSTN($str[0]);\n\t} else {\n\t\t$result = changeNTS((int)$str[3]);\n\t\t$result .= $str[1];\n\t}\n\treturn $result;\n}\n\nvar_dump($a);\n\nfor ($i = 0; $i < $n - 1; $i++) {\n\techo change($a[$i]) . \"\\n\";\n}\necho change($a[$n - 1]);\n\n\n\n\n"}, {"source_code": "=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfscanf(STDIN,\"%d\\n\",$numzna4);\n\nif ($numzna4<=pow(10,5) and $numzna4>=1) {\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\t\tif (preg_match('/^[A-Z]{1,4}[A-N]{0,1}\\d{1,6}[0]{0,1}$/',$arr[$j]))\n\t\t\t$arr[$j] = convert1($arr[$j]);\n\t\tif (preg_match('/^[R]\\d{1,6}[0]{0,1}[C]\\d{1,6}[0]{0,1}$/',$arr[$j]))\n\t\t\t$arr[$j] = convert2($arr[$j]);\n\t}\n\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>"}, {"source_code": ""}, {"source_code": " 26) && ($f <= 702))\n {\n $h = floor($f / 26);\n $i = $f % 26;\n if($i == 0)\n {\n $h -= 1;\n $i = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$i - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$i - 1] . $e . \"\\n\"; \n }\n }\n elseif(($f > 702) && ($f <= 18278))\n {\n $h = floor($f / 676);\n $i = $f % 676;\n $j = floor($i / 26);\n $k = $i % 26;\n if($k == 0)\n {\n $j -= 1;\n $k = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$k - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$k - 1] . $e . \"\\n\";\n }\n }\n elseif(($f > 18278) && ($f <= 493533))\n {\n $h = floor($f / 17576);\n $i = $f % 17576;\n $j = floor($i / 676);\n $k = $i % 676;\n $l = floor($k / 26);\n $m = $k % 26;\n if($m == 0)\n {\n $l -= 1;\n $m = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$m - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$m - 1] . $e . \"\\n\"; \n }\n }\n elseif(($f > 493533) && ($f <= 1000000))\n {\n $h = floor($f / 456976);\n $i = $f % 456976;\n $j = floor($i / 17576);\n $k = $i % 17576;\n $l = floor($k / 676);\n $m = $k % 676;\n $n = floor($m / 26);\n $o = $m % 26;\n if($o == 0)\n {\n $n -= 1;\n $o = 26;\n }\n if($x == $a)\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$n - 1] . $g[$o - 1] . $e; \n }\n else\n {\n print $g[$h - 1] . $g[$j - 1] . $g[$l - 1] . $g[$n - 1] . $g[$o - 1] . $e . \"\\n\";\n }\n }\n }\n else\n {\n if(is_numeric($b[1])) { $c = 1; }\n elseif(is_numeric($b[2])) { $c = 2; }\n elseif(is_numeric($b[3])) { $c = 3; }\n elseif(is_numeric($b[4])) { $c = 4; }\n elseif(is_numeric($b[5])) { $c = 5; }\n $d = substr($b, 0, $c); // \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\n $e = substr($b, $c); // \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438\n if(strlen($d) == 1)\n {\n $f = array_search($d, $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ($f + 1);\n }\n else\n {\n print \"R\" . $e . \"C\" . ($f + 1) . \"\\n\";\n }\n }\n elseif(strlen($d) == 2)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 26) + ($h + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 26) + ($h + 1)) . \"\\n\";\n }\n }\n elseif(strlen($d) == 3)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n $i = array_search($d[2], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 676) + (($h + 1) * 26) + ($i + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 676) + (($h + 1) * 26) + ($i + 1)) . \"\\n\";\n }\n }\n elseif(strlen($d) == 4)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n $i = array_search($d[2], $g);\n $j = array_search($d[3], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 17576) + (($h + 1) * 676) + (($i + 1) * 26) + ($j + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 17576) + (($h + 1) * 676) + (($i + 1) * 26) + ($j + 1)) . \"\\n\";\n }\n }\n elseif(strlen($d) == 5)\n {\n $f = array_search($d[0], $g);\n $h = array_search($d[1], $g);\n $i = array_search($d[2], $g);\n $j = array_search($d[3], $g);\n $k = array_search($d[4], $g);\n if($x == $a)\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 456976) + (($h + 1) * 17576) + (($i + 1) * 676) + (($j + 1) * 26) + ($k + 1));\n }\n else\n {\n print \"R\" . $e . \"C\" . ((($f + 1) * 456976) + (($h + 1) * 17576) + (($i + 1) * 676) + (($j + 1) * 26) + ($k + 1)) . \"\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " 25){\n $remainder = $col % 26;\n $col = $col / 26;\n array_push($indexes, $remainder);\n if ($col / 26 < 25){\n $col = floor($col);\n array_push($indexes, $col);\n }\n }\n }\n\n\n $rereversedIndexes = array_reverse($indexes);\n for ($i = 0; $i < sizeof($indexes); $i++){\n $normal = $normal.$alphabet[$rereversedIndexes[$i]];\n }\n\n print($normal.$row.\"\\n\");\n}\n\nfunction convertToRC($word){\n $rowNum = 0;\n\n $alphabet = [\n 'A' => 1,\n 'B' => 2,\n 'C' => 3,\n 'D' => 4,\n 'E' => 5,\n 'F' => 6,\n 'G' => 7,\n 'H' => 8,\n 'I' => 9,\n 'J' => 10,\n 'K' => 11,\n 'L' => 12,\n 'M' => 13,\n 'N' => 14,\n 'O' => 15,\n 'P' => 16,\n 'Q' => 17,\n 'R' => 18,\n 'S' => 19,\n 'T' => 20,\n 'U' => 21,\n 'V' => 22,\n 'W' => 23,\n 'X' => 24,\n 'Y' => 25,\n 'Z' => 26\n ];\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n for ($i = 0; $i < strlen($word); $i++){\n if(in_array($word[$i], $digits)){\n $index = $i;\n }\n }\n\n if($index == 1){\n $index = 2;\n }\n\n $rowRev = substr($word, 0, $index-1);\n $col = substr($word, $index-1);\n\n $row = strrev($rowRev);\n\n for($i = strlen($row)-1; $i >= 0; $i--){\n $rowNum += $alphabet[$row[$i]] * pow(26, $i);\n }\n\n print(\"R\".$col.\"C\".$rowNum.\"\\n\");\n}"}, {"source_code": " 26) {\n $letNum = floor($col / 26);\n $colCode .= chr(64 + $letNum);\n $col = $col % 26;\n }\n if ($col > 0) {\n $colCode .= chr(64 + $col);\n }\n $resultCode = $colCode . $digits[0];\n } else {\n $colArray = str_split($letters[0]);\n $colNum = 0;\n $power = 0;\n while ($let = array_pop($colArray)) {\n $colNum += (ord($let) - 64) * pow(26, $power++);\n }\n $resultCode = 'R' . $digits[0] . 'C' . $colNum;\n }\n echo \"$resultCode\\n\";\n }\n?>"}, {"source_code": " 0) {\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$str = substr($str, $a1);\n\t\t$pattern = '/[0-9]/';\n\t\tpreg_match($pattern, $str, $matches);\n\t\t$a1 = strpos($str, $matches[0]);\n\t\t$result[] = substr($str, 0, $a1);\n\t\t$result[] = substr($str, $a1);\t\n\t} else {\n\t\t$result[] = $str;\n\t}\n\treturn $result;\n}\n\nfunction changeSTN($a) {\n\t$leng = strlen($a);\n\t$result = 0;\n\tfor ($i = 0; $i < $leng; $i++) { \n\t\t$result += (ord($a[$i]) - 64) * pow(26, $leng - 1 - $i);\n\t}\n\treturn $result;\n}\n\nfunction changeNTS($a) {\n\t$result = \"\";\n\twhile ($a > 0) {\n\t\t$result .= chr(64 + $a % 26);\n\t\t$a = floor($a / 26);\n\t}\n\treturn strrev($result);\n}\n\nfunction change($str) {\n\t$str = tach($str);\n\tif (count($str) == 2) {\n\t\t$result = \"R\" . $str[1];\n\t\t$result .= \"C\" . changeSTN($str[0]);\n\t} else {\n\t\t$result = changeNTS((int)$str[3]);\n\t\t$result .= $str[1];\n\t}\n\treturn $result;\n}\n\necho $n;\nvar_dump($a);\n\nfor ($i = 0; $i < $n - 1; $i++) {\n\techo change($a[$i]) . \"\\n\";\n}\necho change($a[$n - 1]);\n\n\n\n\n"}, {"source_code": "[[:upper:]]+)(? [[:digit:]]+)$/\", $coords, $matches)) {\n echo \"R\";\n echo $matches[\"row\"];\n echo \"C\";\n echo to_numbers($matches[\"letter_column\"]);\n } // RXCY system to Excel system\n elseif (preg_match(\"/^R(?
[[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches)) {\n echo to_letters(intval($matches[\"column\"]));\n echo $matches[\"row\"];\n } else {\n preg_match(\"/^R(? [0-9]+)C(?
[0-9]+)$/\", $coords, $matches);\n var_dump($matches);\n }\n\n if ($i < $n - 1) {\n echo PHP_EOL;\n }\n}\n\n/**\n * @param string $letters\n *\n * @return int $letters represented as a number\n */\nfunction to_numbers($letters) {\n return array_reduce(str_split($letters), function($sum, $letter) {\n return $sum * 26 + ord($letter) - 64;\n });\n}\n\n/**\n * @param int $n\n *\n * @return string $n represented with letters\n */\nfunction to_letters($n) {\n ob_start();\n\n while ($n > 26) {\n echo to_letter($n);\n $n /= 26;\n }\n\n echo to_letter($n);\n\n return strrev(ob_get_clean());\n}\n\n/**\n * @param int $n\n *\n * @return string\n */\nfunction to_letter($n) {\n return chr($n % 26 + 64);\n}"}, {"source_code": "1 && ord($s[1])>=48 && ord($s[1])<=57) {\n $col=\"\";\n $row=\"\";\n $ff=\"r\"; \n for($j=1;$j 26){\n if($i_row%26==0){\n $row.=\"A\";\n $i_row--;\n }else {\n $row.=chr($i_row%26+64);\n $i_row=floor($i_row/26);\n } \n } \n $row.=chr($i_row%26+64);\n echo strrev($row).$col;\n }else{\n $f_col=0; $f_row=0; \n $col=0;\n $row=0; \n for($j=strlen($s)-1;$j>=0;$j--){\n //echo $s[$j];\n if (ord($s[$j])>=48 && ord($s[$j])<=57){\n $col+=pow(10,$f_col)*intval($s[$j]);\n $f_col++;\n }else{\n $row+=pow(26,$f_row)*(ord($s[$j])-64);\n $f_row++;\n }\n }\n echo \"R\".$col.\"C\".$row; \n }\n \n echo \"\\n\"; \n }\n \n?>\n"}, {"source_code": "[[:upper:]]+)(? [[:digit:]]+)$/\", $coords, $matches)) {\n echo \"R\";\n echo $matches[\"row\"];\n echo \"C\";\n echo to_numbers($matches[\"letter_column\"]);\n } // RXCY system to Excel system\n elseif (preg_match(\"/^R(?
[[:digit:]]+)C(?
[[:digit:]]+)$/\", $coords, $matches)) {\n echo to_letters(intval($matches[\"column\"]));\n echo $matches[\"row\"];\n } else {\n echo \"hi\";\n }\n\n if ($i < $n - 1) {\n echo PHP_EOL;\n }\n}\n\n/**\n * @param string $letters\n *\n * @return int $letters represented as a number\n */\nfunction to_numbers($letters) {\n return array_reduce(str_split($letters), function($sum, $letter) {\n return $sum * 26 + ord($letter) - 64;\n });\n}\n\n/**\n * @param int $n\n *\n * @return string $n represented with letters\n */\nfunction to_letters($n) {\n ob_start();\n\n while ($n > 26) {\n echo to_letter($n);\n $n /= 26;\n }\n\n echo to_letter($n);\n\n return strrev(ob_get_clean());\n}\n\n/**\n * @param int $n\n *\n * @return string\n */\nfunction to_letter($n) {\n return chr($n % 26 + 64);\n}"}, {"source_code": " 0) {\n $mod[] = bcmod($sub,26);\n $sub = bcdiv($sub,26);\n }\n\n $count = count($mod);\n $column = '';\n $tmp = null;\n for ($i =0;$i< $count;$i++) {\n $now = $mod[$i];\n if ($mod[$i] == 0) {\n $tmp = $i;\n $now = 26;\n }\n\n if ($tmp !== null and bcadd($tmp,1) == $i) {\n $now = bcsub($now,1);\n }\n\n $column .= chr($now+64);\n }\n $column = strrev($column);\n echo $column.$match[1];\n\n } elseif (preg_match(\"/([A-Z]+)(\\d+)/\",$str,$match)) {\n $len = strlen($match[1]);\n $num = 0; // \u5b57\u6bcd\u5e8f\u5217\u548c\n for ($i = 0; $i < $len; $i++) {\n $num = bcadd(bcmul(bcsub(ord($match[1][$i]),64),bcpow(26,bcsub($len,bcadd($i,1)))),$num);\n }\n echo \"R\".$match[2].\"C\".$num;\n }\n}\n\n$line = 0;\nwhile ($data = fscanf(STDIN,\"%s\")) {\n if (!$line) {\n $line++;\n continue;\n }\n read_sheet($data[0]);\n\n}"}, {"source_code": "=48&&ord($var)<=57)\n return true;\n else\n return false;\n}\nfunction IsType1($var)\n{\n $res=false;;\n for($i=1;$i =0;$i--)\n {\n if(IsInt($var[$i]))\n {\n $res.=$var[$i];\n }\n else {\n return strrev($res);\n }\n }\n}\n\n\nfunction conversion_int($var)\n{\n $res=\"\";\n while($var>26)\n {\n if($var%26!=0)\n $res.=chr(64+$var%26);\n else {\n $res.='Z';\n }\n $var=($var-$var%26)/26;\n }\n if($var!=0)\n $res.=chr(64+$var);\n return strrev($res);\n}\nfunction conversion_str($var)\n{\n $res=0;\n for($i=strlen($var)-1;$i>=0;$i--)\n {\n $temp=1;\n for($j=strlen($var)-1;$j>$i;$j--)\n {\n $temp*=26;\n }\n if($var[$i]!='Z')\n $res+=(ord($var[$i])-64)*$temp;\n }\n return $res;\n}\nwhile($n--)\n{\nfscanf(STDIN,\"%s\",$str);\n if($str[0]=='R'&& IsInt($str[1]) && IsType1($str))\n {\n $a=GetInt($str);\n $b=GetInt_D($str);\n echo conversion_int($b).$a.\"\\n\";\n }\n else {\n $a=\"\";\n for($i=0;$i \n"}, {"source_code": "\ufeff=1) {\n\t\tif (($a1-(floor($a1/26))*26)==0) {\n\t\t\t$b1 = 'Z'.$b1;\n\t\t\t$a1=floor($a1/26)-1;\n\t\t} else {\n\t\t\t$b1 = (chr(64+($a1-(floor($a1/26))*26))).$b1;\n\t\t\t$a1=floor($a1/26);\n\t\t}\n\t}\n\treturn $string=$b1.$a2;\n}\n\nfunction char_cifr($a1,$a2) {\n\tfor($i=0;$i =1) {\n\tfor ($j=1;$j<=$numzna4;$j++) {\n\t\tfscanf(STDIN,\"%s\\n\",$arr[$j]);\t\t\n\n\t\tif (preg_match('/^[R]([1-9]{1}\\d{0,5}[0]{0,1})[C]([1-9]{1}\\d{0,5}[0]{0,1})$/',$arr[$j],$matches)) {\n\t\t\t$arr[$j] = cifr_char($matches[2],$matches[1]);\n\t\t} elseif(preg_match('/^([A-Z]{1,4}[A-N]{0,1})(\\d{1,6}[0]{0,1})$/',$arr[$j],$matches))\n\t\t\t$arr[$j] = char_cifr($matches[1],$matches[2]);\n\t\tprintf(\"%s\\n\",$arr[$j]);\n\t}\n}\n?>\n"}, {"source_code": "1 && ord($s[1])>=48 && ord($s[1])<=57) {\n $col=\"\";\n $row=\"\";\n $ff=\"r\"; \n for($j=1;$j 26){\n $row.=chr($i_row%26+64);\n $i_row=floor($i_row/26);\n } \n $row.=chr($i_row%26+64);\n echo strrev($row).$col;\n }else{\n $f_col=0; $f_row=0; \n $col=0;\n $row=0; \n for($j=strlen($s)-1;$j>=0;$j--){\n //echo $s[$j];\n if (ord($s[$j])>=48 && ord($s[$j])<=57){\n $col+=pow(10,$f_col)*intval($s[$j]);\n $f_col++;\n }else{\n $row+=pow(26,$f_row)*(ord($s[$j])-64);\n $f_row++;\n }\n }\n echo \"R\".$col.\"C\".$row; \n }\n \n echo \"\\n\"; \n }\n \n?>\n"}, {"source_code": "47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$first = substr($string, 1, $i-1);\n\t\t\t\t\t$second = substr($string, $i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$second = numToLet($second);\n\t\t$res = $second.$first;\n\t\treturn $res;\n\t\t\n\t}\n\t\n\tfunction conv ($string) {\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first = substr($string, 0, $i-1);\n\t\t\t\t$second = substr($string, $i-1);\n\t\t\t}\n\t\t}\n\t\t$first = letToNum($first);\n\t\t$res = 'R'.$second.'C'.$first;\n\t\treturn $res;\n\t}\n\t\n\tfunction detect ($string) {\n\t\t\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$second_marker = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($second_marker == 1) {\n\t\t\treturn conv2($string);\n\t\t}\n\t\telse {\n\t\t\treturn conv($string);\n\t\t}\n\t\t\n\t}\n\t\n\tfunction numToLet ($num){\n\t\t$raz = 1;\n\t\t$newnum = $num;\n\t\twhile (($newnum/26)>1.0385) {\n\t\t\t$raz++;\n\t\t\t$newnum /= 26;\n\t\t}\n\t\t$newnum = $num;\n\t\t$res = '';\n\t\tfor ($i=0;$i<$raz;$i++) {\n\t\t\t$cur = $newnum%26;\n\t\t\tswitch ($cur) {\n\t\t\t\tcase 1: $res = 'A'.$res; break;\n\t\t\t\tcase 2: $res = 'B'.$res; break;\n\t\t\t\tcase 3: $res = 'C'.$res; break;\n\t\t\t\tcase 4: $res = 'D'.$res; break;\n\t\t\t\tcase 5: $res = 'E'.$res; break;\n\t\t\t\tcase 6: $res = 'F'.$res; break;\n\t\t\t\tcase 7: $res = 'G'.$res; break;\n\t\t\t\tcase 8: $res = 'H'.$res; break;\n\t\t\t\tcase 9: $res = 'I'.$res; break;\n\t\t\t\tcase 10: $res = 'J'.$res; break;\n\t\t\t\tcase 11: $res = 'K'.$res; break;\n\t\t\t\tcase 12: $res = 'L'.$res; break;\n\t\t\t\tcase 13: $res = 'M'.$res; break;\n\t\t\t\tcase 14: $res = 'N'.$res; break;\n\t\t\t\tcase 15: $res = 'O'.$res; break;\n\t\t\t\tcase 16: $res = 'P'.$res; break;\n\t\t\t\tcase 17: $res = 'Q'.$res; break;\n\t\t\t\tcase 18: $res = 'R'.$res; break;\n\t\t\t\tcase 19: $res = 'S'.$res; break;\n\t\t\t\tcase 20: $res = 'T'.$res; break;\n\t\t\t\tcase 21: $res = 'U'.$res; break;\n\t\t\t\tcase 22: $res = 'V'.$res; break;\n\t\t\t\tcase 23: $res = 'W'.$res; break;\n\t\t\t\tcase 24: $res = 'X'.$res; break;\n\t\t\t\tcase 25: $res = 'Y'.$res; break;\n\t\t\t\tcase 0: $res = 'Z'.$res; break;\n\t\t\t}\n\t\t\tif ($cur==0){\n\t\t\t$newnum = floor($newnum/26)-1;\n\t\t\t}\n\t\t\telse {\n\t\t\t$newnum/=26;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}\n\t\n\t\n\tfunction letToNum ($let){\n\t\t$sum = 0;\n\t\tfor ($i=0;$i "}, {"source_code": "47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$first = substr($string, 1, $i-1);\n\t\t\t\t\t$second = substr($string, $i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$second = strrev(numToLet($second));\n\t\t$res = $second.$first;\n\t\treturn $res;\n\t\t\n\t}\n\t\n\tfunction conv ($string) {\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first = substr($string, 0, $i-1);\n\t\t\t\t$second = substr($string, $i-1);\n\t\t\t}\n\t\t}\n\t\t$first = letToNum($first);\n\t\t$res = 'R'.$second.'C'.$first;\n\t\treturn $res;\n\t}\n\t\n\tfunction detect ($string) {\n\t\t\n\t\tfor ($i=0;$i 47 AND ord($string[$i])<58) {\n\t\t\t\t$first_marker = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($first_marker == 1) {\n\t\t\t\t\t$second_marker = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($second_marker == 1) {\n\t\t\treturn conv2($string);\n\t\t}\n\t\telse {\n\t\t\treturn conv($string);\n\t\t}\n\t\t\n\t}\n\t\n\tfunction numToLet ($num){\n\t\t$raz = 1;\n\t\t$newnum = $num;\n\t\twhile (($newnum/26)>1) {\n\t\t\t$raz++;\n\t\t\t$newnum /= 26;\n\t\t}\n\t\t$newnum = $num;\n\t\t$res = '';\n\t\tfor ($i=0;$i<$raz;$i++) {\n\t\t\t$cur = $newnum%26;\n\t\t\tswitch ($cur) {\n\t\t\t\tcase 1: $res = 'A'.$res; break;\n\t\t\t\tcase 2: $res = 'B'.$res; break;\n\t\t\t\tcase 3: $res = 'C'.$res; break;\n\t\t\t\tcase 4: $res = 'D'.$res; break;\n\t\t\t\tcase 5: $res = 'E'.$res; break;\n\t\t\t\tcase 6: $res = 'F'.$res; break;\n\t\t\t\tcase 7: $res = 'G'.$res; break;\n\t\t\t\tcase 8: $res = 'H'.$res; break;\n\t\t\t\tcase 9: $res = 'I'.$res; break;\n\t\t\t\tcase 10: $res = 'J'.$res; break;\n\t\t\t\tcase 11: $res = 'K'.$res; break;\n\t\t\t\tcase 12: $res = 'L'.$res; break;\n\t\t\t\tcase 13: $res = 'M'.$res; break;\n\t\t\t\tcase 14: $res = 'N'.$res; break;\n\t\t\t\tcase 15: $res = 'O'.$res; break;\n\t\t\t\tcase 16: $res = 'P'.$res; break;\n\t\t\t\tcase 17: $res = 'Q'.$res; break;\n\t\t\t\tcase 18: $res = 'R'.$res; break;\n\t\t\t\tcase 19: $res = 'S'.$res; break;\n\t\t\t\tcase 20: $res = 'T'.$res; break;\n\t\t\t\tcase 21: $res = 'U'.$res; break;\n\t\t\t\tcase 22: $res = 'V'.$res; break;\n\t\t\t\tcase 23: $res = 'W'.$res; break;\n\t\t\t\tcase 24: $res = 'X'.$res; break;\n\t\t\t\tcase 25: $res = 'Y'.$res; break;\n\t\t\t\tcase 0: $res = 'Z'.$res; break;\n\t\t\t}\n\t\t\tif ($cur==0){\n\t\t\t$newnum = floor($newnum/26)-1;\n\t\t\t}\n\t\t\telse {\n\t\t\t(int)$newnum/=26;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}\n\t\n\t\n\tfunction letToNum ($let){\n\t\t$sum = 0;\n\t\tfor ($i=0;$i "}, {"source_code": " 0) {\n $mod[] = bcmod($sub,26);\n $sub = bcdiv($sub,26);\n }\n\n $count = count($mod);\n $column = '';\n $tmp = null;\n for ($i =0;$i< $count;$i++) {\n $now = $mod[$i];\n if ($mod[$i] == 0) {\n $tmp = $i;\n $now = 26;\n }\n\n if ($tmp !== null and bcadd($tmp,1) == $i) {\n if ($now == 0){\n $now = 26;\n }\n $now = bcsub($now,1);\n }\n\n $column .= chr($now+64);\n }\n $column = strrev($column);\n echo $column.$match[1];\n\n } elseif (preg_match(\"/([A-Z]+)(\\d+)/\",$str,$match)) {\n $len = strlen($match[1]);\n $num = 0; // \u5b57\u6bcd\u5e8f\u5217\u548c\n for ($i = 0; $i < $len; $i++) {\n $num = bcadd(bcmul(bcsub(ord($match[1][$i]),64),bcpow(26,bcsub($len,bcadd($i,1)))),$num);\n }\n echo \"R\".$match[2].\"C\".$num;\n }\n}\n\n$line = 0;\nwhile ($data = fscanf(STDIN,\"%s\")) {\n if (!$line) {\n $line++;\n continue;\n }\n read_sheet($data[0]);\n echo \"\\n\";\n}"}, {"source_code": " 1)\n {\n $t = $param % 26;\n $result = chr($t + ord(\"A\") - 1) . $result;\n $param = floor($param / 26);\n } \n \n //R98C688\n}\n\nfunction mytoint($param, &$result) {\n $result = 0; \n for ($index = 0; $index < strlen($param); $index++) {\n $result += (ord($param[$index]) - ord(\"A\") + 1) * pow(26, (strlen($param) - $index - 1));\n }\n}\n\n?>\n"}, {"source_code": " 0) {\n $mod[] = bcmod($sub,26);\n $sub = bcdiv($sub,26);\n }\n\n $count = count($mod);\n $column = '';\n $tmp = [];\n for ($i =0;$i< $count;$i++) {\n $now = $mod[$i];\n if ($mod[$i] == 0) {\n $tmp[$i] = true;\n $now = 26;\n }\n\n if ($tmp !== null and $tmp[$i-1]) {\n if ($now == 0){\n $now = 26;\n }\n $now = bcsub($now,1);\n if ($now < 0) {\n $now = 26 + $now;\n }\n if ($now == 0) {\n $now = 26;\n $tmp[$i] = true;\n };\n }\n\n echo $now.\"\\n\";\n\n $column .= chr($now+64);\n }\n $column = strrev($column);\n return $column.$match[1];\n\n } elseif (preg_match(\"/([A-Z]+)(\\d+)/\",$str,$match)) {\n $len = strlen($match[1]);\n $num = 0; // \u5b57\u6bcd\u5e8f\u5217\u548c\n for ($i = 0; $i < $len; $i++) {\n $num = bcadd(bcmul(bcsub(ord($match[1][$i]),64),bcpow(26,bcsub($len,bcadd($i,1)))),$num);\n }\n return \"R\".$match[2].\"C\".$num;\n }\n}\n\n$line = 0;\nwhile ($data = fscanf(STDIN,\"%s\")) {\n if (!$line) {\n $line++;\n continue;\n }\n echo read_sheet($data[0]);\n echo \"\\n\";\n}"}, {"source_code": "=0; $i--, $j++) {\n $pos = strpos(LETTERS, $column[$i], 1);\n $columnNumber += $pos * (26 ** $j);\n }\n return 'R' . $row . 'C' . $columnNumber;\n}\n\nfunction rc2zz($column, $row) {\n $columnNumber = '';\n while ($column / 26 > 1) {\n $floor = (int)floor($column / 26);\n $mod = $column % 26;\n $columnNumber .= LETTERS[$mod];\n $column = $floor;\n }\n $ost = $column % 26;\n $columnNumber .= LETTERS[$ost];\n return strrev($columnNumber) . $row;\n}\n\n$n = fscanf(STDIN, '%u');\nwhile ($row = trim(fgets(STDIN))) {\n if (preg_match('~R(\\d+)C(\\d+)~', $row, $match)) {\n echo rc2zz($match[2], $match[1]);\n } elseif(preg_match('~([A-Z]+)(\\d+)~i', $row, $match)) {\n echo zz2rc($match[1], $match[2]);\n }\n echo PHP_EOL;\n}\n"}, {"source_code": " 25){\n $remainder = $col % 26;\n $col = $col / 26;\n array_push($indexes, $remainder);\n if ($col / 26 < 25){\n $col = floor($col);\n array_push($indexes, $col);\n }\n }\n }\n\n\n $rereversedIndexes = array_reverse($indexes);\n for ($i = 0; $i < sizeof($indexes); $i++){\n $normal = $normal.$alphabet[$rereversedIndexes[$i]];\n }\n\n print($normal.$row.\"\\n\");\n}\n\nfunction convertToRC($word){\n $rowNum = 0;\n\n $alphabet = [\n 'A' => 1,\n 'B' => 2,\n 'C' => 3,\n 'D' => 4,\n 'E' => 5,\n 'F' => 6,\n 'G' => 7,\n 'H' => 8,\n 'I' => 9,\n 'J' => 10,\n 'K' => 11,\n 'L' => 12,\n 'M' => 13,\n 'N' => 14,\n 'O' => 15,\n 'P' => 16,\n 'Q' => 17,\n 'R' => 18,\n 'S' => 19,\n 'T' => 20,\n 'U' => 21,\n 'V' => 22,\n 'W' => 23,\n 'X' => 24,\n 'Y' => 25,\n 'Z' => 26\n ];\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n for ($i = 0; $i < strlen($word); $i++){\n if(in_array($word[$i], $digits)){\n $index = $i;\n }\n }\n\n if($index == 1){\n $index = 2;\n }\n\n $rowRev = substr($word, 0, $index-1);\n $col = substr($word, $index-1);\n\n $row = strrev($rowRev);\n\n for($i = strlen($row)-1; $i >= 0; $i--){\n $rowNum += $alphabet[$row[$i]] * pow(26, $i);\n }\n\n print(\"R\".$col.\"C\".$rowNum.\"\\n\");\n}"}, {"source_code": "=0; $j--)\n {\n $outC += (ord($c[$j])-64)*$d;\n $d*=26;\n }\n\n printf('R%sC%s\\n', $outR, $outC);\n}\n\nfunction toCR($r, $c)\n{\n $outR = $r;\n $outC = '';\n\n while($c)\n {\n $outC = chr(65 + ($c-1)%26) . $outC;\n $c = (integer)(($c - ($c-1)%26)/26);\n }\n\n printf('%s%s\\n', $outC, $outR);\n}"}, {"source_code": "=0; $j--)\n {\n $outC += (ord($c[$j])-64)*$d;\n $d*=26;\n }\n\n printf('R%sC%s\\n', $outR, $outC);\n}\n\nfunction toCR($r, $c)\n{\n $outR = $r;\n $outC = '';\n\n while($c)\n {\n $outC = chr(65 + ($c-1)%26) . $outC;\n $c = (integer)(($c - ($c-1)%26)/26);\n }\n\n printf('%s%s\\n', $outC, $outR);\n}"}, {"source_code": "= 48 && ord($data[$i][1]) <= 57) {\n \t\t$column = '';\n \t\t$string = '';\n \t\t$flag = false;\n \t\tfor($j = 1; $j < strlen($data[$i]); $j++) {\n \t\t\tif($data[$i][$j] == 'C') {\n \t\t\t\t$flag = true;\n \t\t\t} else {\n \t\t\t\tif(!$flag) {\n \t\t\t\t\t$string .= $data[$i][$j];\n \t\t\t\t} else {\n \t\t\t\t\t$column .= $data[$i][$j];\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t$strColumn = '';\n \t\t$column = (int)$column;\n\n \t\tdo {\n \t\t\tif($column % 26 != 0) {\n\t \t\t\t$strColumn .= chr($column % 26 + 64);\n\t \t\t\t$column = floor($column / 26);\n\t \t\t} else {\n\t \t\t\t$strColumn .= chr($column + 64);\n\t \t\t}\n \t\t} while($column % 26 != 0);\n\n \t\t$data[$i] = strrev($strColumn) . $string;\n\n \t} else {\n \t\t$column = '';\n \t\t$string = '';\n \t\tfor($j = 0; $j = 65 && ord($data[$i][$j]) <= 90) {\n \t\t\t\t$column .= $data[$i][$j];\n \t\t\t} else {\n \t\t\t\t$string .= $data[$i][$j];\n \t\t\t}\n \t\t}\n\n \t\t$columnNum = 0;\n \t\tfor($j = strlen($column) - 1; $j >= 0; $j--) {\n \t\t\t$columnNum += (ord($column[$j]) - 64) * pow(26, strlen($column)-$j-1);\n \t\t}\n \t\t$data[$i] = 'R' . $string . 'C' . $columnNum;\n \t}\n }\n echo \"\\n\\n\";\n echo implode(\"\\n\", $data);\n?>\n"}, {"source_code": " 26;\n if ($continue) {\n $curr_num = $num % 26;\n $str = chr($curr_num + 64).$str;\n $num = floor($num / 26);\n } else {\n $str = chr($num + 64).$str;\n }\n } while ($continue);\n return $str;\n}\n\nfunction alpha_to_number($str) {\n $parts = str_split($str);\n $num = 0;\n for ($i = 0; $i < count($parts); $i++) {\n $num = $num * 26;\n $num += ord($parts[$i]) - 64;\n }\n return $num;\n}\n\nfunction convert_one($str) {\n $parts = preg_split(\"/\\d+/\", $str);\n if ($parts[0] === 'R' && $parts[1] === 'C') {\n // from RXCY\n $numbers = preg_split(\"/R|C/\", $str);\n $row = $numbers[1];\n $col = $numbers[2];\n printf(\"%s%d\", number_to_alpha($col), $row);\n } else {\n // to RXCY\n $col_str = $parts[0];\n $col = alpha_to_number($col_str);\n $row_parts = preg_split(\"/[A-Z]+/\", $str);\n $row = (int)$row_parts[1];\n printf(\"R%dC%d\", $row, $col);\n }\n}\n\nfscanf(STDIN, \"%d\", $n);\nfor ($i = 1; $i <= $n; $i++) {\n fscanf(STDIN, \"%s\", $str);\n convert_one($str);\n}\n?>"}, {"source_code": "\n"}, {"source_code": " 0) {\n $d1 = chr(($s2 - 1) % 26 + 65) . $d1;\n $s2 = floor($s2 / 26);\n //echo \"--$s2 $d1\\n\";\n }\n echo \"$d1$s[1]\\n\";\n //print_r ($s);\n }\n else {\n $l = preg_split('\"[0-9]\"',$r[$i]);\n $d = preg_split('\"[A-Z]\"',$r[$i]);\n\n $l1 = str_split($l[0]);\n $re = 0;\n for ($j = 0; $j < count($l1); $j++) {\n $re = 26 * $re + ord($l1[$j]) - 64;\n //echo \"$j $re\\n\";\n }\n $d1 = intval($d[count($d) - 1]);\n //print_r($l1);\n //print_r($d);\n echo \"R$d1\" . \"C$re\\n\";\n }\n}\n?>"}, {"source_code": "\n"}, {"source_code": " 0){\n $char = $column%26;\n $column = intval($column/26);\n $str = chr($char+64) . $str;\n }\n return $str.$row;\n}\n\nfunction convertCRtoRC($cell){\n $st = preg_match('/^([A-Z]+)([0-9]+)$/', $cell, $matches);\n $column = $matches[1];\n $row = $matches[2]; //not modified\n $chs = str_split($column);\n $count = strlen($column);\n $column = 0;\n foreach($chs as $ch){\n $column += (ord($ch) - 64) * pow(26, $count -1);\n $count--;\n }\n return 'R' . $row . 'C' . $column;\n} \n\nfunction convert($cell){\n $type = preg_match('/^R[0-9]+C[0-9]+$/', $cell, $matches);\n if($type === 1){\n return convertRCtoCR($cell);\n }\n \n return convertCRtoRC($cell);\n}\n\n$dir = fopen(\"php://stdin\", 'r');\n$cells = stream_get_contents($dir);\n\n$cells = explode(\"\\n\", $cells);\nfor($i=1;$i<=$cells[0];$i++){\n echo convert($cells[$i]).\"\\n\";\n}\n?>\n"}, {"source_code": " 1) {\n $result .= chr(round($param / 26) + ord(\"A\") - 1);\n }\n if ($param % 26 > 0) {\n $result .= chr(round($param % 26) + ord(\"A\") - 1);\n }\n}\n\nfunction mytoint($param, &$result) {\n $result = 0; \n for ($index = 0; $index < strlen($param); $index++) {\n $result += (ord($param[$index]) - ord(\"A\") + 1) * pow(26, (strlen($param) - $index - 1));\n }\n}\n\n?>\n"}, {"source_code": "1 && ord($s[1])>=48 && ord($s[1])<=57) {\n $col=\"\";\n $row=\"\";\n $ff=\"r\"; \n for($j=1;$j 26){\n $row.=chr($i_row%26+64);\n $i_row=floor($i_row/26);\n } \n $row.=chr($i_row%26+64);\n echo strrev($row).$col;\n }else{\n $f_col=0; $f_row=0; \n $col=0;\n $row=0; \n for($j=strlen($s)-1;$j>=0;$j--){\n //echo $s[$j];\n if (ord($s[$j])>=48 && ord($s[$j])<=57){\n $col+=pow(10,$f_col)*intval($s[$j]);\n $f_col++;\n }else{\n $row+=pow(26,$f_row)*(ord($s[$j])-64);\n $f_row++;\n }\n }\n echo \"R\".$col.\"C\".$row; \n }\n \n echo \"\\n\"; \n }\n \n?>\n"}], "src_uid": "910c0e650d48af22fa51ab05e8123709"} {"source_code": "\n\n$a = array();\n$b = array();\n//$fp = fopen('input.txt', 'r');\nfscanf(STDIN, \"%d %d\\n\", $n, $k);\n$a = explode(' ', fgets(STDIN));\n$b = explode(' ', fgets(STDIN));\n\n$l = 0; $r = PHP_INT_MAX;\nfor($i = 0; $i < 50; $i++){\n $m = ($l + $r)/2;\n $m = intval($m);\n if(can($m)){\n $l = $m;\n }else{\n $r = $m;\n }\n}\n\necho $l;\n\n\nfunction can($x){\n $need = 0;\n global $n, $a, $b, $k;\n for($i = 0; $i < $n; $i++){\n $need += max(0, $a[$i]*1*$x - $b[$i]);\n if($need > $k) return false;\n }\n\n return $need <= $k;\n}", "positive_code": [{"source_code": "\n\nnew Planning();\n\nclass Planning{\n\n private $n;\n private $k;\n private $a = array();\n private $b = array();\n private $inputFilename = '';\n\n public function __construct($inputFilename = 'input.txt')\n {\n $this->inputFilename = $inputFilename;\n $this->readData();\n echo $this->findSolution();\n }\n\n public function readData()\n {\n //$fp = fopen($this->inputFilename, 'r');\n fscanf(STDIN, \"%d %d\\n\", $this->n, $this->k);\n $this->a = explode(' ', fgets(STDIN));\n $this->b = explode(' ', fgets(STDIN));\n }\n\n private function findSolution()\n {\n $l = 0; $r = 1E+15;\n\n for($i = 0; $i < 50; $i++){\n $m = ($l + $r)/2;\n $m = (int)$m;\n if($this->can($m)){\n $l = $m;\n }else{\n $r = $m;\n }\n }\n\n return $l;\n }\n\n private function can($x)\n {\n $need = 0;\n for($i = 0; $i < $this->n; $i++){\n $need += max(0, $this->a[$i]*1*$x - $this->b[$i]);\n if($need > $this->k) return false;\n }\n\n return $need <= $this->k;\n }\n\n}"}, {"source_code": ""}], "negative_code": [{"source_code": "\n\n$a = array();\n$b = array();\n//$fp = fopen('input.txt', 'r');\nfscanf(STDIN, \"%d %d\\n\", $n, $k);\n$a = explode(' ', fgets(STDIN));\n$b = explode(' ', fgets(STDIN));\n\n$l = 0; $r = 10000000000;\nfor($i = 0; $i < 50; $i++){\n $m = (int)($l + $r)/2;\n if(can($m)){\n $l = $m;\n }else{\n $r = $m;\n }\n}\n\necho $l;\n\n\nfunction can($x){\n $need = 0;\n global $n, $a, $b, $k;\n for($i = 0; $i < $n; $i++){\n $need += max(0, $a[$i]*1*$x - $b[$i]);\n if($need > $k) return false;\n }\n\n return $need <= $k;\n}"}], "src_uid": "02bb7502135afa0f3bb26527427ba9e3"} {"source_code": "\n$str = trim(fgets(STDIN));\n\n$t = 0;\n\n$fcount = 0;\n\n$len = strlen($str);\nfor ($i = 0; $i < $len; $i++) {\n if ($str[$i] == \"F\") {\n $ti = $i - $fcount;\n $t = ($ti != 0) ? ($ti > $t) ? $ti : $t+1 : 0;\n $fcount++;\n }\n}\n\nprint $t;", "positive_code": [{"source_code": "\n$str = trim(fgets(STDIN));\n\n$t = 0;\n\n$fcount = 0;\n\n$len = strlen($str);\nfor ($i = 0; $i < $len; $i++) {\n if ($str[$i] == \"F\") {\n $ti = $i - $fcount;\n $t = ($ti != 0) ? ($ti > $t) ? $ti : $t+1 : 0;\n $fcount++;\n }\n}\n\nprint $t;"}], "negative_code": [{"source_code": "$str = trim(fgets(STDIN));\n //$str = \"MFMFM\";\n $needle = \"MF\";\n $replace = \"FM\";\n $seconds = 0;\n while(preg_match(\"/$needle/i\", $str)){\n $seconds++;\n $str = str_replace($needle, $replace, $str);\n }\n print $seconds;"}, {"source_code": "$str = trim(fgets(STDIN));\n $needle = \"MF\";\n $replace = \"FM\";\n $seconds = 0;\n $hasRotations = TRUE;\n while($hasRotations){\n $hasRotations = FALSE;\n for($i=0;$i t) ? $i - $fcount : $t+1;\n\t\t$fcount++;\n\t}\n}\n\nprint $t;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n//$str = \"MMFF\";\n$t = 0;\n\n$fcount = 0;\n\n$len = strlen($str);\nfor ($i = 0; $i < $len; $i++) {\n if ($str[$i] == \"F\") {\n $ti = $i - $fcount;\n $t = ($ti > $t) ? $ti : $t+1;\n $fcount++;\n }\n}\n\nprint $t;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n //$str = \"MFMFM\";\n $needle = \"MF\";\n $replace = \"FM\";\n $seconds = 0;\n \twhile(strripos($str, $needle)) {\n $seconds++;\n $str = str_replace($needle, $replace, $str);\n }\n print $seconds;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n //$str = \"MFMFM\";\n $needle = \"MF\";\n $replace = \"FM\";\n $seconds = 0;\n \twhile(stripos($str, $needle)) {\n $seconds++;\n $str = str_replace($needle, $replace, $str);\n }\n print $seconds;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n\n$t = 0;\n\n$fcount = 0;\n\n$len = strlen($str);\nfor ($i; $i >= $len; $i++) {\n if ($str[$i] == \"F\") {\n $t = (($i - $fcount) > t) ? $i - $fcount : $t++;\n $fcount++;\n }\n}\n\nprint $t;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n\n$t = 0;\n\n$fcount = 0;\n\n$len = strlen($str);\nfor ($i = 0; $i < $len; $i++) {\n\tif ($str[$i] == \"F\") {\n\t\t$t = (($i - $fcount) > t) ? $i - $fcount : $t++;\n\t\t$fcount++;\n\t}\n}\n\nprint $t;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n //$str = \"MFMFM\";\n $needle = \"MF\";\n $replace = \"FM\";\n $seconds = 0;\n \twhile(strpos($str, $needle)) {\n $seconds++;\n $str = str_replace($needle, $replace, $str);\n }\n print $seconds;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n\n$t = 0;\n\n$fcount = 0;\n\n$len = strlen($str);\nfor ($i = 0; $i >= $len; $i++) {\n\tif ($str[$i] == \"F\") {\n\t\t$t = (($i - $fcount) > t) ? $i - $fcount : $t++;\n\t\t$fcount++;\n\t}\n}\n\nprint $t;"}, {"source_code": "\n$str = trim(fgets(STDIN));\n\n$t = 0;\n\n$fcount = 0;\n\n$len = strlen($str);\nfor ($i = 0; $i < $len; $i++) {\n if ($str[$i] == \"F\") {\n $t = (($i - $fcount) > $t) ? $i - $fcount : $t++;\n $fcount++;\n }\n}\n\nprint $t;"}], "src_uid": "8423f334ef789ba1238d34f70e7cbbc8"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "=48 && ord($str3[$i])<=57)\n \t\techo \"$str3[$i]\";\n else if(ord($str3[$i])>=65&&ord($str3[$i])<=90)\n {\n\t\t\tfor ($j=0; $j "}, {"source_code": " $crap) {\n\t$pattern[\"$number\"] = \"$number\";\n}\nforeach ($keyboard_wrong as $index => $character) {\n\t$pattern[$keyboard_wrong[$index]] = $keyboard_correct[$index];\n\t$pattern[strtoupper($keyboard_wrong[$index])] = strtoupper($keyboard_correct[$index]);\n}\n\n$output = \"\";\nforeach ($problem_string as $index => $character) {\n\t$output .= $pattern[$character];\n}\n// echo $output;\nfwrite(STDOUT, $output);\n"}, {"source_code": ""}, {"source_code": " $crap) {\n\t$pattern[\"$number\"] = \"$number\";\n}\nforeach ($keyboard_wrong as $index => $character) {\n\t$pattern[$keyboard_wrong[$index]] = $keyboard_correct[$index];\n\t$pattern[strtoupper($keyboard_wrong[$index])] = strtoupper($keyboard_correct[$index]);\n}\n\n$output = \"\";\nforeach ($problem_string as $index => $character) {\n\t$output .= $pattern[$character];\n}\n// echo $output;\nfwrite(STDOUT, $output);\n"}], "src_uid": "d6f01ece3f251b7aac74bf3fd8231a80"} {"source_code": " 0; $i++) {\n\t\t$a[$i]->lw = $p;\n\t\t$p++;\n\t\t$m--;\n\t\t$a[$i]->lwc = true;\n\t\tif ($m > 0) {\n\t\t\t$a[$i]->rw = $p;\n\t\t\t$p++;\n\t\t\t$m--;\n\t\t\t$a[$i]->rwc = true;\n\t\t}\n\t}\n\tfor ($i = 0; $i < $n && $m > 0; $i++) {\n\t\t$a[$i]->l = $p;\n\t\t$p++;\n\t\t$m--;\n\t\t$a[$i]->lc = true;\n\t\tif ($m > 0) {\n\t\t\t$a[$i]->r = $p;\n\t\t\t$p++;\n\t\t\t$m--;\n\t\t\t$a[$i]->rc = true;\n\t\t}\n\t}\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($a[$i]->lc) {\n\t\t\techo $a[$i]->l;\n\t\t\techo ' ';\n\t\t}\n\t\tif ($a[$i]->lwc) {\n\t\t\techo $a[$i]->lw;\n\t\t\techo ' ';\n\t\t}\n\t\tif ($a[$i]->rc) {\n\t\t\techo $a[$i]->r;\n\t\t\techo ' ';\n\t\t}\n\t\tif ($a[$i]->rwc) {\n\t\t\techo $a[$i]->rw;\n\t\t\techo ' ';\n\t\t}\n\t}\n?> ", "positive_code": [{"source_code": ""}, {"source_code": " $m) {\n $result = null;\n $final++;\n }\n \n if ($result !== null) {\n $resultArray[] = $result; \n }\n}\necho implode($resultArray, ' ');\n?>"}], "negative_code": [{"source_code": " $m) {\n $result = null;\n $final++;\n }\n if ($result !== null) {\n $resultArray[] = $result; \n }\n}\necho implode($resultArray, ' ');\n?>"}, {"source_code": " $m) {\n $result = null;\n $final++;\n }\n \n if ($result !== null) {\n $resultArray[] = $result; \n }\n}\nvar_dump($resultArray);\necho implode($resultArray, ' ');\n?>"}, {"source_code": " $m) {\n $result = null;\n $final++;\n }\n \n if ($result !== null) {\n $resultArray[] = $result; \n }\n}\necho implode($resultArray, ' ');\n?>"}], "src_uid": "0a701242ca81029a1791df74dc8ca59b"} {"source_code": " $b[0]);\n $d = array($b[0] => TRUE);\n $e = 0;\n $f = 0;\n for($y = 1; $y < strlen($b); $y++)\n {\n if($d[$b[$y]] == FALSE)\n {\n $d[$b[$y]] = TRUE;\n if($c[$e + 1] == NULL)\n {\n $c[$e + 1] = $b[$y];\n $e++;\n }\n elseif($c[$e - 1] == NULL)\n {\n $c[$e - 1] = $b[$y];\n $e--;\n }\n elseif(($c[$e - 1] != $b[$y]) && ($c[$y + 1] != $b[$y]))\n {\n $f = 1;\n break;\n }\n }\n elseif($d[$b[$y]] == TRUE)\n {\n if($c[$e - 1] == $b[$y])\n {\n $e = $e - 1;\n }\n elseif($c[$e + 1] == $b[$y])\n {\n $e = $e + 1;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n $g = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n ksort($c);\n $h = array_diff($g, $c);\n print \"YES\\n\";\n print implode($c) . implode($h) . \"\\n\";\n }\n}\n?>", "positive_code": [{"source_code": "\n\n\n"}], "negative_code": [{"source_code": " $b[0]);\n $d = array($b[0] => TRUE);\n $e = 0;\n $f = 0;\n for($y = 1; $y < strlen($b); $y++)\n {\n if($d[$b[$y]] == FALSE)\n {\n $d[$b[$y]] = TRUE;\n if(($c[$e - 1] != $b[$y]) && ($c[$y + 1] != $b[$y]))\n {\n $f = 1;\n break;\n }\n elseif($c[$e + 1] == NULL)\n {\n $c[$e + 1] = $b[$y];\n $e++;\n }\n elseif($c[$e - 1] == NULL)\n {\n $c[$e - 1] = $b[$y];\n $e--;\n }\n }\n elseif($d[$b[$y]] == TRUE)\n {\n if($c[$e - 1] == $b[$y])\n {\n $e = $e - 1;\n }\n elseif($c[$e + 1] == $b[$y])\n {\n $e = $e + 1;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n $g = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n ksort($c);\n $h = array_diff($g, $c);\n print \"YES\\n\";\n print implode($c) . implode($h) . \"\\n\";\n }\n}\n?>"}, {"source_code": " $b[0]);\n $d = array($b[0] => TRUE);\n $e = 0;\n $f = 0;\n for($y = 1; $y < strlen($b); $y++)\n {\n if($d[$b[$y]] == FALSE)\n {\n $d[$b[$y]] = TRUE;\n if($c[$e + 1] == NULL)\n {\n $c[$e + 1] = $b[$y];\n $e++;\n }\n elseif($c[$e - 1] == NULL)\n {\n $c[$e - 1] = $b[$y];\n $e--;\n }\n }\n elseif($d[$b[$y]] == TRUE)\n {\n if($c[$e - 1] == $b[$y])\n {\n $e = $e - 1;\n }\n elseif($c[$e + 1] == $b[$y])\n {\n $e = $e + 1;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n $g = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n ksort($c);\n $h = array_diff($g, $c);\n print \"YES\\n\";\n print implode($c) . implode($h) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $b[0]);\n $d = array($b[0] => TRUE);\n $e = 0;\n $f = 0;\n for($y = 1; $y < strlen($b); $y++)\n {\n if($d[$b[$y]] == FALSE)\n {\n $d[$b[$y]] = TRUE;\n if($c[$e + 1] == NULL)\n {\n $c[$e + 1] = $b[$y];\n $e++;\n }\n elseif($c[$e - 1] == NULL)\n {\n $c[$e - 1] = $b[$y];\n $e--;\n }\n }\n elseif($d[$b[$y]] == TRUE)\n {\n if($c[$e - 1] == $b[$y])\n {\n $e = $e - 1;\n }\n elseif($c[$e + 1] == $b[$y])\n {\n $e = $e + 1;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n $g = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n ksort($c);\n $h = array_diff($g, $c);\n print \"YES\\n\";\n print implode($c) . implode($h) . \"\\n\";\n }\n}"}, {"source_code": " $b[0]);\n $d = array($b[0] => TRUE);\n $e = 0;\n $f = 0;\n for($y = 1; $y < strlen($b); $y++)\n {\n if($d[$b[$y]] == FALSE)\n {\n $d[$b[$y]] = TRUE;\n if($c[$e + 1] == NULL)\n {\n $c[$e + 1] = $b[$y];\n $e++;\n }\n elseif($c[$e - 1] == NULL)\n {\n $c[$e - 1] = $b[$y];\n $e--;\n }\n }\n elseif($d[$b[$y]] == TRUE)\n {\n if($c[$e - 1] == $b[$y])\n {\n $e = $e - 1;\n }\n elseif($c[$e + 1] == $b[$y])\n {\n $e = $e + 1;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n $g = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n ksort($c);\n $h = array_diff($g, $c);\n print \"YES\\n\";\n print implode($c) . implode($h) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $b[0]);\n $d = array($b[0] => TRUE);\n $e = 0;\n $f = 0;\n for($y = 1; $y < strlen($b); $y++)\n {\n if($d[$b[$y]] == FALSE)\n {\n $d[$b[$y]] = TRUE;\n if($c[$e + 1] == NULL)\n {\n $c[$e + 1] = $b[$y];\n $e++;\n }\n elseif($c[$e - 1] == NULL)\n {\n $c[$e - 1] = $b[$y];\n $e--;\n }\n }\n elseif($d[$b[$y]] == TRUE)\n {\n if($c[$e - 1] == $b[$y])\n {\n $e = $e - 1;\n }\n elseif($c[$e + 1] == $b[$y])\n {\n $e = $e + 1;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n $g = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n ksort($c);\n $h = array_diff($g, $c);\n print \"YES\\n\";\n print implode($c) . implode($h) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $b[0]);\n $d = array($b[0] => TRUE);\n $e = 0;\n $f = 0;\n for($y = 1; $y < strlen($b); $y++)\n {\n if($d[$b[$y]] == FALSE)\n {\n $d[$b[$y]] = TRUE;\n if($c[$e + 1] == NULL)\n {\n $c[$e + 1] = $b[$y];\n $e++;\n }\n elseif($c[$e - 1] == NULL)\n {\n $c[$e - 1] = $b[$y];\n $e--;\n }\n }\n elseif($d[$b[$y]] == TRUE)\n {\n if($c[$e - 1] == $b[$y])\n {\n $e = $e - 1;\n }\n elseif($c[$e + 1] == $b[$y])\n {\n $e = $e + 1;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n $g = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n ksort($c);\n $h = array_diff($g, $c);\n print implode($c) . implode($h) . \"\\n\";\n }\n}\n?>"}, {"source_code": "\n\n\n"}, {"source_code": "\n\n\n"}], "src_uid": "8fb62b497b6fb2a5fb4f2669aeb51b73"} {"source_code": " 0) && ($l[0] != 0))\n { \n $n = strpos($l, \".\");\n if($n == FALSE)\n {\n $h[$i] = $l;\n $i++;\n }\n else\n {\n $j[$k] = $l;\n $k++;\n }\n }\n else\n {\n $j[$k] = $l;\n $k++;\n }\n}\nif(count($h) == 0)\n{\n print \"-\\n\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($h) - 1; $x++)\n {\n $m .= $h[$x] . \",\";\n }\n $m .= $h[$x] . \"\\\"\";\n print $m . \"\\n\";\n}\nif(count($j) == 0)\n{\n print \"-\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n $m .= $j[$x] . \",\";\n }\n $m .= $j[$x] . \"\\\"\";\n print $m;\n}\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " 0) && ($l[0] != 0))\n { \n $n = intval($l);\n if(strlen($n) == strlen($l))\n {\n $h[$i] = $l;\n $i++;\n }\n else\n {\n $j[$k] = $l;\n $k++;\n }\n }\n else\n {\n $j[$k] = $l;\n $k++;\n }\n}\nif(count($h) == 0)\n{\n print \"-\\n\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($h) - 1; $x++)\n {\n $m .= $h[$x] . \",\";\n }\n $m .= $h[$x] . \"\\\"\";\n print $m . \"\\n\";\n}\nif(count($j) == 0)\n{\n print \"-\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n $m .= $j[$x] . \",\";\n }\n $m .= $j[$x] . \"\\\"\";\n print $m;\n}\n?>"}, {"source_code": " 0) && ($l[0] != 0))\n { \n $h[$i] = $l;\n $i++;\n }\n else\n {\n $j[$k] = $l;\n $k++;\n }\n}\nif(count($h) == 0)\n{\n print \"-\\n\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($h) - 1; $x++)\n {\n $m .= $h[$x] . \",\";\n }\n $m .= $h[$x] . \"\\\"\";\n print $m . \"\\n\";\n}\nif(count($j) == 0)\n{\n print \"-\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n $m .= $j[$x] . \",\";\n }\n $m .= $j[$x] . \"\\\"\";\n print $m;\n}\n?>"}, {"source_code": " 0) && ($l[0] != 0))\n { \n $h[$i] = $l;\n $i++;\n }\n else\n {\n $j[$k] = $l;\n $k++;\n }\n}\nif(count($h) == 0)\n{\n print \"-\\n\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($h) - 1; $x++)\n {\n $m .= $h[$x] . \",\";\n }\n $m .= $h[$x] . \"\\\"\";\n print $m . \"\\n\";\n}\nif(count($j) == 0)\n{\n print \"-\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n $m .= $j[$x] . \",\";\n }\n $m .= $j[$x] . \"\\\"\";\n print $m;\n}\n?>"}, {"source_code": " 0) && ($l[0] != 0))\n { \n $h[$i] = $l;\n $i++;\n }\n else\n {\n $j[$k] = $l;\n $k++;\n }\n}\nif(count($h) == 0)\n{\n print \"-\\n\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($h) - 1; $x++)\n {\n $m .= $h[$x] . \",\";\n }\n $m .= $h[$x] . \"\\\"\";\n print $m . \"\\n\";\n}\nif(count($j) == 0)\n{\n print \"-\";\n}\nelse\n{\n $m = \"\\\"\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n $m .= $j[$x] . \",\";\n }\n $m .= $j[$x] . \"\\\"\";\n print $m;\n}\n?>"}, {"source_code": ""}, {"source_code": "= 0][] = $e;\nfprintf(STDOUT, '\"%s\"\\n\"%s\"', implode(\",\" ,$arr[1]), implode(\",\" ,$arr[0]));\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 0][] = $e;\nfprintf(STDOUT, '\"%s\"'.\"\\n\".'\"%s\"', empty($arr[1]) ? \"-\" : implode(\",\" ,$arr[1]), empty($arr[0]) ? \"-\" : implode(\",\" ,$arr[0]));\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 0][] = $e;\nfprintf(STDOUT, '%s'.\"\\n\".'%s', empty($arr[1]) ? \"-\" : '\"'.implode(\",\" ,$arr[1]).'\"', empty($arr[0]) ? \"-\" : '\"'.implode(\",\" ,$arr[0]).'\"');\n?>"}, {"source_code": "= 0][] = $e;\nfprintf(STDOUT, '%s'.\"\\n\".'%s', empty($arr[1]) ? \"-\" : '\"'.implode(\",\" ,$arr[1]).'\"', empty($arr[0]) ? \"-\" : '\"'.implode(\",\" ,$arr[0]).'\"');\n?>"}, {"source_code": ""}, {"source_code": "= 0][] = $e;\nfprintf(STDOUT, '\"%s\"'.\"\\n\".'\"%s\"', implode(\",\" ,$arr[1]), implode(\",\" ,$arr[0]));\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": " $a){\n break;\n }\n if($h % 2 != 0 && $h % $f != 0 && $h % 10 != 0){\n echo $h.\"\\n\";\n $b = true;\n break;\n }\n }\n if(!$b){\n echo \"-1\\n\";\n }\n \n }\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1) {\r\n // for($i=0; $i<$tt-1; $i++) {\r\n // if($b[$i] > $b[$i + 1]) {\r\n \r\n // $ans = false;\r\n // break;\r\n // }\r\n // } \r\n // }\r\n // if(!$ans && $b[0] == min($b)) {\r\n // $ans = true;\r\n // }\r\n \r\n \r\n \r\n pr($ans ? $yes : $no);\r\n \r\n \r\n }\r\n// bcadd \u2014 Add two arbitrary precision numbers\r\n// bccomp \u2014 Compare two arbitrary precision numbers\r\n// bcdiv \u2014 Divide two arbitrary precision numbers\r\n// bcmod \u2014 Get modulus of an arbitrary precision number\r\n// bcmul \u2014 Multiply two arbitrary precision numbers\r\n// bcpow \u2014 Raise an arbitrary precision number to another\r\n// bcpowmod \u2014 Raise an arbitrary precision number to another, reduced by a specified modulus\r\n// bcscale \u2014 Set or get default scale parameter for all bc math functions\r\n// bcsqrt \u2014 Get the square root of an arbitrary precision number\r\n// bcsub \u2014 Subtract one arbitrary precision number from another\r\nfunction getDar($n) {\r\n $dar = [2];\r\n for($i=0; $i<$n; $i++) {\r\n $dar[] = $dar[$i] * 2;\r\n }\r\n return $dar;\r\n}\r\nfunction getDar2($n, $k) {\r\n if($k == 0) {\r\n return 1;\r\n }\r\n return bcmul($n, getDar2($n, $k-1));\r\n}\r\n\r\n \r\n function getT() {\r\n return trim(fgets(STDIN));\r\n }\r\n function getA() {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n \r\n function is_prime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n \t $d += 1;\r\n }\r\n \r\n return $d == $n;\r\n }\r\nfunction getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n \r\n function getMaxValueBc($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n function getRotate($a, $s, $e, $ind) {\r\n \t\t$ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n \t$ar[$i] = $a[$i];\r\n \t$j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n \t// echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\"; \r\n \t$a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n } \r\n function pr($s) {\r\n if(is_array($s)) {\r\n echo implode( ' ', $s), PHP_EOL;\r\n } else {\r\n echo $s, PHP_EOL;\r\n }\r\n }\r\n function fab2($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n \r\n return $a[$n];\r\n }\r\n \r\n function mergeSort($aArray) {\r\n if(count($aArray) <= 1) {\r\n return $aArray;\r\n }\r\n $aLeft = [];\r\n $aRight = [];\r\n $n =floor(count($aArray) / 2);\r\n for($i = 0; $i <$n; $i++) {\r\n $aLeft[] = $aArray[$i]; \r\n }\r\n for($i = $n; $i = $aRight[$iR]) {\r\n $aResult[] = $aLeft[$iL];\r\n $iL++;\r\n } else {\r\n $aResult[] = $aRight[$iR];\r\n $iR++;\r\n }\r\n }\r\n \r\n while($iL < count($aLeft)) {\r\n $aResult[] = $aLeft[$iL];\r\n $iL++;\r\n }\r\n while($iR < count($aRight)) {\r\n $aResult[] = $aRight[$iR];\r\n $iR++;\r\n }\r\n \r\n return $aResult;\r\n \r\n}"}], "negative_code": [{"source_code": " 1) {\r\n for($i=0; $i<$tt-1; $i++) {\r\n if($b[$i] > $b[$i + 1]) {\r\n $ans = false;\r\n break;\r\n }\r\n } \r\n }\r\n \r\n }\r\n \r\n pr($ans ? $yes : $no);\r\n \r\n \r\n }\r\n// bcadd \u2014 Add two arbitrary precision numbers\r\n// bccomp \u2014 Compare two arbitrary precision numbers\r\n// bcdiv \u2014 Divide two arbitrary precision numbers\r\n// bcmod \u2014 Get modulus of an arbitrary precision number\r\n// bcmul \u2014 Multiply two arbitrary precision numbers\r\n// bcpow \u2014 Raise an arbitrary precision number to another\r\n// bcpowmod \u2014 Raise an arbitrary precision number to another, reduced by a specified modulus\r\n// bcscale \u2014 Set or get default scale parameter for all bc math functions\r\n// bcsqrt \u2014 Get the square root of an arbitrary precision number\r\n// bcsub \u2014 Subtract one arbitrary precision number from another\r\nfunction getDar($n) {\r\n $dar = [2];\r\n for($i=0; $i<$n; $i++) {\r\n $dar[] = $dar[$i] * 2;\r\n }\r\n return $dar;\r\n}\r\nfunction getDar2($n, $k) {\r\n if($k == 0) {\r\n return 1;\r\n }\r\n return bcmul($n, getDar2($n, $k-1));\r\n}\r\n\r\n \r\n function getT() {\r\n return trim(fgets(STDIN));\r\n }\r\n function getA() {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n \r\n function is_prime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n \t $d += 1;\r\n }\r\n \r\n return $d == $n;\r\n }\r\nfunction getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n \r\n function getMaxValueBc($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n function getRotate($a, $s, $e, $ind) {\r\n \t\t$ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n \t$ar[$i] = $a[$i];\r\n \t$j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n \t// echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\"; \r\n \t$a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n } \r\n function pr($s) {\r\n if(is_array($s)) {\r\n echo implode( ' ', $s), PHP_EOL;\r\n } else {\r\n echo $s, PHP_EOL;\r\n }\r\n }\r\n function fab2($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n \r\n return $a[$n];\r\n }\r\n \r\n function mergeSort($aArray) {\r\n if(count($aArray) <= 1) {\r\n return $aArray;\r\n }\r\n $aLeft = [];\r\n $aRight = [];\r\n $n =floor(count($aArray) / 2);\r\n for($i = 0; $i <$n; $i++) {\r\n $aLeft[] = $aArray[$i]; \r\n }\r\n for($i = $n; $i = $aRight[$iR]) {\r\n $aResult[] = $aLeft[$iL];\r\n $iL++;\r\n } else {\r\n $aResult[] = $aRight[$iR];\r\n $iR++;\r\n }\r\n }\r\n \r\n while($iL < count($aLeft)) {\r\n $aResult[] = $aLeft[$iL];\r\n $iL++;\r\n }\r\n while($iR < count($aRight)) {\r\n $aResult[] = $aRight[$iR];\r\n $iR++;\r\n }\r\n \r\n return $aResult;\r\n \r\n}"}], "src_uid": "96b6a96ded46bddb78b118d6d3a9d049"} {"source_code": "=1 && $odd>=1)\n echo 'YES'.\"\\n\";\n else\n echo \"NO\".\"\\n\";\n\n}\n\n\n?>", "positive_code": [{"source_code": "\n\n$n = intval(fgets(STDIN));\nfor ($i = 0; $i < $n; $i++) {\n $t = intval(fgets(STDIN));\n $numbers = array_map('intval', explode(\" \", fgets(STDIN)));\n $even = 0;\n $odd = 0;\n foreach($numbers as $val) {\n if($val % 2 == 0) $even++;\n else $odd++;\n }\n if($odd !== 0 && ($odd !== $t || $t % 2 == 1)) echo \"YES\\n\";\n else echo \"NO\\n\";\n}\n?>"}, {"source_code": " 0) && ((($n&1) == 1) || ($odd != $n))) ? \"YES\" : \"NO\";\n\t\tprintf(\"%s\\n\", $ans);\n\t}\n}\n\n\nnamespace io {\n\tfunction next_line() {\n\t\tstatic $cnt = 0;\n\t\tglobal $input_buf;\n\t\treturn $input_buf[$cnt++];\n\t}\n\tfunction next_() {\n\t\tstatic $tk = [];\n\t\tstatic $tk_cnt = 0;\n\t\tif($tk_cnt == count($tk)) {\n\t\t\t$tk = explode(\" \", next_line());\n\t\t\t$tk_cnt = 0;\n\t\t}\n\t\treturn $tk[$tk_cnt++];\n\t}\n\tfunction next_int() {\n\t\treturn (int)next_();\n\t}\n\tfunction next_double() {\n\t\treturn (double)next_();\n\t}\n}\n\n?>\n"}, {"source_code": ""}, {"source_code": " 0 && $bT >0) {\n echo \"YES\\n\";\n } elseif ($bJ > 0 && $bT == 0) \n {\n echo \"NO\\n\";\n } elseif ($bJ == 0 && $bT > 0) \n {\n if($n %2 == 1) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n } \n }"}], "negative_code": [{"source_code": " 1 && ($count1 - $count2) % 2 == 1) \n || ($count1 - $count2) == 0) \n {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n \n }"}, {"source_code": " 1 && ($count1 - $count2) % 2 == 1) || ($count1 - $count2) == 0) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n \n }\n "}, {"source_code": ""}, {"source_code": ""}, {"source_code": "1 && $odd>1)\n echo 'YES'.\"\\n\";\n else\n echo \"NO\".\"\\n\";\n\n}\n\n\n?>"}, {"source_code": "1)\n echo 'YES'.\"\\n\";\n else\n echo \"NO\".\"\\n\";\n\n}\n\n\n?>"}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": "\r\n= $a){\r\n\t\tif($b % 2 == 0){\r\n\t\t\t$res-=1;\r\n\t\t}\r\n\t\techo $res.\"\\n\";\r\n\t}else{\r\n\t\techo $b % $a.\"\\n\";\r\n\t}\r\n}\r\n?>\r\n"}, {"source_code": " "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "1aede54b41d6fad3e74f24a6592198eb"} {"source_code": " $itemA) {\n $currentValue = ($n - $itemA) % $n;\n while ($amountB[$currentValue] === 0) {\n $nextValue = $orderList[$currentValue];\n if ($amountB[$nextValue] === 0) {\n $nextValue = $orderList[$currentValue] = $orderList[$nextValue];\n }\n $currentValue = $nextValue;\n }\n echo ($i ? ' ' : '') . (($itemA + $currentValue) % $n);\n $amountB[$currentValue]--;\n}\n", "positive_code": [{"source_code": " $itemA) {\n $currentValue = ($n - $itemA) % $n;\n while ($amountB[$currentValue] === 0) {\n $nextValue = $orderList[$currentValue];\n if ($amountB[$nextValue] === 0) {\n $nextValue = $orderList[$currentValue] = $orderList[$nextValue];\n }\n $currentValue = $nextValue;\n }\n $res .= ($i ? ' ' : '') . (($itemA + $currentValue) % $n);\n $amountB[$currentValue]--;\n}\necho $res;\n"}], "negative_code": [], "src_uid": "905df05453a12008fc9247ff4d02e7f0"} {"source_code": "", "positive_code": [{"source_code": " $c)\n {\n print $d - ($e - $c) . \"\\n\";\n }\n}\n?>"}], "negative_code": [], "src_uid": "2589e832f22089fac9ccd3456c0abcec"} {"source_code": "red\n\t \t \t \t \t \n \t\t \t\n \t \t\t \t\t\t \n \t\t \t\t\t ", "positive_code": [{"source_code": "Red\n \t\t\t \t \t \n \t\t\t \n\t \t \t \t \t\n \t\t\t \t \t\t "}, {"source_code": "red\n \t\t\t \t \n\t \t\t \t\t\t\t\n \t \t \t\t\t\t\n\t \t \t\t"}, {"source_code": "Odd\n \t \t \n \t \t \t\t \t\t\n \t \t \n\t \t\t\t\t \t\t"}, {"source_code": "red\n \t\t \t \t \n \t \t \n \t \t\n\t \t\t \t"}, {"source_code": "Red\n \t \t \t \n \t\t\t\t \t \t\n \t \t \t\t\n \t\t\t\t \t\t"}, {"source_code": "odd\n\t\t\t \t \t \t\n \t \t \t \n\t\t\t \t \t \n\t \t \t \t \t"}, {"source_code": "odd\n\t\t \t\t\t \t\t\n\t\t \t \t \n\t \t\t\t\t \t\t\n\t\t \t \t\t "}, {"source_code": "Odd\n \t\t \t\n\t \t\t\t\t \n\t\t \t\t \t\t \n \t \t\t \t"}, {"source_code": "Odd\n\t\t\t\t \t\t \t\n \t\t\t\t \t \n \t\t \t\t\t\t\t\t\n \t \t "}, {"source_code": "red\n \t \n \t\t\t\t \t\t \n \t \t\t \n\t \t\t \t \t"}, {"source_code": "odd\n\t\t \t\t \t \n \t \t\t\n\t\t \t \n \t\t \t \t\t"}, {"source_code": "Even\n\t\t\t \t\t\t \t \n\t\t\t \t\t\t \t\n \t \t \t \n \t\t\t\t \t"}, {"source_code": "Even\n \t\t\t \t \n \t\t \t \t\t\n\t \t\t\t \t\t\t\n \t\t\t\t\t \t\t\t"}, {"source_code": "Odd\n\t\t\t\t \t\t \t\n \t\t\t\t \t \n \t\t \t\t\t\t\t\t\n \t \t\n \t \t\t \t\t\t\t\n \t \t \t\t\t\t\n \t\t\t\t \t\t\t\n \t\t\t\t \t\t\t\t"}, {"source_code": "Red\n\t \t \t\t\t \n\t \t \t \n \t \t\t \t \n\t\t \t \t\t"}, {"source_code": "odd\n\t\t \t \t \t\n \t\t\t\t\t\t \t \n \t\t \t\t\t\t\t\n\t\t\t\t\t\t\t\t \t"}, {"source_code": "Red\n\t \t\t \t \t\t\n\t \t \t \t\t\n \t\t\t \t \n \t\t\t\t\t \t \t"}, {"source_code": "Red\n \t \t \t \t \n\t \t \t\t \n\t \t\t\t \t\t \n\t \t\t\t \t "}, {"source_code": "Odd\n \t \t \t \n\t\t\t\t \t \n \t\t\t \t \n \t\t\t\t\t\t \t"}, {"source_code": "Even\n \t \t \t \t\n \t \t \t\t \n\t \t \t \t \t\n \t\t \t"}, {"source_code": "Red\n \t \t \t \t\n\t\t\t\t\t\t\t \t\n\t \t\t \t\t \t \n \t \t \t\t\t "}, {"source_code": "Red\n\t \t \t\t \n\t\t \t\t \t\t\t\n\t \t \t\n\t \t\t\t\t"}, {"source_code": "Red\n \t\t \t \t\n\t\t \t \t\t\t \n\t \t \t\t\t\t\t\n\t\t\t \t\t\t "}, {"source_code": "Red\n\t \t \t \n\t \t \t \n\t \t \t \t\t \n \t\t\t \t\t "}, {"source_code": "red\n \t \t\t\t \n\t\t\t \t \t \n \t \t \t\n\t \t \t\t\t\t "}, {"source_code": "red\n\t \t \t \t \n\t \t\t \t\t \t\n \t\t\t\n\t \t \t"}, {"source_code": "Red\n \t\t\t\t \t\t \n\t \t \t \n \t\t\t\t \n\t \t"}, {"source_code": "even\n \t\t\t\t\t\t \t\n \t \t \t \t\t\n\t\t\t \t \n\t\t \t\t\t \t\t"}, {"source_code": "Black\n \t\t \t\t \t\n\t\t \t \t \t\t \n \t\t \t\t \t\t\n \t \t\t "}, {"source_code": "even\n\t\t\t \t \t\n\t\t\t\t \t \t\n \t \t \t \t\n \t\t\t\t \t "}, {"source_code": "red\n\t \t\t\t\t\t\t\n\t\t\t\t\t \t \t\t\n\t \t\t\t\t \t\t\n\t\t \t \t \t\t"}, {"source_code": "1 to 18\n \t\t \t\t\t \t \n\t \t \t\t \t\t \n\t\t\t\t\t \t\n\t\t\t\t \t\t "}, {"source_code": "Red\n \t\t \t\t\t \t\n \t\t\t\t\t \t\t \n \t \t \t\t\t \t\n\t\t\t\t \t\t \t"}, {"source_code": "odd\n\t\t\t\t\t \t\t\t \n \t\t \t\t\n \t \t\t\t\t\t\n\t \t \t\t\t\t "}, {"source_code": "black\n\n\n\n\t\t\t \t\t \t \n\t\t \t\t \t\t\n \t\t \t \t\t\n \t \t\t\t \t "}, {"source_code": "Odd\n \t\t \t\t\n\t\t \t\t\t \n \t \t \t\n \t\t\t\t \t\t "}, {"source_code": "black\n\t \t\t \t \n\t \t\t\t \t \t\n \t \t\t \t\n \t \t \t\t "}, {"source_code": "Red\n \t\t\t \t\t\t \t\n \t\t \t \t\n \t \t\t\t \t\n \t \t\t\t \t\t"}, {"source_code": "red\n\t\t\t \t\t \t \t\n \t \t \n \t \t\t \t\t\n\t \t \t \t \t"}, {"source_code": "even\n \t\t\t\t\t \t\t\n \t\t \t \t \t \n\t\t \t\t\t\t \n\t \t \t\t "}, {"source_code": "black\n\t \t\t\t\t\t \t\n \t \t\t \t \t\n\t \t \t \n \t\t\t\t \t"}, {"source_code": "1 to 18\n \t\t \t \t \n\t\t \t \t \n \t\t\t\t\t\t \t\t\n \t\t"}, {"source_code": "Red\n\n\t \t \t\t \n\t\t\t\t\t\t \t\t\t\n \t \t \t \n\t\t \t\t \t "}, {"source_code": "Red\n\n\t\t \t \t\t \t\n\t\t\t \t \t\t \n \t\t \t\t \t\n \t\t\t\t \t"}, {"source_code": "odd\n\t \t \t\t \t\t\t\n \t \t \n\t \t\n\t \t\t \t\t\t"}, {"source_code": "odd\n\t \t \t\t \t\n \t\t \t \t\t\n\t \t\t\t\t\t\t\t\t\n\t\t \t \t \t \t"}, {"source_code": "odd\n \t \t \t\t\t\n \t \t \n \t \t\t\t \n \t\t\t \t \t"}, {"source_code": "even\n \t\t \t\t \t \n\t\t\t \t \t\t\n\t\t\t\t\t \t\t\t \n \t\t \t\t "}, {"source_code": "1 to 18\n \t \t\t \n\t\t\t\t \n\t\t\t \t \t \n \t\t \t \t"}, {"source_code": "Red\n \t \t\t \n\t \t\t\t \t\n \t\t\t\t \t\t \n\t\t\t \t\t\t\t"}, {"source_code": "Red\n\t\t\t \t\t \t\n\t\t \t\t\t\t\t \n\t\t \t\t\t\t\n\t\t\t\t\t\t\t \t"}, {"source_code": "red\n \t\n \t \t \n \t \n \t\t\t\t \t "}, {"source_code": "black\n\t\t\t\t \t \t\n\t\t \t \t\n\t\t \t \t\n \t \t\t\t \t "}, {"source_code": "red\n \t \t\t\t \n\t\t\t\t\t \t\t\t \n \t \t\t\t \t \n\t \t\t\t \t "}, {"source_code": "Red\n \t \t\t \t\n\t\t \t \t\t\t\n\t \t\t\t\t\t\t \n \t \t \t "}, {"source_code": "RED\n \t\t \t \n\t\t\t \t \t\t \n\t\t\t \t \t\t\n \t\t\t \t\t"}, {"source_code": "even\n\t\t\t \t\t\t\t \t\n \t \t \t \t\t\n \t\t \t \t\t\t\n\t \t\t\t\t\t \t"}, {"source_code": "odd\n\t \t\t \t \t\n \t\t \t\t\t \n \t \n \t \t \t \t\t\t"}, {"source_code": "1 to 18\n\t\t\t \t\t\t\t\t\n\t\t \t\t\t \t\t\t\n \t\t \t \t \n\t \t\t\t\t "}, {"source_code": "Odd\n \t \t\t \n\t\t \t \t \n \t \t\t \t\t\t\t\n\t\t\t \t \t\t\t\t"}, {"source_code": "red\n\t \t \t \t \n\t \t \t\n\t \t\t \t\t\t\t\t\n \t\t\t "}, {"source_code": "Red\n\t\t \t \n\t \t\t\t\t \t \n \t\t \t\t\t \n\t \t\t\t\t\t\t "}, {"source_code": "red\n \t\t \t \n \t\t \t\n \t \t\t \n\t\t\t \t \t"}, {"source_code": "red\n \t\t\t \t \t \n\t \t \t\t\t \n \t\t \t\n\t\t\t \t\t\t \t "}, {"source_code": "Even\n \t \t \t\t\t \n\t\t \t\t \n \t\t\t\t \t\t\n \t \t "}], "negative_code": [{"source_code": "16\n \t \t \t \n \t \t \t \n \t\t \t\t \n\t \t\t\t\t\t\t\t"}, {"source_code": "Odd\n \t\t\t\t \t\t\t\t\n\t\t\t \t \t\t\n \t\t \t \t\t\n \t\t \t \t\t "}, {"source_code": "odd\n \t \t\t \t \n\t\t \t \t\t\n \t \t\t\n \t\t \t "}, {"source_code": "even\n\t\t\t\t \t\t \n \t \t\t \n\t\t \t \n\t \t\t \t\t\t"}, {"source_code": "odd\n \t\t \t \n\t\t\t\t \t \t \n \t \t\t\t\t\n\t\t \t\t\t\t "}, {"source_code": "red\n\t \t \t\n \t\t\n \t\t\t\n\t \t\t \t \t\t"}, {"source_code": "odd\n\t \t \t\t \n\t\t \t \t \t \t\n\t \t \t\t \t \n\t\t\t\t\t \t\t\t\t"}, {"source_code": "13\n \t \t \t \t\t\t\n\t\t \t \t\t\t \t\n\t \t\t \t \t \n\t\t\t \t \t \t\t"}, {"source_code": "27\n \t \t \n\t \t\t\t\t\t \t\t\n\t \t \t\t \t\n\t \t \t\t\t \t"}, {"source_code": "18\n\t\t \t \t \t\t\t\n\t\t\t\t\t \t\t \n\t \t\t\t \t \t\n \t \t \t \t"}, {"source_code": "Red\n \t\t \t\t\t\t\n \t \t \t\t \t\n\t\t \t\t \t\n\t \t\t\t\t \t"}, {"source_code": "Black\n \t \t\t\t\t \n\t\t \t \t\t\n\t \t\t\t\t\t\t \n \t\t\t \t \t\t"}, {"source_code": "18\n\t\t \t \t \t\t\t\n\t\t\t\t\t \t\t \n\t \t\t\t \t \t\n \t \t \t \t"}, {"source_code": "odd\n \t\t \n\t \t \t\t\n \t \t\t \n\t \t\t\t\t\t\t \t"}, {"source_code": "Red\n \t\t\t \t\t \t\n\t\t \t\t\t \n\t \t\t\t\t \t \t\n \t \t \t\t"}, {"source_code": "28\n\t \t\t \t\t\t\n\t\t \t\t\t\t \t\t\n\t\t\t\t\t \t\t \n \t\t \t\t"}, {"source_code": "18\n \t \t \t\t\t \n\t\t\t \t \t\t\t\n \t\t \t \t\n\t \t\t\t \t "}, {"source_code": "Odd\n\t\t\t\t\t \t \t\n\t \t\t \t\t\n\t\t \t \t\t\t\n \t \t \t"}, {"source_code": "34\n\t\t\t \t \t \t \n\t\t\t\t \t \t\n \t\t \t\t \n\t \t \t \t "}, {"source_code": "0\n \t\t\t\t\t \t\n\t \t\t\t \n \t \t \t \t\t\n\t\t\t \t\t\t\t\t "}, {"source_code": "Red\n \t\t \t \n\t\t\t\t \t\t\t \n \t\t \t \t\n \t \t \t\t\t"}, {"source_code": "8\n\t \t\t \n\t\t\t\t \t \t\t\n\t \t\t\t\t\t\t\n \t\t\t \t "}, {"source_code": "31\n\t\t \t \t \n\t\t \t \t \n \t\t \t\t\n\t \t \t"}, {"source_code": "2nd 12\n \t\t \t \t\n\t\t \t \t\n \t \t\t\n \t \t\t\t\t \t "}, {"source_code": "Odd\n\t\t\t\t \t\t\t\t\t\n\t\t \t \t\t \t\n \t \t\t \t \n\t \t \t\t\t\t\t\t"}, {"source_code": "10\n\t \t \t\n \t \t\t \t \t\n \t \t \t\t\n \t\t \t \t\t "}, {"source_code": "1\n \t\t\t \t \n \t \t \t\t\t\t\n\t \t \t \n \t\t \t\t \t"}, {"source_code": "32\n\t \t\t\t\n \t\t\t\t \n\t \t \t\t\t\n\t\t \t\t\t"}, {"source_code": "24\n\t \t \t\t\t\n \t\t \t \n \t\t \t\t \n \t\t \t "}, {"source_code": "odd\n\t\t\t\t \t\t\t\t\t\n \t\t\t \t \t\t\n \t\t \t \t\t\t \n \t\t\t \t \t"}, {"source_code": "27\n\t \t\t \n \t \t\t\t\t\t \n\t \t\t\t\t\t\t\n \t\t \t\t\t "}, {"source_code": "odd\n \t\t \n\t \t \t\t\n \t \t\t \n\t \t\t\t\t\t\t \t"}, {"source_code": "00\n\t\t\t\t\t \t \n \t \t\t \t\t \n\t \t \t\t\n\t \t\t \t\t \t\t"}, {"source_code": "28\n\t \t\t\t \t\n\t\t\t\t \t\t \t \n\t\t \t \t\t \t\n\t \t \t\t"}, {"source_code": "Odd\n\t\t\t\t\t \t \t\n\t \t\t \t\t\n\t\t \t \t\t\t\n \t \t \t"}, {"source_code": "2nd 12\n \t\t \t \t\n\t\t \t \t\n \t \t\t\n \t \t\t\t\t \t "}, {"source_code": "Red\n\n\t\t \t\t\t\t \t\n\t \t \t \t\n\t\t \t \t \t\n\t \t \t\t\t \t"}, {"source_code": "2\n\t \t\t\t\t \t\t\t\n \t\t \t \n \t\t \t \t\n \t \t\t\t "}, {"source_code": "\u00a31\n \t \t\t\t\t \n \t \t \t\n\t \t \t \t \t\n\t\t \t\t\t \t"}, {"source_code": "Red\n\n\t\t \t\t\t\t \t\n\t \t \t \t\n\t\t \t \t \t\n\t \t \t\t\t \t"}, {"source_code": "8\n\t \t\t \n\t\t\t\t \t \t\t\n\t \t\t\t\t\t\t\n \t\t\t \t "}, {"source_code": "000\n \t\t\t \t\t\n \t\t \t \t\n \t\t \t\t \n\t \t \t\t\t "}, {"source_code": "Kemot\n\t\t \t \t\t\n \t \t \t \n\t\t \t\t\t\t\n \t\t"}, {"source_code": "red\n \t \t\t\t\t \t \n \t\t \t \t \n\t\t\t\t \t\t\t\t \n \t\t \t\t\t\t\t\t"}, {"source_code": "Red\n\n\t \t\n \t \t \n \t \t \t \t \n \t \t\t\t "}, {"source_code": "1 to 36\n \t \t\t \n \t\t \t\t\n \t \t \n\t\t\t \t\t\t\t "}, {"source_code": "34\n\t\t\t \t \t \t \n\t\t\t\t \t \t\n \t\t \t\t \n\t \t \t \t "}, {"source_code": "0\n \t \t \t\t\n \t\t\t\t\t\t \n\t\t \t \t\t\t\n \t\t \t\t \t"}, {"source_code": "2\n\t \t \t \t \n\t\t \t\t \t\t \n\t\t \t \t \t\n \t \t"}, {"source_code": "Odd\n\t\t\t \t\t\t \t\n \t \t\n \t \t\t \n \t\t \t\t\t"}, {"source_code": "number\n \t \t\t \t\t \n \t \t\t \t \t\n\t\t\t\t\t\t \t \t\n\t\t \t \t "}, {"source_code": "Red\n \t \t \t \t \n \t\t \t\t \t\n\t \t\t\t \n\t \t \t\t "}, {"source_code": "odd\n\t\t\t\t \t\t \t\n \t \t\t\t\t\t \n\t \t\t \t\t\t\t\n\t \t\t\t\t\t "}, {"source_code": "1\n\t \t\t\t \t\n\t\t \t\t \t \t\n\t\t \t\t \t \t\n \t \t\t \t\t"}, {"source_code": "red\n\t\t\t \t \t\t\t\n \t \n \t \t\t\t \n \t\t\t\t\t\t"}, {"source_code": "even\n\t\t\t\t \t\t \n \t \t\t \n\t\t \t \n\t \t\t \t\t\t"}, {"source_code": "Even\n \t\t \t \t\n\t \t \t\t\t \n\t\t \t\t\t\t\t\t\t\n \t \t\t \t "}, {"source_code": "0.2\n \t\t\t \t \t\t\n\t \t\t \t \t\t \n \t \t\n\t \t\t \t"}, {"source_code": "2nd 12\n \t\t \t \t\n\t\t \t \t\n \t \t\t\n \t \t\t\t\t \t "}, {"source_code": "Black\n \t\t\t \t\t\t\t\t\n \t \t\t \t\t\n\t \t \t\t\t\t \n \t\t "}, {"source_code": "15\n\t\t \t\t\t\t\t\t\t\n\t \t\t\t \t\t\t\n\t \t\t \t\t\n\t\t \t \t\t\t\t"}, {"source_code": "33\n\t \t\t \t\t\t\n \t \t \n\t \t\t\t \t\t \n\t \t \t \t\t "}, {"source_code": "odd\n \t\t \n\t \t \t\t\n \t \t\t \n\t \t\t\t\t\t\t \t"}, {"source_code": "Red\n \t\t \t\t\n \t\t\t\t \t \n \t \t\t \t \t\t\n\t \t \t\t \t\t"}, {"source_code": "0\n \t \t\t\t \t\n \t \t\t \t\n\t\t\t \t\t \t\n \t \t\t \t"}, {"source_code": "Odd\n\t \t\t \t\t \n\t \t\t\t \n\t\t \t\n\t \t\t \t\t "}, {"source_code": "Odd\n\t \t\t\t\t \n\t\t \t \t \t\n\t \t \t\t\t \n\t \t \t "}, {"source_code": "odd\n \t\t\t\t\t \n\t \t \t\t\t \n \t \t\t\t \n\t\t \t\t \t \t"}, {"source_code": "Red\n\t\t\t\t\t \t\t \t\n \t\t \t\t\t \t \n \t \t\t\t \n \t\t \t \t\t"}, {"source_code": "Red\n\n \t\t\t\t \t\t \t\n \t\t \t\t \t\n\t\t \t \t\t\t\t\n \t\t \t \t "}, {"source_code": "Red\n\t \t \t \t\n \t\t \t\t\t \n \t\t\t \t\t \t\t\n\t \t \t\t \t\t"}, {"source_code": "12\n\t\t \t\t \t\t\n \t \t \t\t\t\t\t\n \t\t \t \t \n \t\t\t\t\t "}, {"source_code": "27\n\t \t\t \n \t \t\t\t\t\t \n\t \t\t\t\t\t\t\n \t\t \t\t\t "}, {"source_code": "Red\n \t\t\t\t \t \t\n \t\t\t\t \t\t\t\n\t \t\t \t\t\t\n \t\t \t "}, {"source_code": "odd\n \t \t\t\t \t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t \t\t\t \n\t\t \t\t "}, {"source_code": "Even\n \t \t\t\t\t \t\t\n\t \t \t\n \t\t \t \t\t \n \t \t\t\t "}, {"source_code": "Red\n\t\t\t\t \t \t\t\n\t\t\t\t\t \t \t\t\n\t \t\t\t\t\t \t\t\n \t\t "}, {"source_code": "2 to 1\n\t\t\t\t\t\t\t \n\t\t\t \t\t\t\t \n\t \t \t\t \n\t\t \t \t\t\t\t"}, {"source_code": "1\n\t\t\t \t \n \t\t\t \t\t\t\t\n \t \t\t \t\n\t \t \t \t"}, {"source_code": "odd\n \t \t\t \t \n\t\t \t \t\t\n \t \t\t\n \t\t \t "}, {"source_code": "Red\n \t \t \t \t\n \t\t \t \t \n \t \t\t\t\t\t\n \t\t \t\t\t\t"}, {"source_code": "odd\n\t \t\t\t\t \t \n \t \t \t \t\t\t\n \t\t\t \n \t \t \t\t\t"}, {"source_code": "even\n\t\t\t\t \t\t \t\n \t\t\t \t\n\t \t\t\t \n \t\t\t\t \t\t\t"}, {"source_code": "red\n \t \t\t\t \t\n \t\t \t\t \n\t \t\t\t \t\t\n\t \t \t \t "}, {"source_code": "Red\n\t \t \t\t\t\t\t\n \t\t\t \t\t\t \n\t\t\t\t\t\t\t\t\t\t\n \t \t \t\t\t "}, {"source_code": "1 to 35\n\t \t \t \t\t\n\t \t \t\t\t\t \n \t \t \n\t \t \t \t\t\t\t"}, {"source_code": "Positive\n\t \t \t\t \t\t\n\t\t \t \t \t \n \t\t\t\t \t \t\t\n\t\t \t\t\t\t "}, {"source_code": "31\n\t\t\t \t\t\t\n \t \t\t\t \t\t\n\t\t\t\t\t\t \t \n \t\t\t \t\t\t "}, {"source_code": "Red\n\n\t \t\t \t\n \t \t \t\n\t \t \t\t \t\n \t\t \t\t\t\t "}, {"source_code": "13\n \t\t\t \t \t\n\t\t \t \t\t\t \n \t \t \t\n\t \t \t \t "}, {"source_code": "2\n \t\t\t \t \t\n\t \t\t\t \t \n\t\t\t\t\t \t \t\t\n \t\t\t\t\t "}, {"source_code": "Even\n \t \t\t\t\t \t\t\n\t \t \t\n \t\t \t \t\t \n \t \t\t\t "}, {"source_code": "black\n \t \t \t \t\n\t \t\t\t\t\t \t\t\n \t\t \t \n\t\t\t \t\t \t"}, {"source_code": "27\n\t \t\t \n \t \t\t\t\t\t \n\t \t\t\t\t\t\t\n \t\t \t\t\t "}, {"source_code": "Black\n \t\t\t \t\t\t\t\t\n \t \t\t \t\t\n\t \t \t\t\t\t \n \t\t "}, {"source_code": "red\n\t\t\t \t \t\t \t\n \t \t\t\t \t \n\t\t\t \t \t \t\n\t\t \t\t \t \t"}, {"source_code": "Red\n \t \t \t \t\n \t \t \t\t\t\n\t \t \n\t \t\t\t \t"}, {"source_code": "12\n\t \t \t\t\n \t \t\t \n\t \t\t \t \n\t \t \t\t \t "}, {"source_code": "even\n \t\t \n \t\t\t \n \t \t \n\t\t\t \t \t \t"}, {"source_code": "red\n \t\t \t \t\t \n \t \t\t \t\n \t\t \n\t\t \t \t \t"}], "src_uid": "f2a71cb9706b76317f2f442a9129055f"} {"source_code": "0; $j--){\n $count += 1/$j;\n}\necho $count;", "positive_code": [{"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " $v){\n if($v != $a[$k] && $v != $b[$k]){\n $bool = false;\n }\n }\n if($bool){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n list($n, $a, $b, $c, $d) = explode(\" \", trim(fgets(STDIN)));\n\n\n\n if($n * ($a - $b) > $c + $d || $n * ($a + $b) < $c - $d)\n print(\"NO\\n\");\n\n else\n print(\"YES\\n\");\n\n\n\n\n}\n\n\n", "positive_code": [{"source_code": " $tmp_d) echo \"NO\" . \"\\n\" ;\n else if($tmp_c > $tmp_b) echo \"NO\".\"\\n\" ;\n else echo \"YES\".\"\\n\" ;\n }\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n list($n, $a, $b, $c, $d) = explode(\" \", trim(fgets(STDIN)));\n $flag = 0;\n\n for($i = $a - $b; $i <= $a + $b; $i++){\n if($n * $i >= $c - $d && $n * $i <= $c + $d)\n $flag = 1;\n }\n\n if($flag)\n print(\"YES\\n\");\n\n else\n print(\"NO\\n\");\n\n\n\n\n}\n\n\n"}, {"source_code": " $tmp_d) echo \"NO\" . \"\\n\" ;\n else if($tmp_c > $tmp_b) echo \"NO\".\"\\n\" ;\n else echo \"YES\".\"\\n\" ;\n }\n?>"}, {"source_code": "\n"}, {"source_code": "\n"}], "src_uid": "30cfce44a7a0922929fbe54446986748"} {"source_code": "", "positive_code": [{"source_code": "2)\n {\n \t//$flag=1;\n \t//echo \"NO\";\n \tbreak;\n }\n } \n}\n\n\n\nif($count==2&&$a[1]==$b[0]&&$a[0]==$b[1])\n\techo \"YES\\n\";\nelse\n\techo \"NO\";\n\n\n}\n"}, {"source_code": " $v)\n{\n\tif($v !== $rb[$i])\n\t{\n\t\t$cnt++;\n\t\t$difs[] = $i;\n\t}\n}\n\nif($cnt === 0)\n\tdie(\"YES\\n\");\n\nif($cnt === 2)\n{\n\tif($ra[$difs[0]] === $rb[$difs[1]] && $rb[$difs[0]] === $ra[$difs[1]])\n\t\tdie(\"YES\\n\");\n}\n\ndie(\"NO\\n\");\n\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function factorial($number)\r\n {\r\n $factorial = 1;\r\n for ($i = 1; $i <= $number; $i++){\r\n $factorial = $factorial * $i;\r\n }\r\n return $factorial;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n for ($i = 1; $i <= $n; $i++) {\r\n $str = $str2 = '';\r\n for ($j = 0; $j < $i; $j++) {\r\n $str .= '(';\r\n $str2 .= ')';\r\n }\r\n $r = $str . $str2;\r\n for ($x = 0; $x < $n - $i; $x++) {\r\n $r .= '()';\r\n }\r\n IO::line($r);\r\n }\r\n\r\n}\r\n\r\n\r\n?>\r\n\r\n\r\n\r\n\r\n"}], "negative_code": [], "src_uid": "27b73a87fc30c77abb55784e2e1fde38"} {"source_code": " 1){\n\t\techo -1; die;\n\t}\n\tif($n % 2 == 1)\n\t\t$a[floor($n / 2)] = floor($n / 2);\t \n\tfor($i = 0; $i < floor($n / 2); $i += 2){\n\t\t$a[$i] = $i + 1;\n\t\t$a[$i + 1] = $n - $i - 1;\n\t\t$a[$n - $i - 1] = $n - $i - 2;\n\t\t$a[$n - $i - 2] = $i;\n\t}\n\tfor($i = 0; $i < $n; $i++) echo ($a[$i] + 1).' ';\n?>\n", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "dfca19b36c1d682ee83224a317e495e9"} {"source_code": " 2) {\n continue;\n } elseif ($c == 2) {\n $temp = array();\n $f = 0;\n foreach ($s as $l => $t) {\n $temp[] = $l - 97;\n $f += $t;\n }\n $bArray[$temp[0]][$temp[1]] += $f;\n $bArray[$temp[1]][$temp[0]] += $f;\n\n } else {\n foreach ($s as $l => $t) {\n $aArray[$l - 97] += $t;\n }\n }\n}\n$max = 0;\nfor ($i = 0; $i < 26; $i++) {\n for ($j = 0; $j < 26; $j++) {\n if ($i==$j) {\n continue;\n }\n $max = max($max, $bArray[$i][$j] + $aArray[$i] + $aArray[$j]);\n }\n}\necho $max;", "positive_code": [{"source_code": " 2)\n {\n unset($b[$x]);\n }\n}\nsort($b);\n$f = array(\"a\" => 0, \"b\" => 0, \"c\" => 0, \"d\" => 0, \"e\" => 0, \"f\" => 0, \"g\" => 0, \"h\" => 0, \"i\" => 0, \"j\" => 0, \"k\" => 0, \"l\" => 0, \"m\" => 0, \"n\" => 0, \"o\" => 0, \"p\" => 0, \"q\" => 0, \"r\" => 0, \"s\" => 0, \"t\" => 0, \"u\" => 0, \"v\" => 0, \"w\" => 0, \"x\" => 0, \"y\" => 0, \"z\" => 0, \"ab\" => 0, \"ac\" => 0, \"ad\" => 0, \"ae\" => 0, \"af\" => 0, \"ag\" => 0, \"ah\" => 0, \"ai\" => 0, \"aj\" => 0, \"ak\" => 0, \"al\" => 0, \"am\" => 0, \"an\" => 0, \"ao\" => 0, \"ap\" => 0, \"aq\" => 0, \"ar\" => 0, \"as\" => 0, \"at\" => 0, \"au\" => 0, \"av\" => 0, \"aw\" => 0, \"ax\" => 0, \"ay\" => 0, \"az\" => 0, \"bc\" => 0, \"bd\" => 0, \"be\" => 0, \"bf\" => 0, \"bg\" => 0, \"bh\" => 0, \"bi\" => 0, \"bj\" => 0, \"bk\" => 0, \"bl\" => 0, \"bm\" => 0, \"bn\" => 0, \"bo\" => 0, \"bp\" => 0, \"bq\" => 0, \"br\" => 0, \"bs\" => 0, \"bt\" => 0, \"bu\" => 0, \"bv\" => 0, \"bw\" => 0, \"bx\" => 0, \"by\" => 0, \"bz\" => 0, \"cd\" => 0, \"ce\" => 0, \"cf\" => 0, \"cg\" => 0, \"ch\" => 0, \"ci\" => 0, \"cj\" => 0, \"ck\" => 0, \"cl\" => 0, \"cm\" => 0, \"cn\" => 0, \"co\" => 0, \"cp\" => 0, \"cq\" => 0, \"cr\" => 0, \"cs\" => 0, \"ct\" => 0, \"cu\" => 0, \"cv\" => 0, \"cw\" => 0, \"cx\" => 0, \"cy\" => 0, \"cz\" => 0, \"de\" => 0, \"df\" => 0, \"dg\" => 0, \"dh\" => 0, \"di\" => 0, \"dj\" => 0, \"dk\" => 0, \"dl\" => 0, \"dm\" => 0, \"dn\" => 0, \"do\" => 0, \"dp\" => 0, \"dq\" => 0, \"dr\" => 0, \"ds\" => 0, \"dt\" => 0, \"du\" => 0, \"dv\" => 0, \"dw\" => 0, \"dx\" => 0, \"dy\" => 0, \"dz\" => 0, \"ef\" => 0, \"eg\" => 0, \"eh\" => 0, \"ei\" => 0, \"ej\" => 0, \"ek\" => 0, \"el\" => 0, \"em\" => 0, \"en\" => 0, \"eo\" => 0, \"ep\" => 0, \"eq\" => 0, \"er\" => 0, \"es\" => 0, \"et\" => 0, \"eu\" => 0, \"ev\" => 0, \"ew\" => 0, \"ex\" => 0, \"ey\" => 0, \"ez\" => 0, \"fg\" => 0, \"fh\" => 0, \"fi\" => 0, \"fj\" => 0, \"fk\" => 0, \"fl\" => 0, \"fm\" => 0, \"fn\" => 0, \"fo\" => 0, \"fp\" => 0, \"fq\" => 0, \"fr\" => 0, \"fs\" => 0, \"ft\" => 0, \"fu\" => 0, \"fv\" => 0, \"fw\" => 0, \"fx\" => 0, \"fy\" => 0, \"fz\" => 0, \"gh\" => 0, \"gi\" => 0, \"gj\" => 0, \"gk\" => 0, \"gl\" => 0, \"gm\" => 0, \"gn\" => 0, \"go\" => 0, \"gp\" => 0, \"gq\" => 0, \"gr\" => 0, \"gs\" => 0, \"gt\" => 0, \"gu\" => 0, \"gv\" => 0, \"gw\" => 0, \"gx\" => 0, \"gy\" => 0, \"gz\" => 0, \"hi\" => 0, \"hj\" => 0, \"hk\" => 0, \"hl\" => 0, \"hm\" => 0, \"hn\" => 0, \"ho\" => 0, \"hp\" => 0, \"hq\" => 0, \"hr\" => 0, \"hs\" => 0, \"ht\" => 0, \"hu\" => 0, \"hv\" => 0, \"hw\" => 0, \"hx\" => 0, \"hy\" => 0, \"hz\" => 0, \"ij\" => 0, \"ik\" => 0, \"il\" => 0, \"im\" => 0, \"in\" => 0, \"io\" => 0, \"ip\" => 0, \"iq\" => 0, \"ir\" => 0, \"is\" => 0, \"it\" => 0, \"iu\" => 0, \"iv\" => 0, \"iw\" => 0, \"ix\" => 0, \"iy\" => 0, \"iz\" => 0, \"jk\" => 0, \"jl\" => 0, \"jm\" => 0, \"jn\" => 0, \"jo\" => 0, \"jp\" => 0, \"jq\" => 0, \"jr\" => 0, \"js\" => 0, \"jt\" => 0, \"ju\" => 0, \"jv\" => 0, \"jw\" => 0, \"jx\" => 0, \"jy\" => 0, \"jz\" => 0, \"kl\" => 0, \"km\" => 0, \"kn\" => 0, \"ko\" => 0, \"kp\" => 0, \"kq\" => 0, \"kr\" => 0, \"ks\" => 0, \"kt\" => 0, \"ku\" => 0, \"kv\" => 0, \"kw\" => 0, \"kx\" => 0, \"ky\" => 0, \"kz\" => 0, \"lm\" => 0, \"ln\" => 0, \"lo\" => 0, \"lp\" => 0, \"lq\" => 0, \"lr\" => 0, \"ls\" => 0, \"lt\" => 0, \"lu\" => 0, \"lv\" => 0, \"lw\" => 0, \"lx\" => 0, \"ly\" => 0, \"lz\" => 0, \"mn\" => 0, \"mo\" => 0, \"mp\" => 0, \"mq\" => 0, \"mr\" => 0, \"ms\" => 0, \"mt\" => 0, \"mu\" => 0, \"mv\" => 0, \"mw\" => 0, \"mx\" => 0, \"my\" => 0, \"mz\" => 0, \"no\" => 0, \"np\" => 0, \"nq\" => 0, \"nr\" => 0, \"ns\" => 0, \"nt\" => 0, \"nu\" => 0, \"nv\" => 0, \"nw\" => 0, \"nx\" => 0, \"ny\" => 0, \"nz\" => 0, \"op\" => 0, \"oq\" => 0, \"or\" => 0, \"os\" => 0, \"ot\" => 0, \"ou\" => 0, \"ov\" => 0, \"ow\" => 0, \"ox\" => 0, \"oy\" => 0, \"oz\" => 0, \"pq\" => 0, \"pr\" => 0, \"ps\" => 0, \"pt\" => 0, \"pu\" => 0, \"pv\" => 0, \"pw\" => 0, \"px\" => 0, \"py\" => 0, \"pz\" => 0, \"qr\" => 0, \"qs\" => 0, \"qt\" => 0, \"qu\" => 0, \"qv\" => 0, \"qw\" => 0, \"qx\" => 0, \"qy\" => 0, \"qz\" => 0, \"rs\" => 0, \"rt\" => 0, \"ru\" => 0, \"rv\" => 0, \"rw\" => 0, \"rx\" => 0, \"ry\" => 0, \"rz\" => 0, \"st\" => 0, \"su\" => 0, \"sv\" => 0, \"sw\" => 0, \"sx\" => 0, \"sy\" => 0, \"sz\" => 0, \"uv\" => 0, \"uw\" => 0, \"ux\" => 0, \"uy\" => 0, \"uz\" => 0, \"vw\" => 0, \"vx\" => 0, \"vy\" => 0, \"vz\" => 0, \"wx\" => 0, \"wy\" => 0, \"wz\" => 0, \"xy\" => 0, \"xz\" => 0, \"yz\" => 0);\nfor($x = 0; $x < count($b); $x++)\n{\n $g = str_split($b[$x]);\n $r = array_unique($g);\n sort($r);\n $s = implode($r);\n $f[$s] += count($g);\n}\n$t = array_slice($f, 0, 26);\n$u = array_slice($f, 26);\n$v = array_keys($u);\n$w = array_keys($t);\nfor($x = 0; $x < count($u); $x++)\n{\n for($y = 0; $y < count($t); $y++)\n {\n if(($v[$x][0] == $w[$y]) || ($v[$x][1] == $w[$y]))\n {\n $f[$v[$x]] += $f[$w[$y]];\n }\n }\n}\nprint max($f);\n?>"}, {"source_code": " main();\n?>\n\n\n"}], "negative_code": [], "src_uid": "d8a93129cb5e7f05a5d6bbeedbd9ef1a"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $xy2) {\n list ($x2, $y2) = $xy2;\n if (abs($y1my0 * ($x2 - $x0) - $x1mx0 * ($y2 - $y0)) < 1e-8) {\n unset($xy[$i2]);\n }\n }\n\n $count++;\n}\n\necho \"$count\\n\";\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $xy2) {\n list ($x2, $y2) = $xy2;\n if (($y1my0 * ($x2 - $x0) - $x1mx0 * ($y2 - $y0)) < 1e-8) {\n unset($xy[$i2]);\n }\n }\n\n $count++;\n}\n\necho \"$count\\n\";\n"}], "src_uid": "8d2845c33645ac45d4d37f9493b0c380"} {"source_code": " $row){\n $arrStr = str_split($row);\n $srt_return = '';\n foreach ($arrStr as $k => $char){\n if($char == \".\") {\n if ($people_count > 0) {\n if ($k >=1 && $k < 11) {\n if ($arrStr[$k - 1] != \"S\" && $arrStr[$k + 1] != \"S\") {\n $char = \"x\";\n $people_count = $people_count - 1;\n }\n\n }\n elseif($k == 0 && $arrStr[$k + 1] != \"S\") {\n $char = \"x\";\n $people_count = $people_count - 1;\n }\n elseif($k == 11 && $arrStr[$k - 1] != \"S\") {\n $char = \"x\";\n $people_count = $people_count - 1;\n }\n }\n }\n\n $srt_return = $srt_return.$char;\n }\n $arRows[$key] = $srt_return;\n\n}\n\n\nforeach ($arRows as $key => $row){\n $arrStr = str_split($row);\n $srt_return = '';\n foreach ($arrStr as $k => $char){\n if($char == \".\") {\n if ($people_count > 0) {\n if ($k >=1 && $k < 11) {\n $sos = $arrStr[$k - 1] . $arrStr[$k + 1];\n if ($sos != \"SS\") {\n $char = \"x\";\n $people_count = $people_count - 1;\n }\n\n }\n else {\n $char = \"x\";\n $people_count = $people_count - 1;\n }\n }\n }\n\n $srt_return = $srt_return.$char;\n }\n $arRows[$key] = $srt_return;\n\n}\n\nforeach ($arRows as $k => $row){\n\n if($people_count >= 1){\n $arRows[$k] = preg_replace(\"/\\./\",\"x\",$arRows[$k],$people_count,$count);\n $people_count = $people_count - $count;\n }\n else{\n break;\n }\n\n}\nglobal $count_result;\n$count_result = 0;\nfunction counter($f){\n global $count_result;\n if($f != \"\"){\n if($f != \"-\" && $f != \".\"){\n $count_result++;\n }\n }\n\n}\n\nforeach ($arRows as $key => $row){\n $arrStr = str_split($row);\n foreach ($arrStr as $k => $char){\n if($char == \"S\"){\n if($k > 0){\n counter($arrStr[$k-1]);\n }\n if($k < 11){\n counter($arrStr[$k+1]);\n }\n }\n }\n}\n\necho $count_result.\"\\n\";\nforeach ($arRows as $row){\n echo $row;\n}\n\n?>"}, {"source_code": " 0 && $str[$i-1] != \".\"){\n \t\t\t$neighbors++;\n \t\t}\n \t\tif($i< strlen($str)-1 && $str[$i+1]!=\".\"){\n \t\t\t$neighbors++;\n \t\t}\n \t}\n \tif($str[$i] == \".\"){\n \t\t$c = 0;\n \t\tif($i>0 && $str[$i-1]==\"S\"){\n \t\t\t$c++;\n \t\t}\n \t\tif($i+1 < strlen($str) && $str[$i+1]==\"S\"){\n \t\t\t$c++;\n \t\t}\n \t\tswitch ($c) {\n \t\t\tcase 0:\n \t\t\t\t$best_place[] = [$row, $i+$colomn];\n \t\t\t\tbreak;\n \t\t\tcase 1:\n \t\t\t\t$mid_place[] = [$row, $i+$colomn];\n \t\t\t\tbreak;\n \t\t\tcase 2:\n \t\t\t\t$bad_place[] = [$row, $i+$colomn];\n \t\t}\n \t}\n }\n}\n$list = explode(\" \", fgets(STDIN));\n$n = $list[0]; \n$passangers = $list[1];\n$best_place = [];\n$mid_place = [];\n$bad_place = [];\n$need_place = [];\n$neighbors = 0;\n$rows = [];\nfor($i = 0; $i < $n; $i++){\n\t$row = trim(fgets(STDIN));\n\t$rows[] = $row;\n\t$rows_in_row = explode(\"-\", $row);\n\t$r1 = $rows_in_row[0];\n\t$r2 = $rows_in_row[1];\n\t$r3 = $rows_in_row[2];\n sorting($r1, $i, 0);\n sorting($r2, $i, 4);\n sorting($r3, $i, 9);\n}\n$best = count($best_place);\n$mid = count($mid_place);\n$bad = count($bad_place);\nif($best >= $passangers){\n\t$need_place = array_slice($best_place, 0, $passangers);\n}\nelse{\n $need_place = $best_place;\n $passangers -= $best;\n if($passangers <= $mid){\n \t$need_place = array_merge($need_place, array_slice($mid_place, 0, $passangers));\n $neighbors += $passangers;\n }\n else{\n \t$neighbors += $mid;\n \t$passangers-=$mid;\n \t$need_place = array_merge($need_place, $mid_place, array_slice($bad_place, 0, $passangers));\n \t$neighbors += 2*$passangers;\n }\n}\nforeach ($need_place as $place) {\n\t$rows[$place[0]][$place[1]] = \"x\";\n}\necho $neighbors;\nforeach ($rows as $row) {\n\techo \"\\n\".$row;\n}\n?>"}, {"source_code": " 0))\n {\n $e[$y] = \"x\";\n $b--;\n }\n }\n $c[$x] = $e;\n}\nif($b > 0)\n{\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"1\") && ($b > 0))\n {\n $e[$y] = \"x\";\n $b--;\n }\n }\n $c[$x] = $e;\n }\n if($b > 0)\n {\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"2\") && ($b > 0))\n {\n $e[$y] = \"x\";\n $b--;\n }\n }\n $c[$x] = $e;\n }\n }\n else\n {\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"1\") || ($e[$y] == \"2\"))\n {\n $e[$y] = \".\";\n }\n }\n $c[$x] = $e;\n }\n }\n}\nelse\n{\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"1\") || ($e[$y] == \"2\"))\n {\n $e[$y] = \".\";\n }\n }\n $c[$x] = $e;\n }\n}\nfor($x = 0; $x < $a; $x++)\n{\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"1\") || ($e[$y] == \"2\"))\n {\n $e[$y] = \".\";\n }\n }\n $c[$x] = $e;\n}\n$f = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if($e[$y] == \"S\")\n {\n if($e[$y - 1] != NULL)\n {\n if(($e[$y - 1] == \"P\") || ($e[$y - 1] == \"x\") || ($e[$y - 1] == \"S\"))\n {\n $f++;\n }\n }\n if($e[$y + 1] != NULL)\n {\n if(($e[$y + 1] == \"P\") || ($e[$y + 1] == \"x\") || ($e[$y + 1] == \"S\"))\n {\n $f++;\n }\n }\n }\n }\n $c[$x] = $e;\n}\nprint $f . \"\\n\";\nfor($x = 0; $x < $a; $x++)\n{\n print $c[$x] . \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": " 0))\n {\n $e[$y] = \"x\";\n $b--;\n }\n }\n $c[$x] = $e;\n}\nif($b > 0)\n{\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"1\") && ($b > 0))\n {\n $e[$y] = \"x\";\n $b--;\n }\n }\n $c[$x] = $e;\n }\n if($b > 0)\n {\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"2\") && ($b > 0))\n {\n $e[$y] = \"x\";\n $b--;\n }\n }\n $c[$x] = $e;\n }\n }\n else\n {\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"1\") || ($e[$y] == \"2\"))\n {\n $e[$y] = \".\";\n }\n }\n $c[$x] = $e;\n }\n }\n}\nelse\n{\n for($x = 0; $x < $a; $x++)\n {\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if(($e[$y] == \"1\") || ($e[$y] == \"2\"))\n {\n $e[$y] = \".\";\n }\n }\n $c[$x] = $e;\n }\n}\n$f = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e = $c[$x];\n for($y = 0; $y < 12; $y++)\n {\n if($e[$y] == \"S\")\n {\n if($e[$y - 1] != NULL)\n {\n if(($e[$y - 1] == \"P\") || ($e[$y - 1] == \"x\") || ($e[$y - 1] == \"S\"))\n {\n $f++;\n }\n }\n if($e[$y + 1] != NULL)\n {\n if(($e[$y + 1] == \"P\") || ($e[$y + 1] == \"x\") || ($e[$y + 1] == \"S\"))\n {\n $f++;\n }\n }\n }\n }\n $c[$x] = $e;\n}\nprint $f . \"\\n\";\nfor($x = 0; $x < $a; $x++)\n{\n print $c[$x] . \"\\n\";\n}\n?>"}, {"source_code": " \"Px-S\",\n \"/S-\\.P/\" => \"S-xP\",\n \"/P\\.-/\" => \"Px-\",\n \"/P\\.P/\" => \"PxP\",\n \"/\\.\\.P/\" => \".xP\",\n \"/P\\.\\./\" => \"Px.\",\n \"/^\\.P/\" => \"xP\",\n \"/P\\.$/\" => \"Px\"\n);\n\n$arSecondPaterns = array(\n \"/\\.\\.S/\" =>\".xS\",\n \"/S\\.\\./\" =>\"Sx.\",\n \"/-\\.S/\"=> \"-xS\",\n \"/S\\.-/\"=> \"Sx-\",\n \"/S\\.$/\" =>\"Sx\",\n \"/^\\.S/\" =>\"xS\",\n \"/P\\.S/\"=> \"PxS\",\n \"/S\\.P/\"=> \"SxP\",\n);\n\n$count = 0;\nforeach ($arRows as $k => $row){\n if($people_count >= 2){\n $maxDuble = intval($people_count / 2);\n $arRows[$k] = preg_replace(\"/P\\.\\.P/\",\"PxxP\",$arRows[$k]);\n $people_count -= ($count * 2);\n }\n else{\n break;\n }\n\n}\n\n$count = 0;\nforeach ($arRows as $k => $row){\n foreach ($arFirstPaterns as $search => $replace){\n if($people_count >= 1){\n $arRows[$k] = preg_replace($search,$replace,$arRows[$k],$people_count,$count);\n $people_count -= $count;\n }\n else{\n break 2;\n }\n }\n}\n$count = 0;\nforeach ($arRows as $k => $row){\n foreach ($arSecondPaterns as $search => $replace){\n if($people_count >= 1){\n $arRows[$k] = preg_replace($search,$replace,$arRows[$k],$people_count,$count);\n $people_count -= $count;\n }\n else{\n break 2;\n }\n }\n}\n\nforeach ($arRows as $key => $row){\n $arrStr = str_split($row);\n $srt_return = '';\n foreach ($arrStr as $k => $char){\n if($char == \".\") {\n if ($people_count > 0) {\n if ($k >=1 && $k < 11) {\n $sos = $arrStr[$k - 1] . $arrStr[$k + 1];\n if ($sos != \"SS\") {\n $char = \"x\";\n $people_count--;\n }\n\n }\n else {\n $char = \"x\";\n $people_count--;\n }\n }\n }\n\n $srt_return = $srt_return.$char;\n }\n $arRows[$key] = $srt_return;\n\n}\n\nforeach ($arRows as $k => $row){\n\n if($people_count >= 1){\n $arRows[$k] = preg_replace(\"/\\./\",\"x\",$arRows[$k],$people_count,$count);\n $people_count -= $count;\n }\n else{\n break;\n }\n\n}\nglobal $count_result;\n$count_result = 0;\nfunction counter($f){\n global $count_result;\n if($f != \"\"){\n if($f != \"-\" && $f != \".\"){\n $count_result++;\n }\n }\n\n}\n\nforeach ($arRows as $key => $row){\n $arrStr = str_split($row);\n foreach ($arrStr as $k => $char){\n if($char == \"S\"){\n if($k > 0){\n counter($arrStr[$k-1]);\n }\n if($k < 11){\n counter($arrStr[$k+1]);\n }\n }\n }\n}\n\necho $count_result.\"\\n\";\nforeach ($arRows as $row){\n echo $row;\n}\n\n\n?>"}, {"source_code": " $pos){\n \t$pos = $arr[$i-1] + $range;\n\t\tif($arr[$i] > $pos){\n\t\t\t$velo = -1;\n\t\t\tbreak;\n\t\t} else {$velo ++;}\n }\n}\necho $velo.\" \";"}, {"source_code": " 0 && $str[$i-1] != \".\"){\n \t\t\t$neighbors++;\n \t\t}\n \t\tif($i< strlen($str)-1 && $str[$i+1]!=\".\"){\n \t\t\t$neighbors++;\n \t\t}\n \t}\n \tif($str[$i] == \".\"){\n \t\t$c = 0;\n \t\tif($i>0 && $str[$i-1]==\"S\"){\n \t\t\t$c++;\n \t\t}\n \t\tif($i+1 < strlen($str) && $str[$i+1]==\"S\"){\n \t\t\t$c++;\n \t\t}\n \t\tswitch ($c) {\n \t\t\tcase 0:\n \t\t\t\t$best_place[] = [$row, $i+$colomn];\n \t\t\t\tbreak;\n \t\t\tcase 1:\n \t\t\t\t$mid_place[] = [$row, $i+$colomn];\n \t\t\t\tbreak;\n \t\t\tcase 2:\n \t\t\t\t$bad_place[] = [$row, $i+$colomn];\n \t\t}\n \t}\n }\n}\n$list = explode(\" \", fgets(STDIN));\n$n = $list[0]; \n$passangers = $list[1];\n$best_place = [];\n$mid_place = [];\n$bad_place = [];\n$need_place = [];\n$neighbors = 0;\n$rows = [];\nfor($i = 0; $i < $n; $i++){\n\t$row = trim(fgets(STDIN));\n\t$rows[] = $row;\n\t$rows_in_row = explode(\"-\", $row);\n\t$r1 = $rows_in_row[0];\n\t$r2 = $rows_in_row[1];\n\t$r3 = $rows_in_row[2];\n sorting($r1, $i, 0);\n sorting($r2, $i, 4);\n sorting($r3, $i, 9);\n}\n$best = count($best_place);\n$mid = count($mid_place);\n$bad = count($bad_place);\necho \"neig $neighbors \\n\";\nif($best >= $passangers){\n\t$need_place = array_slice($best_place, 0, $passangers);\n}\nelse{\n $need_place = $best_place;\n $passangers -= $best;\n if($passangers <= $mid){\n \t$need_place = array_merge($need_place, array_slice($mid_place, 0, $passangers));\n $neighbors += $passangers;\n }\n else{\n \t$neighbors += $mid;\n \t$passangers-=$mid;\n \t$need_place = array_merge($need_place, $mid_place, array_slice($bad_place, 0, $passangers));\n \t$neighbors += 2*$passangers;\n }\n}\nforeach ($need_place as $place) {\n\t$rows[$place[0]][$place[1]] = \"x\";\n}\necho $neighbors.\"\\n\";\nforeach ($rows as $row) {\n\techo $row.\"\\n\";\n}\n//echo \"best\";\n//var_dump($best_place);\n//echo \"\\n mid\";\n//var_dump($mid_place);\n//echo \"\\n bad\";\n//var_dump($bad_place);\n?>"}], "src_uid": "4f45c5fd31e500c1128cf6cb5e41e3d6"} {"source_code": " $b)\n {\n print \"-1\";\n break;\n }\n }\n}\n?>", "positive_code": [{"source_code": " $b)\n {\n print \"-1\";\n break;\n }\n}\n?>"}, {"source_code": " $b)\n {\n print \"-1\";\n break;\n }\n }\n}\n?>"}, {"source_code": "", "positive_code": [{"source_code": " 4, Cube => 6, Octahedron => 8, Dodecahedron => 12, Icosahedron => 20);\n$b = trim(fgets(STDIN));\n$c = 0;\nfor($x = 0; $x < $b; $x++)\n{\n $d = trim(fgets(STDIN));\n $c += $a[$d];\n}\nprint $c;\n?>"}, {"source_code": "solution($data1, $data2);\n\n// End of interface\n\n\nclass MainClass {\n\tpublic $problemLink = 'https://codeforces.com/problemset/problem/785/A';\n\tpublic $submissionLink = '';\n\n\tpublic function solution($n, $s)\n\t{\n\t\t$res = 0;\n\t\t\tfor($i = 0; $i < $n; $i++){\n\t\t\t\tswitch ($s[$i]) {\n\t\t\t\t\tcase 'Tetrahedron':\n\t\t\t\t\t\t$res = $res + 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Cube':\n\t\t\t\t\t\t$res = $res + 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Octahedron':\n\t\t\t\t\t\t$res = $res + 8;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Dodecahedron':\n\t\t\t\t\t\t$res = $res + 12;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Icosahedron':\n\t\t\t\t\t\t$res = $res + 20;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $res;\n\t}\n\n}"}, {"source_code": ""}, {"source_code": " 4,\n 'Cube' => 6,\n 'Octahedron' => 8,\n 'Dodecahedron' => 12,\n 'Icosahedron' => 20,\n];\n$sum = 0;\nfor ($i = 1; $i <= $count; $i++) {\n $sum += $array[trim(fgets(STDIN))];\n}\n\necho $sum;"}, {"source_code": " 4, \"Cube\" => 6, \"Octahedron\" => 8, \"Dodecahedron\" => 12, \"Icosahedron\" => 20];\n\n$total = 0;\nfor ($k=0; $k<$n; $k++) {\n $total += $const[$i[$k][0]];\n}\n\necho $total;\n\n?>"}, {"source_code": ""}, {"source_code": "4,\"Cube\"=>6,\"Dodecahedron\"=>12,\"Icosahedron\"=>20,\"Octahedron\"=>8];\nfor ($i=0;$i<$n;$i++) { \n $a=trim(fgets(STDIN));\n $result+=$shekl[$a];\n}\necho $result;"}, {"source_code": " $line) {\n $input[$index] = explode(\" \", trim($line));\n}\n\n// Solve past this line\n$shapeLibrary = [\n 'Tetrahedron' => 4,\n 'Cube' => 6,\n 'Octahedron' => 8,\n 'Dodecahedron' => 12,\n 'Icosahedron' => 20\n];\n$shapes = array_slice($input, 1);\n$output = 0;\n\nforeach ($shapes as $shape) {\n $output += $shapeLibrary[$shape[0]];\n}\n\necho $output;\n "}, {"source_code": "4, \"C\"=>6, \"O\"=>8, \"D\"=>12, \"I\"=>20);\n$sum = 0;\nfor ($i=0;$i<$n;$i++){\n\t$sum += $a[substr(trim(fgets(STDIN)), 0, 1)];\n}\necho $sum; \n?>"}, {"source_code": " 0){$line = str_replace($del,'',$line);$dataex[] = $line;$text = explode(\" \",$line);\n 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;}\n function G(){$ret = $this->arr_txt[$this->ntxt++];$this->nline = $this->linex[$this->ntxt];return $ret;}\n function GL(){$this->ntxt = $this->liney[$this->nline]+1;return $this->arr_line[$this->nline++];}} /*init*/\n\n$inp = new stdIn(false);\n$n = $inp->arr_line[0];\n$gran = 0;\nfor ($i=1;$i<$n+1;$i++){\n $str = $inp->arr_line[$i];\n switch ($str){\n case \"Tetrahedron\":\n $gran = $gran + 4 ;\n break;\n case \"Cube\":\n $gran = $gran + 6 ;\n break;\n case \"Octahedron\":\n $gran = $gran + 8 ;\n break;\n case \"Dodecahedron\":\n $gran = $gran + 12 ;\n break;\n case \"Icosahedron\":\n $gran = $gran + 20 ;\n break;\n\n }\n}\necho $gran;"}], "negative_code": [], "src_uid": "e6689123fefea251555e0e096f58f6d1"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n"}], "negative_code": [], "src_uid": "296552dc2df23b3920baef7d47d0a591"} {"source_code": "= 2400) and ($s[2] > $s[1])) {\n $g = true;\n }\n}\nif ($g) {\n print \"YES\";\n} else {\n print \"NO\";\n}\n?>\n\n\n", "positive_code": [{"source_code": "= 2400) && ($e > $d))\n {\n $b = 1;\n break;\n }\n}\nif($b == 0)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>"}, {"source_code": "= 2400 && intval($x[2]) > intval($x[1])){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\tprint \"YES\";\n}else{\n\tprint \"NO\";\n}"}, {"source_code": " $pieces[1] && $pieces[1] > 2399) {\n echo 'YES';\n die();\n }\n}\necho 'NO';\n"}, {"source_code": "=2400&&($after>2400&&$after>$before)){\n\t\t$answ=\"YES\";\n\t\t\n\t\tbreak;\n\t\t\n\t}\n\t\n}\necho $answ;\n\n\n"}, {"source_code": " $before && $before >= 2400) {\n\t\tdie('YES');\n\t}\n}\ndie('NO');"}], "negative_code": [{"source_code": "= 2400 && $x[2] > $x[1]){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\tprint \"YES\";\n}else{\n\tprint \"NO\";\n}"}, {"source_code": "= 2400 && $a[$i][2] > $a[$i][1]){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\tprint \"YES\";\n}else{\n\tprint \"NO\";\n}"}, {"source_code": " 2400 && $a[$i][2] > $a[$i][1]){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\tprint \"YES\";\n}else{\n\tprint \"NO\";\n}"}, {"source_code": "$handle = fopen (\"php://stdin\",\"r\");\nfscanf($handle,\"%d\",$n);\n$a = array();\nfor($a_i = 0; $a_i < $n; $a_i++) {\n $a_temp = fgets($handle);\n $a[] = explode(\" \",$a_temp);\n array_walk($a[$a_i],'intval');\n}\n\n//$n=3;\n/*\n$handles = [\n\t['Burunduk1', 2526, 2537],\n\t['BudAlNik', 2084, 2214],\n\t['subscriber', 2833, 2749]\n];*/\n$good = false;\nfor($i=0; $i<3 ;$i++){\n\tif($a[$i][1] > 2400 && $a[$i][2] > $a[$i][1]){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\techo \"YES\";\n}else{\n\techo \"NO\";\n}"}, {"source_code": "= 2400 && intval($x[2]) > intval($x[1])){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\tprint \"YES\";\n}else{\n\tprint \"NO\";\n}"}, {"source_code": "$handle = fopen (\"php://stdin\",\"r\");\nfscanf($handle,\"%d\",$n);\n$arr_temp = fgets($handle);\n$arr = explode(\" \",$arr_temp);\narray_walk($handles,'intval');\n\n$n=3;\n$handles = [\n\t['Burunduk1', 2526, 2537],\n\t['BudAlNik', 2084, 2214],\n\t['subscriber', 2833, 2749]\n];\n$good = false;\nfor($i=0; $i<3 ;$i++){\n\tif($handles[$i][1] > 2400 && $handles[$i][2] > $handles[$i][1]){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\techo \"YES\";\n}else{\n\techo \"NO\";\n}"}, {"source_code": "$handle = fopen (\"php://stdin\",\"r\");\nfscanf($handle,\"%d\",$n);\n$a = array();\nfor($a_i = 0; $a_i < $n; $a_i++) {\n $a_temp = fgets($handle);\n $a[] = explode(\" \",$a_temp);\n array_walk($a[$a_i],'intval');\n}\n\n//$n=3;\n/*\n$handles = [\n\t['Burunduk1', 2526, 2537],\n\t['BudAlNik', 2084, 2214],\n\t['subscriber', 2833, 2749]\n];*/\n$good = false;\nfor($i=0; $i<3 ;$i++){\n\tif($a[$i][1] > 2400 && $a[$i][2] > $a[$i][1]){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\tprint \"YES\";\n}else{\n\tprint \"NO\";\n}"}, {"source_code": "= 2400 && $a[$i][2] > $a[$i][1]){\n\t\t$good = true;\n\t\tbreak;\n\t}\n}\nif($good){\n\tprint \"YES\";\n}else{\n\tprint \"NO\";\n}"}, {"source_code": "\n\n$stdin = fopen('php://stdin', 'r');\n$s = trim(fgets($stdin));\n$answ=\"NO\";\nwhile (!feof($stdin)) {\n\tlist($name,$before,$after)=explode(\" \",trim(fgets($stdin)));\n\tif($before>=2400&&$after>2400){\n\t\t$answ=\"YES\";\n\t}\n\t\n}\n\necho $answ;\n"}, {"source_code": "\n\n$stdin = fopen('php://stdin', 'r');\n$s = trim(fgets($stdin));\n$answ=\"NO\";\n$i=0;\nwhile ($i<(int)$s) {\n\t$i++;\n\tlist($name,$before,$after)=explode(\" \",trim(fgets($stdin)));\n\tif($before>=2400&&$after>2400){\n\t\t$answ=\"YES\";\n\t\t\n\t\tbreak;\n\t\t\n\t}\n\t\n}\necho $answ;\n\n\n"}, {"source_code": " $before && $before > 2400) {\n\t\tdie('YES');\n\t}\n}\ndie('NO');"}, {"source_code": " $before && $before >= 2400) {\n\t\tdie('YES');\n\t}\n}\ndie('NO');"}], "src_uid": "3bff9b69423cf6c8425e347a4beef96b"} {"source_code": "", "positive_code": [{"source_code": " $a)\n foreach($h as $j => $b)\n if($i!=$j && abs($a-$b)<=$d) $ans++;\n\necho $ans;\n"}, {"source_code": " $a)\n foreach($height as $j => $b)\n if($i!=$j && abs($a-$b)<=$d) $ans++;\n\necho $ans;\n"}, {"source_code": ""}, {"source_code": "=1 && $n<=1000)&&(is_integer($d) && $d>=1 && $d<=exp(9*log(10))))\n{ //\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u0438\u0430\u043f\u043e\u0437\u043e\u043d\u0430 \u0434\u043b\u044f n\n $f=true;\n for ($i=0; $i<=$n-1; $i++)\n {// \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u043e\u0441\u0442\u0430 \u0441\u043e\u043b\u0434\u0430\u0442\n if (($otryad[$i]<1)||($otryad[$i]>exp(9*log(10))))\n {$f=false;}\n }\n if ($f)\n {\n $count=0;\n for ($i=0; $i<$n-1; $i++)\n {\n for ($j=$i+1; $j<$n; $j++)\n {\n $h=abs($otryad[$i]-$otryad[$j]);\n if ($h<=$d) {$count++;}\n }\n }\n $count=$count*2;\n fputs(STDOUT, \"$count\");\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=1 && $n<=1000)&&($d>=1 && $d<=exp(9*log(10))))\n\t{\nfor ($i=1; $i<=$n-1; $i++)\n{\n\t$r=stripos($s,' ');\n\t$mas[$i]=substr($s, 0, $r);\n\t$s=substr($s, $r+1, $len-$r-1);\n\t}\n\t$mas[$n]=$s;\nfputs(STDOUT, \"Vihodnie dannie: \");\n\t$count=0;\n\tfor ($i=1; $i<=$n-1; $i++)\n\t{\n\t\tfor ($j=$i+1; $j<=$n; $j++)\n\t\t{\n\t\t\t$h=abs($mas[$i]-$mas[$j]);\n\t\t\tif ($h<=$d) {$count++;}\n\t\t\t}\n\t\t}\n\t\t$count=$count*2;\n\t\tfputs(STDOUT, \"$count\");\n\t}\n\telse\n\t{fputs(STDOUT, \"Nevernii diapazon\");\n\t\t}\n?>"}, {"source_code": "=1 && $n<=1000)&&($d>=1 && $d<=exp(9*log(10))))\n {\nfor ($i=1; $i<=$n-1; $i++)\n{\n $r=stripos($s,' ');\n $mas[$i]=substr($s, 0, $r);\n if (($mas[$i]<1)||($mas[$i]>exp(9*log(10))))\n {$f=false;}\n $s=substr($s, $r+1, $len-$r-1);\n }\n $mas[$n]=$s;\n if (($mas[$n]<1)||($mas[$n]>exp(9*log(10))))\n {$f=false;}\n if ($f)\n {\nfputs(STDOUT, \"Vihodnie dannie: \");\n $count=0;\n for ($i=1; $i<=$n-1; $i++)\n {\n for ($j=$i+1; $j<=$n; $j++)\n {\n $h=abs($mas[$i]-$mas[$j]);\n if ($h<=$d) {$count++;}\n }\n }\n $count=$count*2;\n fputs(STDOUT, \"$count\");\n }\n else\n {fputs(STDOUT, \"Nevernii diapazon\");\n }\n }\n?>"}, {"source_code": "\n\n\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "290d9779a6be44ce6a2e62989aee0dbd"} {"source_code": "=0;$i--)\n{\n if($left[$i] != \"=\")\n $sl+=$left[$i]*$ctmp;\n\n$ctmp++;\n}\n$ctmp=1;\nfor($i=0;$i $sl)\necho 'right';\nelse\necho 'left';\n\n?>", "positive_code": [{"source_code": "0)\n{\n if($a[$j] == '=')\n $temp = 0;\n else\n $temp = $a[$j];\n \n $totalL = $totalL +($temp * $i);\n \n $i--;\n $j++;\n}\n$right++;\nwhile($a[$right])\n{\n if($a[$right] == '=')\n $temp = 0;\n else\n $temp = $a[$right];\n \n $totalR = $totalR +($temp * ($right-$right2));\n \n $right++;\n}\n\nif($totalR > $totalL)\n echo\"right\";\nelse if($totalR < $totalL)\n echo\"left\";\nelse\n echo\"balance\";\n ?>"}, {"source_code": "$right) echo \"left\";\nelse echo \"right\";\n?>"}, {"source_code": " $value) {\n if ($value !== \"=\") {\n $pos = $key + 1;\n $leftweight += $value * $pos;\n }\n}\nforeach ($right as $key => $value) {\n if ($value !== \"=\") {\n $pos = $key + 1;\n $rightweight += $value * $pos;\n }\n}\n\nif ($leftweight == $rightweight) {\n echo \"balance\";\n} elseif ($leftweight > $rightweight) {\n echo \"left\";\n} else {\n echo \"right\";\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " $value) {\n if ($value !== \"=\") {\n $pos = $key + 1;\n $leftweight += $value * $pos;\n }\n}\nforeach ($right as $key => $value) {\n if ($value !== \"=\") {\n $pos = $key + 1;\n $rightweight += $value * $pos;\n }\n}\n\nif ($left == $right) {\n echo \"balance\";\n} elseif ($left > $right) {\n echo \"left\";\n} else {\n echo \"right\";\n}\n?>"}, {"source_code": " $value) {\n if ($value !== \"=\") {\n $pos = $key + 1;\n $leftweight += $value * $pos;\n }\n}\nforeach ($right as $key => $value) {\n if ($value !== \"=\") {\n $pos = $key + 1;\n $rightweight += $value * $pos;\n }\n}\n\nif ($left == $right) {\n echo \"balance\";\n} elseif ($left > $right) {\n echo \"left\";\n} else {\n echo \"right\";\n}\n?>"}], "src_uid": "19f2c21b18e84f50e251b1dfd557d32f"} {"source_code": "_fh = $fileHandler;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n\n$bc = Utils::bitCount($n);\nif ($bc > $k || $n<$k) {\n\techo \"NO\";\n\texit();\n} else {\n\t$stack = str_split(strrev(decbin($n)), 1);\n\n\t$d = $k - $bc;\n\twhile ($d > 0) {\n\t\t$top = array_pop($stack);\n\t\tif ($top === null) {echo \"NO\";exit();}\n\t\tif ($top <= $d) {\n\t\t\t$d -= $top;\n\t\t\t$x = array_pop($stack);\n\t\t\tif ($x === null) {echo \"NO\";exit();}\n\t\t\t$x+= $top*2;\n\t\t\tarray_push($stack, $x);\n\t\t} else {\n\t\t\t$x = array_pop($stack);\n\t\t\tif ($x === null) {echo \"NO\";exit();}\n\t\t\t$x+= $d*2;\n\t\t\tarray_push($stack, $x);\n\t\t\tarray_push($stack, $top-$d);\n\t\t\t$d -= $d;\n\t\t}\n\n\t}\n\t$s = '';\n\tforeach ($stack as $degree=>$count) {\n\t\t$s .= str_repeat(' ' . (1<<$degree), $count);\n\t}\n\techo \"YES\\n\";\n\techo trim($s);\n}\n\n", "positive_code": [{"source_code": " $b)\n{\n $c = array_fill(0, $b, 1);\n $d = 0;\n $e = 1;\n $f = 0;\n $g = 0;\n while(TRUE)\n {\n $h = pow(2, $e) + ($b - 1) + $f;\n if($h < $a)\n {\n $e++;\n }\n elseif($h == $a)\n {\n $c[$d] = pow(2, $e);\n $g = 1;\n break;\n }\n elseif($h > $a)\n {\n $b--;\n if($b == 0)\n {\n break;\n }\n $c[$d] = pow(2, $e - 1);\n $d++;\n $f += pow(2, $e - 1);\n $e = 1;\n }\n }\n if($g == 0)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $c);\n }\n}\n?>"}], "negative_code": [{"source_code": " $b)\n{\n $c = array_fill(0, $b, 1);\n $d = 0;\n $e = 1;\n $f = 0;\n while(TRUE)\n {\n $h = pow(2, $e) + ($b - 1) + $f;\n if($h < $a)\n {\n $e++;\n }\n elseif($h == $a)\n {\n $c[$d] = pow(2, $e);\n $f = 1;\n break;\n }\n elseif($h > $a)\n {\n $b--;\n if($b == 0)\n {\n break;\n }\n $c[$d] = pow(2, $e - 1);\n $d++;\n $f += pow(2, $e - 1);\n $e = 1;\n }\n }\n if($f == 0)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $c);\n }\n}\n?>"}, {"source_code": "_fh = $fileHandler;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n\n$bc = Utils::bitCount($n);\nif ($bc > $k) {\n\techo \"NO\";\n\texit();\n} else {\n\t$stack = str_split(strrev(decbin($n)), 1);\n\t\n\t$d = $k - $bc;\n\twhile ($d > 0) {\n\t\t$top = array_pop($stack);\n\t\tif ($top <= $d) {\n\t\t\t$d -= $top;\n\t\t\t$x = array_pop($stack);\n\t\t\t$x+= $top*2;\n\t\t\tarray_push($stack, $x);\n\t\t} else {\n\t\t\t$x = array_pop($stack);\n\t\t\t$x+= $d*2;\n\t\t\tarray_push($stack, $x);\n\t\t\tarray_push($stack, $top-$d);\n\t\t\t$d -= $d;\n\t\t}\n\t}\n\t$s = '';\n\tforeach ($stack as $degree=>$count) {\n\t\t$s .= str_repeat(' ' . (1<<$degree), $count);\n\t}\n\techo \"YES\\n\";\n\techo trim($s);\n}\n\n"}, {"source_code": "_fh = $fileHandler;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n\n$bc = Utils::bitCount($n);\nif ($bc > $k || $n<$k) {\n\techo \"NO\";\n\texit();\n} else {\n\t$stack = str_split(strrev(decbin($n)), 1);\n\tvar_dump($stack);\n\n\t$d = $k - $bc;\n\twhile ($d > 0) {\n\t\t$top = array_pop($stack);\n\t\tif ($top === null) {echo \"NO\";exit();}\n\t\tif ($top <= $d) {\n\t\t\t$d -= $top;\n\t\t\t$x = array_pop($stack);\n\t\t\tif ($x === null) {echo \"NO\";exit();}\n\t\t\t$x+= $top*2;\n\t\t\tarray_push($stack, $x);\n\t\t} else {\n\t\t\t$x = array_pop($stack);\n\t\t\tif ($x === null) {echo \"NO\";exit();}\n\t\t\t$x+= $d*2;\n\t\t\tarray_push($stack, $x);\n\t\t\tarray_push($stack, $top-$d);\n\t\t\t$d -= $d;\n\t\t}\n\t\tvar_dump($stack);\n\t}\n\t$s = '';\n\tforeach ($stack as $degree=>$count) {\n\t\t$s .= str_repeat(' ' . (1<<$degree), $count);\n\t}\n\techo \"YES\\n\";\n\techo trim($s);\n}\n\n"}], "src_uid": "10d6179b479e1238a51154a9a6fc13cb"} {"source_code": "';\n\n if (is_array($data)) {\n print_r($data);\n } else {\n var_dump($data);\n }\n\n if ($die) {\n die();\n }\n\n echo ' "}, {"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $c = strlen($data);\n if ($c<2 || $c>200000) print 0;\n else{\n $sc = substr_count($data, 'I');\n \tif ($sc>0) print $sc;\n \telse print substr_count($data, 'A');\n }\n ?>"}, {"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $arr = array();\n $c = strlen($data);\n for ($i=0;$i<$c;$i++)\n \t$arr[$data{$i}]++;\n \n if (isset($arr['I'])) print $arr['I'];\n elseif (isset($arr['A'])) print $arr['A'];\n else print 0;\n ?>"}, {"source_code": "\n $a = fgets(STDIN);\n $data = trim(fgets(STDIN));\n $arr = array();\n for ($i=0;$i<$a;$i++){\n \t$arr[$data{$i}]++;\n }\n if (isset($arr['I'])) print $arr['I'];\n elseif (isset($arr['A'])) print $arr['A'];\n else print 0;\n ?>"}, {"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $a = substr_count($data, 'I');\n if ($a == 1){\n \tprint 1;\n }elseif ($a > 1){\n \tprint $a - 1;\n }else print substr_count($data, 'A');\n ?>"}, {"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $sc = substr_count($data, 'I');\n if ($sc>0) print $sc;\n else print substr_count($data, 'A');\n ?>"}, {"source_code": "\n fgets(STDIN);\n $data = trim(fgets(STDIN));\n $arr = array();\n for ($i=0;$i "}], "src_uid": "5e4defe52832cc0d36e7ea5d9f86f895"} {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tif ((int)($temp_len / 2) % 2 === 1 && $temp_len !== 3){ \n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t\tif ($temp_len % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[(int)($temp_len / 2) - 1] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[(int)($temp_len / 2) + 1] + 1;\n\t\t} else {\n\t\t\t$temp_arr_1[] = $arr_key[(int)($temp_len / 2) - 1] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\t\t}\n\t} else {\n\t\tfor ($i = 0; $i < (int)($temp_len / 2); $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>", "positive_code": [{"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n\t\n/*\tanother way roop numbers is half.\n\t$len = count($arr_key);\n\tfor ($i = 0; $i < $len / 2; $i++) {\n\t\tif ($temp_c % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_1[] = $arr_key[$len - $i - 1] + 1;\n\t\t} else {\n\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[$len - $i - 1] + 1;\n\t}\n\tif ($len % 2 === 1) $temp_arr_1[] = $arr_key[$len % 2 + 1] + 1;\n\t}\n*/\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.runtime err \u30af\u30e9\u30b9\u306e\u540d\u79f0\n2.output 01\n*/\n?>"}], "negative_code": [{"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray(12);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\tforeach ($arr_key as $as_i) {\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\t$temp_c++;\n\t}\n\t\tarray_printf($temp_arr_1);\n\t\tprint(\"\\n\");\n\t\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.runtime err \u30af\u30e9\u30b9\u306e\u540d\u79f0\n2.output 01\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tif ((int)($temp_len / 2) / 2 === 1){ \n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t\t$temp_arr_1[(int)($temp_len / 2) - 1];\n\t\t$temp_arr_2[(int)($temp_len / 2)];\n\t} else {\n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tif ((int)($temp_len / 2) % 2 === 1 && $temp_len !== 3){ \n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t\t$temp_arr_1[] = $arr_key[(int)($temp_len / 2) - 1] + 1;\n\t\t$temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\t} else {\n\t\tfor ($i = 0; $i < (int)($temp_len / 2); $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tfor ($i = 0; $i < (int)($temp_len / 2); $i++) {\n\t\tif ($temp_c % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t} else {\n\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t}\n\t\t$temp_c++;\n\t}\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2) + 1] + 1;\n\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.runtime err \u30af\u30e9\u30b9\u306e\u540d\u79f0\n2.output 01\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tif ((int)($temp_len / 2) % 2 === 1 && $temp_len !== 3){ \n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t\t$temp_arr_1[] = $arr_key[(int)($temp_len / 2) - 1];\n\t\t$temp_arr_2[] = $arr_key[(int)($temp_len / 2)];\n\t} else {\n\t\tfor ($i = 0; $i < (int)($temp_len / 2); $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tif ((int)($temp_len / 2) / 2 === 1 && $temp_len !== 3){ \n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t\t$temp_arr_1[(int)($temp_len / 2) - 1];\n\t\t$temp_arr_2[(int)($temp_len / 2)];\n\t} else {\n\t\tfor ($i = 0; $i < (int)($temp_len / 2); $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\tforeach ($arr_key as $as_i) {\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\t$temp_c++;\n\t}\n\t\n/*\tanother way roop numbers is half.\n\t$len = count($arr_key);\n\tfor ($i = 0; $i < $len / 2; $i++) {\n\t\tif ($temp_c % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[$i];\n\t\t\t$temp_arr_1[] = $arr_key[$len - $i - 1];\n\t\t} else {\n\t\t\t$temp_arr_2[] = $arr_key[$i];\n\t\t\t$temp_arr_2[] = $arr_key[$len - $i - 1];\n\t}\n\tif ($len % 2 === 1) $temp_arr_1[] = $arr_key[$len % 2 + 1];\n\t}\n*/\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.runtime err \u30af\u30e9\u30b9\u306e\u540d\u79f0\n2.output 01\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tif ((int)($temp_len / 2) / 2 === 1 && $temp_len !== 3){ \n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t\t$temp_arr_1[(int)($temp_len / 2) - 1];\n\t\t$temp_arr_2[(int)($temp_len / 2)];\n\t} else {\n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\n/*\t$temp_c = 1;\n\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\tfor ($i = 0; $i < $temp_len / 2; $i++) {\n\t\tif ($temp_c % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t} else {\n\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t}\n\tif ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len % 2 + 1] + 1;\n\t}\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.runtime err \u30af\u30e9\u30b9\u306e\u540d\u79f0\n2.output 01\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tfor ($i = 0; $i < (int)($temp_len / 2); $i++) {\n\t\tif ($temp_c % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t} else {\n\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t}\n\t\t$temp_c++;\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tfor ($i = 0; $i < (int)$temp_len / 2; $i++) {\n\t\tif ($temp_c % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t} else {\n\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t}\n\t\t$temp_c++;\n\t}\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[$temp_len / 2 + 1] + 1;\n\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.runtime err \u30af\u30e9\u30b9\u306e\u540d\u79f0\n2.output 01\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\t//for ($i = 0; $i < $temp_len / 2; $i++) {\n\tif ((int)($temp_len / 2) % 2 === 1 && $temp_len !== 3){ \n\t\tfor ($i = 0; $i < (int)($temp_len / 2) - 1; $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t\t$temp_arr_1[(int)($temp_len / 2) - 1];\n\t\t$temp_arr_2[(int)($temp_len / 2)];\n\t} else {\n\t\tfor ($i = 0; $i < (int)($temp_len / 2); $i++) {\n\t\t\tif ($temp_c % 2 === 1) {\n\t\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t} else {\n\t\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t\t}\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t//if ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len / 2 + 1] + 1;\n\tif ($temp_len % 2 === 1) $temp_arr_2[] = $arr_key[(int)($temp_len / 2)] + 1;\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.\u30eb\u30fc\u30d7\u306e\u30ad\u30e3\u30b9\u30c8\n2.\u6b8b\u3063\u305f1\u3064\u3092\u5165\u308c\u308b\u914d\u5217\n3.index\u306e\u30ad\u30e3\u30b9\u30c8\n*/\n?>"}, {"source_code": "_tok = $tok;\n\t\t$this->_token = strtok($str_line, $this->_tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->_token;\n\t\t$this->_token = strtok($this->_tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n\t\n\tpublic function nextIntArray($num) {\n\t\t$temp_arr = array();\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$temp_arr[] = (int)$this->nextToken();\n\t\t}\n\t\treturn $temp_arr;\n\t}\n}\n\nfunction array_printf(array $array) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= \"$value\" . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction solve(){\n\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_k = $Token->nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$inp_arr = $Token->nextIntArray($inp_k);\n\t\n\tif (arsort(&$inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$arr_key = array_keys($inp_arr); \n\t$temp_arr_1 = array();\n\t$temp_arr_2 = array();\n\t$temp_c = 1;\n\n/*\tforeach ($arr_key as $as_i) {\n\t\t//if ($temp_c % 2 === 1) $temp_arr_1[] = $as_i;\n\t\tif ($temp_c % 2 === 1) $temp_arr_1[] = $as_i + 1;\n\t\t//else if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i;\n\t\telse if ($temp_c % 2 === 0) $temp_arr_2[] = $as_i + 1;\n\t\t$temp_c++;\n\t}\n*/\t\n\t//another way roop numbers is half.\n\t$temp_len = count($arr_key);\n\tfor ($i = 0; $i < $temp_len / 2; $i++) {\n\t\tif ($temp_c % 2 === 1) {\n\t\t\t$temp_arr_1[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_1[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t} else {\n\t\t\t$temp_arr_2[] = $arr_key[$i] + 1;\n\t\t\t$temp_arr_2[] = $arr_key[$temp_len - $i - 1] + 1;\n\t\t}\n\t\t$temp_c++;\n\t}\n\tif ($temp_len % 2 === 1) $temp_arr_1[] = $arr_key[$temp_len % 2 + 1] + 1;\n\n\n\t$len_arr1 = count($temp_arr_1);\n\t$len_arr2 = count($temp_arr_2);\n\tprintf(\"%d\\n\", $len_arr1);\n\tarray_printf($temp_arr_1);\n\tprintf(\"\\n%d\\n\", $len_arr2);\n\tarray_printf($temp_arr_2);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n/*\n1.runtime err \u30af\u30e9\u30b9\u306e\u540d\u79f0\n2.output 01\n*/\n?>"}], "src_uid": "0937a7e2f912fc094cc4275fd47cd457"} {"source_code": "in();\n\n\tfor ($i = 0; $i < $N; $i++)\n\t{\n\t\t$A[] = (int)$Input->in();\n\t}\n\n\t$M = (int)$Input->in();\n\n\t$max = -1;\n\t$c = 0;\n\n\tfor ($i = 0; $i < $M; $i++)\n\t{\n\t\t$B = (int)$Input->in();\n\n\t\tforeach ($A as $a)\n\t\t{\n\t\t\tif ($B % $a === 0)\n\t\t\t{\n\t\t\t\tif ($max < intval($B / $a))\n\t\t\t\t{\n\t\t\t\t\t$max = intval($B / $a);\n\t\t\t\t\t$c = 1;\n\t\t\t\t}\n\t\t\t\telse if ($max === intval($B / $a))\n\t\t\t\t{\n\t\t\t\t\t$c++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\n\tprint($c);\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>", "positive_code": [{"source_code": " $ff) {\n $res=1;\n $ff = $ss;\n }\n elseif ($ss == $ff) {\n $res++;\n }\n }\n }\n}\necho $res;\n?>"}, {"source_code": " $max) {$max = $b[$j]/$a[$i]; $r = 1;}\n\nprint $r;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "102667eaa3aee012fef70f4192464674"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "85f90533a9840e944deef9f3b4229cb8"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "b1959af75dfdf8281e70ae66375caa14"} {"source_code": ""}, {"source_code": "0)\n\t{\nlist($c, $d) = explode(\" \", trim(fgets(STDIN)));\n\t\tif(strlen($c)>strlen($d))\n\t\t\t$mp[$c]=$d;\n\t\telse\n\t\t\t$mp[$c]=$c;\n\t$b--;}\n\n$qw = explode(\" \", trim(fgets(STDIN)));\n\tfor ($i=0;$i<$a;$i++)\n\t{\n\t\tif ($i != $a-1)\n\t\techo $mp[$qw[$i]].\" \";\nelse echo $mp[$qw[$i]].PHP_EOL;\n\t}\n\t\n\n?>"}, {"source_code": " strlen($data[1])){\n $short_sting = $data[1];\n }\n else{\n $short_sting = $data[0];\n }\n \n $voc[$data[0]] = $short_sting;\n\n}\n\n$lection = readline();\n\n$lection_array = explode(' ', $lection);\n$new_lect = [];\nfor($a = 0;$a < $lection_size; $a++){\n $new_lect[] = $voc[$lection_array[$a]];\n}\n\n$return = implode(' ', $new_lect);\n\nprint_r($return);\n\nreturn 0;\n\n?>"}, {"source_code": " $kalame) {\n if(strlen($array[$kalame]) < strlen($kalame)){\n $jomle[$key]=$array[$kalame];\n }\n}\necho join(' ',$jomle);"}, {"source_code": "$item){\n $s = str_replace($k.\" \",$item.\" \",$s);\n}\n\necho $s;"}, {"source_code": "$item){\n $s = str_replace(\" \".$k.\" \",\" \".$item.\" \",$s);\n}\n\necho trim($s);"}], "src_uid": "edd556d60de89587f1b8daa893538530"} {"source_code": "0){\n // echo \"1\";\n echo $array[$i];\n echo \"\\n\";\n }\n else{\n $check=0;\n // echo \"2\";\n for ($l=0;$l<$len;$l++){\n // echo \"3\";\n if($var[0]!=$var[$l]){\n // echo \"4\";\n $swap=$var[0];\n $var[0]=$var[$l];\n $var[$l]=$swap;\n for($m=0;$m<$len;$m++){\n echo $var[$m];\n }\n echo \"\\n\";\n $check=-1;\n break;\n\n\n }\n }\n if($check!=-1){\n echo -1;\n echo \"\\n\";\n }\n }\n\n }\n\n // }\n\n?>"}, {"source_code": ""}, {"source_code": " $r1) {\n $r2 = max($r2, $dist[$j][1]);\n }\n }\n $result = min($result,$r1+$r2);\n }\n fprintf(STDOUT,\"%.0f\",$result);\n exit();\n}", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n if(strcmp($dist[$j][1],$r2) > 0){\n $r2 = $dist[$j][1];\n }\n\n }\n }\n // var_dump($r1);\n // var_dump($r2);\n if(strcmp($result,bcadd($r1,$r2))) {\n $result = bcadd($r1, $r2);\n }\n }\n fprintf(STDOUT,\"%s\",$result);\n\n exit();\n}\n"}, {"source_code": " 0) {\n if(strcmp($dist[$j][1],$r2) > 0){\n $r2 = $dist[$j][1];\n }\n\n }\n }\n // var_dump($r1);\n // var_dump($r2);\n if(strcmp($result,bcadd($r1,$r2)) > 0) {\n $result = bcadd($r1, $r2);\n }\n }\n fprintf(STDOUT,\"%s\",$result);\n\n exit();\n}\n"}, {"source_code": " $r1) {\n $r2 = max($r2, $dist[$j][1]);\n }\n }\n $result = min($result,$r1+$r2);\n }\n fprintf(STDOUT,\"%.0f\",$result);\n exit();\n}\n"}], "src_uid": "5db9c5673a04256c52f180dbfca2a52f"} {"source_code": ""}], "negative_code": [], "src_uid": "d2669f85bdb59715352c6bc3d7ba9652"} {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n $f = trim(fgets(STDIN));\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if($c[$f[$y]][$e[$f[$y]]] > $g)\n {\n $g = $c[$f[$y]][$e[$f[$y]]];\n }\n $e[$f[$y]]++;\n }\n print $g . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n $f = trim(fgets(STDIN));\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if($c[$f[$y]][$e[$f[$y]]] > $g)\n {\n $g = $c[$f[$y]][$e[$f[$y]]];\n $e[$y]++;\n }\n }\n print $g . \"\\n\";\n}\n?>"}, {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "6ee356f2b3a4bb88087ed76b251afec2"} {"source_code": "= $e[$y + 1])\n {\n $f = $e[$y + 1] - $d;\n if($f < 0)\n {\n $f = 0;\n }\n $c += $e[$y] - $f;\n }\n elseif($e[$y] < $e[$y + 1])\n {\n $f = $e[$y + 1] - $d;\n if($f < 0)\n {\n $f = 0;\n }\n if($e[$y] >= $f)\n {\n $c += $e[$y] - $f;\n }\n else\n {\n $c -= $f - $e[$y];\n if($c < 0)\n {\n $g = 1;\n break;\n }\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": "= $e[$y + 1])\n {\n $c += $e[$y] - ($e[$y + 1] - $d);\n }\n elseif($c >= ($e[$y + 1] - $d) - $e[$y])\n {\n $c -= ($e[$y + 1] - $d) - $e[$y];\n }\n else\n {\n $f = 1;\n break;\n }\n }\n if($f == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}], "src_uid": "3f60e740d9a3ec14223b2b1f62c52f61"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "eb1bb862dc2b0094383192f6998891c5"} {"source_code": "= 0; $y--)\n {\n if($c[$y] > $d)\n {\n $e++;\n }\n else\n {\n $d = $c[$y];\n }\n }\n print $e . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " $s){\n $z++;\n }\n $s = min($s, $arr[$j]);\n }\n printf(\"%d\\n\", $z);\n}\n?>"}], "negative_code": [], "src_uid": "09faf19627d2ff00c3821d4bc2644b63"} {"source_code": "0)\n{\n $b = strpos($a, '0');\n $c = substr_replace($a, '', $b, 1);\n echo $c;\n}else{\n $b = strpos($a, '1');\n $c = substr_replace($a, '', $b, 1);\n echo $c;\n}\n?>", "positive_code": [{"source_code": " 1)) {\n\t$res = substr($res, 1, strlen($res) - 1);\n}\n\necho $res;\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0)\n{\n $b = strpos($a, '0');\n $c = substr_replace($a, '', $b, 1);\n echo $c;\n}else{\n $b = strpos($a, '1');\n $c = substr_replace($a, '', $b, 1);\n echo $c;\n}\n?>"}], "negative_code": [{"source_code": "$v) {\n if ($v == '0') $p=$k;\n}\n$o='';\nfor ($i=0;$i "}, {"source_code": "$v) {\n if ($v == '0') $p=$k;\n}\n$o='';\nfor ($i=0;$i "}, {"source_code": "$v) {\n if ($v == '0') $p=$k;\n}\n$o='';\nfor ($i=0;$i "}], "src_uid": "133eaf241bb1557ba9a3f59c733d34bf"} {"source_code": ""}], "negative_code": [], "src_uid": "080a3458eaea4903da7fa4cf531beba2"} {"source_code": "= 0; $x--)\n{\n $d[$c[$x]] += $d[$x + 2];\n}\n$e = array();\nfor($x = 0; $x < $a; $x++)\n{\n $e[$c[$x]][count($e[$c[$x]])] = $x + 2;\n}\n$f = array(1 => 1);\n$g = array(1 => 1);\n$h = array(1);\n$i = array(0);\n$k = 2;\nwhile(TRUE)\n{\n $j = $e[$h[count($h) - 1]][$i[count($i) - 1]];\n if($j == NULL)\n {\n unset($h[count($h) - 1]);\n unset($i[count($i) - 1]);\n $i[count($i) - 1] += 1;\n if(count($h) == 0)\n {\n break;\n }\n }\n else\n {\n $f[$k] = $j;\n $g[$j] = $k;\n $k++;\n if($e[$j] == TRUE)\n {\n $h[count($h)] = $j;\n $i[count($i)] = 0;\n }\n else\n {\n $i[count($i) - 1] += 1;\n }\n }\n}\nfor($x = 0; $x < $b; $x++)\n{\n list($l, $m) = explode(\" \", trim(fgets(STDIN)));\n if($m > $d[$l])\n {\n print \"-1\\n\";\n }\n else\n {\n print $f[$g[$l] + $m - 1] . \"\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " $right_id[$u])\n echo \"-1\\n\";\n else echo \"$value_map[$id]\\n\";\n}\nfunction dfs($node){\n global $dfs_id;\n global $edge;\n global $left_id;\n global $right_id;\n global $value_map;\n $left_id[$node] = ++$dfs_id;\n $value_map[$dfs_id] = $node;\n //var_dump($node);\n if(isset($edge[$node])){\n $child_count = count($edge[$node]); \n for($i = 0;$i < $child_count;$i++){\n dfs($edge[$node][$i]);\n }\n }\n $right_id[$node] = $dfs_id; \n}"}], "negative_code": [], "src_uid": "4dffa25857c7719a43817e0ad01ef759"} {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "h = $h;\n// $this->len = 2 * ($a + $b);\n// }\n//\n//}\n//\n//class Page {\n//\n// public $a, $b, $p;\n//\n// public function __construct($a, $b, $p) {\n// $this->a = $a;\n// $this->b = $b;\n// $this->p = $p;\n// }\n//\n//}\n//\n//function getPrice($room, $page) {\n// $piece = (int)($page -> a / $room->h);\n// if($piece<=0)\n// return 99999999;\n// $wide = $piece * $page -> b;\n//\n// $yu_len = $room->len % $wide;\n// $rolls = (int)($room->len / $wide) + ($yu_len != 0 ? 1 : 0);\n// return $rolls * $page->p;\n//}\n//\n//$room = array();\n//$page = array();\n$fr = fopen(\"php://stdin\", \"r\");\n$n = (int) fgets($fr);\n$arr = fgets($fr);\nfclose($fr);\n$arr = explode(' ', $arr);\n$ary = array();\n\nforeach ($arr as $value) {\n $value2=(int)$value;\n $ary[$value2] = 1;\n}\n$cnt = 0;\nfor ($i = 1; $i <= $n; ++$i) {\n if ($ary[$i] == 1){\n// echo \"haha\";\n $cnt++;\n }\n}\necho $n-$cnt;\n\n//\n//for ($i = 0; $i < $rooms; ++$i) {\n// fscanf(STDIN, \"%d%d%d\", $a, $b, $h);\n// array_push($room, new Room($a, $b, $h));\n//}\n//\n//fscanf(STDIN, \"%d\", $pages);\n//for ($i = 0; $i < $pages; ++$i) {\n// fscanf(STDIN, \"%d%d%d\", $a, $b, $p);\n// array_push($page, new Page($a, $b, $p));\n//}\n//\n//$sum=0;\n//\n//foreach ($room as $rm) {\n// $min=99999999;\n// foreach ($page as $pg) {\n// $price=getPrice($rm, $pg);\n// if($price<$min)\n// $min=$price;\n// }\n// $sum+=$min;\n//}\n//echo $sum;\n//\n//usort($a, 'cmp');\n//$b = Array();\n//foreach ($a as $ai) {\n// $l = 0;\n// $r = count($b);\n// while ($l < $r) {\n// $m = ($l + $r) / 2;\n// if ($ai->h > $b[$m]->h) {\n// $l = $m + 1;\n// } else {\n// $r = $m;\n// }\n// }\n// $ai->p = ($r == 0 ? NULL : $b[$r - 1]);\n// $b[$r] = $ai;\n//}\n//\n//echo count($b) . \"\\n\";\n//if (count($b) > 0) {\n// $c = Array();\n// for ($p = array_pop($b); $p != NULL; $p = $p->p) {\n// array_unshift($c, $p->i);\n// }\n// print implode($c, ' ') . \"\\n\";\n//}\n?>", "positive_code": [{"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": "h = $h;\n// $this->len = 2 * ($a + $b);\n// }\n//\n//}\n//\n//class Page {\n//\n// public $a, $b, $p;\n//\n// public function __construct($a, $b, $p) {\n// $this->a = $a;\n// $this->b = $b;\n// $this->p = $p;\n// }\n//\n//}\n//\n//function getPrice($room, $page) {\n// $piece = (int)($page -> a / $room->h);\n// if($piece<=0)\n// return 99999999;\n// $wide = $piece * $page -> b;\n//\n// $yu_len = $room->len % $wide;\n// $rolls = (int)($room->len / $wide) + ($yu_len != 0 ? 1 : 0);\n// return $rolls * $page->p;\n//}\n//\n//$room = array();\n//$page = array();\n$fr = fopen(\"php://stdin\", \"r\");\n$n = (int) fgets($fr);\n$arr = fgets($fr);\nfclose($fr);\n$arr = explode(' ', $arr);\n$ary = array();\n\nforeach ($arr as $value) {\n $value=(int)$value;\n $ary[$value2] = 1;\n}\n$cnt = 0;\nfor ($i = 1; $i <= $n; ++$i) {\n if ($ary[$i] == NULL){\n// echo \"haha\";\n $cnt++;\n }\n}\necho $cnt;\n\n//\n//for ($i = 0; $i < $rooms; ++$i) {\n// fscanf(STDIN, \"%d%d%d\", $a, $b, $h);\n// array_push($room, new Room($a, $b, $h));\n//}\n//\n//fscanf(STDIN, \"%d\", $pages);\n//for ($i = 0; $i < $pages; ++$i) {\n// fscanf(STDIN, \"%d%d%d\", $a, $b, $p);\n// array_push($page, new Page($a, $b, $p));\n//}\n//\n//$sum=0;\n//\n//foreach ($room as $rm) {\n// $min=99999999;\n// foreach ($page as $pg) {\n// $price=getPrice($rm, $pg);\n// if($price<$min)\n// $min=$price;\n// }\n// $sum+=$min;\n//}\n//echo $sum;\n//\n//usort($a, 'cmp');\n//$b = Array();\n//foreach ($a as $ai) {\n// $l = 0;\n// $r = count($b);\n// while ($l < $r) {\n// $m = ($l + $r) / 2;\n// if ($ai->h > $b[$m]->h) {\n// $l = $m + 1;\n// } else {\n// $r = $m;\n// }\n// }\n// $ai->p = ($r == 0 ? NULL : $b[$r - 1]);\n// $b[$r] = $ai;\n//}\n//\n//echo count($b) . \"\\n\";\n//if (count($b) > 0) {\n// $c = Array();\n// for ($p = array_pop($b); $p != NULL; $p = $p->p) {\n// array_unshift($c, $p->i);\n// }\n// print implode($c, ' ') . \"\\n\";\n//}"}, {"source_code": "h > $b[$m]->h) {\n// $l = $m + 1;\n// } else {\n// $r = $m;\n// }\n// }\n// $ai->p = ($r == 0 ? NULL : $b[$r - 1]);\n// $b[$r] = $ai;\n//}\n//\n//echo count($b) . \"\\n\";\n//if (count($b) > 0) {\n// $c = Array();\n// for ($p = array_pop($b); $p != NULL; $p = $p->p) {\n// array_unshift($c, $p->i);\n// }\n// print implode($c, ' ') . \"\\n\";\n//}"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "bdd86c8bc54bbac6e2bb5a9d68b6eb1c"} {"source_code": " /* BismiLahi Rahmani Rahim */ ?>\n\n= $a ? $j+1 : $a; $i <= $x; $i ++) {\n $answer[] = array($i, $j);\n }\n}\nsort($answer);\n\nprintf(\"%d\\n\", count($answer));\n\nforeach ($answer as $val) {\n printf(\"%d %d\\n\", $val[0], $val[1]);\n}\n\n\n?>\n", "positive_code": [{"source_code": ""}, {"source_code": " $f[$x])\n {\n array_push($g, $e[$x] . \" \" . $f[$x]);\n }\n}\nif(count($g) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \"\\n\";\n }\n print $g[$x];\n}\n?>"}], "negative_code": [{"source_code": " $a)\n{\n $b = $a;\n}\n$e = array();\n$f = array();\n$g = $a;\n$h = $b;\n$i = $c;\n$j = $d;\n$k = 0;\n$l = array();\n$n = array();\n$o = array();\nfor($x = 1; $x <= 10000; $x++)\n{\n if($c > $d)\n {\n $k++;\n array_push($e, $c);\n array_push($f, $d);\n $p = $d;\n if(strlen($p) == 1)\n {\n $p = 0 . $p;\n }\n array_push($l, $c . \".\" . $p);\n }\n if($c == $a)\n {\n $c = $i;\n $d++;\n if($d == $b + 1)\n {\n break;\n }\n }\n $c++;\n}\nasort($l);\n$m = array_keys($l);\nfor($x = 0; $x < count($e); $x++)\n{\n array_push($n, $e[$m[$x]]);\n array_push($o, $f[$m[$x]]);\n}\nif($k > 0)\n{\n print $k . \"\\n\";\n for($x = 0; $x < count($e); $x++)\n {\n if($x == count($e) - 1)\n {\n print $n[$x] . \" \" . $o[$x];\n }\n else\n {\n print $n[$x] . \" \" . $o[$x] . \"\\n\";\n }\n }\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": " $a)\n{\n $b = $a;\n}\n$e = array();\n$f = array();\n$g = $a;\n$h = $b;\n$i = $c;\n$j = $d;\n$k = 0;\nfor($x = 1; $x <= ($g - $i + 1) + ($h - $j + 1); $x++)\n{\n if($c > $d)\n {\n $k++;\n array_push($e, $c);\n array_push($f, $d);\n }\n if($c == $a)\n {\n $c = $i;\n $d++;\n }\n $c++;\n}\nif($k > 0)\n{\n print $k . \"\\n\";\n for($x = 0; $x < count($e); $x++)\n {\n if($x == count($e) - 1)\n {\n print $e[$x] . \" \" . $f[$x];\n }\n else\n {\n print $e[$x] . \" \" . $f[$x] . \"\\n\";\n }\n }\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": " $a)\n{\n $b = $a;\n}\n$e = array();\n$f = array();\n$g = $a;\n$h = $b;\n$i = $c;\n$j = $d;\n$k = 0;\n$l = array();\n$n = array();\n$o = array();\nfor($x = 1; $x <= 10000; $x++)\n{\n if($c > $d)\n {\n $k++;\n array_push($e, $c);\n array_push($f, $d);\n array_push($l, $c . $d);\n }\n if($c == $a)\n {\n $c = $i;\n $d++;\n if($d == $b + 1)\n {\n break;\n }\n }\n $c++;\n}\nasort($l);\n$m = array_keys($l);\nfor($x = 0; $x < count($e); $x++)\n{\n array_push($n, $e[$m[$x]]);\n array_push($o, $f[$m[$x]]);\n}\nif($k > 0)\n{\n print $k . \"\\n\";\n for($x = 0; $x < count($e); $x++)\n {\n if($x == count($e) - 1)\n {\n print $n[$x] . \" \" . $o[$x];\n }\n else\n {\n print $n[$x] . \" \" . $o[$x] . \"\\n\";\n }\n }\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": " $a)\n{\n $b = $a;\n}\n$e = array();\n$f = array();\n$g = $a;\n$h = $b;\n$i = $c;\n$j = $d;\n$k = 0;\nfor($x = 1; $x <= 10000; $x++)\n{\n if($c > $d)\n {\n $k++;\n array_push($e, $c);\n array_push($f, $d);\n }\n if($c == $a)\n {\n $c = $i;\n $d++;\n if($d == $b + 1)\n {\n break;\n }\n }\n $c++;\n}\nif($k > 0)\n{\n print $k . \"\\n\";\n for($x = 0; $x < count($e); $x++)\n {\n if($x == count($e) - 1)\n {\n print $e[$x] . \" \" . $f[$x];\n }\n else\n {\n print $e[$x] . \" \" . $f[$x] . \"\\n\";\n }\n }\n}\nelse\n{\n print \"0\";\n}\n?>"}, {"source_code": " /* BismiLahi Rahmani Rahim */ ?>\n\n $x) {\n printf(\"0\");\n exit;\n}\n\nfor ($j = $b; $j <= $y; $j ++) {\n for ($i = $j + 1 >= $a ? $j+1 : $a; $i <= $x; $i ++) {\n $answer[] = array($i, $j);\n }\n}\nsort($answer);\n\nprintf(\"%d\\n\", count($answer));\n\nforeach ($answer as $val) {\n printf(\"%d %d\\n\", $val[0], $val[1]);\n}\n\n\n?>\n"}], "src_uid": "bb3e3b51a4eda8fef503952a00777910"} {"source_code": " $max_row) {\n\n $max_row = $current_row;\n $row = $j;\n $rows = [$j];\n } elseif ($current_row == $max_row) {\n $rows[] = $j;\n }\n }\n\n if ($cols) {\n $max_col = max($cols);\n $col = array_search($max_col, $cols);\n }\n\n $res = ($x - $max_col) + ($y - $max_row);\n if ($res == 0) {\n return 0;\n }\n\n foreach ($cols as $_c => $val) {\n if ($val == $max_col) {\n foreach ($rows as $_r) {\n\n if ($matrix[$_c][$_r] != '*') {\n return $res - 1;\n }\n }\n }\n }\n\n return $res;\n}\n\n\n$n = intval(fgets($__fp));\n$res1 = [];\nfor ($i = 0; $i < $n; $i++) {\n list($x, $y) = array_map('intval', explode(' ', trim(fgets($__fp))));\n $matrix = [];\n for ($j = 0; $j < $x; $j++) {\n $matrix[] = str_split(trim(fgets($__fp)));\n }\n\n $res1[] = calcTime($x, $y, $matrix);\n}\n\nfclose($__fp);\n\necho join(PHP_EOL, $res1);", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($a == 16433) && ($x == 149))\n {\n for($y = 0; $y < $b; $y++)\n {\n print implode(\" \", $e3) . \"\\n\";\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $e5 = max($e4);\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if($e5 == $c)\n {\n $i = $b - $h;\n }\n elseif($h == $b)\n {\n $i = $c - $e;\n }\n elseif(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": ""}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if($d[$y] == $h)\n {\n $d2 = $y;\n break;\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": ""}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($a == 16433) && ($x >= 147))\n {\n for($y = 0; $y < $b; $y++)\n {\n print implode(\" \", $e3) . \"\\n\";\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n if(($a == 16433) && ($x == 148))\n {\n for($y = 0; $y < $b; $y++)\n {\n print implode(\" \", $e3) . \"\\n\";\n }\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n $d3 = array_unique($d);\n if((count($e5) == 1) && ($e5[0] != \".\"))\n {\n $i = $b - $h;\n }\n elseif((count($d3) == 1) && ($d3[0] != \".\"))\n {\n $i = $c - $e;\n }\n elseif(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($a == 16433) && ($x >= 147))\n {\n for($y = 0; $y < $b; $y++)\n {\n print implode(\" \", $e3[$y]) . \"\\n\";\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($a == 16433) && ($x == 148))\n {\n print_r($e3);\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n $d3 = array_unique($d);\n if(count($e5) == 1)\n {\n $i = $b - $h;\n }\n elseif(count($d3) == 1)\n {\n $i = $c - $e;\n }\n elseif(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": ""}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($a == 16433) && ($x == 148))\n {\n for($y = 0; $y < $b; $y++)\n {\n $e4 = $e3[$y];\n print implode(\" \", $e4) . \"\\n\";\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($a == 16433) && ($x == 150))\n {\n for($y = 0; $y < $b; $y++)\n {\n print implode(\" \", $e3) . \"\\n\";\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": ""}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if($d[$y] == $h)\n {\n $d2 = $y;\n break;\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if(($e3[$e2][$d2] == \"*\") && ($e2 != $d2))\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $e)\n {\n $e = $g;\n $e2 = $y;\n }\n $e3[$y] = $f;\n }\n $h = max($d);\n for($y = 0; $y < $c; $y++)\n {\n if(($d[$y] == $h) && ($e3[$e2][$y] == \".\"))\n {\n $d2 = $y;\n break;\n }\n elseif($d[$y] == $h)\n {\n $d2 = $y;\n }\n }\n if(($a == 16433) && ($x == 147))\n {\n for($y = 0; $y < $b; $y++)\n {\n print implode(\" \", $e3) . \"\\n\";\n }\n }\n if(($e == $c) && ($h == $b))\n {\n $i = 0;\n }\n else\n {\n if($e3[$e2][$d2] == \"*\")\n {\n $i = ($b - $h) + ($c - $e);\n }\n else\n {\n $i = ($b - $h) + ($c - $e) - 1;\n }\n }\n print $i . \"\\n\";\n}\n?>"}, {"source_code": " $max_row) {\n $max_row = $current_row;\n $row = $j;\n }\n }\n\n if ($cols) {\n $max_col = max($cols);\n $col = array_search($max_col, $cols);\n }\n $res = ($x - $max_col) + ($y - $max_row);\n\n//if(!isset($matrix[$row][$col] ))\n//{\n// var_dump($matrix, $row, $col);exit;\n//}\n\n\n if($res != 0 && $matrix[$col][$row] != '*')\n {\n $res -= 1;\n }\n\n return $res;\n\n}\n\n\n$n = intval(fgets($__fp));\n$res1 = [];\nfor ($i = 0; $i < $n; $i++) {\n list($x, $y) = array_map('intval', explode(' ', trim(fgets($__fp))));\n $matrix = [];\n for ($j = 0; $j < $x; $j++)\n {\n $matrix[] = str_split(trim(fgets($__fp)));\n }\n\n $res1[] = calcTime($x, $y, $matrix);\n}\n\nfclose($__fp);\n\necho join(PHP_EOL, $res1);"}, {"source_code": " $max_row) {\n $max_row = $current_row;\n $row = $j;\n }\n }\n\n if ($cols) {\n $max_col = max($cols);\n $col = array_search($max_col, $cols);\n }\n\n return ($x - $max_col) + ($y - $max_row);\n\n}\n\n\n$n = intval(fgets($__fp));\n$res1 = [];\nfor ($i = 0; $i < $n; $i++) {\n list($x, $y) = array_map('intval', explode(' ', trim(fgets($__fp))));\n $matrix = [];\n for ($j = 0; $j < $x; $j++)\n {\n $matrix[] = str_split(trim(fgets($__fp)));\n }\n\n $res1[] = calcTime($x, $y, $matrix);\n}\n\nfclose($__fp);\n\necho join(PHP_EOL, $res1);"}, {"source_code": " $max_row) {\n $max_row = $current_row;\n $row = $j;\n }\n }\n\n if ($cols) {\n $max_col = max($cols);\n $col = array_search($max_col, $cols);\n }\n\n return ($x - $max_col) + ($y - $max_row) - 1;\n\n}\n\n\n$n = intval(fgets($__fp));\n$res1 = [];\nfor ($i = 0; $i < $n; $i++) {\n list($x, $y) = array_map('intval', explode(' ', trim(fgets($__fp))));\n $matrix = [];\n for ($j = 0; $j < $x; $j++)\n {\n $matrix[] = str_split(trim(fgets($__fp)));\n }\n\n $res1[] = calcTime($x, $y, $matrix);\n}\n\nfclose($__fp);\n\necho join(PHP_EOL, $res1);"}, {"source_code": " $max_row) {\n $max_row = $current_row;\n $row = $j;\n }\n }\n\n if ($cols) {\n $max_col = max($cols);\n $col = array_search($max_col, $cols);\n }\n\n $res = ($x - $max_col) + ($y - $max_row);\n return $res == 0 ? $res : $res - 1;\n\n}\n\n\n$n = intval(fgets($__fp));\n$res1 = [];\nfor ($i = 0; $i < $n; $i++) {\n list($x, $y) = array_map('intval', explode(' ', trim(fgets($__fp))));\n $matrix = [];\n for ($j = 0; $j < $x; $j++)\n {\n $matrix[] = str_split(trim(fgets($__fp)));\n }\n\n $res1[] = calcTime($x, $y, $matrix);\n}\n\nfclose($__fp);\n\necho join(PHP_EOL, $res1);"}], "src_uid": "a1b6a2f4659169e0e818bbdee6d36e76"} {"source_code": " $el[1] ? $el[1].' '.$el[0] : $buf;\r\n $el = $el[0] > $el[1] ? [$el[1],$el[0]] : $el;\r\n\r\n\r\n $sizes[] = $el[0];\r\n $sizes[] = $el[1];\r\n\r\n $arr[] = $buf;\r\n\r\n $arrCommon[] = $el;\r\n }else{\r\n $elCount = $buf;\r\n }\r\n $i = true;\r\n}\r\n\r\n$lineMap = array_count_values($sizes);\r\n$multiMap = array_count_values($arr);\r\n\r\nforeach($arr as $k => $size){\r\n\r\n $pExpl = explode(' ', $size);\r\n if($pExpl[0] == $pExpl[1]){\r\n\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 2;\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $lineMap[$pExpl[0]] - $multiMap[$size];\r\n\r\n $step = $pCountAdd;\r\n\r\n }else{\r\n //remove itself\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 1;\r\n $lineMap[$pExpl[1]] = $lineMap[$pExpl[1]] - 1;\r\n\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $multiMap[$size];\r\n\r\n $sameLeft = $multiMap[$pExpl[0].' '.$pExpl[0]] ? $multiMap[$pExpl[0].' '.$pExpl[0]] : 0;\r\n $sameRight = $multiMap[$pExpl[1].' '.$pExpl[1]] ? $multiMap[$pExpl[1].' '.$pExpl[1]] : 0;\r\n $pCountAdd = ($lineMap[$pExpl[0]] + $lineMap[$pExpl[1]]) - $sameLeft - $sameRight - $pCountAdd;\r\n\r\n $step = $pCountAdd;\r\n\r\n }\r\n\r\n $count += $step;\r\n\r\n}\r\n\r\necho $count;\r\n?>", "positive_code": [{"source_code": " $el[1] ? $el[1].' '.$el[0] : $buf;\r\n $el = $el[0] > $el[1] ? [$el[1],$el[0]] : $el;\r\n\r\n\r\n $sizes[] = $el[0];\r\n $sizes[] = $el[1];\r\n\r\n $arr[] = $buf;\r\n\r\n $arrCommon[] = $el;\r\n }else{\r\n $elCount = $buf;\r\n }\r\n $i = true;\r\n}\r\n\r\n$lineMap = array_count_values($sizes);\r\n$multiMap = array_count_values($arr);\r\n\r\nforeach($arr as $k => $size){\r\n\r\n $pExpl = explode(' ', $size);\r\n if($pExpl[0] == $pExpl[1]){\r\n\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 2;\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $lineMap[$pExpl[0]] - $multiMap[$size];\r\n\r\n $step = $pCountAdd;\r\n\r\n }else{\r\n //remove itself\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 1;\r\n $lineMap[$pExpl[1]] = $lineMap[$pExpl[1]] - 1;\r\n\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $multiMap[$size];\r\n\r\n $sameLeft = $multiMap[$pExpl[0].' '.$pExpl[0]] ? $multiMap[$pExpl[0].' '.$pExpl[0]] : 0;\r\n $sameRight = $multiMap[$pExpl[1].' '.$pExpl[1]] ? $multiMap[$pExpl[1].' '.$pExpl[1]] : 0;\r\n $pCountAdd = ($lineMap[$pExpl[0]] + $lineMap[$pExpl[1]]) - $sameLeft - $sameRight - $pCountAdd;\r\n\r\n $step = $pCountAdd;\r\n\r\n }\r\n\r\n $count += $step;\r\n\r\n}\r\n\r\necho $count;\r\n?>"}, {"source_code": " $el[1] ? $el[1].' '.$el[0] : $buf;\r\n $el = $el[0] > $el[1] ? [$el[1],$el[0]] : $el;\r\n\r\n $sizes[] = $el[0];\r\n $sizes[] = $el[1];\r\n\r\n $arr[] = $buf;\r\n\r\n $arrCommon[] = $el;\r\n}\r\n\r\n$lineMap = array_count_values($sizes);\r\n$multiMap = array_count_values($arr);\r\n\r\nforeach($arr as $k => $size){\r\n $pExpl = explode(' ', $size);\r\n\r\n if($pExpl[0] == $pExpl[1]){\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 2;\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $lineMap[$pExpl[0]] - $multiMap[$size];\r\n\r\n $step = $pCountAdd;\r\n } else {\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 1;\r\n $lineMap[$pExpl[1]] = $lineMap[$pExpl[1]] - 1;\r\n\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n $pCountAdd = $multiMap[$size];\r\n\r\n foreach ($multiMap as $code => $map){\r\n if($code != $size && $map > 0){\r\n $exCode = explode(' ', $code);\r\n if($exCode[0] == $pExpl[0] || $exCode[0] == $pExpl[1] || $exCode[1] == $pExpl[0] || $exCode[1] == $pExpl[1]){\r\n $pCountAdd += $map;\r\n \r\n }\r\n }\r\n }\r\n\r\n $step = $pCountAdd;\r\n }\r\n\r\n $count += $step;\r\n}\r\n\r\necho $count;\r\n?>"}, {"source_code": " 1000){\r\n echo 0;\r\n }else{\r\n function checkPair($size, $arr){\r\n $c = 0;\r\n foreach($arr as $k => $r){\r\n if($size[0] == $r[0] || $size[0] == $r[1] || $size[1] == $r[0] || $size[1] == $r[1]){\r\n $c++;\r\n }\r\n }\r\n \r\n return $c;\r\n }\r\n \r\n \r\n $tmpSizes = $sizes;\r\n foreach($sizes as $k => $size){\r\n unset($tmpSizes[$k]);\r\n $count += checkPair($size, $tmpSizes);\r\n }\r\n echo $count;\r\n }\r\n \r\n?>"}, {"source_code": " $el[1] ? $el[1].' '.$el[0] : $buf;\r\n $el = $el[0] > $el[1] ? [$el[1],$el[0]] : $el;\r\n\r\n $sizes[] = $el[0];\r\n $sizes[] = $el[1];\r\n\r\n $arr[] = $buf;\r\n\r\n $arrCommon[] = $el;\r\n}\r\n\r\n$lineMap = array_count_values($sizes);\r\n$multiMap = array_count_values($arr);\r\n\r\nforeach($arr as $k => $size){\r\n $pExpl = explode(' ', $size);\r\n\r\n if($pExpl[0] == $pExpl[1]){\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 2;\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $lineMap[$pExpl[0]] - $multiMap[$size];\r\n\r\n $step = $pCountAdd;\r\n } else {\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 1;\r\n $lineMap[$pExpl[1]] = $lineMap[$pExpl[1]] - 1;\r\n\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n $pCountAdd = $multiMap[$size];\r\n\r\n foreach ($multiMap as $code => $map){\r\n if($code != $size && $map > 0){\r\n $exCode = explode(' ', $code);\r\n if($exCode[0] == $pExpl[0] || $exCode[0] == $pExpl[1] || $exCode[1] == $pExpl[0] || $exCode[1] == $pExpl[1]){\r\n $pCountAdd += 1;\r\n \r\n }\r\n }\r\n }\r\n\r\n $step = $pCountAdd;\r\n }\r\n\r\n $count += $step;\r\n}\r\n\r\necho $count;\r\n?>"}, {"source_code": " $el[1] ? $el[1].' '.$el[0] : $buf;\r\n $el = $el[0] > $el[1] ? [$el[1],$el[0]] : $el;\r\n /*if($el[0] == $el[1]){\r\n $sizes[] = $el[0];\r\n }else{\r\n $sizes[] = $el[0];\r\n $sizes[] = $el[1];\r\n\r\n }*/\r\n\r\n $sizes[] = $el[0];\r\n $sizes[] = $el[1];\r\n\r\n $arr[] = $buf;\r\n\r\n $arrCommon[] = $el;\r\n }else{\r\n $elCount = $buf;\r\n }\r\n $i = true;\r\n}\r\n\r\n$lineMap = array_count_values($sizes);\r\n$multiMap = array_count_values($arr);\r\n\r\nforeach($arr as $k => $size){\r\n // $pCountW = $lineMap[$size[0]];\r\n // $pCountH = $lineMap[$size[1]];\r\n $pExpl = explode(' ', $size);\r\n if($pExpl[0] == $pExpl[1]){\r\n\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 2;\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $lineMap[$pExpl[0]] - $multiMap[$size];\r\n\r\n $step = $pCountAdd;\r\n\r\n }else{\r\n //remove itself\r\n $lineMap[$pExpl[0]] = $lineMap[$pExpl[0]] - 1;\r\n $lineMap[$pExpl[1]] = $lineMap[$pExpl[1]] - 1;\r\n\r\n $multiMap[$size] = $multiMap[$size] - 1;\r\n\r\n $pCountAdd = $multiMap[$size];\r\n\r\n foreach ($multiMap as $code => $map){\r\n if($code != $size && $map > 0){\r\n $exCode = explode(' ', $code);\r\n if($exCode[0] == $pExpl[0] || $exCode[0] == $pExpl[1] || $exCode[1] == $pExpl[0] || $exCode[1] == $pExpl[1]){\r\n $pCountAdd += 1;\r\n \r\n }\r\n }\r\n\r\n }\r\n\r\n $step = $pCountAdd;\r\n\r\n }\r\n\r\n $count += $step;\r\n\r\n}\r\n\r\necho $count;\r\n?>"}, {"source_code": " 100000){\r\n echo 0;\r\n}else{\r\n\r\n function cmp($a, $b) {\r\n if ($a == $b) {\r\n return 0;\r\n }\r\n return ($a < $b) ? -1 : 1;\r\n }\r\n\r\n uasort($sizes, 'cmp');\r\n\r\n\r\n /*echo ' ';\r\n print_r($sizes);\r\n echo '';*/\r\n\r\n $i = 1;\r\n foreach($sizes as $k => $size){\r\n if($size[0] == $size[1]) {\r\n $pair[] = $size[0];\r\n }else{\r\n $single[] = $size[0];\r\n $single[] = $size[1];\r\n }\r\n\r\n $i++;\r\n }\r\n\r\n $count = count($pair);\r\n\r\n foreach ($single as $k => $s){\r\n if(in_array($s, $pair)){\r\n // unset($single[$k]);\r\n $count++;\r\n }\r\n }\r\n\r\n\r\n/* echo '';\r\n print_r($hash);\r\n echo '';*/\r\n\r\n\r\n/* echo '';\r\n print_r($pair);\r\n echo '';\r\n\r\n echo '';\r\n print_r($single);\r\n echo '';*/\r\n\r\n foreach(array_count_values($single) as $value){\r\n $count+=intdiv($value,2);\r\n }\r\n\r\n echo $count;\r\n}"}, {"source_code": "width = $width;\r\n $this->height = $height;\r\n }\r\n\r\n public function width(): int\r\n {\r\n return $this->width;\r\n }\r\n\r\n public function height(): int\r\n {\r\n return $this->height;\r\n }\r\n\r\n public function mark(): void\r\n {\r\n $this->isMarked = true;\r\n }\r\n\r\n public function isMarked(): bool\r\n {\r\n return $this->isMarked;\r\n }\r\n}\r\n\r\n/**\r\n * @param Monitor[] $monitors\r\n * @return int\r\n */\r\nfunction findSuitablePairs(array $monitors): int\r\n{\r\n $groups = [];\r\n foreach ($monitors as $monitor) {\r\n $width = $monitor->width();\r\n\r\n if (!isset($groups[$width])) {\r\n $groups[$width] = [];\r\n }\r\n $groups[$width][] = $monitor;\r\n\r\n $height = $monitor->height();\r\n if ($width === $height) {\r\n continue;\r\n }\r\n\r\n if (!isset($groups[$height])) {\r\n $groups[$height] = [];\r\n }\r\n $groups[$height][] = $monitor;\r\n }\r\n\r\n $result = 0;\r\n\r\n foreach ($groups as $key => $monitors) {\r\n $countToCalc = 0;\r\n /** @var Monitor $monitor */\r\n foreach ($monitors as $monitor) {\r\n if ($monitor->isMarked()) {\r\n continue;\r\n }\r\n $countToCalc++;\r\n $monitor->mark();\r\n }\r\n $result += $countToCalc * ($countToCalc - 1) / 2;\r\n }\r\n\r\n return $result;\r\n}\r\n\r\nfunction readInput()\r\n{\r\n $commandsCount = trim(fgets(STDIN));\r\n if (empty($commandsCount)) {\r\n return [];\r\n }\r\n\r\n $result = [];\r\n\r\n for ($i = 0; $i < $commandsCount; $i++) {\r\n $result[] = explode(' ', trim(fgets(STDIN)));\r\n }\r\n\r\n return $result;\r\n}\r\n"}], "src_uid": "32c99f64fdf69b9fd87b07dbd14ceffa"} {"source_code": " $v) {\n if (isset($arr[$i + 1])) {\n $diff[] = $arr[$i + 1] - $v;\n }\n}\nsort($diff);\nwhile (--$k) {\n $result -= array_pop($diff);\n}\necho $result;\n", "positive_code": [{"source_code": " 0; $x--)\n {\n $f = $c[$x] - $c[$x - 1];\n if($e[$f] > 0)\n {\n $e[$f]--;\n $h += $g - $c[$x];\n $g = $c[$x - 1];\n }\n }\n $h += $g - $c[0];\n print $h;\n}\n?>"}, {"source_code": " $v) {\n if (isset($arr[$i + 1])) {\n $diff[] = $arr[$i + 1] - $v;\n }\n}\nsort($diff);\necho array_sum(array_slice($diff, 0, $n - $k));\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 0; $x--)\n {\n $f = $c[$x] - $c[$x - 1];\n if($e[$f] > 0)\n {\n $b--;\n $e[$f]--;\n unset($c[$x]);\n if($b == 0)\n {\n break;\n }\n }\n }\n print max($c) - min($c);\n}\n?>"}, {"source_code": " $v) {\n $pairDiff[] = (int)($arr[$i + 1] ?? $v) - (int)$v;\n}\nif ($n ==='44721' && $k ==='44000') {\n rsort($arr);\n die(implode(' ', $arr));\n}\nunset($arr);\n\nwhile ($k--) {\n $result -= $pairDiff[--$n];\n}\necho $result;\n"}, {"source_code": " $v) {\n $diff[] = ($arr[$i + 1] ?? $v) - $v;\n}\nsort($diff);\necho array_sum($n - $k);\n//15502462 1301009\n"}, {"source_code": " $v) {\n $diff[] = ($arr[$i + 1] ?? $v) - $v;\n}\nsort($diff);\necho array_sum(array_slice($diff, 0, $n - $k));\n//15502462 1301009\n"}, {"source_code": " $v) {\n if (isset($arr[$i + 1])) {\n $pairDiff[] = $arr[$i + 1] - $arr[$i];\n }\n}\n$result = $v - $arr[0];\nwhile (--$k && count($pairDiff) > 0) {\n $result -= array_pop($pairDiff);\n}\necho $result;\n"}, {"source_code": " $v) {\n $pairDiff[] = (int)($arr[$i + 1] ?? $v) - (int)$v;\n}\n$result = (int)$v - (int)$arr[0];\nunset($arr);\nwhile ($k--) {\n $result -= $pairDiff[$n - $k - 1];\n}\necho $result;\n"}, {"source_code": " $v) {\n $pairDiff[] = (int)($arr[$i + 1] ?? $v) - (int)$v;\n}\nunset($arr);\nwhile ($k--) {\n $result -= $pairDiff[--$n];\n}\necho $result;\n"}, {"source_code": " $v) {\n $pairDiff[] = ($arr[$i + 1] ?? $arr[$i]) - $arr[$i];\n}\n$result = (int)$v - (int)$arr[0];\nwhile ($k--) {\n $result -= $pairDiff[$n - $k - 1];\n}\necho $result;\n"}, {"source_code": " $v) {\n if (isset($arr[$i + 1])) {\n $pairDiff[] = $arr[$i + 1] - $arr[$i];\n }\n}\nif ($k === '1') {\n die(array_sum($pairDiff));\n}\n$limit = $n - $k;\n$result = 0;\nfor ($i = 0; $i < $limit; $i++) {\n $result += $pairDiff[$i];\n}\necho $result;\n"}, {"source_code": " $v) {\n $diff[] = ($arr[$i + 1] ?? $v) - $v;\n}\necho array_sum(array_slice($diff, 0, $n - $k));\n//15502462 1301009\n"}], "src_uid": "2895624e708159bc2a6f3e91140a6c45"} {"source_code": " 1) {\r\n for($j=1; $j < $i; $j++) {\r\n $temp .= '0 '; \r\n }\r\n }\r\n if($i > 0) {\r\n $temp .= '1'; \r\n }\r\n \r\n IO::pr($temp); \r\n }\r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}", "positive_code": [{"source_code": " 1) {\r\n for($j=1; $j < $i-1; $j++) {\r\n $temp .= '0 '; \r\n }\r\n }\r\n if($i > 0) {\r\n $temp .= '1'; \r\n }\r\n \r\n IO::pr($temp); \r\n }\r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}, {"source_code": " 1) {\r\n for($j=1; $j < $n-1; $j++) {\r\n $temp .= '0 '; \r\n }\r\n }\r\n if($i > 0) {\r\n $temp .= '1'; \r\n }\r\n \r\n IO::pr($temp); \r\n }\r\n}\r\n \r\n \r\nclass IO {\r\n public static function get()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}], "src_uid": "4a473e34f2be18a19c306d80d4693199"} {"source_code": "", "positive_code": [{"source_code": "\r\n 0,\r\n ')' => 0\r\n ];\r\n $bStatus = true;\r\n for ($i = 0; $i < $count; $i++) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b['('] += 1;\r\n }\r\n if ($b['('] < $b[')']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n $counter = 0;\r\n if ($b['('] == $b[')']) {\r\n $counter += 1;\r\n }\r\n if ($bStatus) {\r\n $b = [\r\n '(' => 0,\r\n ')' => 0\r\n ];\r\n for ($i = $count-1; $i >= 0; $i--) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b[')'] += 1;\r\n }\r\n if ($b[')'] < $b['(']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n if ($b['('] == $b[')']) {\r\n $counter += 1;\r\n }\r\n }\r\n\r\n\r\n echo $a[0] != $a[$count-1] && $count % 2 == 0 && $bStatus && $counter != 0? 'YES' : 'NO';\r\n\r\n}\r\n\r\n#$t = 1;\r\n$t = Read::int();\r\nwhile ($t--) {\r\n solve();\r\n echo \"\\n\";\r\n}\r\n\r\n\r\nclass Read\r\n{\r\n public static function string()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function int()\r\n {\r\n return intval(fgets(STDIN));\r\n }\r\n\r\n public static function array_int($sep = ' ')\r\n {\r\n $s = trim(fgets(STDIN));\r\n return preg_split(\"/[\\s,]+/\", $s);\r\n }\r\n\r\n}\r\n\r\nclass Bigint\r\n{\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 / $bigint2\r\n */\r\n public static function div($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcmod($bigint1, $bigint2) == 0 ? bcdiv($bigint1, $bigint2) : bcadd(bcdiv($bigint1, $bigint2), 1);\r\n case 'floor':\r\n return bcdiv($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcdiv($bigint1, $bigint2);\r\n return bcsub(bcdiv($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2)\r\n {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\n"}, {"source_code": " '', $y => '']);\r\n $len = strlen($s);\r\n $d = [$x => 1, $y => -1];\r\n $d[$z] = substr_count($s, $x) * 2 == $len ? -1 : 1;\r\n $sum = 0;\r\n $flg = true;\r\n for ($j = 0; $j < $len && $flg; ++$j) {\r\n $sum += $d[$s[$j]];\r\n $sum < 0 && $flg = false;\r\n }\r\n 0 != $sum && $flg = false;\r\n echo ($flg ? 'YES' : 'NO').PHP_EOL;\r\n }\r\n}\r\n"}, {"source_code": " '(', 'B' => '(', 'C' => ')'];\r\n $map[] = [$s[0] => '(', 'C' => '(', 'B' => ')'];\r\n $map[] = [$s[0] => '(', 'B' => ')', 'C' => ')'];\r\n } elseif ('B' == $s[0]) {\r\n $map[] = [$s[0] => '(', 'A' => '(', 'C' => ')'];\r\n $map[] = [$s[0] => '(', 'C' => '(', 'A' => ')'];\r\n $map[] = [$s[0] => '(', 'A' => ')', 'C' => ')'];\r\n } elseif ('C' == $s[0]) {\r\n $map[] = [$s[0] => '(', 'B' => '(', 'A' => ')'];\r\n $map[] = [$s[0] => '(', 'A' => '(', 'B' => ')'];\r\n $map[] = [$s[0] => '(', 'B' => ')', 'A' => ')'];\r\n }\r\n for ($i = 0; $i < 3; $i++) {\r\n $s2 = strtr($s, $map[$i]);\r\n $m = 0;\r\n for ($j = 0, $l = strlen($s2); $j < $l; $j++) {\r\n $m += ['(' => 1, ')' => -1][$s2[$j]];\r\n if ($m < 0) break;\r\n }\r\n if (empty($m)) break;\r\n }\r\n echo [true => 'YES', false => 'NO'][$m == 0], \"\\n\";\r\n}"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $a = str_split(IO::str());\r\n $c = [];\r\n $c[$a[0]] = 1;\r\n $c[$a[count($a) - 1]] = -1;\r\n $res1 = $res2 = [\r\n 'open' => 0, 'close' => 0\r\n ];\r\n $bool = true;\r\n $bool2 = true;\r\n $res = $res0 = 0;\r\n foreach ($a as $k => $b) {\r\n if(isset($c[$b])) {\r\n $res0 += $c[$b];\r\n if ($c[$b] == 1) {\r\n $res1['open'] += 1;\r\n } else {\r\n $res1['close'] += 1;\r\n }\r\n } else {\r\n $res0 -= 1;\r\n $res1['close'] += 1;\r\n }\r\n if ($res0 < 0) {\r\n $bool = false;\r\n }\r\n }\r\n foreach ($a as $k => $b) {\r\n if(isset($c[$b])) {\r\n $res += $c[$b];\r\n if ($c[$b] == 1) {\r\n $res2['open'] += 1;\r\n } else {\r\n $res2['close'] += 1;\r\n }\r\n } else {\r\n $res += 1;\r\n $res2['open'] += 1;\r\n }\r\n if ($res < 0) {\r\n $bool2 = false;\r\n }\r\n }\r\n\r\n if (($bool && $res1['close'] == $res1['open']) || ($bool2 && $res2['close'] == $res2['open'])) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n}"}, {"source_code": " $U,\r\n 'R' => $R,\r\n 'D' => $D,\r\n 'L' => $L\r\n ];\r\n if ($U >= $n) {\r\n $R -= 1;\r\n $L -= 1;\r\n }\r\n if ($D >= $n) {\r\n $R -= 1;\r\n $L -= 1;\r\n }\r\n if ($R >= $n) {\r\n $U -= 1;\r\n $D -= 1;\r\n }\r\n if ($L >= $n) {\r\n $U -= 1;\r\n $D -= 1;\r\n }\r\n\r\n\r\n echo max($a) <= $n && $U >= 0 && $R >= 0 && $D >= 0 && $L >= 0 ? 'YES' : 'NO';\r\n\r\n}\r\n\r\n#$t = 1;\r\n$t = Read::int();\r\nwhile ($t--) {\r\n solve();\r\n echo \"\\n\";\r\n}\r\n\r\n\r\nclass Read\r\n{\r\n public static function string()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function int()\r\n {\r\n return intval(fgets(STDIN));\r\n }\r\n\r\n public static function array_int($sep = ' ')\r\n {\r\n $s = trim(fgets(STDIN));\r\n return preg_split(\"/[\\s,]+/\", $s);\r\n }\r\n\r\n}\r\n\r\nclass Bigint\r\n{\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 / $bigint2\r\n */\r\n public static function div($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcmod($bigint1, $bigint2) == 0 ? bcdiv($bigint1, $bigint2) : bcadd(bcdiv($bigint1, $bigint2), 1);\r\n case 'floor':\r\n return bcdiv($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcdiv($bigint1, $bigint2);\r\n return bcsub(bcdiv($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2)\r\n {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\r\n 0,\r\n ')' => 0\r\n ];\r\n $bStatus = true;\r\n for ($i = 0; $i < $count; $i++) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b['('] += 1;\r\n }\r\n if ($b['('] < $b[')']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n if ($b['('] != $b[')']) {\r\n $bStatus = false;\r\n }\r\n if ($bStatus) {\r\n $b = [\r\n '(' => 0,\r\n ')' => 0\r\n ];\r\n for ($i = $count-1; $i >= 0; $i--) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b[')'] += 1;\r\n }\r\n if ($b[')'] < $b['(']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n if ($b['('] != $b[')']) {\r\n $bStatus = false;\r\n }\r\n }\r\n\r\n\r\n echo $a[0] != $a[$count-1] && $count % 2 == 0 && $bStatus ? 'YES' : 'NO';\r\n\r\n}\r\n\r\n#$t = 1;\r\n$t = Read::int();\r\nwhile ($t--) {\r\n solve();\r\n echo \"\\n\";\r\n}\r\n\r\n\r\nclass Read\r\n{\r\n public static function string()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function int()\r\n {\r\n return intval(fgets(STDIN));\r\n }\r\n\r\n public static function array_int($sep = ' ')\r\n {\r\n $s = trim(fgets(STDIN));\r\n return preg_split(\"/[\\s,]+/\", $s);\r\n }\r\n\r\n}\r\n\r\nclass Bigint\r\n{\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 / $bigint2\r\n */\r\n public static function div($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcmod($bigint1, $bigint2) == 0 ? bcdiv($bigint1, $bigint2) : bcadd(bcdiv($bigint1, $bigint2), 1);\r\n case 'floor':\r\n return bcdiv($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcdiv($bigint1, $bigint2);\r\n return bcsub(bcdiv($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2)\r\n {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\r\n 0,\r\n ')' => 0\r\n ];\r\n $bStatus = true;\r\n for ($i = 0; $i < $count; $i++) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b['('] += 1;\r\n }\r\n if ($b['('] < $b[')']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n if ($bStatus) {\r\n $b = [\r\n '(' => 0,\r\n ')' => 0\r\n ];\r\n for ($i = $count-1; $i >= 0; $i--) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b[')'] += 1;\r\n }\r\n if ($b[')'] < $b['(']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n\r\n echo $a[0] != $a[$count-1] && $count % 2 == 0 && $bStatus ? 'YES' : 'NO';\r\n\r\n}\r\n\r\n#$t = 1;\r\n$t = Read::int();\r\nwhile ($t--) {\r\n solve();\r\n echo \"\\n\";\r\n}\r\n\r\n\r\nclass Read\r\n{\r\n public static function string()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function int()\r\n {\r\n return intval(fgets(STDIN));\r\n }\r\n\r\n public static function array_int($sep = ' ')\r\n {\r\n $s = trim(fgets(STDIN));\r\n return preg_split(\"/[\\s,]+/\", $s);\r\n }\r\n\r\n}\r\n\r\nclass Bigint\r\n{\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 / $bigint2\r\n */\r\n public static function div($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcmod($bigint1, $bigint2) == 0 ? bcdiv($bigint1, $bigint2) : bcadd(bcdiv($bigint1, $bigint2), 1);\r\n case 'floor':\r\n return bcdiv($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcdiv($bigint1, $bigint2);\r\n return bcsub(bcdiv($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2)\r\n {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\r\n 0,\r\n ')' => 0\r\n ];\r\n $bStatus = true;\r\n for ($i = 0; $i < $count; $i++) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b['('] += 1;\r\n }\r\n if ($b['('] < $b[')']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n if ($bStatus) {\r\n $b = [\r\n '(' => 0,\r\n ')' => 0\r\n ];\r\n for ($i = $count-1; $i >= 0; $i--) {\r\n if ($a[0] == $a[$i]) {\r\n $b['('] += 1;\r\n } elseif ($a[$count-1] == $a[$i]) {\r\n $b[')'] += 1;\r\n } else {\r\n $b[')'] += 1;\r\n }\r\n if ($b[')'] < $b['(']) {\r\n $bStatus = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n\r\n echo $a[0] != $a[$count-1] && $bStatus ? 'YES' : 'NO';\r\n\r\n}\r\n\r\n#$t = 1;\r\n$t = Read::int();\r\nwhile ($t--) {\r\n solve();\r\n echo \"\\n\";\r\n}\r\n\r\n\r\nclass Read\r\n{\r\n public static function string()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function int()\r\n {\r\n return intval(fgets(STDIN));\r\n }\r\n\r\n public static function array_int($sep = ' ')\r\n {\r\n $s = trim(fgets(STDIN));\r\n return preg_split(\"/[\\s,]+/\", $s);\r\n }\r\n\r\n}\r\n\r\nclass Bigint\r\n{\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 / $bigint2\r\n */\r\n public static function div($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcmod($bigint1, $bigint2) == 0 ? bcdiv($bigint1, $bigint2) : bcadd(bcdiv($bigint1, $bigint2), 1);\r\n case 'floor':\r\n return bcdiv($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcdiv($bigint1, $bigint2);\r\n return bcsub(bcdiv($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2)\r\n {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\r\n= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2)\r\n {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\r\n= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2)\r\n {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '')\r\n {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": ""}], "src_uid": "4d24aaf5ebf70265b027a6af86e09250"} {"source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\nfunction readNumArray($f) {\n\treturn readStringExplodeNum($f, ' ', true);\n}\n\nfunction readArray($f) {\n\treturn readStringExplodeNum($f, ' ');\n}\n\nfunction readTrimString($f) {\n\treturn trim(readString($f));\n}\n\n###### /IO ######\n# for($i=0;$i<$n;$i++)\n\nfunction getDiffCount($base, $l) {\n\t$return = 0;\n\tforeach ($base as $i => $v) {\n\t\tif ($base[$i] != $l[$i]) {\n\t\t\t$return++;\n\t\t}\n\t}\n\treturn $return;\n}\n\nfunction getAnswer($is_test = false, $f = false) {\n\tif ($is_test === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$k = readNum($f);\n\t$n = readString($f);\n\t$items = str_split($n);\n\t$len = count($items);\n\tsort($items);\n\t$nSum = array_sum($items);\n\t$pos = 0;\n\t$steps = 0;\n\twhile ($nSum < $k && $pos < $len) {\n\t\t$need = $k - $nSum;\n\t\t$canInc = min(9 - $items[$pos], $need);\n\n\t\t$items[$pos] += $canInc;\n\t\t$nSum += $canInc;\n\t\t$steps++;\n\t\t$pos++;\n\t}\n\techo $steps;\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": " 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $c += $b[$x];\n $d[$b[$x]]++;\n}\nif($c >= $a)\n{\n print \"0\";\n}\nelse\n{\n $e = 0;\n $f = $a - $c;\n $g = 9;\n for($x = 0; $x <= 8; $x++)\n {\n $h = $d[$x];\n $i = $h * $g;\n if($f > $i)\n {\n $e += $d[$x];\n $f -= $i;\n $g--;\n }\n elseif($f == $i)\n {\n $e += $d[$x];\n $f -= $i;\n break;\n }\n elseif($f < $i)\n {\n $e += $d[$x];\n $j = $i - $f;\n $k = floor($j / $g);\n $e -= $k;\n break;\n }\n }\n print $e;\n}\n?>"}], "negative_code": [], "src_uid": "d7e6e5042b8860bb2470d5a493b0adf6"} {"source_code": "\n$str=str_replace(' ','',trim(fgets(STDIN)));\n$text=str_replace(' ','',trim(fgets(STDIN)));\n$no=0;\n$yes=0;\nfor($i=0;$i", "positive_code": [{"source_code": ""}, {"source_code": " $alph_in_header[$val]) {\n echo \"NO\";\n die();\n }\n }\n \n echo \"YES\";\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $alph_in_header[$val]) {\n echo \"NO\";\n die();\n }\n }\n \n echo \"YES\";\n?>"}], "src_uid": "b1ef19d7027dc82d76859d64a6f43439"} {"source_code": " 1) { break; }\r\n }\r\n $k = count($a) - $c;\r\n $c = floor($c / 2);\r\n $ans = $c + $k;\r\n echo $ans.PHP_EOL;\r\n}\r\n\r\n?>", "positive_code": [{"source_code": "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $a = str_split(IO::str());\r\n $b = [];\r\n $res = 0;\r\n foreach ($a as $v) {\r\n if (isset($b[$v])) {\r\n $b[$v] += 1;\r\n } else {\r\n $b[$v] = 1;\r\n }\r\n }\r\n $t = 0;\r\n foreach ($b as $k => $v) {\r\n if ($v >= 2) {\r\n $res++;\r\n } else {\r\n $t++;\r\n }\r\n }\r\n $res += floor($t / 2);\r\n IO::line($res);\r\n}\r\n\r\n\r\n?>"}], "negative_code": [{"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $a = str_split(IO::str());\r\n $b = [];\r\n $res = 0;\r\n foreach ($a as $v) {\r\n if (isset($b[$v])) {\r\n $b[$v] += 1;\r\n } else {\r\n $b[$v] = 1;\r\n }\r\n }\r\n $res = min(floor(count($a) / 2), count($b));\r\n if (count($b) == 1 && count($a) < 2) {\r\n $res = 0;\r\n }\r\n\r\n IO::line($res);\r\n}\r\n\r\n\r\n?>"}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $a = str_split(IO::str());\r\n $b = [];\r\n $res = 0;\r\n foreach ($a as $v) {\r\n if (isset($b[$v])) {\r\n $b[$v] += 1;\r\n } else {\r\n $b[$v] = 1;\r\n }\r\n }\r\n $res = min(floor(count($a) / 2), count($b));\r\n if (count($b) == 1) {\r\n $res = 0;\r\n }\r\n\r\n IO::line($res);\r\n}\r\n\r\n\r\n?>"}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $a = str_split(IO::str());\r\n $b = [];\r\n $res = 0;\r\n foreach ($a as $v) {\r\n if (isset($b[$v])) {\r\n $b[$v] += 1;\r\n } else {\r\n $b[$v] = 1;\r\n }\r\n }\r\n $res = min(floor(count($a) / 2), count($b));\r\n if (count($b) == 0) {\r\n $res = 0;\r\n }\r\n\r\n IO::line($res);\r\n}\r\n\r\n\r\n?>"}], "src_uid": "a6b760941ab8be2c32c6dc66c623ea0e"} {"source_code": " $c[$x + 1])\n {\n $h = 1;\n }\n }\n else\n {\n if($c[$x] < $c[$x + 1])\n {\n $h = 1;\n }\n }\n}\nif($h == 0)\n{\n print implode(\" \", $c);\n}\nelse\n{\n print \"Impossible\";\n}\n?>", "positive_code": [{"source_code": " '',\n\t\t\"\\n\" => '',\n\t);\n\treturn strtr(fgets($f), $r);\n}\n\nfunction readNumString($f) {\n\treturn trim(fgets($f));\n}\n\nfunction stringToArray($str) {\n\treturn str_split($str);\n}\n\nfunction readNum($f, $is_int = false) {\n\t$v = readNumString($f);\n\treturn $is_int ? intval($v) : floatval($v);\n}\n\nfunction readStringExplode($f, $delimiter = ' ') {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = 'trim';\n\treturn array_map($callf, $return);\n}\n\nfunction readStringExplodeNum($f, $delimiter = ' ', $is_int = false) {\n\t$v = readNumString($f);\n\tif ($delimiter == '') {\n\t\t$return = stringToArray($v);\n\t} else {\n\t\t$return = explode($delimiter, $v);\n\t}\n\t$callf = $is_int ? 'intval' : 'floatval';\n\treturn array_map($callf, $return);\n}\n\n###### /IO ######\n$n = readNum(STDIN);\n\t$nums = readStringExplodeNum(STDIN);\n\tsort($nums);\n\n\t$a = $b = array();\n\t$isError = false;\n\tfor ($i = 0; $i <= $n / 2; $i++) {\n\t\tif (empty($nums)) {\n\t\t\tbreak;\n\t\t}\n\t\t$num = array_shift($nums);\n\t\tif (empty($a)) {\n\t\t\t$a[$i] = $num;\n\t\t} else {\n\t\t\tif ($a[$i - 1] > $num) {\n\t\t\t\t$isError = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$a[$i] = $num;\n\t\t}\n\n\t\t$num = array_pop($nums);\n\t\tif (empty($b)) {\n\t\t\t$b[$i] = $num;\n\t\t} else {\n\t\t\tif ($b[$i - 1] < $num) {\n\t\t\t\t$isError = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$b[$i] = $num;\n\t\t}\n\t}\n\tif ($isError) {\n\t\techo 'Impossible';\n\t} else {\n\t\tforeach ($a as $i => $num) {\n\t\t\techo $a[$i] . ' ' . $b[$i] . ' ';\n\t\t}\n\t}"}], "negative_code": [], "src_uid": "2401d34db475853661d6e1e1cb5a8216"} {"source_code": " 1)\n{\n if ($p1)\n {\n $p1 = false;\n array_pop ($board);\n }\n else\n {\n $p1 = true;\n array_shift ($board);\n }\n --$n;\n}\n\n/* Output */\necho $board[0];\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": " 1) {\n echo $numbers[1];\n} else {\n echo $numbers[0];\n}\n\n"}, {"source_code": " $cols) {\n\n foreach ($cols as $col) {\n\n $numCount = 0;\n\n for ($i = -1; $i < 2; $i++) {\n\n for ($j = -1; $j < 2; $j++) {\n\n if ($i != 0 || $j != 0) {\n\n if (isset($field[$row + $i][$col + $j])) {\n\n $val = $field[$row + $i][$col + $j];\n\n if ($val == '.' || ($val != '*' && $val == 0)) {\n\n $result = 'NO';\n break;\n } elseif ($val != '*') {\n\n $numCount++;\n $field[$row + $i][$col + $j]--;\n $totalSum--;\n }\n }\n }\n }\n }\n }\n\n if ($result == 'NO') {\n break;\n }\n}\n\nif ($totalSum != 0) {\n $result = 'NO';\n}\n\necho $result;\n\n"}], "src_uid": "f93a8bd64a405233342f84542fce314d"} {"source_code": "= 0; $i--) {\n\t\t\tif (in_array(intval($str[$i]), $reversable) || $str[$i] == ':') {\n\t\t\t\t$str2 .= (intval($str[$i]) == 2 ? '5' : (intval($str[$i]) == 5 ? '2' : $str[$i]));\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tlist($h2, $m2) = explode(\":\", $str2);\n\t\tif (intval($h2) >= $h || intval($m2) >= $m) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tfunction increment_time_minutes_please($str, $h, $m) {\n\t\tlist($h2, $m2) = explode(\":\", $str);\n\t\t$h2 = intval($h2);\n\t\t$m2 = intval($m2);\n\t\tif ($m2 + 1 == $m) {\n\t\t\t$h2++;\n\t\t\t$m2 = 0;\n\t\t} else {\n\t\t\t$m2++;\n\t\t}\n\t\tif ($h2 == $h) {\n\t\t\t$h2 = 0;\n\t\t}\n\n\t\treturn ($h2 >= 10 ? $h2 : \"0\".$h2).\":\".($m2 >= 10 ? $m2 : \"0\".$m2);\n\t}\n\n\tfor ($o = 0; $o < $t; $o++) {\n\t\tlist($h, $m) = explode(\" \", trim(fgets(STDIN)));\n\t\t$time = trim(fgets(STDIN));\n\t\tfor ($i = 0; $i < $h*$m; $i++)\n\t\t\tif (check_reversed_number_if_valid_please($time, $h, $m)) {\n\t\t\t\tprint $time.\"\\n\";\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$time = increment_time_minutes_please($time, $h, $m);\n\t\t\t}\n\t\t}\n?>"}], "negative_code": [], "src_uid": "7f28e4dbd199b84bd7885bf7f479cf38"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": "#include \n#include \n\nusing namespace std;\n\nint main()\n{\n int n, m, k, i, j, count=0;\n cin>>n>>m;\n \n int st[n][m];\n for(i = 0; i < n; i++) \n\t\tfor(j = 0; j < m; j++)\n\t\tcin >> st[i][j];\n\t\t\n\tfor(i=0; i ", "positive_code": [{"source_code": " 0) $x -- ;\n else break ;\n $ans = $i;\n }\n echo $ans + $x . \"\\n\" ;\n }\n?>"}], "negative_code": [{"source_code": " 0) $x -- ;\n else\n {\n $ans = $i - 1 ;\n break ;\n }\n }\n echo $ans + $x . \"\\n\" ;\n }\n?>"}, {"source_code": " 0) $x -- ;\n else break ;\n $ans = $i;\n }\n echo $ans + $x . \"\\n\" ;\n }\n?>"}, {"source_code": " 0) $x -- ;\n else\n {\n $ans = $i - 1 ;\n break ;\n }\n }\n echo $ans . \"\\n\" ;\n }\n?>"}], "src_uid": "e5fac4a1f3a724234990fe758debc33f"} {"source_code": "= $a[$k-1]) {\n\t$i++;\n\tfputs($f, ($j+1).' ');\n\tif ($i == $k) break;\n}\n\n\nfclose($f);"}], "negative_code": [{"source_code": "3){\nfputs($handle, var_export($hList, true).\"\\n\");\nfputs($handle, var_export($newhList, true).\"\\n\");\n}\nfputs($handle, end($newhList).\"\\n\");\nfputs($handle, implode(' ',array_keys($newhList)));\t\nfclose($handle);\n"}, {"source_code": "3){\nfputs($handle, var_export($newhList, true).\"\\n\");\n}\nfputs($handle, end($newhList).\"\\n\");\nfputs($handle, implode(' ',array_keys($newhList)));\t\nfclose($handle);\n"}, {"source_code": "\n", "positive_code": [{"source_code": "=$i) {\n $t /= $i;\n $c++;\n }\n if ($c>0) {\n $pArray[$i] = $c;\n $c = 0;\n }\n }\n}\nfunction isPrime($x)\n{\n $k = floor(sqrt($x)) + 1;\n $result = true;\n for ($i = 2; $i < $k; $i++) {\n if ($x % $i ==0) {\n $result = false;\n break;\n }\n }\n return $result;\n}\n\n$r = array();\nforeach ($pArray as $p => $q) {\n for ($i = 1; $i <= $q; $i++) {\n $r[] = pow($p, $i);\n }\n}\necho count($r).PHP_EOL;\necho implode(\" \", $r);\n"}], "negative_code": [], "src_uid": "7f61b1d0e8294db74d33a6b6696989ad"} {"source_code": " $count ? $cMax : $count;", "positive_code": [{"source_code": " $b)\n {\n $f -= $c[$d];\n $d++;\n $e++;\n }\n if($e == $a)\n {\n break;\n } \n}\nprint $h;\n?>"}, {"source_code": ""}, {"source_code": " $time) {\n $max = $max > ($count -1) ? $max : ($count -1);\n $count -= 1;\n $old = $arr[$i - $count];\n $temp -=$old;\n }\n else if($i == $n-1){\n $max = $max > ($count) ? $max : ($count);\n }\n }\n echo $max;\n}\n\ntest($n,$a,$t);"}, {"source_code": " $maxBooks) {\n $maxBooks = $right - $left + 1;\n }\n } else {\n $sum -= $a[$left];\n $left++;\n $right--;\n }\n $right++;\n}\necho ($maxBooks);"}, {"source_code": " $t) {\n\n $temp = $i - $start;\n\n if ($temp > $maxLength) {\n $maxLength = $temp;\n }\n\n $s -= (int) $a[$start];\n $start++;\n }\n}\n\nif ($s <= $t) {\n $temp = $n - $start;\n\n if ($temp > $maxLength) {\n $maxLength = $temp;\n }\n}\n\necho $maxLength < 0 ? 0 : $maxLength;"}, {"source_code": " /* BismiLahi Rahmani Rahim */ ?>\n\n\n"}], "negative_code": [{"source_code": ""}, {"source_code": " $b)\n {\n $d[$i] = $h;\n $h--;\n $i++;\n $g -= $c[$e];\n $e++;\n }\n}\nprint max($d);\n?>"}, {"source_code": " $b)\n {\n $d[$i] = $h;\n $i++;\n $h--;\n $g -= $c[$e];\n $e++;\n }\n}\nprint max($d);\n?>"}, {"source_code": " $b)\n {\n $d[$i] = $h;\n $h--;\n $i++;\n $g -= $c[$e];\n $e++;\n }\n}\nprint max($d);\n?>"}, {"source_code": " $b)\n {\n $f -= $c[$d];\n $d++;\n $e++;\n $g--;\n if($e == $a)\n {\n break;\n }\n }\n}\nprint max($h, $g);\n?>"}, {"source_code": " $b)\n {\n $d[$i] = $h;\n $i++;\n $h--;\n $g -= $c[$e];\n $e++;\n }\n}\nprint max($d);\n?>"}, {"source_code": ""}, {"source_code": " $b)\n {\n $f -= $c[$d];\n $d++;\n $e++;\n $g--;\n if($e == $a)\n {\n break;\n }\n }\n}\nprint max($h, $g);\n?>"}, {"source_code": ""}, {"source_code": " $t)\n break;\n $total = $temp;\n}\n\necho $count;"}, {"source_code": " $t)\n break;\n $total = $temp;\n}\n\necho $total;"}, {"source_code": " $t)\n break;\n $total = $temp;\n}\n\necho $total;"}, {"source_code": " $t)\n break;\n}\n\necho $total;"}, {"source_code": " $t)\n break;\n $total = $temp;\n $count++;\n}\n\necho $count;"}, {"source_code": " $maxBooks) {\n $maxBooks = $right - $left + 1;\n }\n } else {\n $sum -= $a[$left];\n $left++;\n $right--;\n }\n $right++;\n}\necho ($maxBooks);"}], "src_uid": "ef32a8f37968629673547db574261a9d"} {"source_code": " 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n continue;\n }\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n if($i+1 < count($b) && $b[$i]+$b[$i-1] == $b[$i+1]) continue;\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n if($i+2 < count($b) && $b[$i]+$b[$i+1] == $b[$i+2]) continue;\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) {\n break(2);\n }\n }\n }\n \n if($b == $d){\n print \"YES\\n\";\n foreach($who as $w){\n print $w.\"\\n\";\n }\n }\n else print \"NO\";\n \n}\n?>", "positive_code": [{"source_code": "= 0))\n {\n while(TRUE)\n {\n if(($m[$y - 1] == FALSE) && ($m[$y + 1] == FALSE))\n {\n break;\n }\n elseif((($m[$y - 1] < $m[$y]) && ($m[$y + 1] >= $m[$y]) && (($y - 1) >= 0)) || (($m[$y - 1] < $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y - 1) >= 0)) || ($m[$y + 1] == FALSE))\n {\n print ($y + $x + 1) . \" L\\n\";\n $m[$y - 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n $y--;\n }\n elseif((($m[$y - 1] >= $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y + 1) >= 0)) || ($m[$y - 1] == FALSE))\n {\n print ($y + $x + 1) . \" R\\n\";\n $m[$y + 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n }\n }\n break;\n }\n elseif(($m[$y] == $n) && ($m[$y + 1] < $n))\n {\n while(TRUE)\n {\n if(($m[$y - 1] == FALSE) && ($m[$y + 1] == FALSE))\n {\n break;\n }\n elseif((($m[$y - 1] < $m[$y]) && ($m[$y + 1] >= $m[$y]) && (($y - 1) >= 0)) || (($m[$y - 1] < $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y - 1) >= 0)) || ($m[$y + 1] == FALSE))\n {\n print ($y + $x + 1) . \" L\\n\";\n $m[$y - 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n $y--;\n }\n elseif((($m[$y - 1] >= $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y + 1) >= 0)) || ($m[$y - 1] == FALSE))\n {\n print ($y + $x + 1) . \" R\\n\";\n $m[$y + 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n }\n }\n break;\n }\n }\n \n }\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n continue;\n }\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n if($i+1 < count($b) && $b[$i]+$b[$i-1] == $b[$i+1]) continue;\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n if($i+2 < count($b) && $b[$i]+$b[$i+1] == $b[$i+2]) continue;\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) {\n break(2);\n }\n }\n }\n \n if($b == $d){\n print \"YES\\n\";\n foreach($who as $w){\n print $w.\"\\n\";\n }\n }\n else print \"NO\";\n \n}\n?>"}], "negative_code": [{"source_code": "= 0))\n {\n while(TRUE)\n {\n if(($m[$y - 1] == FALSE) && ($m[$y + 1] == FALSE))\n {\n break;\n }\n elseif((($m[$y - 1] < $m[$y]) && ($m[$y + 1] >= $m[$y]) && (($y - 1) >= 0)) || (($m[$y - 1] < $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y - 1) >= 0)) || ($m[$y + 1] == FALSE))\n {\n print ($y + $x + 1) . \" L\\n\";\n $m[$y - 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n $y--;\n }\n elseif((($m[$y - 1] >= $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y + 1) >= 0)) || ($m[$y - 1] == FALSE))\n {\n print ($y + $x + 1) . \" R\\n\";\n $m[$y + 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n }\n }\n break;\n }\n elseif(($m[$y] == $n) && ($m[$y + 1] < $n))\n {\n while(TRUE)\n {\n if(($m[$y - 1] == FALSE) && ($m[$y + 1] == FALSE))\n {\n break;\n }\n elseif((($m[$y - 1] < $m[$y]) && ($m[$y + 1] >= $m[$y]) && (($y - 1) >= 0)) || (($m[$y - 1] < $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y - 1) >= 0)) || ($m[$y + 1] == FALSE))\n {\n print ($y + $x + 1) . \" L\\n\";\n $m[$y - 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n $y--;\n }\n elseif((($m[$y - 1] >= $m[$y]) && ($m[$y + 1] < $m[$y]) && (($y + 1) >= 0)) || ($m[$y - 1] == FALSE))\n {\n print ($y + $x + 1) . \" R\\n\";\n $m[$y + 1] += $m[$y];\n $o = array_slice($m, 0, $y);\n $p = array_slice($m, $y + 1);\n $m = array_merge($o, $p);\n }\n }\n break;\n }\n }\n \n }\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n continue;\n }\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n //$b = array_slice($b, $i);\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n //$b = array_slice($b, $i+1);\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) {\n foreach($b as $bv) print $bv.\" \";\n print \"\\n\";\n foreach($d as $dv) print $dv.\" \";\n print \"\\n------\\n\";\n break(2);\n }\n }\n foreach($b as $bv) print $bv.\" \";\n print \"\\n\";\n foreach($d as $dv) print $dv.\" \";\n print \"\\n------\\n\";\n }\n \n if($b == $d){\n print \"YES\\n\";\n foreach($who as $w){\n print $w.\"\\n\";\n }\n }\n else print \"NO\";\n \n}\n?>"}, {"source_code": " 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n continue;\n }\n\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) {\n break(2);\n }\n }\n \n }\n \n if($c == 1 && $b != $d){\n $b = $cb;\n $d = $cd;\n $who = array();\n $k = 0;\n while(count($d) > 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n continue;\n }\n for($i = count($b)-1; $i >= 0; $i--){\n if($i > 0 && $b[$i] > $b[$i-1]){\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) {\n break(2);\n }\n }\n }\n }\n \n if($b == $d){\n print \"YES\\n\";\n foreach($who as $w){\n print $w.\"\\n\";\n }\n }\n else print \"NO\";\n \n}\n?>"}, {"source_code": " 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n continue;\n }\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n //$b = array_slice($b, $i);\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n //$b = array_slice($b, $i+1);\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) {\n break(2);\n }\n }\n }\n \n if($b == $d){\n print \"YES\\n\";\n foreach($who as $w){\n print $w.\"\\n\";\n }\n }\n else print \"NO\";\n \n}\n?>"}, {"source_code": " 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n continue;\n }\n if ($sd > 1){\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) {\n break(2);\n }\n }\n }\n else{\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i == count($b)-1) {\n break(2);\n }\n }\n }\n }\n \n if($b == $d){\n print \"YES\\n\";\n foreach($who as $w){\n print $w.\"\\n\";\n }\n }\n else print \"NO\";\n \n}\n?>"}, {"source_code": " 0){\n if($b[0] == $d[0]){\n $b = array_slice($b, 1);\n $d = array_slice($d, 1);\n $k++;\n }\n for($i = 0; $i < count($b); $i++){\n if($i > 0 && $b[$i] > $b[$i-1]){\n $b[$i] += $b[$i-1];\n $who[] = ($i+1+$k).' L';\n //$b = array_slice($b, $i);\n unset($b[$i-1]);\n $b = array_values($b);\n break;\n }\n if($i+1 < count($b) && $b[$i] > $b[$i+1]){\n $b[$i] += $b[$i+1];\n $who[] = ($i+1+$k).' R';\n //$b = array_slice($b, $i+1);\n unset($b[$i+1]);\n $b = array_values($b);\n break;\n } \n if($i == count($b)-1) break(2);\n }\n }\n \n if(count($who) && $b == $d){\n print \"YES\\n\";\n foreach($who as $w){\n print $w.\"\\n\";\n }\n }\n else print \"NO\";\n \n}\n?>"}], "src_uid": "a37f805292e68bc0ad4555fa32d180ef"} {"source_code": " ' ...',\n '/(\\\\s*,\\\\s*)/s' => ', ',\n '/\\\\s{2,}/s' => ' ',\n '/\\\\.\\\\.\\\\. (\\d)/s' => '...$1',\n);\n$str = fgets(STDIN);\n$str = preg_replace(array_keys($rx), array_values($rx), $str);\nfwrite(STDOUT, trim($str));"}, {"source_code": ""}, {"source_code": "\n$input = file_get_contents(\"php://stdin\");\n\n$len = strlen ($input);\n$result = '';\n$prew = '';\nfor($i = 0; $i < $len; $i++){\n if($input[$i] == '.'){\n if($prew){\n $result .= $prew . '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n $prew = '';\n } else if($input[$i] == ','){\n if($prew == ', '){\n $result .= $prew;\n }\n $prew = ', ';\n } else if($input[$i] == ' '){\n if(!$prew){\n $prew = ' ';\n }\n } else {\n if($prew == ', ' || $result[strlen ($result) - 1] != '.'){\n $result .= $prew;\n }\n $result .= $input[$i];\n $prew = '';\n }\n}\necho trim($result);\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "= 0; $x--)\n{\n if(($b[$x] == \",\") && (($b[$x - 1] == \" \")))\n {\n array_splice($b, $x - 1, 1);\n $x++;\n }\n}\nfor($x = 0; $x < count($b); $x++)\n{\n if(($b[$x] == \",\") && ($b[$x + 1] == \",\"))\n {\n $b[$x] = \", \";\n }\n}\nprint implode($b);\n?>"}, {"source_code": ""}, {"source_code": "= 0; $x--)\n{\n if(($b[$x] == \",\") && (($b[$x - 1] == \" \")))\n {\n array_splice($b, $x - 1, 1);\n $x++;\n }\n}\nprint implode($b);\n?>"}, {"source_code": "= 0; $x--)\n{\n if(($b[$x] == \",\") && (($b[$x - 1] == \" \")))\n {\n array_splice($b, $x - 1, 1);\n $x++;\n }\n}\nfor($x = 0; $x < count($b); $x++)\n{\n if(($b[$x] == \",\") && ($b[$x + 1] == \",\"))\n {\n $b[$x] = \", \";\n }\n}\nprint implode($b);\n?>"}, {"source_code": "= 0; $x--)\n{\n if(($b[$x] == \",\") && (($b[$x - 1] == \" \")))\n {\n array_splice($b, $x - 1, 1);\n $x++;\n }\n}\nfor($x = 0; $x < count($b); $x++)\n{\n if(($b[$x] == \",\") && ($b[$x + 1] == \",\"))\n {\n $b[$x] = \", \";\n }\n}\nprint implode($b);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " ' ...',\n '/(\\\\s*,\\\\s*)/s' => ', ',\n '/\\\\s{2,}/s' => ' ',\n);\n$str = fgets(STDIN);\n$str = preg_replace(array_keys($rx), array_values($rx), $str);\nfwrite(STDOUT, trim($str));"}, {"source_code": " ' ...',\n '/(\\\\s*,\\\\s*)/s' => ', ',\n '/\\\\s\\\\s/s' => ' ',\n);\n$str = fgets(STDIN);\n$str = preg_replace(array_keys($rx), array_values($rx), $str);\nfwrite(STDOUT, trim($str));"}, {"source_code": ""}, {"source_code": "\n$input = file_get_contents(\"php://stdin\");\n\n$len = strlen ($input);\n$result = '';\n$prew = '';\nfor($i = 0; $i < $len; $i++){\n if($input[$i] == '.'){\n if($prew){\n $result .= $prew . '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n $prew = '';\n } else if($input[$i] == ','){\n if($prew == ', '){\n $result .= $prew;\n }\n $prew = ', ';\n } else if($input[$i] == ' '){\n if(!$prew){\n $prew = ' ';\n }\n } else {\n if($prew && $result[strlen ($result) - 1] != '.'){\n $result .= $prew;\n }\n $result .= $input[$i];\n $prew = '';\n }\n}\necho trim($result);\n?>"}, {"source_code": "\n/*\n$start_time = microtime();\n$start_array = explode(\" \",$start_time);\n$time['start'] = $start_array[1] + $start_array[0];*/\n\n$input = file_get_contents(\"php://stdin\");\n$input = str_replace(\" \", \"\", $input);\n\n$len = strlen ($input);\n$result = '';\nfor($i = 0; $i < $len; $i++){\n //echo $input[$i];\n if($input[$i] == '.'){\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd';\n if($i < 1 || $input[$i - 1] == ','){\n $result .= '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n } else if($input[$i] == ','){\n $result .= ', ';\n } else {\n $result .= $input[$i];\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd';\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n }\n \n \n //echo \"\\n\";\n}\n\necho $result;\n/*\n$end_time = microtime();\n$end_array = explode(\" \",$end_time);\n$time['gener_class'] = $end_array[1] + $end_array[0];\necho $time_gener['class'] = round($time['gener_class']-$time['start'],5);*/\n?>"}, {"source_code": "\n/*\n$start_time = microtime();\n$start_array = explode(\" \",$start_time);\n$time['start'] = $start_array[1] + $start_array[0];*/\n\n$input = file_get_contents(\"php://stdin\");\n$input = str_replace(\" \", \"\", $input);\n\n$len = strlen ($input);\n$result = '';\nfor($i = 0; $i < $len; $i++){\n //echo $input[$i];\n if($input[$i] == '.'){\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd';\n if($i < 1 || $input[$i - 1] == ','){\n $result .= '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n } else if($input[$i] == ','){\n if(isset($input[$i + 1])){\n\t\t\t$result .= ', ';\n\t\t} else {\n\t\t\t$result .= ',';\n\t\t}\n } else {\n $result .= $input[$i];\n if($input[$i + 1] == ','){\n $i++;\n $result .= ', ';\n }\n }\n \n \n //echo \"\\n\";\n}\n\necho trim($result);\n/*\n$end_time = microtime();\n$end_array = explode(\" \",$end_time);\n$time['gener_class'] = $end_array[1] + $end_array[0];\necho $time_gener['class'] = round($time['gener_class']-$time['start'],5);*/\n?>"}, {"source_code": "\n/*\n$start_time = microtime();\n$start_array = explode(\" \",$start_time);\n$time['start'] = $start_array[1] + $start_array[0];*/\n\n$input = file_get_contents(\"php://stdin\");\n$input = str_replace(\" \", \"\", $input);\n\n$len = strlen ($input);\n$result = '';\nfor($i = 0; $i < $len; $i++){\n //echo $input[$i];\n if($input[$i] == '.'){\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd';\n if($i > 1 && $input[$i - 1] == ','){\n $result .= '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n } else if($input[$i] == ','){\n $result .= ', ';\n } else {\n $result .= $input[$i];\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd';\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n }\n \n \n //echo \"\\n\";\n}\n\necho $result;\n/*\n$end_time = microtime();\n$end_array = explode(\" \",$end_time);\n$time['gener_class'] = $end_array[1] + $end_array[0];\necho $time_gener['class'] = round($time['gener_class']-$time['start'],5);*/\n?>"}, {"source_code": "\n$input = file_get_contents(\"php://stdin\");\n\n$len = strlen ($input);\n$result = '';\n$prew = '';\nfor($i = 0; $i < $len; $i++){\n if($input[$i] == '.'){\n if($prew){\n $result .= $prew . '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n $prew = '';\n } else if($input[$i] == ','){\n if($prew == ', '){\n $result .= $prew;\n }\n $prew = ', ';\n } else if($input[$i] == ' '){\n if(!$prew){\n $prew = ' ';\n }\n } else {\n $result .= $prew . $input[$i];\n $prew = '';\n }\n}\necho trim($result);\n?>"}, {"source_code": "\n/*\n$start_time = microtime();\n$start_array = explode(\" \",$start_time);\n$time['start'] = $start_array[1] + $start_array[0];*/\n\n$input = file_get_contents(\"php://stdin\");\n$input = str_replace(\" \", \"\", $input);\n\n$len = strlen ($input);\n$result = '';\nfor($i = 0; $i < $len; $i++){\n //echo $input[$i];\n if($input[$i] == '.'){\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd';\n if($input[$i - 1] == ','){\n $result .= '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n if($i > 1 && $input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n } else if($input[$i] == ','){\n $result .= ', ';\n } else {\n $result .= $input[$i];\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd';\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n }\n \n \n //echo \"\\n\";\n}\n\necho $result;\n/*\n$end_time = microtime();\n$end_array = explode(\" \",$end_time);\n$time['gener_class'] = $end_array[1] + $end_array[0];\necho $time_gener['class'] = round($time['gener_class']-$time['start'],5);*/\n?>"}, {"source_code": "\n/*\n$start_time = microtime();\n$start_array = explode(\" \",$start_time);\n$time['start'] = $start_array[1] + $start_array[0];*/\n\n$string = file_get_contents(\"php://stdin\");\n\n$patterns[0] = \"/(\\s+),/\";\n$patterns[1] = \"/,/\";\n$patterns[2] = \"/(\\.\\.\\.)/\";\n$patterns[3] = \"/(\\s+)/\";\n\n\n$replacements[3] = \",\";\n$replacements[2] = \", \";\n$replacements[1] = \" ...\";\n$replacements[0] = \" \";\n\necho trim(preg_replace($patterns, $replacements, $string));\n/*\n$end_time = microtime();\n$end_array = explode(\" \",$end_time);\n$time['gener_class'] = $end_array[1] + $end_array[0];\necho $time_gener['class'] = round($time['gener_class']-$time['start'],5);*/\n?>"}, {"source_code": "\n/*\n$start_time = microtime();\n$start_array = explode(\" \",$start_time);\n$time['start'] = $start_array[1] + $start_array[0];*/\n\n$input = file_get_contents(\"php://stdin\");\n$input = str_replace(\" \", \"\", $input);\n\n$len = strlen ($input);\n$result = '';\nfor($i = 0; $i < $len; $i++){\n //echo $input[$i];\n if($input[$i] == '.'){\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd';\n if($i < 1 || $input[$i - 1] == ','){\n $result .= '...';\n } else {\n $result .= ' ...';\n }\n $i += 2;\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n } else if($input[$i] == ','){\n if(isset($input[$i + 1])){\n\t\t\t$result .= ', ';\n\t\t} else {\n\t\t\t$result .= ',';\n\t\t}\n } else {\n $result .= $input[$i];\n //echo ' \ufffd\ufffd\ufffd\ufffd\ufffd';\n if($input[$i + 1] == ','){\n //echo ' \ufffd\ufffd\ufffd';\n $i++;\n $result .= ', ';\n }\n }\n \n \n //echo \"\\n\";\n}\n\necho $result;\n/*\n$end_time = microtime();\n$end_array = explode(\" \",$end_time);\n$time['gener_class'] = $end_array[1] + $end_array[0];\necho $time_gener['class'] = round($time['gener_class']-$time['start'],5);*/\n?>"}], "src_uid": "c7d8c71a1f7e6c7364cce5bddd488a2f"} {"source_code": "\n\n$str1 = trim(fgets(STDIN));\n$str2 = trim(fgets(STDIN));\n//$str1 = '11 5';\n//$str2 = '3 2 3 2 2';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n\n$i=-1;\nforeach($arr as $key=>$value){\n $i++;\n $arr3[$i]=$value;\n $arr4[$i]=$key;\n}\n$arr=$arr3;\n\n$max=$arr[sizeof($arr)-1];\n//print_r($arr); echo '
';\n//print_r($arr3); echo '
';\n//print_r($arr4); echo '
';\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n //echo $k.' ';\n echo $arr4[$k].' ';\n }\n}\n\n?>", "positive_code": [{"source_code": " $a)\n{\n for($x = 0; $x <= count($e) - $a; $x++)\n {\n $i = array_slice($e, $x, $a);\n $j = $i[0];\n $k = $i[$a - 1];\n $l = 0;\n if($j == $k)\n {\n $i = array_slice($i, 1);\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] != $j) && ($i[$y + 1] != $j))\n {\n $l = 1;\n $m = array_slice($i, 0, $y + 1);\n $n = array_slice($i, $y + 1);\n break;\n }\n }\n array_push($m, $j);\n $o = array_merge($m, $n);\n if($l == 1)\n {\n break;\n }\n }\n else\n {\n $l = 2;\n break;\n }\n }\n if($l == 0)\n {\n print \"-1\";\n }\n elseif($l == 1)\n {\n print implode(\" \", $o);\n }\n elseif($l == 2)\n {\n print implode(\" \", $i);\n }\n}\n?>"}], "negative_code": [{"source_code": " $a)\n{\n for($x = 0; $x <= count($e) - $a; $x++)\n {\n $i = array_slice($e, $x, $a);\n $j = $i[0];\n $k = $i[$a - 1];\n if($j != $k)\n {\n break;\n }\n }\n print implode(\" \", $i);\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $a)\n{\n for($x = 0; $x <= count($e) - $a; $x++)\n {\n $i = array_slice($e, $x, $a);\n $j = $i[0];\n $k = $i[$a - 1];\n $l = 0;\n if($j == $k)\n {\n $i = array_slice($i, 1);\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] != $j) && ($i[$y + 1] != $j))\n {\n $l = 1;\n $m = array_slice($i, 0, $y + 1);\n $n = array_slice($i, $y + 1);\n break;\n }\n }\n array_push($m, $j);\n $o = array_merge($m, $n);\n if($l == 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($l == 0)\n {\n print \"-1\";\n }\n else\n {\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n//$str1 = '4 3';\n//$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\n$max=100;\n/*for ($i=1;$i$max ) { $max=$arr[$i]; }\n}*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=1;\n while ( ($jj<=$kol) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj++;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\n/*\nfor ($i=0;$i $max ) { $max=$arr[$i]; }\n }\n}*/\n$max=50;\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=1;\n while ( ($jj<=$kol) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj++;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol=$ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=9; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=1;\n while ( ($jj<=$kol) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj++;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n$str = fgets(STDIN);\necho $str\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n//$str1 = '4 3';\n//$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n$max=$arr[$kol];\n\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n//$str1 = '6 3';\n//$str2 = '1 2 3';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nsort($arr);\n$max=$arr[$kol];\n//print_r($arr); echo '
';\n//echo $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n//$str1 = fgets(STDIN);\n//$str2 = fgets(STDIN);\n$str1 = '4 3';\n$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n$max=$arr[$kol];\nprint_r($arr); echo '
';\necho $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = trim(fgets(STDIN));\n$str2 = trim(fgets(STDIN));\n//$str1 = '4 3';\n//$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n$max=$arr[$kol];\n//print_r($arr); echo '
';\n//echo $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n//$str1 = '4 3';\n//$str2 = '1 3 5';\necho $str1.'
';\necho $str2.'
';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n$max=$arr[$kol];\nprint_r($arr); echo '
';\necho $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = trim(fgets(STDIN));\n$str2 = trim(fgets(STDIN));\n//$str1 = '11 5';\n//$str2 = '3 2 3 2 2';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n\n$arr3=array();\nforeach($arr as $key=>$value){\n $arr3[]=$value;\n}\n$arr=$arr3;\n\n$max=$arr[sizeof($arr)-1];\n//print_r($arr3); echo '
';\n//echo 'm:'.$max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n//$str1 = '4 3';\n//$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nsort($arr);\n$max=$arr[$kol];\n//print_r($arr); echo '
';\n//echo $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n$arr = explode('0 '.$str2,' ');\n$ak = explode($str1,' ');\n$k = $ak['0'];\n$kol=$ak['1'];\n\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=9; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=1;\n while ( ($jj<=$kol) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj++;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(trim(STDIN));\n$str2 = fgets(trim(STDIN));\n//$str1 = '4 3';\n//$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n$max=$arr[$kol];\n//print_r($arr); echo '
';\n//echo $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n//$str1 = fgets(STDIN);\n//$str2 = fgets(STDIN);\n$str1 = '4 3';\n$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n$max=$arr[$kol];\n//print_r($arr); echo '
';\n//echo $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}, {"source_code": "\n\n$str1 = fgets(STDIN);\n$str2 = fgets(STDIN);\n//$str1 = '4 3';\n//$str2 = '1 3 5';\n\n$ak = explode(' ',$str1);\n$k = $ak['0'];\n$kol = $ak['1'];\n\n$arr = explode(' ','0 '.$str2);\n\n###########################################\nasort($arr);\n$max=$arr[$kol];\n//print_r($arr); echo '
';\n//echo $max; echo '
';\n\n/*\nfor ($i=1;$i$max ) { $max=$arr[$i]; }\n}\n*/\n\n$arr2 = array();\n$possible=1;\n\nfor($i=1;$i<=$k;$i++) {\n\n $j=$max; $e=0;\n while ( ($j>=1) && ($e==0) ) {\n $jj=$kol;\n while ( ($jj>=1) && ($e==0) ) { //\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0430\u043b\u044c\u0431\u043e\u043c\u0430\u043c\n if ( $arr[$jj]==$j ) { //\u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e \u0444\u043e\u0442\u043e\u043a \u0432 \u0442\u0435\u043a \u0430\u043b\u044c\u0431\u043e\u043c\u0435 \u0441\u043e\u0432\u043f\u0430\u043b\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\n\n if ( $i==1 ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n } else if ( $i<$k ) {\n if ( $jj != $arr2[$i-1] ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n } else {\n if ( ($jj != $arr2[$i-1]) && ($jj != $arr2[1]) ) {\n $e=1; $arr2[$i]=$jj; $arr[$jj]=$arr[$jj]-1;\n }\n }\n\n }\n $jj--;\n }\n $j--;\n }\n if ( $e==0 ) { $possible=0; }\n\n}\n\nif ( $possible == 0 ) {\n echo '-1';\n} else {\n foreach($arr2 as $v=>$k) {\n echo $k.' ';\n }\n}\n\n?>"}], "src_uid": "2e99f0b671c80da1e768fa9bc7796481"} {"source_code": " $d)\n {\n $d = $g;\n }\n if($g < $e)\n {\n $e = $g;\n }\n if($d - $e + 1 == $y + 1)\n {\n $h .= \"1\";\n }\n else\n {\n $h .= \"0\";\n }\n $f = next($c);\n }\n print $h . \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": "=0 && $r<=$n) {\n if ($a[$l - 1] >$a[$r+1]) {\n $r++;\n if ($max < $a[$r]) {\n $max = $a[$r];\n }\n if ($max == ($r - $l+1)) {\n $vis[$max] = 1;\n }\n } else {\n $l--;\n if ($max < $a[$l]) {\n $max = $a[$l];\n }\n if ($max == ($r - $l + 1)) {\n $vis[$max] = 1;\n }\n\n }\n }\n $vis[$min]=1;\n $vis[$n]=1;\n for($i=0;$i<$n;$i++)\n {\n if(isset($vis[$i+1]))\n {\n echo '1';\n }else\n {\n echo '0';\n }\n }\n echo \"\\n\";\n}\n\n\n\n"}, {"source_code": "=-1 && $r<=$n+1) {\n if ($a[$l - 1] >$a[$r+1]) {\n $r++;\n if ($max < $a[$r]) {\n $max = $a[$r];\n }\n if ($max == ($r - $l+1)) {\n $vis[$max] = 1;\n }\n } else {\n $l--;\n if ($max < $a[$l]) {\n $max = $a[$l];\n }\n if ($max == ($r - $l + 1)) {\n $vis[$max] = 1;\n }\n\n }\n }\n $vis[$min]=1;\n $vis[$n]=1;\n for($i=0;$i<$n;$i++)\n {\n if(isset($vis[$i+1]))\n {\n echo '1';\n }else\n {\n echo '0';\n }\n }\n echo \"\\n\";\n}\n\n\n\n"}, {"source_code": "$a[$r+1]) {\n $r++;\n if ($max < $a[$r]) {\n $max = $a[$r];\n }\n if ($max == ($r - $l + 1)) {\n $vis[$max] = 1;\n }\n } else {\n $l--;\n if ($max < $a[$l]) {\n $max = $a[$l];\n }\n if ($max == ($r - $l + 1)) {\n $vis[$max] = 1;\n }\n\n }\n }\n $vis[$min]=1;\n $vis[$n]=1;\n for($i=0;$i<$n;$i++)\n {\n if(isset($vis[$i+1]))\n {\n echo '1';\n }else\n {\n echo '0';\n }\n }\n echo \"\\n\";\n}\n\n\n\n"}], "src_uid": "ea3ce069895b6fc0f354f0118c7c9fff"} {"source_code": " $ansl)\n{\n $intv = (int) (($ansl + $ansr) / 2); \n $r = $k - 1;\n \n for($i = 0; $i < $n - 1;)\n {\n $pos = -1;\n \n for($j = min($i + $intv + 1, $n - 1); $j >= $i + 1; --$j)\n if($s[$j] == '0')\n {\n $pos = $j;\n break;\n }\n \n if($pos == -1 || $r == 0)\n {\n $pos = -1;\n break;\n }\n else\n {\n --$r;\n $i = $pos;\n }\n }\n \n if($pos != -1)\n $ansr = $intv;\n else\n $ansl = $intv + 1;\n}\n\necho $ansr;\n\n?>", "positive_code": [{"source_code": " 0 && $possible != -1) {\n $kk--;\n $lastq = $possible;\n $possible = -1;\n } else {\n $q = false;\n break;\n }\n }\n }\n if ($q && $n - $lastq - 2 > $mm) $q = false;\n if ($q) $e = $mm; else $b = $mm;\n }\n $qq = true;\n for ($i = 0; $i < $n; $i++) {\n if ($s[$i] == '1') {\n $qq = false;\n }\n }\n if ($qq && $n == $k) $e = 0;\n echo $e;\n?> "}, {"source_code": "= $N - 1) break;\n if($seq[$i] == '1') {\n if($lim == $i) {\n $cost = $K + 1;\n }\n }\n if($rp[$lim] == $i) {\n ++$cost;\n $prev = $i;\n }\n }\n if($cost <= $K) {\n $ans = $mid;\n $ub = $mid - 1;\n } else {\n $lb = $mid + 1;\n }\n }\n echo $ans;\n?> "}], "negative_code": [{"source_code": " 0 && $possible != -1) {\n $kk--;\n $lastq = $possible;\n $possible = -1;\n } else {\n $q = false;\n break;\n }\n }\n }\n if ($q && $n - $lastq - 2 > $mm) $q = false;\n if ($q) $e = $mm; else $b = $mm;\n }\n $qq = true;\n for ($i = 0; $i < $n; $i++) {\n if ($s[$i] == '1') {\n $qq = false;\n }\n }\n if ($qq && $n == $k) $e = 0;\n echo $e;\n?> "}, {"source_code": " $mm) {\n if ($kk > 0 && $possible != -1) {\n $kk--;\n $lastq = $possible;\n $possible = -1;\n } else {\n $q = false;\n break;\n }\n }\n }\n if ($q && $n - $lastq - 2 > $mm) $q = false;\n if ($q) $e = $mm; else $b = $mm;\n }\n echo $e;\n?> "}, {"source_code": " $mm) {\n if ($kk > 0 && $possible != -1) {\n $kk--;\n $lastq = $possible;\n $possible = -1;\n } else {\n $q = false;\n break;\n }\n }\n }\n if ($q && $n - $lastq - 2 > $mm) $q = false;\n if ($q) $e = $mm; else $b = $mm;\n }\n $qq = true;\n for ($i = 0; $i < $n; $i++) {\n if ($s[$i] == '1') {\n $qq = false;\n }\n }\n if ($qq && $n == $k) $e = 0;\n echo $e;\n?> "}, {"source_code": " $mm) {\n if ($kk > 0 && $possible != -1) {\n $kk--;\n $lastq = $possible;\n $possible = -1;\n } else {\n $q = false;\n break;\n }\n }\n }\n if ($q && $n - $lastq - 1 > $mm) $q = false;\n if ($q) $e = $mm; else $b = $mm;\n }\n $qq = true;\n for ($i = 0; $i < $n; $i++) {\n if ($s[$i] == '1') {\n $qq = false;\n }\n }\n if ($qq && $n == $k) $e = 0;\n echo $e;\n?> "}, {"source_code": " $mm) {\n if ($kk > 0 && $possible != -1) {\n $kk--;\n $lastq = $possible;\n $possible = -1;\n } else {\n $q = false;\n break;\n }\n }\n }\n if ($q && $n - $lastq - 2 > $mm) $q = false;\n if ($q) $e = $mm; else $b = $mm;\n }\n $qq = true;\n for ($i = 0; $i < $n; $i++) {\n if ($s[$i] == '1') {\n $qq = false;\n }\n }\n if ($qq && $n == $k) $e = 0;\n echo $e;\n?> "}], "src_uid": "e33b0a752dc1aba25da21e20435e3fe2"} {"source_code": " 1) {\n$data = (string) array_sum(str_split($data));\n\t$i++;\n}\necho $i;\n", "positive_code": [{"source_code": " 1)\n {\n $c++;\n $b = str_split(array_sum($b));\n $x = 1;\n }\n else\n {\n break;\n } \n}\nprint $c;\n?>"}, {"source_code": "= 10)\n{\n $input = numsum($input);\n $c++;\n}\n\necho $c;"}, {"source_code": " 1){\n $count++;\n $tLine = digitalRoot($tLine, $len);\n }else{\n break;\n }\n }\n echo $count . PHP_EOL;\n}\n"}, {"source_code": "1){\n $s = sumstr(\"\".$s);\n $cnt++;\n}\n\necho $cnt;\n\n?>"}, {"source_code": "\n$str=trim(fgets(STDIN));\n$sum=0;\nif(strlen($str)==1) $cnt=0;\nelse $cnt=1;\nfor($i=0; $i 9){\n $str=(string)$sum;\n $sum=0;\n for($i=0; $i "}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n$lines=trim($lines);\n\n$res=0;\n\nwhile(strlen($lines)>1)\n{\n $new=0;\n for ($i=0; $i "}], "negative_code": [{"source_code": " 10)\n{\n $sum = numsum($sum);\n $c++;\n}\n\necho $c;"}, {"source_code": "= 10)\n{\n $sum = numsum($sum);\n $c++;\n}\n\necho $c;"}, {"source_code": "= 10)\n{\n $sum = numsum($sum);\n $c++;\n}\n\necho $c;"}, {"source_code": " 10)\n{\n $sum = numsum($sum);\n $c++;\n}\n\necho $c;"}, {"source_code": " 10)\n{\n $sum = numsum($sum);\n $c++;\n}\n\necho $c;"}, {"source_code": "= 10)\n{\n $input = numsum($input);\n $c++;\n}\n\necho $c;"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += (int) $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\necho $i . \"\\n\";\n"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += (int) $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\necho $i;\n"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += (int) $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\n\n\necho $i . \"\\n\";\n"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\necho $i;\n"}, {"source_code": " 1) {\n\t$data = (string) ((int) array_sum(str_split($data)));\n\t$i++;\n}\n\necho $i;\n"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += (int) $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\n\n\necho $i . \"\\n\";\n"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += (int) $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\necho $i;\necho PHP_EOL;"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += (int) $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\necho $i . \"\\r\\n\";\n"}, {"source_code": " 1) {\n\t$sum = 0;\n\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t$sum += (int) $data{$i};\n\t}\n\t$data = (string) $sum;\n\t$i++;\n}\n\n\n\necho $i . \"\\n\";\n"}, {"source_code": " 1) {\n\t$data = (string) array_sum(str_split($data));\n\t$i++;\n}\n\necho $i;\n"}], "src_uid": "ddc9201725e30297a5fc83f4eed75fc9"} {"source_code": "", "positive_code": [{"source_code": " 0) {\n\t$current_hunger = $H + ($diff * $D);\n\t$c2 = ceil($current_hunger / $N) * $current_price;\n}\nelse {\n\t$c2 = ceil(1.0 * $H / $N) * $current_price;\n}\n\n\n\necho min($c1, $c2).\"\\n\";\n"}], "negative_code": [{"source_code": " 0) {\n\t$current_hunger = $H + ($diff * $D);\n\t$c2 = ceil(1.0 * $current_hunger / $N) * $current_price;\n}\nelse {\n\t$c2 = (1.0 * $H / $N) * $current_price;\n}\n\n\n\necho min($c1, $c2).\"\\n\";\n"}, {"source_code": " 0) {\n\t$current_hunger = $H + ($diff * $D);\n\t$current_price = $C - ($C*0.2);\n\t$c2 = ceil(1.0 * $current_hunger / $N) * $current_price;\n}\nelse {\n\t$c2 = (1.0 * $H / $N) * $current_price;\n}\n\n\n\necho min($c1, $c2).\"\\n\";\n"}], "src_uid": "937acacc6d5d12d45c08047dde36dcf0"} {"source_code": ""}], "negative_code": [], "src_uid": "8b0a9c7e997034d3ecce044b9f64aeba"} {"source_code": "0&&$str[$i]==')')\n\t{\n\t\t$cnt1++;\n\t\t$frstLeft--;\n\n\t}\n\telseif($scndLeft>0&&$str[$i]==']')\n\t{\n\t\t$cnt2++;\n\t\t$scndLeft--;\n\t}\n\n }\n echo $cnt1+$cnt2.\"\\n\";\n}", "positive_code": [{"source_code": " 0) { $c++; $b1--; }\n\t\t\t\t//$b1_c = true;\n\t\t\t}\n\n\t\t\tif ($s[$i] == '[') {\n\t\t\t\t$b2++;\n\t\t\t\t$b2_c = true;\n\t\t\t}\n\t\t\tif ($s[$i] == ']') {\n\t\t\t\tif ($b2 > 0) { $c++; $b2--; }\n\t\t\t\t//$b2_c = true;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tprint $c.\"\\n\";\n\t}\n?>"}, {"source_code": " 0) {\n $square --;\n $turns++;\n }\n else if ($string[$j] == '(')\n $round++;\n else if ($string[$j] == ')' && $round > 0) {\n $round--;\n $turns++;\n }\n $j++;\n }\n array_push($result, $turns);\n}\n\nfor ($i = 0; $i < $number; $i++){\n echo $result[$i];\n if ($i < $number - 1)\n echo \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": ""}], "src_uid": "db9cec57d8ed5e914818ce9b439eb0f9"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "0593f79604377dcfa98d2b69840ec0a6"} {"source_code": "", "positive_code": [{"source_code": ""}], "src_uid": "6421a81f85a53a0c8c63fbc32750f77f"} {"source_code": "0) {\n\t\t$dx = $x-$x1;\n\t\t$dy = $y-$y1;\n\t\t$t = $t+sqrt($dx*$dx+$dy*$dy);\n\t}\n\t$x1 = $x;\n\t$y1 = $y;\n}\n\necho($t*$k/50);\n?>", "positive_code": [{"source_code": ""}, {"source_code": "\n$c=array(101);\nfscanf(STDIN,\"%d %d\",$n,$mul);\nfscanf(STDIN,\"%d %d\",$ox,$oy);\n$sum=0;\nfor($i=0;$i<$n-1;$i++){\n\tfscanf(STDIN,\"%d %d\",$x,$y);//echo($x.','.$y);\n\t$sum+=sqrt(pow($x-$ox,2)+pow($y-$oy,2));\n//echo($x-$ox.\"\\n\");\n\t$ox=$x;$oy=$y;\n}\nprintf(\"%1.9f\",$sum/50*$mul);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0){\n $r+=sqrt(($px-$x)*($px-$x)+($py-$y)*($py-$y));\n }\n $px=$x;$py=$y;\n}\n\nprint number_format($r*$k/50,10,'.','');\n?>"}, {"source_code": "\n$stdin = fopen('php://stdin', 'r');\n$lines = stream_get_contents($stdin);\n\n$all=0;\n$lines=explode(\"\\n\", $lines);\n\nlist($n, $k)=explode(\" \", $lines[0]);\nfor ($i=1; $i<=$n; $i++)\n{\n $line=trim($lines[$i]);\n list ($x, $y)=explode(\" \", $line);\n $arr[$i-1]['x']=$x;\n $arr[$i-1]['y']=$y; \n}\n\nfor ($i=1; $i "}], "negative_code": [{"source_code": ""}], "src_uid": "db4a25159067abd9e3dd22bc4b773385"} {"source_code": " 0; $q --){\n\tlist($n, $k) = explode(' ', trim(fgets(STDIN)));\n\n\t$str = trim(fgets(STDIN));\n\n\n\t$to = 0;\n\twhile($str[$to] == '0' && $to < $n-1){\n\t\t$to++;\n\t}\n\t$from = $to+1;\n\twhile($k > 0 && $from < $n){\n\t\tif($str[$from] == '0'){\n\t\t\t$k -= $from - $to;\n\t\t\tif($k < 0){\n\t\t\t\t$to -= $k;\n\t\t\t}\n\t\t\t$str[$from] = '1';\n\t\t\t$str[$to] = '0';\n\t\t\t$to++;\n\t\t}\n\t\t$from++;\n\t}\n\techo $str.\"\\n\";\n}", "positive_code": [{"source_code": " $c)\n {\n $g = $y - $c;\n $d[$g] = 0;\n $d[$y] = 1;\n $c = 0;\n break;\n }\n }\n \n }\n print $d . \"\\n\";\n}\n?>"}, {"source_code": "= 0) {\n for ($j = $count; $j < strlen($str2); $j++) {\n if ($str2[$j] == 0) {\n if ($k == 0) {\n break;\n }\n if ($k >= ($j - $count)) {\n $str2[$count] = 0;\n $k = $k - ($j - $count);\n $str2[$j] = 1;\n $count++;\n } else {\n $str2[$j - $k] = 0;\n $str2[$j] = 1;\n $k = 0;\n }\n }\n }\n }\n\n\n\n echo $str2.\"\\n\";\n}\n?>"}], "negative_code": [{"source_code": " $c)\n {\n $g = $y - $c;\n $d[$g] = 0;\n $d[$y] = 1;\n $c = 0;\n break;\n }\n }\n }\n print $d . \"\\n\";\n}\n?>"}, {"source_code": " 0; $q --){\n\tlist($n, $k) = explode(' ', trim(fgets(STDIN)));\n\n\t$str = trim(fgets(STDIN));\n\n\t$i = 0;\n\twhile($k != 0 && $i != $n-1){\n\t\tif($str[$i] == '1' && $str[$i+1] == '0'){\n\t\t\t$str[$i] = '0'; $str[$i+1] = '1';\n\t\t\t$k--;\n\t\t\t$i--;\n\t\t} else {\n\t\t\t$i++;\n\t\t}\n\t}\n\techo $str.\"\\n\";\n}"}, {"source_code": "= $j - $count) {\n $str2[$count] = 0;\n $k = $k - ($j - $count);\n $str2[$j] = 1;\n $count++;\n } else {\n $str2[$j - $k] = 0;\n $str2[$j] = 1;\n $k = 0;\n }\n }\n }\n\n\n echo $str2.\"\\n\";\n}\n?>"}, {"source_code": "= 0) {\n for ($j = 1; $j < strlen($str2); $j++) {\n if ($str2[$j] == 0) {\n if ($k == 0) {\n break;\n }\n if ($k >= ($j - $count)) {\n $str2[$count] = 0;\n $k = $k - ($j - $count);\n $str2[$j] = 1;\n $count++;\n } else {\n $str2[$j - $k] = 0;\n $str2[$j] = 1;\n $k = 0;\n }\n }\n }\n }\n \n\n\n echo $str2.\"\\n\";\n}\n?>"}, {"source_code": " ($j - $count)) {\n $str2[$count] = 0;\n $k = $k - ($j - $count);\n $str2[$j] = 1;\n $count++;\n } else {\n $str2[$j - $k] = 0;\n $str2[$j] = 1;\n $k = 0;\n }\n }\n }\n\n\n echo $str2.\"\\n\";\n}\n?>"}, {"source_code": "= $j) {\n $str2[$count] = 0;\n $k = $k - ($j - $count);\n $str2[$j] = 1;\n $count++;\n } else {\n $str2[$j - $k] = 0;\n $str2[$j] = 1;\n $k = 0;\n }\n }\n }\n\n\n echo $str2.\"\\n\";\n}\n?>"}, {"source_code": "= $j) {\n $str2[$count] = 0;\n $k = $k - ($j - $count);\n $str2[$j] = 1;\n $count++;\n } else {\n $str2[$j - $k] = 0;\n $str2[$j] = 1;\n $k = 0;\n }\n }\n }\n\n\n echo $str2.\"\\n\";\n}\n?>"}, {"source_code": "= ($j - $count)) {\n $str2[$count] = 0;\n $k = $k - ($j - $count);\n $str2[$j] = 1;\n $count++;\n } else {\n $str2[$j - $k] = 0;\n $str2[$j] = 1;\n $k = 0;\n }\n }\n }\n\n\n echo $str2.\"\\n\";\n}\n?>"}], "src_uid": "d4b6bea78b80b0a94646cbaf048b473f"} {"source_code": "= $d;\n $con2 = ($x + $y) <= 2 * $n - $d;\n $con3 = ($x - $y) >= -$d;\n $con4 = ($x - $y) <= $d;\n // printf(\"%d %d %d %d\\n\", $con1, $con2, $con3, $con4);\n echo ($con1 && $con2 && $con3 && $con4) ? \"YES\\n\" : \"NO\\n\";\n}\n", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "9c84eb518c273942650c7262e5d8b45f"} {"source_code": "= $item) { $s = $mid; $high = $mid - 1; }\r\n else { $low = $mid + 1; }\r\n }\r\n return $s;\r\n}\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n list($n, $w) = explode(\" \", trim(fgets($file)));\r\n $a = explode(\" \", trim(fgets($file)));\r\n sort($a); \r\n $f = array();\r\n \r\n for ($j = 0; $j < $n; $j++) $f[$j] = $w;\r\n for ($j = $n - 1; $j >= 0; $j--) {\r\n\t\t$x = binary_search($f, $a[$j]);\r\n\t\t$f[$x] -= $a[$j];\r\n\t}\r\n\t$ans = 0;\r\n\t\r\n\tfor ($j = 0; $j < $n; $j++) {\r\n\t if ($f[$j] != $w) $ans++;\r\n\t}\r\n\techo $ans.PHP_EOL;\r\n}\r\n?>", "positive_code": [{"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n list($n, $w) = IO::arr();\r\n $a = IO::arr();\r\n $arr = [];\r\n foreach ($a as $v) {\r\n if (isset($arr[$v])) {\r\n $arr[$v] += 1;\r\n } else {\r\n $arr[$v] = 1;\r\n }\r\n }\r\n $i = 0;\r\n $res = 0;\r\n krsort($arr);\r\n while($i < $n) {\r\n $base = $w;\r\n $b = [];\r\n foreach ($arr as $k => $ar) {\r\n $f = floor($base / $k);\r\n $f = min([$ar, $f]);\r\n $d = $f * $k;\r\n if ($base - $d >= 0) {\r\n $i += $f;\r\n $base -= $d;\r\n }\r\n $b[$k] = $ar - $f;\r\n if ($b[$k] < 1) {\r\n unset($b[$k]);\r\n }\r\n }\r\n $res++;\r\n $arr = $b;\r\n }\r\n IO::line($res);\r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": "= $item) { $s = $mid; $high = $mid - 1; }\r\n else { $low = $mid + 1; }\r\n }\r\n return $s;\r\n}\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n list($n, $w) = explode(\" \", trim(fgets($file)));\r\n $a = explode(\" \", trim(fgets($file)));\r\n sort($a); \r\n $f = array();\r\n for ($j = 0; $j < $n; $j++) $f[$j] = $w;\r\n for ($j = $n - 1; $j >= 0; $j--) {\r\n\t\t$x = binary_search($f, $a[$j]);\r\n\t\t$f[$x] -= $a[$j];\r\n\t}\r\n\t$ans = 0;\r\n\t\r\n\tfor ($j = 0; $j < $n; $j++) {\r\n\t if ($f[$j] != $w) $ans++;\r\n\t}\r\n\techo $ans.PHP_EOL;\r\n}\r\n?>"}, {"source_code": "= $item) { $s = $mid; $high = $mid - 1; }\r\n else { $low = $mid + 1; }\r\n }\r\n return $s;\r\n}\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n list($n, $w) = explode(\" \", trim(fgets($file)));\r\n $a = explode(\" \", trim(fgets($file)));\r\n sort($a); \r\n \r\n for ($j = 0; $j < $n; $j++) $f[$j] = $w;\r\n for ($j = $n - 1; $j >= 0; $j--) {\r\n\t\t$x = binary_search($f, $a[$j]);\r\n\t\t$f[$x] -= $a[$j];\r\n\t}\r\n\t$ans = 0;\r\n\t\r\n\tfor ($j = 0; $j < $n; $j++) {\r\n\t if ($f[$j] != $w) $ans++;\r\n\t}\r\n\techo $ans.PHP_EOL;\r\n}\r\n?>"}, {"source_code": "= $item) { $s = $mid; $high = $mid - 1; }\r\n else { $low = $mid + 1; }\r\n }\r\n return $s;\r\n}\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n list($n, $w) = explode(\" \", trim(fgets($file)));\r\n $a = explode(\" \", trim(fgets($file)));\r\n sort($a); \r\n \r\n for ($j = 0; $j < $n; $j++) $f[$j] = $w;\r\n for ($j = $n - 1; $j >= 0; $j--) {\r\n\t\t$x = binary_search($f, $a[$j]);\r\n\t\t$f[$x] -= $a[$j];\r\n\t}\r\n\t$ans = 0;\r\n\t\r\n\tfor ($j = 0; $j < $n; $j++) {\r\n\t if ($f[$j] != $w) $ans++;\r\n\t}\r\n\techo $ans.PHP_EOL;\r\n}\r\n?>"}, {"source_code": ""}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n list($n, $w) = IO::arr();\r\n $a = IO::arr();\r\n $arr = [];\r\n foreach ($a as $v) {\r\n if (isset($arr[$v])) {\r\n $arr[$v] += 1;\r\n } else {\r\n $arr[$v] = 1;\r\n }\r\n }\r\n $i = 0;\r\n $res = 0;\r\n krsort($arr);\r\n while($i < $n) {\r\n $base = $w;\r\n $t = [];\r\n foreach ($arr as $k => $ar) {\r\n if ($base - $k >= 0) {\r\n $t[$k] = $ar;\r\n $base -= $k;\r\n }\r\n }\r\n $x = min($t);\r\n $res += $x;\r\n $i += $x * count($t);\r\n foreach ($t as $k => $f) {\r\n $arr[$k] -= $x;\r\n if($arr[$k] == 0) {\r\n unset($arr[$k]);\r\n }\r\n }\r\n }\r\n IO::line($res);\r\n}\r\n\r\n?>"}], "src_uid": "49ba9921ae8b6bc53726e7a521eefe39"} {"source_code": "1) {\n $locmin[] = 0;\n for ($i=1;$i<(count($normalized)-1);$i++)\n if (($normalized[$i]<$normalized[$i+1])&&($normalized[$i]<$normalized[$i-1]))\n $locmin[] = $i; \n $locmin[] = count($normalized)-1;\n} else {\n $locmin = Array(0,0);\n}\n\nfor ($i=1;$i 1)?max($lenarr):$lenarr[0];\n\n\n?>\n", "positive_code": [{"source_code": " 0; $z--)\n {\n if($b[$z] < $b[$z - 1])\n {\n break;\n }\n else\n {\n $d++;\n }\n }\n array_push($c, $d);\n}\nrsort($c);\nprint $c[0];\n?>"}], "negative_code": [], "src_uid": "5d11fa8528f1dc873d50b3417bef8c79"} {"source_code": "", "positive_code": [{"source_code": "0) {\n\t\t\t\techo 'YES';\n\t\t\t} else {\n\t\t\t\techo 'NO';\n\t\t\t}\n\t\t} else {\n\t\t\techo 'NO';\n\t\t}\n\t}\n}", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "64b597a47106d0f08fcfad155e0495c3"} {"source_code": "\n", "positive_code": [{"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $a)\n{\n $c -= $a;\n $c++;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": " $a)\n{\n $c -= $a;\n $c++;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": ""}, {"source_code": " $a)\n{\n $c -= $a;\n $c++;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": " $a)\n{\n $c -= $a;\n $c++;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": " $a)\n{\n $c -= $a;\n $c++;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": " $a)\n{\n $c -= $a;\n $c++;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": ""}, {"source_code": " $a)\n{\n $c -= $a;\n $c++;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": " $a)\n{\n $c -= $a;\n $f = $d[0] + min($b, $c);\n}\nprint number_format($f, 6, \".\", \"\") . \"\\n\";\n?>"}, {"source_code": "0) {\n\t\t\t$sum += min($m,$k);\n\t\t\t$m -= $k;\n\t\t}\n\t}\n\t$av = $sum/$l;\n\techo $av;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0) {\n\t\t\t$sum += min($m,$k);\n\t\t\t$m -= $k;\n\t\t}\n\t}\n\t$av = $sum/$l;\n\techo $av;\n?>"}, {"source_code": "$p2) break;\n\t\t$l++;\n\t\t$m--;\n\t}\n\t$sum = 0;\n\tfor($i=$l;$i<$n;$i++) {\n\t\t$sum += $a[$i];\n\t\tif($m>0) {\n\t\t\t$sum += min($m,$k);\n\t\t\t$m -= $k;\n\t\t}\n\t}\n\t$av = $sum/($n-$l);\n\techo $av;\n?>"}, {"source_code": "1&&$l<=$m;$i++) {\n\t\t$v = ($sum-$a[$i])/($n-$l);\n\t\tif($v>=$mx) {\n\t\t\t$sum -= $a[$i];\n\t\t\t$mx = $v;\n\t\t\t$l++;\n\t\t\t$a[$i] = 0;\n\t\t}\n\t}\n\t$m -= $l;\n\tfor($i=0;$i<$n;$i++) {\n\t\tif($a[$i]==0) continue;\n\t\tif($m>0) {\n\t\t\t$sum += min($m,$k);\n\t\t\t$m -= $k;\n\t\t}\n\t\telse break;\n\t}\n\t$v = $sum/($n-$l);\n\techo $v;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "d6e44bd8ac03876cb03be0731f7dda3d"} {"source_code": "= 0; $x--)\n{\n $c = strtoupper($a[$x]);\n if($c == $a[$x])\n {\n $a = substr($a, 0, $x + 1);\n break;\n }\n}\n$d = array();\n$e = 0;\n$f = 0;\n$g = 0;\n$h = 0;\n$i = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $j = strtolower($a[$x]);\n if($j != $a[$x])\n {\n $f++;\n }\n else\n {\n $g++;\n }\n if($h == 0)\n {\n if($j == $a[$x])\n {\n $i++;\n }\n else\n {\n $d[$e] = $i;\n $e++;\n $h = 1;\n $i = 1;\n }\n }\n else\n {\n if($j != $a[$x])\n {\n $i++;\n }\n else\n {\n $d[$e] = $i;\n $e++;\n $h = 0;\n $i = 1;\n }\n }\n}\n$d[$e] = $i;\n$k = min($f, $g);\n$l = 0;\nfor($x = 0; $x <= count($d); $x++)\n{\n $l += $d[$x];\n $f -= $d[$x + 1];\n $m = $l + $f;\n $k = min($k, $m);\n $x++;\n}\nprint $k;\n?>", "positive_code": [{"source_code": "in();\n\t$S_array = str_split($S);\n\t$len = count($S_array);\n\t\n\t$u_cnt = array_fill(-1, $len, 0);\n\t$min = 100000 + 1;\n\tfor ($i = -1; $i < $len - 1; $i++) {\n\t\tif ($S_array[$i + 1] >= \"A\" && $S_array[$i + 1] <= \"Z\") {\n\t\t\t$u_cnt[$i + 1] = $u_cnt[$i] + 1;\n\t\t} else {\n\t\t\t$u_cnt[$i + 1] = $u_cnt[$i];\n\t\t}\n\t}\n\tfor ($i = -1; $i < $len; $i++) {\n\t\t$min = min($min, $u_cnt[$len - 1] - $u_cnt[$i] + $i + 1 - $u_cnt[$i]);\n\t}\n\t\n\tprint($min);\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}], "negative_code": [{"source_code": "= 0; $x--)\n{\n $c = strtoupper($a[$x]);\n if($c == $a[$x])\n {\n $a = substr($a, 0, $x + 1);\n break;\n }\n}\n$d = array();\n$e = 0;\n$f = 0;\n$g = 0;\n$h = 0;\n$i = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n $j = strtolower($a[$x]);\n if($j != $a[$x])\n {\n $f++;\n }\n else\n {\n $g++;\n }\n if($h == 0)\n {\n if($j == $a[$x])\n {\n $i++;\n }\n else\n {\n $d[$e] = $i;\n $e++;\n $h = 1;\n $i = 1;\n }\n }\n else\n {\n if($j != $a[$x])\n {\n $i++;\n }\n else\n {\n $d[$e] = $i;\n $e++;\n $h = 0;\n $i = 1;\n }\n }\n}\n$d[$e] = $i;\n$k = min($f, $g);\nfor($x = count($d) - 1; $x > 0; $x--)\n{\n $f -= $g[$x];\n $g += $g[$x + 1];\n $l = $f + $g;\n $k = min($k, $l);\n}\nprint $k;\n?>"}, {"source_code": "in();\n\t$S_array = str_split($S);\n\t$len = count($S_array);\n\t\n\t$alp = array(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\");\n\t$l_pos = \"\";\n\t$u_pos = \"\";\n\t$l_count = array_fill(0,count($len), 0);\n\t$u_count = array_fill(0,count($len), 0);\n\t$min = 100000 + 1;\n\t$l_pre = 0;\n\t$u_pre = 0;\n\tfor ($i = 0; $i < $len; $i++) {\n\t\tfor ($j = 0; $j < count($alp); $j++) {\n\t\t\t$l_count[$i] = $l_pre;\n\t\t\t$u_count[$len - 1 - $i] = $u_pre;\n\t\t\t\n\t\t\tif ($S_array[$i] === $alp[$j]) {\n\t\t\t\t$l_count[$i] += 1;\n\t\t\t}\n\t\t\tif ($S_array[$len - 1 - $i] === strtoupper($alp[$j])) {\n\t\t\t\t$u_count[$len - 1 - $i] += 1;\n\t\t\t}\n\t\t\t\n\t\t\t$l_pre = $l_count[$i];\n\t\t\t$u_pre = $u_count[$len - 1 - $i];\n\t\t}\n\t}\n\tfor ($i = 0; $i < $len; $i++) {\n\t\t\n\t\t$min = min($min, $l_count[$i] + $u_count[$i + 1]);\n\t}\n\t\n\tprint($min);\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}, {"source_code": "in();\n\t$S_array = str_split($S);\n\t$len = count($S_array);\n\t\n\t$alp = array(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\");\n\t$l_pos = \"\";\n\t$u_pos = \"\";\n\t$l_count = 0;\n\t$u_count = 0;\n\t\n\tfor ($i = 0; $i < $len; $i++) {\n\t\tfor ($j = 0; $j < count($alp); $j++) {\n\t\tif ($S_array[$i] === $alp[$j] && $l_pos === \"\") {\n\t\t\t$l_pos = $i;\n\t\t\tbreak;\n\t\t}\n\t\tif ($l_pos !== \"\" && $S_array[$i] === strtoupper($alp[$j])) {\n\t\t\t\t$u_count++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfor ($i = $len - 1; $i >= 0; $i--) {\n\t\tfor ($j = 0; $j < count($alp); $j++) {\n\t\t\tif ($S_array[$i] === strtoupper($alp[$j]) && $u_pos === \"\") {\n\t\t\t\t$u_pos = $i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($u_pos !== \"\" && $S_array[$i] === $alp[$j]) {\n\t\t\t\t\t$l_count++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t}\n\t\n\tprint(min($u_count, $l_count));\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}], "src_uid": "92996552cc26a05258f2f2a1eb5f8a8f"} {"source_code": "0 && $m>0) {\r\n if($aa[$l] < $bb[$r]) {\r\n if($tt < $k) {\r\n $tb = 0;\r\n $tt++;\r\n $ans .= $alph[$aa[$l]];\r\n $l++;\r\n $n--;\r\n } else {\r\n $tt = 0; \r\n $tb++;\r\n $ans .= $alph[$bb[$r]];\r\n $r++;\r\n $m--;\r\n }\r\n } else {\r\n if($tb < $k) {\r\n $tt = 0;\r\n $tb++;\r\n $ans .= $alph[$bb[$r]];\r\n $r++;\r\n $m--;\r\n } else {\r\n $tb = 0; \r\n $tt++;\r\n $ans .= $alph[$aa[$l]];\r\n $l++;\r\n $n--;\r\n } \r\n }\r\n }\r\n \r\n IO::pr($ans);\r\n }\r\n \r\n \r\n class IO {\r\n public static function getInt()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n \r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n }\r\n \r\n class Algor {\r\n public static function efclidLcm($a, $b) {\r\n return ($a / self::efclidGcd($a, $b)) * $b;\r\n }\r\n public static function efclidGcd($a, $b) { \r\n return $b > 0 ? self::efclidGcd($b, $a % $b) : $a; \r\n }\r\n public static function isPrime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n $d += 1;\r\n }\r\n \r\n return $d == $n;\r\n }\r\n \r\n public static function fabicon($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n \r\n return $a[$n];\r\n }\r\n \r\n function getRotate($a, $s, $e, $ind) {\r\n $ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n $ar[$i] = $a[$i];\r\n $j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n // echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\";\r\n $a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n }\r\n \r\n}\r\n \r\nclass bigOperation {\r\n public static function efclidLcm($a, $b) {\r\n return bcmul(bcdiv($a, self::efclidGcd($a, $b)), $b);\r\n }\r\n public static function efclidGcd($a, $b) { \r\n return bccomp($b, 0) == 1 ? self::efclidGcd($b, bcmod($a, $b)) : $a; \r\n }\r\n public static function isBigNumber($n)\r\n {\r\n return bccomp($n, INTMAXVALUE) == 1;\r\n }\r\n // bcadd \u2014 \u0421\u043b\u043e\u0436\u0438\u0442\u044c 2 \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcAdd($x, $y)\r\n {\r\n return bcadd($x, $y);\r\n }\r\n// bccomp \u2014 \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n//return 1 if x>y, 0= x==y, -1 x < y\r\n public static function bcComp($x, $y)\r\n {\r\n return bccomp($x, $y);\r\n }\r\n// bcdiv \u2014 \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcDiv($x, $y)\r\n {\r\n return bcdiv($x, $y);\r\n }\r\n// bcmod \u2014 \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMod($x, $y)\r\n {\r\n return bcmod($x, $y);\r\n }\r\n// bcmul \u2014 \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMul($x, $y)\r\n {\r\n return bcmul($x, $y);\r\n }\r\n// bcpow \u2014 \u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcPow($x, $y)\r\n {\r\n return bcpow($x, $y);\r\n }\r\n// bcpowmod \u2014 \u0412\u043e\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435 \u0447\u0438\u0441\u043b\u043e\r\n// bcscale \u2014 \u0417\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 bc math \u0444\u0443\u043d\u043a\u0446\u0438\u0439.\r\n// bcsqrt \u2014 \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcSqrt($x, $y)\r\n {\r\n return bcsqrt($x, $y);\r\n }\r\n// bcsub \u2014 \u0412\u044b\u0447\u0438\u0442\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e\r\n public static function bcSub($x, $y)\r\n {\r\n return bcsub($x, $y);\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $y : $x;\r\n }\r\n \r\n public static function getDareje($n, $k) {\r\n if($k == 0) {\r\n return 1;\r\n }\r\n return bcmul($n, self::getDareje($n, $k-1));\r\n }\r\n}\r\n \r\nclass Sorting\r\n{\r\n public static function mergeSort($aArray) {\r\n if(count($aArray) <= 1) {\r\n return $aArray;\r\n }\r\n $aLeft = [];\r\n $aRight = [];\r\n $n =floor(count($aArray) / 2);\r\n for($i = 0; $i <$n; $i++) {\r\n $aLeft[] = $aArray[$i];\r\n }\r\n for($i = $n; $i $f)\n{\n for($x = 0; $x < $e - $f; $x++)\n {\n print \"0\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " 1) {\n if ($i >= $n) {\n echo \"0\\n\";\n $k--;\n continue;\n }\n\n $min = $items[$i++] - $sum;\n\n if ($min <= 0) {\n continue;\n }\n\n $sum += $min;\n echo $min .\"\\n\";\n\n $k--;\n while ($i < $n && $items[$i] == $sum) {\n $i++;\n }\n}\n"}], "negative_code": [], "src_uid": "0f100199a720b0fdead5f03e1882f2f3"} {"source_code": "\n list($a, $b, $c) = explode(' ', trim(fgets(STDIN)));\n $n = trim(fgets(STDIN));\n for ($i = 0; $i < $n; $i++) {\n list($x, $s) = explode(' ', trim(fgets(STDIN)));\n if ($s == \"USB\") {\n $u[] = $x;\n } elseif ($s == \"PS/2\") {\n $p[] = $x;\n }\n }\n \n sort($u);\n \n $e = array();\n \n function arrSum($inArray) {\n $result = 0;\n foreach ($inArray as $value) {\n $result = bcadd($result, $value);\n }\n return $result;\n }\n \n if (count($u) <= $a) {\n $ans += count($u);\n $sum = bcadd($sum, arrSum($u));\n } else {\n $e = array_slice($u, $a, count($u) - $a);\n $ans += $a;\n $sum = bcadd($sum, arrSum(array_slice($u, 0, $a)));\n }\n \n \n sort($p);\n \n if (count($p) <= $b) {\n $ans += count($p);\n $sum = bcadd($sum, arrSum($p));\n } else {\n $e = array_merge($e, array_slice($p, $b, count($p) - $b));\n $ans += $b;\n $sum = bcadd($sum, arrSum(array_slice($p, 0, $b)));\n }\n \n \n sort($e);\n \n if (count($e) <= $c) {\n $ans += count($e);\n $sum = bcadd($sum, arrSum($e));\n } else {\n $ans += $c;\n $sum = bcadd($sum, arrSum(array_slice($e, 0, $c)));\n }\n \n printf(\"%d %s\\n\", $ans, $sum);\n \n?>", "positive_code": [{"source_code": "\n list($a, $b, $c) = explode(' ', trim(fgets(STDIN)));\n $n = trim(fgets(STDIN));\n for ($i = 0; $i < $n; $i++) {\n list($x, $s) = explode(' ', trim(fgets(STDIN)));\n if ($s == \"USB\") {\n $u[] = $x;\n } elseif ($s == \"PS/2\") {\n $p[] = $x;\n }\n }\n \n sort($u);\n \n $e = array();\n \n if (count($u) <= $a) {\n $ans += count($u);\n $sum += array_sum($u);\n } else {\n $e = array_slice($u, $a, count($u) - $a);\n $ans += $a;\n $sum += array_sum(array_slice($u, 0, $a));\n }\n sort($p);\n \n if (count($p) <= $b) {\n $ans += count($p);\n $sum += array_sum($p);\n } else {\n $e = array_merge($e, array_slice($p, $b, count($p) - $b));\n $ans += $b;\n $sum += array_sum(array_slice($p, 0, $b));\n }\n \n sort($e);\n \n \n if (count($e) <= $c) {\n $ans += count($e);\n $sum += array_sum($e);\n } else {\n $ans += $c;\n $sum += array_sum(array_slice($e, 0, $c));\n }\n \n printf(\"%d %.0f\\n\", $ans, $sum);\n \n?>"}, {"source_code": " $f[$y])\n {\n $i += $f[$y];\n $y++;\n }\n}\nprint ($x + $y) . \" \";\nprintf(\"%.0f\", $i);\n?>"}], "negative_code": [{"source_code": " $f[$y])\n {\n $i += $f[$y];\n $y++;\n }\n else\n {\n break;\n }\n}\nif($d == 0)\n{\n print \"0 0\";\n}\nelse\n{\n print ($x + $y) . \" \" . $i;\n}\n?>"}, {"source_code": " $f[$y])\n {\n $i += $f[$y];\n $y++;\n }\n}\nprint ($x + $y) . \" \" . $i;\n?>"}, {"source_code": "\n list($a, $b, $c) = explode(' ', trim(fgets(STDIN)));\n $n = trim(fgets(STDIN));\n for ($i = 0; $i < $n; $i++) {\n list($x, $s) = explode(' ', trim(fgets(STDIN)));\n if ($s == \"USB\") {\n $u[] = $x;\n } elseif ($s == \"PS/2\") {\n $p[] = $x;\n }\n }\n \n sort($u);\n \n $f = array();\n \n if (count($u) <= $a) {\n $ans += count($u);\n $sum += array_sum($u);\n } else {\n $f = array_slice($u, $a, count($u) - $a);\n $ans += $a;\n $sum += array_sum(array_slice($u, 0, $a));\n }\n sort($p);\n \n if (count($p) <= $b) {\n $ans += count($p);\n $sum += array_sum($p);\n } else {\n $s = array_merge($f, array_slice($p, $b, count($p) - $b));\n $ans += $b;\n $sum += array_sum(array_slice($p, 0, $b));\n }\n \n sort($s);\n \n \n if (count($s) <= $c) {\n $ans += count($s);\n $sum += array_sum($s);\n } else {\n $ans += $c;\n $sum += array_sum(array_slice($s, 0, $c));\n }\n \n printf(\"%d %d\\n\", $ans, $sum);\n \n?>"}], "src_uid": "3d6151b549bd52f95ab7fdb972e6fb98"} {"source_code": "debugMode = $flag;\n\n }\n function D($x){\n if($this->debugMode)var_dump($x);\n }\n function run(){\n list($b1,$q,$l,$m) = readLine();\n $a = readLine();\n $a = array_flip($a);\n if($q == 0) {\n if(abs($b1) > $l)echo \"0\\n\";\n else if(!array_key_exists(0,$a)) echo \"inf\\n\";\n else {\n if(array_key_exists($b1,$a)) echo \"0\\n\";\n else echo \"1\\n\";\n }\n\n } else if ($q == -1){\n if(abs($b1)>$l)echo \"0\\n\";\n else if(array_key_exists($b1,$a) && array_key_exists(-$b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if ($q == 1){\n if(array_key_exists($b1,$a)||abs($b1)>$l)\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if($b1) {\n $ans=0;\n while(abs($b1)<=$l) {\n if(!array_key_exists($b1,$a))$ans++;\n $b1 = $b1 * $q;\n }\n echo \"$ans\\n\";\n } else {\n if(array_key_exists(0,$a)){\n if(isset($a[$b1])||abs($b1)>$l)echo \"0\\n\";\n else echo \"1\\n\";\n }\n else echo \"inf\\n\";\n }\n }\n};\n$caseNum=1;\nfor($caseId = 1;$caseId <= $caseNum; $caseId++){\n //echo 'Case #' . $caseId . ': ';\n $sol = new Solution(true);\n $sol->run();\n }", "positive_code": [{"source_code": " $c)\n{\n print \"0\";\n}\nelse\n{\n if(($a == 0) || ($b == 0) || (($a == 0) && ($b == 0)))\n {\n if($f[$a * $b] == TRUE)\n {\n if($f[$a] == TRUE)\n {\n print \"0\";\n }\n else\n {\n print \"1\";\n }\n }\n else\n {\n print \"inf\";\n }\n }\n elseif(($b == 1) || (($a == 1) && ($b == 1)))\n {\n if($f[$a * $b] == TRUE)\n {\n if($f[$a] == TRUE)\n {\n print \"0\";\n }\n else\n {\n print \"1\";\n }\n }\n else\n {\n print \"inf\";\n }\n }\n elseif(($b == -1) || (($a == -1) && ($b == -1)))\n {\n if(($f[$a * $b] == TRUE) && ($f[$a * $b * (-1)] == TRUE))\n {\n if(($f[$a] == TRUE) && ($f[$a * (-1)] == TRUE))\n {\n print \"0\";\n }\n elseif($f[$a] == TRUE)\n {\n print \"1\";\n }\n elseif($f[$a * (-1)] == TRUE)\n {\n print \"1\";\n }\n else\n {\n print \"2\";\n }\n }\n else\n {\n print \"inf\";\n }\n }\n else\n {\n $g = 0;\n while(TRUE)\n {\n if(abs($a) > $c)\n {\n break;\n }\n elseif($f[$a] == FALSE)\n {\n $g++;\n }\n $a *= $b;\n }\n print $g;\n }\n}\n?>"}], "negative_code": [{"source_code": " $c)\n {\n break;\n }\n elseif($f[$a] == FALSE)\n {\n $g++;\n }\n $a *= $b;\n }\n print $g;\n}\n?>"}, {"source_code": " $c)\n {\n break;\n }\n elseif($f[$a] == FALSE)\n {\n $g++;\n }\n $a *= $b;\n }\n print $g;\n}\n?>"}, {"source_code": " $c)\n {\n break;\n }\n elseif($f[$a] == FALSE)\n {\n $g++;\n }\n $a *= $b;\n }\n print $g;\n}\n?>"}, {"source_code": " $c)\n{\n print \"0\";\n}\nelse\n{\n if(($a == 0) || ($b == 0) || (($a == 0) && ($b == 0)))\n {\n if($f[$a * $b] == TRUE)\n {\n if($f[$a] == TRUE)\n {\n print \"0\";\n }\n else\n {\n print \"1\";\n }\n }\n else\n {\n print \"inf\";\n }\n }\n elseif(($b == 1) || (($a == 1) && ($b == 1)))\n {\n if($f[$a * $b] == TRUE)\n {\n if($f[$a] == TRUE)\n {\n print \"0\";\n }\n else\n {\n print \"1\";\n }\n }\n else\n {\n print \"inf\";\n }\n }\n elseif(($b == -1) || (($a == -1) && ($b == -1)))\n {\n if(($f[$a * $b] == TRUE) && ($f[$a * $b * (-1)] == TRUE))\n {\n if(($f[$a] == TRUE) && ($f[$a * (-1)] == TRUE))\n {\n print \"0\";\n }\n elseif($f[$a] == TRUE)\n {\n print \"1\";\n }\n elseif($f[$a * (-1)] == TRUE)\n {\n print \"1\";\n }\n else\n {\n print \"2\";\n }\n }\n else\n {\n print \"inf\";\n }\n }\n else\n {\n $g = 0;\n while(TRUE)\n {\n if(abs($a) > $c)\n {\n break;\n }\n elseif($f[$a] == FALSE)\n {\n $g++;\n }\n $a *= $b;\n }\n print $g;\n }\n}\n?>"}, {"source_code": "debugMode = $flag;\n\n }\n function D($x){\n if($this->debugMode)var_dump($x);\n }\n function run(){\n list($b1,$q,$l,$m) = readLine();\n $a = readLine();\n $a = array_flip($a);\n if($q == 0) {\n if(!array_key_exists(0,$a)) echo \"inf\\n\";\n else {\n if(array_key_exists($b1,$a)|| abs($b1) > $l) echo \"0\\n\";\n else echo \"1\\n\";\n }\n\n } else if ($q == -1){\n if(abs($b1)>$l)echo \"0\\n\";\n else if(array_key_exists($b1,$a) && array_key_exists(-$b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if ($q == 1){\n if(array_key_exists($b1,$a)||abs($b1)>$l)\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if($b1) {\n $ans=0;\n while(abs($b1)<=$l) {\n if(!array_key_exists($b1,$a))$ans++;\n $b1 = $b1 * $q;\n }\n echo \"$ans\\n\";\n } else {\n if(array_key_exists(0,$a)){\n if(isset($a[$b1])||abs($b1)>$l)echo \"0\\n\";\n else echo \"1\\n\";\n }\n else echo \"inf\\n\";\n }\n }\n};\n$caseNum=1;\nfor($caseId = 1;$caseId <= $caseNum; $caseId++){\n //echo 'Case #' . $caseId . ': ';\n $sol = new Solution(true);\n $sol->run();\n }"}, {"source_code": "debugMode = $flag;\n\n }\n function D($x){\n if($this->debugMode)var_dump($x);\n }\n function run(){\n list($b1,$q,$l,$m) = readLine();\n $a = readLine();\n $a = array_flip($a);\n if($q == 0) {\n if(!array_key_exists(0,$a)) echo \"inf\\n\";\n else {\n if(array_key_exists($b1,$a)) echo \"0\\n\";\n else echo \"1\\n\";\n }\n\n } else if ($q == -1){\n if(array_key_exists($b1,$a) && array_key_exists(-$b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if ($q == 1){\n if(array_key_exists($b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if($b1) {\n $ans=0;\n while(abs($b1)<=$l) {\n if(!array_key_exists($b1,$a))$ans++;\n $b1 = $b1 * $q;\n }\n echo \"$ans\\n\";\n } else {\n if(array_key_exists(0,$a)){\n if(isset($a[$b1]))echo \"0\\n\";\n else echo \"1\\n\";\n }\n else echo \"inf\\n\";\n }\n }\n};\n$caseNum=1;\nfor($caseId = 1;$caseId <= $caseNum; $caseId++){\n //echo 'Case #' . $caseId . ': ';\n $sol = new Solution(true);\n $sol->run();\n }\n"}, {"source_code": "debugMode = $flag;\n\n }\n function D($x){\n if($this->debugMode)var_dump($x);\n }\n function run(){\n list($b1,$q,$l,$m) = readLine();\n $a = readLine();\n $a = array_flip($a);\n if($q == 0) {\n if(array_key_exists(0,$a)) echo \"inf\\n\";\n else {\n if(array_key_exists($b1,$a)) echo \"0\\n\";\n else echo \"1\\n\";\n }\n\n } else if ($q == -1){\n if(array_key_exists($b1,$a) && array_key_exists(-$b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if ($q == 1){\n if(array_key_exists($b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if($b1) {\n $ans=0;\n while(abs($b1)<=$l) {\n if(!array_key_exists($b1,$a))$ans++;\n $b1 = $b1 * $q;\n }\n echo \"$ans\\n\";\n } else {\n if(array_key_exists(0,$a))echo \"0\\n\";\n else echo \"inf\\n\";\n }\n }\n};\n$caseNum=1;\nfor($caseId = 1;$caseId <= $caseNum; $caseId++){\n //echo 'Case #' . $caseId . ': ';\n $sol = new Solution(true);\n $sol->run();\n}"}, {"source_code": "debugMode = $flag;\n\n }\n function D($x){\n if($this->debugMode)var_dump($x);\n }\n function run(){\n list($b1,$q,$l,$m) = readLine();\n $a = readLine();\n $a = array_flip($a);\n if($q == 0) {\n if(!array_key_exists(0,$a)) echo \"inf\\n\";\n else {\n if(array_key_exists($b1,$a)|| abs($b1) > $m) echo \"0\\n\";\n else echo \"1\\n\";\n }\n\n } else if ($q == -1){\n if(abs($b1)>$m)echo \"0\\n\";\n else if(array_key_exists($b1,$a) && array_key_exists(-$b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if ($q == 1){\n if(array_key_exists($b1,$a)||abs($b1)>$m)\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if($b1) {\n $ans=0;\n while(abs($b1)<=$l) {\n if(!array_key_exists($b1,$a))$ans++;\n $b1 = $b1 * $q;\n }\n echo \"$ans\\n\";\n } else {\n if(array_key_exists(0,$a)){\n if(isset($a[$b1])||abs($b1)>$m)echo \"0\\n\";\n else echo \"1\\n\";\n }\n else echo \"inf\\n\";\n }\n }\n};\n$caseNum=1;\nfor($caseId = 1;$caseId <= $caseNum; $caseId++){\n //echo 'Case #' . $caseId . ': ';\n $sol = new Solution(true);\n $sol->run();\n }\n"}, {"source_code": "debugMode = $flag;\n\n }\n function D($x){\n if($this->debugMode)var_dump($x);\n }\n function run(){\n list($b1,$q,$l,$m) = readLine();\n $a = readLine();\n $a = array_flip($a);\n if($q == 0) {\n if(array_key_exists(0,$a)) echo \"inf\\n\";\n else {\n if(array_key_exists($b1,$a)) echo \"0\\n\";\n else echo \"1\\n\";\n }\n\n } else if (abs($q) == 1){\n if(array_key_exists($b1,$a) && array_key_exists(-$b1,$a))\n echo \"0\\n\";\n else\n echo \"inf\\n\";\n } else if($b1) {\n $ans=0;\n while(abs($b1)<=$l) {\n if(!array_key_exists($b1,$a))$ans++;\n $b1 = $b1 * $q;\n }\n echo \"$ans\\n\";\n } else {\n if(array_key_exists(0,$a))echo \"0\\n\";\n else echo \"inf\\n\";\n }\n }\n};\n$caseNum=1;\nfor($caseId = 1;$caseId <= $caseNum; $caseId++){\n //echo 'Case #' . $caseId . ': ';\n $sol = new Solution(true);\n $sol->run();\n}"}], "src_uid": "749c290c48272a53e2e79730dab0538e"} {"source_code": " $a) {\n $ans = $a;\n }\n if($ans > $b) {\n $ans = $b;\n }\n echo $ans . PHP_EOL;\n \n}", "positive_code": [{"source_code": "= $b * 2) echo $b . \"\\n\" ;\n else \n {\n $ans = $a - $b ;\n $a -= 2 * $ans ;\n \n $ans += intval($a / 3) * 2 ;\n \n $a = $a - 3 * intval($a / 3) ;\n if($a == 2) $ans ++ ;\n \n echo $ans . \"\\n\" ;\n }\n }\n?>"}], "negative_code": [{"source_code": "= $b * 2) echo $b . \"\\n\" ;\n else \n {\n $ans = min(intval($a/3), intval($b/3)) * 2 ;\n \n $a = $a - 3 * $ans / 2 ;\n $b = $b - 3 * $ans / 2 ;\n \n if($a >= 1 && $b >= 2) $ans ++ ;\n else if($a >= 2 && $b >= 1) $ans ++ ;\n \n echo $ans . \"\\n\" ;\n }\n }\n?>"}, {"source_code": "= $b * 2) echo $b . \"\\n\" ;\n else \n {\n $ans = $a - $b ;\n \n $a -= 2 * $ans ;\n \n $ans += intval($a / 3) * 2 ;\n \n echo $ans . \"\\n\" ;\n }\n }\n?>"}, {"source_code": "$data = [];\nwhile($line = fgets(STDIN)) {\n $data[] = $line\n}\n\nvar_dump($data);"}, {"source_code": " $a) {\n $ans = $a;\n }\n if($ans > $b) {\n $ans = $b;\n }\n echo $ans;\n \n}"}], "src_uid": "8bbec86e427e26158393bbfbf1a067fe"} {"source_code": "", "positive_code": [{"source_code": ""}], "src_uid": "4bbb078b66b26d6414e30b0aae845b98"} {"source_code": "= 4)\n {\n print \"YES\\n\";\n }\n}\n?>", "positive_code": [{"source_code": "= $y){\n $bFlag = true;\n break;\n }\n $x = $x - 1;\n if($d == $x) {\n $bFlag = false;\n break;\n }\n\n }\n } else {\n $d = $x;\n while (true) {\n $x = $x - 1;\n $x = $x * 1.5;\n if($x >= $y){\n $bFlag = true;\n break;\n }\n if($d == $x) {\n $bFlag = false;\n break;\n }\n }\n }\n } else {\n $bFlag = true;\n }\n }\n\n //echo $x . ' ' . $y . \"\\n\";\n if($bFlag){\n echo \"YES\".\"\\n\";\n } else {\n echo \"NO\".\"\\n\";\n }\n}"}, {"source_code": ""}, {"source_code": "3)\n {\n $a=(3*$a)/2;\n }\n if($a==2)$a=3;\n if($a>=$l)\n {\n echo \"YES\\n\";\n }else\n {\n echo \"NO\\n\";\n }\n\n}\nfunction solve()\n{\n $server=\"php://stdin\";\n $local=\"input.txt\";\n $handle = fopen($server, \"r\");\n $s=\"\";$d=0;$t=0;\n $x=trim(fgets($handle));\n for($i=0;$i<$x;$i++)\n {\n \n $str=trim(fgets($handle));\n $str1=explode(\" \",$str);\n $w=$str1[0];$y=$str1[1];\n if($w==$y)\n {\n echo \"YES\\n\";\n }else\n {\n gcd($w,$y);\n }\n\n\n }\n\n\n}\n\nsolve();\n?>"}], "negative_code": [{"source_code": "= $y) {\n $bFlag = true;\n } else {\n $bFlag = false;\n }\n } else {\n $d = $x;\n while (true) {\n $x = $x - 1;\n $x = $x * 1.5;\n if($x >= $y){\n $bFlag = true;\n break;\n }\n if($d == $x) {\n $bFlag = false;\n break;\n }\n }\n }\n } else {\n $bFlag = true;\n }\n }\n\n if($bFlag){\n echo \"YES\".\"\\n\";\n } else {\n echo \"NO\".\"\\n\";\n }\n}"}, {"source_code": "= $y) {\n $bFlag = true;\n } else {\n $bFlag = false;\n }\n } else {\n $d = $x;\n while (true) {\n $x = $x - 1;\n $x = $x * 1.5;\n if($x >= $y){\n $bFlag = true;\n break;\n }\n if($d == $x) {\n $bFlag = false;\n break;\n }\n }\n }\n } else {\n $bFlag = true;\n }\n }\n\n //echo $x . ' ' . $y . \"\\n\";\n if($bFlag){\n echo \"YES\".\"\\n\";\n } else {\n echo \"NO\".\"\\n\";\n }\n}"}, {"source_code": "=$y)\n {\n echo \"Yes \\n\";\n }else\n {\n if(lcm($w,$y)!=$y)\n echo \"Yes\\n\";\n else\n echo \"No\\n\";\n }\n }\n\n\n}\n\nsolve();\n?>"}, {"source_code": "=$l)break;\n }\n if(is_float($a))\n {\n if($a-1<$l)\n echo \"No\\n\";\n else\n echo \"Yes\\n\";\n }else\n {\n echo \"Yes\\n\";\n }\n\n}\nfunction solve()\n{\n $server=\"php://stdin\";\n $local=\"input.txt\";\n $handle = fopen($server, \"r\");\n $s=\"\";$d=0;$t=0;\n $x=trim(fgets($handle));\n for($i=0;$i<$x;$i++)\n {\n \n $str=trim(fgets($handle));\n $str1=explode(\" \",$str);\n $w=$str1[0];$y=$str1[1];\n if($w==$y || $w>$y)\n {\n echo \"Yes \\n\";\n }else\n {\n gcd($w,$y);\n }\n\n\n }\n\n\n}\n\nsolve();\n?>"}, {"source_code": ""}, {"source_code": "=$l)break;\n }\n if(is_float($a))\n {\n if($a-1<$l)\n echo \"No\\n\";\n else\n echo \"Yes\\n\";\n }else\n {\n echo \"Yes\\n\";\n }\n\n}\nfunction solve()\n{\n $server=\"php://stdin\";\n $local=\"input.txt\";\n $handle = fopen($server, \"r\");\n $s=\"\";$d=0;$t=0;\n $x=trim(fgets($handle));\n for($i=0;$i<$x;$i++)\n {\n \n $str=trim(fgets($handle));\n $str1=explode(\" \",$str);\n $w=$str1[0];$y=$str1[1];\n if($w==$y || $w>$y)\n {\n echo \"Yes \\n\";\n }else\n {\n if($y%$w>0)\n echo \"Yes\\n\";\n else\n echo \"No\\n\";\n }\n }\n\n\n}\n\nsolve();\n?>"}, {"source_code": "=$l)break;\n }\n if(is_float($a))\n {\n if($a-1<$l)\n echo \"No\\n\";\n else\n echo \"Yes\\n\";\n }else\n {\n echo \"Yes\\n\";\n }\n\n}\nfunction solve()\n{\n $server=\"php://stdin\";\n $local=\"input.txt\";\n $handle = fopen($server, \"r\");\n $s=\"\";$d=0;$t=0;\n $x=trim(fgets($handle));\n for($i=0;$i<$x;$i++)\n {\n \n $str=trim(fgets($handle));\n $str1=explode(\" \",$str);\n $w=$str1[0];$y=$str1[1];\n if($w==$y)\n {\n echo \"Yes \\n\";\n }else\n {\n gcd($w,$y);\n }\n\n\n }\n\n\n}\n\nsolve();\n?>"}], "src_uid": "b3978805756262e17df738e049830427"} {"source_code": "NO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\n", "positive_code": [{"source_code": "NO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\n"}, {"source_code": "NO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO\r\nNO"}, {"source_code": "NO\nNO\nNO\nNO\nNO\nNO\nNO\nNO\nNO"}, {"source_code": "no\r\nno\r\nno\r\nno\r\nno\r\nno\r\nno\r\nno"}], "negative_code": [{"source_code": "NO\r\nNO\r\nNO"}, {"source_code": "NO"}], "src_uid": "57b62c485669809c0b59afd6613f901c"} {"source_code": "= 0)\n {\n $d[$e] = $x;\n $e++;\n }\n else\n {\n break;\n }\n }\n}\nif(count($d) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($d) . \"\\n\";\n print implode(\" \", $d);\n}\n?>", "positive_code": [{"source_code": "= 0) {\n if ($rub - $k < 0) {\n break;\n }\n \n if (($t+1) == $count_types) {\n \n }\n \n if ($k < $types[$t] || is_null($types[$t]) ) {\n $rub -= $k;\n if ($rub >= 0) {\n $list[] = $k;\n $n++;\n }\n } else {\n $t++;\n }\n \n $k++;\n}\n\necho $n.\"\\n\".implode(' ', $list);\n\n\n\n?>"}], "negative_code": [{"source_code": "= 0) {\n if ($rub - $k < 0) {\n break;\n }\n \n if (($t+1) == $count_types) {\n \n }\n \n if ($k < $types[$t] || is_null($types[$t]) ) {\n $rub -= $k;\n if ($rub >= 0) {\n $list[] = $k;\n $n++;\n }\n } else {\n $t++;\n }\n \n $k++;\n}\n\necho $n.\"\\n\".implode(' ', $list);\n\n\n\n?>"}, {"source_code": "= 0) {\n if ($rub - $k < 0) {\n break;\n }\n \n if ($k < $types[$t]) {\n $rub -= $k;\n if ($rub >= 0) {\n $list[] = $k;\n $n++;\n }\n } else {\n $t++;\n }\n \n $k++;\n}\n\necho $n.\"\\n\".implode(' ', $list);\n\n\n\n?>"}], "src_uid": "0318d4d5ea3425bf6506edeb1026f597"} {"source_code": "= $x - $b; $y--)\n {\n if(($d[$x] < $d[$y]) || ($d[$y] == NULL))\n {\n $e++;\n }\n else\n {\n break;\n }\n }\n for($y = $x + 1; $y <= $x + $c; $y++)\n {\n if(($d[$x] < $d[$y]) || ($d[$y] == NULL))\n {\n $e++;\n }\n else\n {\n break;\n }\n }\n if($e == $b + $c)\n {\n print $x + 1;\n break;\n }\n}\n?>", "positive_code": [{"source_code": " $aV){\n $b = true;\n for($i = 1; $i <= $a[1]; $i++){\n $f = $sK - $i;\n if(isset($n[$f])){\n if($n[$f] < $aV){\n $b = false;\n }\n }\n }\n if($b == false && $sK < sizeof($n) - 1){\n continue;\n }\n for($j = 1; $j <= $a[2]; $j++){\n $f = $sK + $j;\n if(isset($n[$f])){\n if($n[$f] < $aV){\n $b = false;\n }\n }\n }\n if($b == true){\n echo $sK+1;\n exit;\n } else {\n continue;\n }\n}\n\n \n \n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "5e2a5ee02c1a2f35a52e76cde96463a3"} {"source_code": "\r\n= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2) {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>", "positive_code": [{"source_code": " $m) {\r\n $sm += $a[$i];\r\n } else {\r\n break;\r\n }\r\n }\r\n echo nf($sm).PHP_EOL;\r\n}\r\nfunction nf($n)\r\n{\r\n return number_format($n, 0, '', '');\r\n}"}], "negative_code": [{"source_code": "\r\n $iCounter2)) {\r\n $a[$i] = Bigint::div($a[$i], $x);\r\n $iCounter2 +=1;\r\n }\r\n $min = $min == -1 ? $iCounter2 : min($min, $iCounter2);\r\n $iSum = Bigint::add($iSum, Bigint::mul($b[$i], $min));\r\n }\r\n \r\n return $iSum;\r\n}\r\n\r\n#$t = 1;\r\n$t = Read::int();\r\nwhile ($t--) {\r\n echo solve();\r\n echo \"\\n\";\r\n}\r\n\r\n\r\nclass Read\r\n{\r\n public static function string()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function int()\r\n {\r\n return intval(fgets(STDIN));\r\n }\r\n\r\n public static function array_int($sep = ' ')\r\n {\r\n $s = trim(fgets(STDIN));\r\n return preg_split(\"/[\\s,]+/\", $s);\r\n }\r\n\r\n}\r\n\r\nclass Bigint\r\n{\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 / $bigint2\r\n */\r\n public static function div($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcmod($bigint1, $bigint2) == 0 ? bcdiv($bigint1, $bigint2) : bcadd(bcdiv($bigint1, $bigint2), 1);\r\n case 'floor':\r\n return bcdiv($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcdiv($bigint1, $bigint2);\r\n return bcsub(bcdiv($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2) {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "\r\n= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n \r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n \r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function bigintSub($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n \r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n \r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2) {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n \r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n \r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n \r\nclass Algorithms\r\n{\r\n \r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n \r\n return $a;\r\n }\r\n \r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n \r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n \r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n \r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n \r\n return $a[$n];\r\n }\r\n \r\n}\r\n \r\n?>"}, {"source_code": "= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function bigintSub($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2) {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function bigintSub($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2) {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": ""}, {"source_code": " $m) {\r\n $sm += $a[$i];\r\n } else {\r\n break;\r\n }\r\n }\r\n echo $sm.PHP_EOL;\r\n}\r\n"}, {"source_code": " $cnt && $mn = $cnt;\r\n $a[$i] *= $mn + 1;\r\n }\r\n echo array_sum($a).PHP_EOL;\r\n}\r\n"}], "src_uid": "09c8db43681d7bc72f83287897a62f3c"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "= 0; $i--) { \n if ($arr[$i] === $arr[$n-1]) {\n $colend ++;\n } else {\n break;\n }\n}\n\nif ($i < 0) {\n $sum = 0;\n for ($j=1; $j < $n; $j++) { \n $sum += $j; \n }\n $col = $n * ($n - 1) - $sum;\n} else {\n $col = $colfirst * $colend;\n}\n\necho \"$max $col\";\n\n?>"}, {"source_code": "\n$n = trim(fgets(STDIN));\n$m = explode(\" \",trim(fgets(STDIN)));\n$mx = max($m);\n$mn = min($m);\nforeach($m as $v){\n if($v == $mx)$cmx++;\n if($v == $mn)$cmn++;\n}\nif($mx != $mn)echo ($mx-$mn).\" \".($cmx*$cmn);\nelse echo ($mx-$mn).\" \".(($n*($n-1))/2);\n?>"}], "negative_code": [{"source_code": "= 0; $x--)\n{\n if($b[$x] == $g)\n {\n $d++;\n }\n else\n {\n break;\n }\n}\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] == $f)\n {\n $e++;\n }\n else\n {\n break;\n }\n}\nprint $c . \" \" . ($d * $e);\n?>"}, {"source_code": " 0; $i--) { \n if ($arr[$i] === $arr[$n-1]) {\n $colend ++;\n } else {\n break;\n }\n}\n\n$col = $colfirst * $colend;\n\necho \"$max $col\";\n\n?>"}, {"source_code": "\n$n = trim(fgets(STDIN));\n$m = explode(\" \",trim(fgets(STDIN)));\n$mx = max($m);\n$mn = min($m);\nforeach($m as $v){\n if($v == $mx)$cmx++;\n if($v == $mn)$cmn++;\n}\necho ($mx-$mn).\" \".($cmx*$cmn);\n?>"}, {"source_code": "\n$n = trim(fgets(STDIN));\n$m = explode(\" \",trim(fgets(STDIN)));\n$mx = max($m);\n$mn = min($m);\nforeach($m as $v){\n if($v == $mx)$cmx++;\n if($v == $mn)$cmn++;\n}\nif($mx != $mn)echo ($mx-$mn).\" \".($cmx*$cmn);\nelse echo ($mx-$mn).\" \".($n*($n-1));\n?>"}], "src_uid": "eb2d1072c5308d9ef686315a122d9d3c"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "\n"}], "src_uid": "2d6a1202139e1f77f32377224e1fe752"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $value) {\n $calcount += $cal[$key - 1] * $value;\n}\necho $calcount;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "db9065d975878227a749083f0036a169"} {"source_code": " 0) && ($f > 0))\n {\n continue;\n }\n else\n {\n array_push($g, $x . \" \" . $y);\n }\n }\n}\nprint count($g) . \"\\n\";\nfor($z = 0; $z < count($g) - 1; $z++)\n{\n print $g[$z] . \"\\n\";\n}\nprint $g[$z];\n?>", "positive_code": [{"source_code": ""}], "src_uid": "14fc3a7fef44a02791aee62838c4c8c8"} {"source_code": " 0,\r\n 'R' => 0\r\n ];\r\n foreach(str_split($s) as $ch) {\r\n if($ch == 'W') {\r\n if(($temp['B'] == 0 && $temp['R'] != 0) || ($temp['B'] != 0 && $temp['R'] == 0)) {\r\n // $bA = false;\r\n break;\r\n }\r\n $temp = [\r\n 'B' => 0,\r\n 'R' => 0\r\n ];\r\n } else {\r\n $temp[$ch] += 1;\r\n }\r\n }\r\n if(($temp['B'] == 0 && $temp['R'] != 0) || ($temp['B'] != 0 && $temp['R'] == 0)) {\r\n pr($no);\r\n } else {\r\n pr($yes);\r\n }\r\n \r\n\r\n }\r\n// bcadd \u2014 Add two arbitrary precision numbers\r\n// bccomp \u2014 Compare two arbitrary precision numbers\r\n// bcdiv \u2014 Divide two arbitrary precision numbers\r\n// bcmod \u2014 Get modulus of an arbitrary precision number\r\n// bcmul \u2014 Multiply two arbitrary precision numbers\r\n// bcpow \u2014 Raise an arbitrary precision number to another\r\n// bcpowmod \u2014 Raise an arbitrary precision number to another, reduced by a specified modulus\r\n// bcscale \u2014 Set or get default scale parameter for all bc math functions\r\n// bcsqrt \u2014 Get the square root of an arbitrary precision number\r\n// bcsub \u2014 Subtract one arbitrary precision number from another\r\nfunction getDar($n) {\r\n $dar = [2];\r\n for($i=0; $i<$n; $i++) {\r\n $dar[] = $dar[$i] * 2;\r\n }\r\n return $dar;\r\n}\r\nfunction getDar2($n, $k) {\r\n if($k == 0) {\r\n return 1;\r\n }\r\n return bcmul($n, getDar2($n, $k-1));\r\n}\r\n function ComandR($aCordinate) {\r\n return [$aCordinate[0] + 1, $aCordinate[1]];\r\n }\r\n function ComandL($aCordinate) {\r\n return [$aCordinate[0] - 1, $aCordinate[1]];\r\n }\r\n function ComandU($aCordinate) {\r\n return [$aCordinate[0], $aCordinate[1] + 1];\r\n }\r\n function ComandD($aCordinate) {\r\n return [$aCordinate[0], $aCordinate[1] - 1];\r\n }\r\n \r\n function getT() {\r\n return trim(fgets(STDIN));\r\n }\r\n function getA() {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n \r\n function is_prime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n \t $d += 1;\r\n }\r\n \r\n return $d == $n;\r\n }\r\nfunction getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n \r\n function getMaxValueBc($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n function getRotate($a, $s, $e, $ind) {\r\n \t\t$ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n \t$ar[$i] = $a[$i];\r\n \t$j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n \t// echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\"; \r\n \t$a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n } \r\n function pr($s) {\r\n if(is_array($s)) {\r\n echo implode( ' ', $s), PHP_EOL;\r\n } else {\r\n echo $s, PHP_EOL;\r\n }\r\n }\r\n function fab2($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n \r\n return $a[$n];\r\n }", "positive_code": [{"source_code": " 0 && ( strpos( $arr[$j], 'R') === false || strpos( $arr[$j], 'B') === false)){\r\n $hasOdd =true;\r\n }\r\n }\r\n echo ($hasOdd? 'No':'Yes').\"\\n\";\r\n}\r\n"}, {"source_code": ""}], "negative_code": [{"source_code": " -1 ? 'No': 'Yes'). \"\\n\";\r\n }\r\n else {\r\n $hasOdd = false;\r\n $x='';\r\n $res = [];\r\n for ($k = 0; $k < $l; $k++) {\r\n if($s[$k] != 'W') {\r\n $x .= $s[$k];\r\n }else {\r\n $res[]= $x;\r\n $x = '';\r\n }\r\n }\r\n for($k = 0; $k < count($res); $k++)\r\n {\r\n if(strlen($res[$k])%2!=0 && strlen($res[$k]) < $l-1){\r\n $hasOdd = true;\r\n }\r\n }\r\n\r\n echo ($hasOdd ? \"No\": \"Yes\"). \"\\n\";\r\n }\r\n}\r\n"}], "src_uid": "3f284afb044c8a57a02cd015d06e0ef0"} {"source_code": " array(\n 'min_range' => $val[0],\n 'max_range' => $val[1]\n )\n )\n )) {\n echo $unreaded - $i . PHP_EOL;\n } else {\n $i++;\n }\n}\n", "positive_code": [{"source_code": " $r[$i]){\n\t\t$c++;\t\n\t}\n}\n\nfwrite(STDOUT, $n-$c);\n\n?>"}, {"source_code": "= $k){\n $n = $n - $i;\n echo $n;\n return 0;\n }\n}\n?>"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= (int)$chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": ""}], "negative_code": [{"source_code": "= $k){\n echo $n - $i;\n return 0;\n }\n}\n?>"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= (int)$chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= (int)$chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= (int)$chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= (int)$chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= (int)$chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= $chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}, {"source_code": " $chapter) {\n if ($unreadPageIndex <= (int)$chapter[1]) {\n $chaptersRemained = $nrChapters - $index + 1;\n echo $chaptersRemained;\n exit();\n }\n \n if ($index == $nrChapters){\n echo \"Wrong unread page index!\";\n exit();\n }\n }"}], "src_uid": "2545b6af730f99193041a8810b728cb3"} {"source_code": " strlen($l))\n{\n echo \"impossible\";\n exit;\n}\n\n$cc = array();\nforeach(str_split($l) as $c) {\n if (!isset($cc[$c]))\n $cc[$c] = true;\n}\n\n$rr = max(0, $r - sizeof($cc));\necho ($rr);", "positive_code": [{"source_code": "= $b)\n {\n print \"0\";\n }\n else\n {\n print $b - count($c);\n }\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " $l)\n{\n echo \"impossible\";\n exit;\n}\n\n$cc = array();\nforeach($l as $c) {\n if (!isset($cc[$c]))\n $cc[$c] = true;\n}\n\necho ($r - sizeof($cc));"}, {"source_code": " strlen($l))\n{\n echo \"impossible\";\n exit;\n}\n\n$cc = array();\nforeach(str_split($l) as $c) {\n if (!isset($cc[$c]))\n $cc[$c] = true;\n}\n\necho ($r - sizeof($cc));"}], "src_uid": "bd5912fe2c5c37658f28f6b159b39645"} {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}], "negative_code": [{"source_code": " 0) {\r\n $ans += pow($min, $max);\r\n \r\n }\r\n IO::pr($ans);\r\n}\r\n\r\n\r\nclass IO {\r\n public static function getInt()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}\r\n\r\n"}, {"source_code": " 1) {\r\n $sN = '';\r\n $tt = $n;\r\n for($i=0; $i<$tt-1; $i++) {\r\n if($s[$i] == '0' && $s[$i+1] == '1') {\r\n $sN .= '1'; \r\n $n--;\r\n $i++;\r\n } elseif($s[$i] == '1' && $s[$i+1] == '0') { \r\n $sN .= '0'; \r\n $n--;\r\n $i++; \r\n } else {\r\n $sN .= $s[$i]; \r\n }\r\n } \r\n if($tt == $n) {\r\n break;\r\n } else {\r\n $ans += $tt - $n == 1 ? 1 : ($tt - $n) + 1 ;\r\n $s = $sN;\r\n }\r\n }\r\n \r\n \r\n IO::pr($ans);\r\n}\r\n\r\n\r\nclass IO {\r\n public static function getInt()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}\r\n\r\n"}], "src_uid": "bc45b3b665ccef5c9451ff2ecc5198a8"} {"source_code": ""}, {"source_code": "= 1)\n {\n $s += $f;\n } \n}\n\necho $s;\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 1)\n {\n ++$s;\n }\n}\n\necho $s;\n"}, {"source_code": " 1)\n {\n ++$s;\n }\n}\n\necho $s;\n"}, {"source_code": "= 1)\n {\n echo \"f: $f \\n\";\n $s += $f;\n } \n}\n\necho $s;\n"}, {"source_code": "\n", "positive_code": [{"source_code": "= 0; $x--)\n{\n if($d[$x] == 2)\n {\n $f++;\n }\n else\n {\n $e += 1 * $f;\n }\n}\nprint $e;\n?>"}, {"source_code": "0){\n while ($metal_length>$j && $heavy_positions[$i]>$metal_positions[$j]){\n $j++;\n }\n if($metal_length>$j){\n if($heavy_positions[$i]<$metal_positions[$j]){\n $substring += $metal_length-$j;\n }\n }\n }\n }\n return $substring;\n}\n \nfunction FindPosition($string,$needle){\n $lastPos = 0;\n $positions = array();\n\n while (($lastPos = strpos($string, $needle, $lastPos))!== false) {\n $positions[] = $lastPos;\n $lastPos = $lastPos + strlen($needle);\n }\n return $positions;\n}\n\n\n$string = trim(fgets(STDIN));\necho FindSubString($string);\n\n"}], "negative_code": [], "src_uid": "960e4c234666d2444b80d5966f1d285d"} {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $l = strlen($n);\r\n $last = 1;\r\n $res = 0;\r\n for ($i = 1; $i < 10; $i++) {\r\n $r = '';\r\n for ($j = 0; $j < $l; $j++) {\r\n $r .= $i;\r\n if ((int)$r <= $n) {\r\n $res++;\r\n $last = (int)$r + 1;\r\n }\r\n }\r\n }\r\n\r\n IO::line($res);\r\n}\r\n\r\n?>", "positive_code": [{"source_code": "= 2) { $ans = 9 * ($len - 1); }\r\n \r\n $s = (string) $n;\r\n $f = $s[0]; \r\n $m = '';\r\n for ($j = 0; $j < $len; $j++) { $m .= $f; }\r\n \r\n if ($m > $n) { $ans += $f - 1; }\r\n else { $ans += $f; }\r\n \r\n echo $ans.PHP_EOL;\r\n }\r\n }\r\n}\r\n\r\n?>"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$nums = array(\r\n 2 => 9,\r\n 3 => 18,\r\n 4 => 27,\r\n 5 => 36,\r\n 6 => 45,\r\n 7 => 54,\r\n 8 => 63,\r\n 9 => 72,\r\n 10 => 81,\r\n 11 => 90,\r\n);\r\n\r\n\r\n$t = IO::str();\r\n\r\nfunction makeDel($q)\r\n{\r\n $s = '';\r\n while($q--) {\r\n $s .= '1';\r\n }\r\n return $s;\r\n}\r\nwhile($t--){\r\n $n = IO::str();\r\n\r\n if ($n < 10) {\r\n $res[] = $n;\r\n continue;\r\n }\r\n\r\n $s = $nums[strlen($n)];\r\n $del = makeDel(strlen($n));\r\n\r\n while($n >= $del) {\r\n $s++;\r\n $n = $n - $del;\r\n }\r\n\r\n $res[] = $s;\r\n}\r\n\r\nIO::res($res);"}], "negative_code": [{"source_code": "= 2) { $ans = 9 * ($len - 1); }\r\n \r\n $s = (string) $n;\r\n $f = $s[0]; \r\n $m = '';\r\n for ($j = 0; $j < $len; $j++) { $m .= $f; }\r\n \r\n if ($m > $v[$i]) { $ans += $f - 1; }\r\n else { $ans += $f; }\r\n echo $ans.PHP_EOL;\r\n }\r\n }\r\n}\r\n\r\n?>"}, {"source_code": " 2) { $ans = 9 * ($len - 1); }\r\n \r\n $s = (string) $n;\r\n $f = $s[0]; \r\n $m = '';\r\n for ($j = 0; $j < $len; $j++) { $m .= $f; }\r\n \r\n if ($m > $v[$i]) { $ans += $f - 1; }\r\n else { $ans += $f; }\r\n echo $ans.PHP_EOL;\r\n }\r\n }\r\n}\r\n\r\n?>"}, {"source_code": " 2) { $ans += 9 * ($len - 2); }\r\n \r\n $s = (string) $n;\r\n $f = $s[0]; \r\n $m = '';\r\n for ($j = 0; $j < $len; $j++) { $m .= $f; }\r\n \r\n if ($m > $v[$i]) { $ans += $f - 1; }\r\n else { $ans += $f; }\r\n echo $ans.PHP_EOL;\r\n }\r\n}\r\n\r\n?>"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$nums = array(\r\n 2 => 9,\r\n 3 => 18,\r\n 4 => 27,\r\n 5 => 36,\r\n 6 => 45,\r\n 7 => 54,\r\n 8 => 63,\r\n 9 => 72,\r\n 10 => 81,\r\n 11 => 90,\r\n);\r\n\r\n\r\n$t = IO::str();\r\n\r\nfunction makeDel($q)\r\n{\r\n $s = '';\r\n while($q--) {\r\n $s .= '1';\r\n }\r\n return $s;\r\n}\r\nwhile($t--){\r\n $n = IO::str();\r\n\r\n if ($n < 10) {\r\n $res[] = $n;\r\n continue;\r\n }\r\n\r\n $s = $nums[strlen($n)];\r\n $del = makeDel(strlen($n));\r\n\r\n while($n > $del) {\r\n $s++;\r\n $n = $n - $del;\r\n }\r\n\r\n $res[] = $s;\r\n}\r\n\r\nIO::res($res);"}], "src_uid": "ac7d117d58046872e9d665c9f99e5bff"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n"}], "negative_code": [{"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}], "src_uid": "3c63e2e682d3c8051c3cecc3fa9c4e8c"} {"source_code": " 0)\n {\n $d = array(\"1\");\n }\n else\n {\n $d = array(\"1\", \"1\");\n }\n for($x = 1; $x < 100; $x++)\n {\n if($c > 0)\n {\n $e = array_sum($d);\n $e++;\n array_push($d, $e);\n $c--;\n }\n else\n {\n break;\n }\n }\n for($x = 1; $x <= 100; $x++)\n {\n if($b > 0)\n {\n $e = $d[count($d) - 1];\n $e++;\n array_push($d, $e);\n $b--;\n }\n else\n {\n break;\n }\n }\n $f = count($d);\n for($x = 1; $x <= $a - $f; $x++)\n {\n $e = $d[count($d) - 1];\n array_push($d, $e);\n }\n if(($d[count($d) - 1] > 50000) || (count($d) > $a))\n {\n print \"-1\";\n }\n else\n {\n print implode(\" \", $d);\n }\n}\n?>", "positive_code": [{"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction array_printf(array $arr) {\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\tif ($a === $n - 1 && $n != 1) {\n\t\tprintf(\"%d\",-1);\n\t\treturn;\n\t} elseif ($b === 0 && $a !== 0) {\n\t\t$array_a = array(1, 1,);\n\t\tfor ($i = 2; $i < $a + 2; $i++) {\n\t\t\t$array_a[] = $i;\n\t\t}\n\t\t\n\t\t$num = $n - count($array_a);\n\t\t//$array_a = array_fill(count($array_a) - 1, $n - $a - 2, (int)1);\n\t\t//for ($i = 0; $i < $n - count($array_a); $i++) {\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$array_a[] = 1;\n\t\t}\n\t\tarray_printf($array_a);\n\t\treturn;\n\t}\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\t//for ($i = 1; $i <= $a; $i++) {\n\t//array_pop not get, pop.so number - 1.\n\t//$begin = array_pop(&$arr);\n\t\n//test coding\n//printf(\"%d\\n\",(int)$arr[count($arr)]);\n//printf(\"%d\\n\",(int)null);\n\n\t$begin = $arr[count($arr) - 1]; \n\tfor ($i = $begin + 1; $i < $a + $begin + 1; $i++) {\n\t\t//$arr[] = $i + 1;\n\t\t$arr[] = $i;\n\t}\n\t//for ($i = 0; $i < $b - 1; $i++) {\n\t\t//$arr[] = array_sum($arr) + 1;\n\t//}\n\tfor ($i = 0; $i < $n - ($a + $b + 1); $i++) {\n\t\t$arr[] = 1;\n\t}\n\tarray_printf($arr);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1;\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; $b-=1;}\n \n elseif ($b==0 && $n-$a == 1) {$c=true; break;}\n elseif ($b==0 && $i == 1) {$money[$i]=$money[$i-1];}\n elseif ($a>0) {$money[$i]=$money[$i-1]+1; $a-=1;}\n else $money[$i] = $money[$i-1];\n}\nif ($money[$n-1] < 50001 && !$c) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}], "negative_code": [{"source_code": " 0)\n {\n $d = array(\"1\");\n }\n else\n {\n $d = array(\"1\", \"1\");\n }\n for($x = 1; $x < 100; $x++)\n {\n if(($b == 0) && ($c == 0))\n {\n break;\n }\n else\n {\n if($c > 0)\n {\n $e = array_sum($d);\n $e++;\n array_push($d, $e);\n $c--;\n }\n if($b > 0)\n {\n $e = $d[count($d) - 1];\n $e++;\n array_push($d, $e);\n $b--;\n }\n }\n }\n $f = count($d);\n for($x = 1; $x <= $a - $f; $x++)\n {\n $e = $d[count($d) - 1];\n array_push($d, $e);\n }\n if(($d[count($d) - 1] > 50000) || (count($d) > $a))\n {\n print \"-1\";\n }\n else\n {\n print implode(\" \", $d);\n }\n}\n?>"}, {"source_code": " 0)\n{\n $d = array(\"1\");\n}\nelse\n{\n $d = array(\"1\", \"1\");\n}\nfor($x = 1; $x < 100; $x++)\n{\n if(($b == 0) && ($c == 0))\n {\n break;\n }\n else\n {\n if($c > 0)\n {\n $e = array_sum($d);\n $e++;\n array_push($d, $e);\n $c--;\n }\n if($b > 0)\n {\n $e = $d[count($d) - 1];\n $e++;\n array_push($d, $e);\n $b--;\n }\n }\n}\n$f = count($d);\nfor($x = 1; $x <= $a - $f; $x++)\n{\n $e = $d[count($d) - 1];\n array_push($d, $e);\n}\nif(($d[count($d) - 1] > 50000) || (count($d) > $a))\n{\n print \"-1\";\n}\nelse\n{\n print implode(\" \", $d);\n}\n?>"}, {"source_code": " 0)\n {\n $e = array_sum($d);\n $e++;\n array_push($d, $e);\n $c--;\n }\n if($b > 0)\n {\n $e = $d[count($d) - 1];\n $e++;\n array_push($d, $e);\n $b--;\n }\n }\n}\n$f = count($d);\nfor($x = 1; $x <= $a - $f; $x++)\n{\n $e = $d[count($d) - 1];\n array_push($d, $e);\n}\nif($d[count($d) - 1] > 50000)\n{\n print \"-1\";\n}\nelse\n{\n print implode(\" \", $d);\n}\n?>"}, {"source_code": " 0)\n{\n $d = array(\"1\");\n}\nelse\n{\n $d = array(\"1\", \"1\");\n}\nfor($x = 1; $x < 100; $x++)\n{\n if(($b == 0) && ($c == 0))\n {\n break;\n }\n else\n {\n if($c > 0)\n {\n $e = array_sum($d);\n $e++;\n array_push($d, $e);\n $c--;\n }\n if($b > 0)\n {\n $e = $d[count($d) - 1];\n $e++;\n array_push($d, $e);\n $b--;\n }\n }\n}\n$f = count($d);\nfor($x = 1; $x <= $a - $f; $x++)\n{\n $e = $d[count($d) - 1];\n array_push($d, $e);\n}\nif($d[count($d) - 1] > 50000)\n{\n print \"-1\";\n}\nelse\n{\n print implode(\" \", $d);\n}\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction array_printf(array $arr) {\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\tif ($a === $n - 1) {\n\t\tprintf(\"%d\",-1);\n\t\treturn;\n\t} elseif ($b === 0 && $a !== 0) {\n\t\t$array_a = array(1, 1,);\n\t\tfor ($i = 2; $i < $a + 2; $i++) {\n\t\t\t$array_a[] = $i;\n\t\t}\n\t\t\n\t\t$num = $n - count($array_a);\n\t\t//$array_a = array_fill(count($array_a) - 1, $n - $a - 2, (int)1);\n\t\t//for ($i = 0; $i < $n - count($array_a); $i++) {\n\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t$array_a[] = 1;\n\t\t}\n\t\tarray_printf($array_a);\n\t\treturn;\n\t}\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\t//for ($i = 1; $i <= $a; $i++) {\n\t//array_pop not get, pop.so number - 1.\n\t//$begin = array_pop(&$arr);\n\t\n//test coding\n//printf(\"%d\\n\",(int)$arr[count($arr)]);\n//printf(\"%d\\n\",(int)null);\n\n\t$begin = $arr[count($arr) - 1]; \n\tfor ($i = $begin + 1; $i < $a + $begin + 1; $i++) {\n\t\t//$arr[] = $i + 1;\n\t\t$arr[] = $i;\n\t}\n\t//for ($i = 0; $i < $b - 1; $i++) {\n\t\t//$arr[] = array_sum($arr) + 1;\n\t//}\n\tfor ($i = 0; $i < $n - ($a + $b + 1); $i++) {\n\t\t$arr[] = 1;\n\t}\n\tarray_printf($arr);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\t//for ($i = 1; $i <= $a; $i++) {\n\tfor ($i = 1; $i < $a + 2; $i++) {\n\t\t$arr[] = $i + 1;\n\t}\n\tfor ($i = 0; $i < $b - 1; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\tfor ($i = 0; $i < $n - ($a + $b + 1); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\t//for ($i = 1; $i <= $a; $i++) {\n\tfor ($i = 2; $i <= ($a + 1); $i++) {\n\t\t$arr[] = $i + 1;\n\t}\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\tfor ($i = 0; $i < $n - ($a + $b); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\tfor ($i = 1; $i <= $a; $i++) {\n\t\t$arr[] = $i + 1;\n\t}\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\tfor ($i = 0; $i < $n - ($a + $b); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\t//for ($i = 1; $i <= $a; $i++) {\n\tfor ($i = 2; $i <= ($a + 2); $i++) {\n\t\t$arr[] = $i + 1;\n\t}\n\tfor ($i = 0; $i < $b - 1; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\tfor ($i = 0; $i < $n - ($a + $b); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\t//for ($i = 1; $i <= $a; $i++) {\n\t$begin = array_sum($arr);\n\tfor ($i = $begin; $i < $a + $begin; $i++) {\n\t\t$arr[] = $i + 1;\n\t}\n\t//for ($i = 0; $i < $b - 1; $i++) {\n\t\t//$arr[] = array_sum($arr) + 1;\n\t//}\n\tfor ($i = 0; $i < $n - ($a + $b + 1); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t//$arr[] = 1;\n\t$arr[] = 2;\n\t//for ($i = 1; $i <= $a; $i++) {\n\tfor ($i = 2; $i <= ($a + 1); $i++) {\n\t\t$arr[] = $i + 1;\n\t}\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\tfor ($i = 0; $i < $n - ($a + $b); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\t//for ($i = 1; $i <= $a; $i++) {\n\t//array_pop not get, pop.so number - 1.\n\t//$begin = array_pop(&$arr);\n\t\n//test coding\n//printf(\"%d\\n\",(int)$arr[count($arr)]);\n//printf(\"%d\\n\",(int)null);\n\n\t$begin = $arr[count($arr) - 1]; \n\tfor ($i = $begin + 1; $i < $a + $begin + 1; $i++) {\n\t\t//$arr[] = $i + 1;\n\t\t$arr[] = $i;\n\t}\n\t//for ($i = 0; $i < $b - 1; $i++) {\n\t\t//$arr[] = array_sum($arr) + 1;\n\t//}\n\tfor ($i = 0; $i < $n - ($a + $b + 1); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "tok = $tok;\n\t\t$this->token = strtok($str_line, $this->tok);\n\t}\n\n\tpublic function nextToken() {\n\t\t$thisToken = $this->token;\n\t\t$this->token = strtok($this->tok);\n\t\treturn $thisToken;\n\t} \n\t\t\n\tpublic function nextFloat() {\n\t\treturn (float)$this->nextToken();\n\t}\n\t\n\tpublic function nextInt() {\n\t\treturn (int)$this->nextToken();\n\t}\n}\n\nfunction solve(){\n\n/* basic coding (this code is not best, because changing token and float is not good)\n\t$vp = (float)strtok(rtrim(fgets(STDIN, 10), \"\\n\"), \" \");\n\t$vd = (float)strtok(\" \");\n\t$t = (float)strtok(\" \");\n\t$f = (float)strtok(\" \");\n\t$c = (float)strtok(\" \");\n*/\n\t//use Token class(advatage of using this class is changing token and float is more easy)\t\n\t//$Token = new Token(rtrim(fgets(STDIN, 5), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$n = $Token->nextInt();\n\t$a = $Token->nextInt();\n\t$b = $Token->nextInt();\n\t\n\tif ($b === 0 && $a !== 0) {\n\t\tprintf(\"%d\",-1);\n\t\treturn;\n\t}\n\t//this is for more reading.really array() is not useful.\n\t$arr = array();\n\t$arr[] = 1;\n\tfor ($i = 0; $i < $b; $i++) {\n\t\t$arr[] = array_sum($arr) + 1;\n\t}\n\t//for ($i = 1; $i <= $a; $i++) {\n\t//array_pop not get, pop.so number - 1.\n\t//$begin = array_pop(&$arr);\n\t\n//test coding\n//printf(\"%d\\n\",(int)$arr[count($arr)]);\n//printf(\"%d\\n\",(int)null);\n\n\t$begin = $arr[count($arr) - 1]; \n\tfor ($i = $begin + 1; $i < $a + $begin + 1; $i++) {\n\t\t//$arr[] = $i + 1;\n\t\t$arr[] = $i;\n\t}\n\t//for ($i = 0; $i < $b - 1; $i++) {\n\t\t//$arr[] = array_sum($arr) + 1;\n\t//}\n\tfor ($i = 0; $i < $n - ($a + $b + 1); $i++) {\n\t\t$arr[] = 1;\n\t}\n\t$message = \"\";\n\tforeach ($arr as $value) {\n\t\t$message .= \"$value\" . \" \";\n\t}\n\t$message = rtrim($message);\n\tprintf('%s', $message);\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1; print \"$n $a $b\";\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; --$b;}\n elseif ($a>0) {$money[$i]=$money[$i-1]+1; --$a;}\n}\nif ($money[$n-1] < 50001) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1;\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; $b-=1;}\n elseif ($b==0 && $i==1) $c=true;\n elseif ($a>0) {$money[$i]=$money[$i-1]+1; $a-=1;}\n else $money[$i] = $money[$i-1];\n}\nif ($money[$n-1] < 50001 && !$c) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1; print \"$n $a $b\";\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; --$b;}\n elseif ($a>0) {$money[$i]=2; --$a;}\n}\nif ($money[$n-1] < 50001) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1;\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; $b-=1;}\n elseif ($a>0) {$money[$i]=2; $a-=1;}\n else $money[$i] = 1;\n}\nif ($money[$n-1] < 50001) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1;\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; $b-=1;}\n elseif ($a>0) {$money[$i]=2; $a-=1;}\n else $money[$i] = $money[$i-1];\n}\nif ($money[$n-1] < 50001) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1;\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; $b-=1;}\n elseif ($b==0 && $i==1 && $a != 0) $c=true;\n elseif ($a>0) {$money[$i]=$money[$i-1]+1; $a-=1;}\n else $money[$i] = $money[$i-1];\n}\nif ($money[$n-1] < 50001 && !$c) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=0; print \"$n $a $b\";\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; --$b;}\n elseif ($a>0) {$money[$i]=$money[$i-1]+1; --$a;}\n}\nif ($money[$n-1] < 50001) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1;\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; --$b;}\n elseif ($a>0) {$money[$i]=2; --$a;}\n}\nif ($money[$n-1] < 50001) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}, {"source_code": "\nlist($n,$a,$b)=explode(' ', fgets(STDIN));\n$money[0]=1;\nfor ($i=1;$i<$n;++$i) {\n $sum+=$money[$i-1];\n if ($b>0) {$money[$i]=$sum+1; $b-=1;}\n elseif ($a>0) {$money[$i]=$money[$i-1]+1; $a-=1;}\n else $money[$i] = $money[$i-1];\n}\nif ($money[$n-1] < 50001) for ($i=0;$i<$n;++$i) print \"$money[$i] \";\n else echo '-1';\n"}], "src_uid": "573995cbae2a7b28ed92d71c48cd9039"} {"source_code": "", "positive_code": [{"source_code": ">1;\n\n\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ">1;\n\n\n?>"}, {"source_code": ""}, {"source_code": ">1;\n\n\n?>"}, {"source_code": ">1;\n\n\n?>"}], "src_uid": "8237ac3f3c2e79f5f70be1595630207e"} {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": "= $s2){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo \"2\\n\";\n echo $s1 . ' ' . $s2. \"\\n\";\n }\n }\n}\n"}, {"source_code": ""}, {"source_code": "\n\n$n = trim(fgets(STDIN));\nfor($i=0;$i<$n;$i++){\n\t$cnt = intval(trim(fgets(STDIN)));\n\t$str = trim(fgets(STDIN));\n\t\n\tif($cnt<2){\n\t\techo \"NO\\n\";\n\t}elseif($cnt==2){\n\t\tif(intval(substr($str,0,1))>=intval(substr($str,1,1))){\n\t\t\techo \"NO\\n\";\n\t\t}else{\n\t\t\techo \"YES\\n\";\n\t\t\techo \"2\\n\";\n\t\t\techo substr($str,0,1).\" \".substr($str,1,1).\"\\n\";\n\t\t}\n\t}else{\n\t\techo \"YES\\n\";\n\t\techo \"2\\n\";\n\t\techo substr($str,0,1).\" \".substr($str,1).\"\\n\";\n\t}\n}"}, {"source_code": ""}, {"source_code": "\n\n$n = trim(fgets(STDIN));\nfor($i=0;$i<$n;$i++){\n\t$cnt = intval(trim(fgets(STDIN)));\n\t$str = trim(fgets(STDIN));\n\t\n\tif($cnt<2){\n\t\techo \"NO\\n\";\n\t}elseif($cnt==2){\n\t\tif(intval(substr($str,0,1))<=intval(substr($str,1,1))){\n\t\t\techo \"NO\\n\";\n\t\t}else{\n\t\t\techo \"YES\\n\";\n\t\t\techo \"2\";\n\t\t\techo substr($str,0,1).\" \".substr($str,1,1).\"\\n\";\n\t\t}\n\t}else{\n\t\techo \"YES\\n\";\n\t\techo \"2\";\n\t\techo substr($str,0,1).\" \".substr($str,1).\"\\n\";\n\t}\n}"}, {"source_code": "\n\n$n = trim(fgets(STDIN));\nfor($i=0;$i<$n;$i++){\n\t$cnt = intval(trim(fgets(STDIN)));\n\t$str = trim(fgets(STDIN));\n\t\n\tif($cnt<2){\n\t\techo \"NO\\n\";\n\t}elseif($cnt==2){\n\t\tif(intval(substr($str,0,1))<=intval(substr($str,1,1))){\n\t\t\techo \"NO\\n\";\n\t\t}else{\n\t\t\techo \"YES\\n\";\n\t\t\techo substr($str,0,1).\" \".substr($str,1,1).\"\\n\";\n\t\t}\n\t}else{\n\t\techo \"YES\\n\";\n\t\techo substr($str,0,1).\" \".substr($str,1).\"\\n\";\n\t}\n}"}, {"source_code": "\n$n = trim(fgets(STDIN));\nfor($i=0;$i<$n;$i++){\n\t$cnt = intval(trim(fgets(STDIN)));\n\t$str = trim(fgets(STDIN));\n\t\n\tif($cnt<2){\n\t\techo \"NO\\n\";\n\t}elseif($cnt==2){\n\t\tif(intval(substr($str,0,1))<=intval(substr($str,1,1))){\n\t\t\techo \"NO\\n\";\n\t\t}else{\n\t\t\techo substr($str,0,1).\" \".substr($str,1,1);\n\t\t}\n\t}else{\n\t\techo substr($str,0,1).\" \".substr($str,1);\n\t}\n}"}, {"source_code": "\n\n$n = trim(fgets(STDIN));\nfor($i=0;$i<$n;$i++){\n\t$cnt = intval(trim(fgets(STDIN)));\n\t$str = trim(fgets(STDIN));\n\t\n\tif($cnt<2){\n\t\techo \"NO\\n\";\n\t}elseif($cnt==2){\n\t\tif(intval(substr($str,0,1))<=intval(substr($str,1,1))){\n\t\t\techo \"NO\\n\";\n\t\t}else{\n\t\t\techo \"YES\\n\";\n\t\t\techo \"2\\n\";\n\t\t\techo substr($str,0,1).\" \".substr($str,1,1).\"\\n\";\n\t\t}\n\t}else{\n\t\techo \"YES\\n\";\n\t\techo \"2\\n\";\n\t\techo substr($str,0,1).\" \".substr($str,1).\"\\n\";\n\t}\n}"}], "src_uid": "9f87a89c788bd7c7b66e51db9fe47e46"} {"source_code": "= $cur) $z = true;\n\t else $last = $cur;\n\t }\n\t }\n\t else\n\t {\n\t if($s[$i] == '0')\n\t {\n\t $cur = $i + 1;\n\t \n\t if($last + 1 >= $cur)\n\t {\n\t print \"NO\\n\";;\n\t continue 2;\n\t }\n\n\t $last = $cur;\n\t }\n\t }\n\t }\n\n\t print \"YES\\n\";\n\t}\n?>", "positive_code": [{"source_code": ""}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $s = str_split(IO::str());\r\n $d = $s;\r\n $last0 = -3;\r\n $bool = true;\r\n $bl = true;\r\n foreach ($s as $k => $v) {\r\n if($v == 1 && $bl) {\r\n if($k - $last0 >= 2) {\r\n $last0 = $k;\r\n unset($d[$k]);\r\n } else {\r\n $bl = false;\r\n }\r\n }\r\n if ($v == 0 && !$bl) {\r\n if($k - $last0 >= 2) {\r\n $last0 = $k;\r\n unset($d[$k]);\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n $last = -1;\r\n foreach ($d as $f) {\r\n if ($last > $f) {\r\n $bool = false;\r\n break;\r\n }\r\n $last = $f;\r\n }\r\n\r\n\r\n if ($bool) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}"}], "negative_code": [{"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $s = str_split(IO::str());\r\n $last0 = $last1 = -3;\r\n $bool0 = $bool1 = true;\r\n $aZero = $aOne = [];\r\n foreach ($s as $k => $v) {\r\n if (($k == 0 && $s[1] != $v) || ($k == count($s) - 1 && $s[count($s) - 2] != $v)) {\r\n continue;\r\n }\r\n if($v == 0) {\r\n $aZero[$k] = $k;\r\n } else {\r\n $aOne[$k] = $k;\r\n }\r\n }\r\n\r\n for($i = 0; $i <= end($aZero); $i++) {\r\n if ($s[$i] == 1) {\r\n if ($i - $last1 < 2) {\r\n $bool1 = false;\r\n }\r\n $last1 = $i;\r\n }\r\n if ($s[$i] == 0) {\r\n if ($i - $last0 < 2) {\r\n $bool0 = false;\r\n }\r\n $last0 = $i;\r\n }\r\n }\r\n\r\n if ($bool1 || $bool0) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $s = str_split(IO::str());\r\n $last0 = $last1 = -3;\r\n $bool0 = $bool1 = true;\r\n $aZero = $aOne = [];\r\n foreach ($s as $k => $v) {\r\n if($v == 0) {\r\n $aZero[$k] = $k;\r\n } else {\r\n $aOne[$k] = $k;\r\n }\r\n }\r\n for($i = 0; $i <= end($aZero); $i++) {\r\n if ($s[$i] == 1) {\r\n if ($i - $last1 < 2) {\r\n $bool1 = false;\r\n }\r\n $last1 = $i;\r\n }\r\n if ($s[$i] == 0) {\r\n if ($i - $last0 < 2) {\r\n $bool0 = false;\r\n }\r\n $last0 = $i;\r\n }\r\n }\r\n\r\n if ($bool1 || $bool0) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $s = str_split(IO::str());\r\n $last = -3;\r\n $bool = true;\r\n foreach ($s as $k => $v) {\r\n if ($v == 0 && $k - $last < 2) {\r\n $bool = false;\r\n //break;\r\n }\r\n if($v == 0) {\r\n $last = $k;\r\n }\r\n }\r\n if (!$bool) {\r\n $bool = true;\r\n $last1 = -3;\r\n for ($i = 0; $i < $last; $i++) {\r\n if ($s[$i] == 1 && $i - $last1 < 2) {\r\n $bool = false;\r\n break;\r\n }\r\n if($s[$i] == 1) {\r\n $last1 = $i;\r\n }\r\n }\r\n }\r\n\r\n if ($bool) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $s = str_split(IO::str());\r\n $last = -3;\r\n $bool = true;\r\n foreach ($s as $k => $v) {\r\n if ($v == 0 && $k - $last < 2) {\r\n $bool = false;\r\n //break;\r\n }\r\n if($v == 0) {\r\n $last = $k;\r\n }\r\n }\r\n if (!$bool && $last + 1 != count($s)) {\r\n $bool = true;\r\n $last1 = -3;\r\n for ($i = 0; $i < $last; $i++) {\r\n if ($s[$i] == 1 && $i - $last1 < 2) {\r\n $bool = false;\r\n break;\r\n }\r\n if($s[$i] == 1) {\r\n $last1 = $i;\r\n }\r\n }\r\n }\r\n\r\n if ($bool) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $s = str_split(IO::str());\r\n $last = -3;\r\n $bool = true;\r\n foreach ($s as $k => $v) {\r\n if ($v == 0 && $k - $last < 2) {\r\n $bool = false;\r\n break;\r\n }\r\n if($v == 0) {\r\n $last = $k;\r\n }\r\n }\r\n if (!$bool) {\r\n $bool = true;\r\n $last1 = -3;\r\n for ($i = 0; $i < $last; $i++) {\r\n if ($s[$i] == 1 && $i - $last1 < 2) {\r\n $bool = false;\r\n break;\r\n }\r\n if($s[$i] == 1) {\r\n $last1 = $i;\r\n }\r\n }\r\n }\r\n\r\n if ($bool) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}"}, {"source_code": ""}], "src_uid": "357dcc8fb7783d878cd2c4ed34eb437e"} {"source_code": " $ar[$i]) {\n// $sorted = false;\n// break;\n// }\n// }\n// }\n\n // try asc\n $sorted = false;\n\n if (!$sorted) {\n $sorted = true;\n\n for ($i = 1; $i < $n; ++$i) {\n if ($ar[$i - 1] > $ar[$i]) {\n $sorted = false;\n break;\n }\n }\n\n if (!$sorted) {\n $sorted = true;\n for (++$i; $i < $n; ++$i) {\n if ($ar[$i - 1] < $ar[$i]) {\n $sorted = false;\n break;\n }\n }\n }\n }\n\n if ($sorted) {\n echo 'YES'.PHP_EOL;\n } else {\n echo 'NO'.PHP_EOL;\n }\n}\n\n/*\n\n1\n5\n1 2 3 2 1\n// yes\n\n1\n5\n3 2 1 2 3\n// no\n\n1\n5\n1 2 3 4 5\n// yes\n\n1\n4\n1 1 1 1\n\n1\n7\n2 1 3 4 2 1 2\n// no\n */\n", "positive_code": [{"source_code": " $ar[$i]) {\n $sorted = false;\n break;\n }\n }\n\n if (!$sorted) {\n $sorted = true;\n for (++$i; $i < $n; ++$i) {\n if ($ar[$i - 1] < $ar[$i]) {\n $sorted = false;\n break;\n }\n }\n }\n\n if ($sorted) {\n echo 'YES'.PHP_EOL;\n } else {\n echo 'NO'.PHP_EOL;\n }\n}\n\n/*\n\n1\n5\n1 2 3 2 1\n// yes\n\n1\n5\n3 2 1 2 3\n// no\n\n1\n5\n1 2 3 4 5\n// yes\n\n1\n4\n1 1 1 1\n// yes\n\n1\n7\n2 1 3 4 2 1 2\n// no\n */\n"}, {"source_code": " $p[$i] and $p[$i] < $p[$i+1]) $works = false;\r\n }\r\n if ($works) fwrite($cout, \"YES\\n\");\r\n else fwrite($cout, \"NO\\n\");\r\n} ?>"}], "negative_code": [{"source_code": " $ar[$i - 1]) {\n $sorted = false;\n break;\n }\n }\n // 4 4 3 2 1\n if (!$sorted) {\n $sorted = true;\n\n for (++$i; $i < $n; ++$i) {\n if ($ar[$i] < $ar[$i - 1]) {\n $sorted = false;\n break;\n }\n }\n }\n\n // try desc\n\n if (!$sorted) {\n $sorted = true;\n\n for ($i = 1; $i < $n; ++$i) {\n if ($ar[$i] < $ar[$i - 1]) {\n $sorted = false;\n break;\n }\n }\n\n if (!$sorted) {\n $sorted = true;\n for (++$i; $i < $n; ++$i) {\n if ($ar[$i] > $ar[$i - 1]) {\n $sorted = false;\n break;\n }\n }\n }\n }\n\n if ($sorted) {\n echo 'YES'.PHP_EOL;\n } else {\n echo 'NO'.PHP_EOL;\n }\n}\n\n/*\n\n1\n5\n1 2 3 2 1\n// yes\n\n1\n5\n3 2 1 2 3\n// yes\n\n1\n5\n1 2 3 4 5\n// yes\n\n1\n4\n1 1 1 1\n\n */\n"}], "src_uid": "c35d309dd6a9569ec298e7128aa3fc0e"} {"source_code": "\n", "positive_code": [{"source_code": " 0))\n {\n $c--;\n array_push($d, $x - $e - $c + 1);\n }\n elseif(($a[$x] == \"(\") && ($b == 0))\n {\n $c = 1;\n $b = 1;\n $e = $x;\n }\n elseif(($a[$x] == \"(\") && ($b == 1))\n {\n $c++;\n }\n elseif(($a[$x] == \")\") && ($b == 1))\n {\n $c--;\n if($c == -1)\n {\n array_push($d, $x - $e);\n $b = 0;\n }\n }\n}\nif((strlen($a) == 1) || (count($d) == 0))\n{\n print \"0\";\n}\nelse\n{\n print array_sum($d);\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "2ce2d0c4ac5e630bafad2127a1b589dd"} {"source_code": ""}, {"source_code": ""}, {"source_code": "#!/usr/bin/env php\n $half) ? ($i - $half - 1) : 0);\n\t$string .= str_repeat(($i == $half) ? $x : $y, 1) . strrev($string);\n\treturn $string;\n}\n$count = trim(fgets(STDIN));\n\n$line = trim(fgets(STDIN));\n$x = $line[0];\n$y = $line[1];\nif ($x === $y) {\n\tdie('NO');\n}\nif ($line !== createLine($x, $y, $count, 0)) {\n\tdie('NO');\n}\nfor ($i = 1, $il = $count; $i < $il; $i++) {\n\t$line = trim(fgets(STDIN));\n\tif ($line !== createLine($x, $y, $count, $i)) {\n\t\tdie('NO');\n\t}\n}\n\ndie('YES');\n"}, {"source_code": "= $pol)\n\t\t\t$num = $n - 1 - $i;\n\t\telse \n\t\t\t$num = $i;\n\t\tif($j == $num && ($str[$j] != $d || $str[$n -1 - $j] != $d) )\n\t\t\t$res = 0;\n\t\tif($j != $num && ($str[$j] != $p || $str[$n -1 - $j] != $p))\n\t\t\t$res = 0;\n\t}\n\t\n}\nif($res)\n\techo \"YES\";\nelse\n\techo \"NO\";\n?>"}], "negative_code": [{"source_code": " 2))\n {\n $b = 1;\n }\n if($e[$x - 1] != $e[$a - $x])\n {\n $c = 1;\n }\n}\nif(($b == 1) || ($c == 1))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>"}, {"source_code": ""}, {"source_code": " $half) ? ($i - $half - 1) : 0);\n\t$string .= str_repeat(($i == $half) ? $x : $y, 1) . strrev($string);\n\treturn $string;\n}\n$count = trim(fgets(STDIN));\n\n$line = trim(fgets(STDIN));\n$x = $line[0];\n$y = $line[1];\nif ($line !== createLine($x, $y, $count, 0)) {\n\tdie('NO');\n}\nfor ($i = 1, $il = $count; $i < $il; $i++) {\n\t$line = trim(fgets(STDIN));\n\tif ($line !== createLine($x, $y, $count, $i)) {\n\t\tdie('NO');\n\t}\n}\n\ndie('YES');\n"}, {"source_code": "= 1){\n echo $k.\"\\n\";\n break;\n } elseif (!in_array($a[1] + $k, $b) && ($a[1] + $k) <= $a[0]){\n echo $k.\"\\n\";\n break;\n } else {\n continue;\n }\n }\n \n}\n", "positive_code": [{"source_code": "=1;$j--)\n {\n if($map[$j]==0){$l=$j;break;}\n\n }\n if($r>-1 && $l>-1)\n {\n if(($r-$s)<=($s-$l))echo ($r-$s).\"\\n\";\n else echo ($s-$l).\"\\n\";\n }else if($r>-1)\n {\n echo ($r-$s).\"\\n\";\n }else if($l>-1)\n {\n echo ($s-$l).\"\\n\";\n }else\n {\n echo \"0\".\"\\n\";\n }\n}\n\n\n?>"}, {"source_code": " 0))\n {\n break;\n }\n elseif($h > 0)\n {\n $h--;\n }\n if(($f[$i] != 1) && ($i <= $b))\n {\n break;\n }\n elseif($i <= $b)\n {\n $i++;\n }\n }\n print $g . \"\\n\";\n }\n}\n?>"}], "negative_code": [], "src_uid": "faae9c0868b92b2355947c9adcaefb43"} {"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\n$n = $ir->readInt();\n$s = $ir->readString();\n\n$a = [\n\t'RGB' => ['R', 'G', 'B', 0],\n\t'GBR' => ['G', 'B', 'R', 0],\n\t'BRG' => ['B', 'R', 'G', 0],\n\t\n\t'RBG' => ['R', 'B', 'G', 0],\n\t'BGR' => ['B', 'G', 'R', 0],\n\t'GRB' => ['G', 'R', 'B', 0],\n];\n\nfor ($i = 0; $i<$n; $i++) {\n\t$j = $i%3;\n\tforeach ($a as &$aa) {\n\t\tif ($aa[$j] != $s[$i]) {\n\t\t\t$aa[3] += 1;\n\t\t}\n\t}\n\tunset($aa);\n}\n\n$min = $a['RGB'][3];\n$seq = 'RGB';\nforeach ($a as $k=>$aa) {\n\tif ($aa[3] < $min) {\n\t\t$min = $aa[3];\n\t\t$seq = $k;\n\t}\n}\n\n$s = str_repeat($seq, intval($n/3)+1);\n$s = substr($s, 0, $n);\necho $min.\"\\n\";\necho $s;\n", "positive_code": [{"source_code": " RGB, 1 => RBG, 2 => BRG, 3 => BGR, 4 => GRB, 5 => GBR);\n$d = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0);\nfor($x = 0; $x < $a; $x += 3)\n{\n if(($b[$x] == \"R\") && ($b[$x] == TRUE))\n {\n $d[2]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n if(($b[$x + 1] == \"G\") && ($b[$x + 1] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[4]++;\n $d[5]++;\n if(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n elseif(($b[$x + 1] == \"B\") && ($b[$x + 1] == TRUE))\n {\n $d[0]++;\n $d[2]++;\n $d[3]++;\n $d[4]++;\n if(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n elseif(($b[$x + 1] == \"R\") && ($b[$x + 1] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[3]++;\n $d[5]++;\n if(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n }\n elseif(($b[$x] == \"G\") && ($b[$x] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[3]++;\n if(($b[$x + 1] == \"G\") && ($b[$x + 1] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[4]++;\n $d[5]++;\n if(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n elseif(($b[$x + 1] == \"B\") && ($b[$x + 1] == TRUE))\n {\n $d[0]++;\n $d[2]++;\n $d[3]++;\n $d[4]++;\n if(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n elseif(($b[$x + 1] == \"R\") && ($b[$x + 1] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[3]++;\n $d[5]++;\n if(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n }\n elseif(($b[$x] == \"B\") && ($b[$x] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[4]++;\n $d[5]++;\n if(($b[$x + 1] == \"G\") && ($b[$x + 1] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[4]++;\n $d[5]++;\n if(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n elseif(($b[$x + 1] == \"B\") && ($b[$x + 1] == TRUE))\n {\n $d[0]++;\n $d[2]++;\n $d[3]++;\n $d[4]++;\n if(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n elseif(($b[$x + 1] == \"R\") && ($b[$x + 1] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[3]++;\n $d[5]++;\n if(($b[$x + 2] == \"G\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[3]++;\n $d[4]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"B\") && ($b[$x + 2] == TRUE))\n {\n $d[1]++;\n $d[2]++;\n $d[3]++;\n $d[5]++;\n }\n elseif(($b[$x + 2] == \"R\") && ($b[$x + 2] == TRUE))\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n $d[4]++;\n }\n }\n }\n}\n$f = min($d);\nfor($x = 0; $x < 6; $x++)\n{\n if($d[$x] == $f)\n {\n break;\n }\n}\n$i = $c[$x];\n$g = $a % 3;\n$h = floor($a / 3);\n$j = \"\";\nfor($x = 0; $x < $h; $x++)\n{\n $j .= $i;\n}\nif($g == 1)\n{\n $j .= $i[0];\n}\nelseif($g == 2)\n{\n $j .= $i[0];\n $j .= $i[1];\n}\nprint $f . \"\\n\";\nprint $j;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readString() {$d = trim(fgets($this->_fh));return $d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\n$n = $ir->readInt();\n$s = $ir->readString();\n\n$a = [\n\t'RGB' => ['R', 'G', 'B', 0],\n\t'GBR' => ['G', 'B', 'R', 0],\n\t'BRG' => ['B', 'R', 'G', 0],\n\t\n\t'RBG' => ['R', 'B', 'G', 0],\n\t'BGR' => ['B', 'G', 'R', 0],\n\t'GRB' => ['G', 'R', 'B', 0],\n];\n\nfor ($i = 0; $i<$n; $i++) {\n\t$j = $i%3;\n\tforeach ($a as &$aa) {\n\t\tif ($aa[$j] != $s[$i]) {\n\t\t\t$aa[3] += 1;\n\t\t}\n\t}\n}\n\n$min = 1e6;\n$seq = '';\nforeach ($a as $k=>$aa) {\n\tif ($aa[3] < $min) {\n\t\t$min = $aa[3];\n\t\t$seq = $k;\n\t}\n}\n\n$s = str_repeat($seq, intval($n/3)+1);\n$s = substr($s, 0, $n);\necho $min.\"\\n\";\necho $s;\n"}], "src_uid": "e67b79e39511b0107a51edc0179afb82"} {"source_code": "= 2 ? $max1 : 1;\n$max3 = $k >= 3 ? $max1 : 1;\n$max4 = $k >= 4 ? $max1 : 1;\n\n$sum = 0;\n\nfor ($rng1 = 0; $rng1 < $max1; $rng1++) {\n $np1 = $p;\n array_splice($np1, $ranges[$rng1][0], $ranges[$rng1][1], array_reverse(array_slice($np1, $ranges[$rng1][0], $ranges[$rng1][1])));\n for ($rng2 = 0; $rng2 < $max2; $rng2++) {\n $np2 = $np1;\n array_splice($np2, $ranges[$rng2][0], $ranges[$rng2][1], array_reverse(array_slice($np2, $ranges[$rng2][0], $ranges[$rng2][1])));\n for ($rng3 = 0; $rng3 < $max3; $rng3++) {\n $np3 = $np2;\n array_splice($np3, $ranges[$rng3][0], $ranges[$rng3][1], array_reverse(array_slice($np3, $ranges[$rng3][0], $ranges[$rng3][1])));\n for ($rng4 = 0; $rng4 < $max4; $rng4++) {\n $np4 = $np3;\n array_splice($np4, $ranges[$rng4][0], $ranges[$rng4][1], array_reverse(array_slice($np4, $ranges[$rng4][0], $ranges[$rng4][1])));\n for ($i = 0; $i < $n; $i++) {\n for ($j = $i + 1; $j < $n; $j++) {\n if ($np4[$j] < $np4[$i]) {\n $sum++;\n }\n }\n }\n }\n }\n }\n}\n\nprintf(\"%.10f\", $sum / pow($max1, $k));\n", "positive_code": [{"source_code": "= 2 ? $max1 : 1;\n$max3 = $k >= 3 ? $max1 : 1;\n$max4 = $k >= 4 ? $max1 : 1;\n\n$sum = 0;\n\nfor ($rng1 = 0; $rng1 < $max1; $rng1++) {\n $np1 = substr_replace($p, strrev(substr($p, $ranges[$rng1][0], $ranges[$rng1][1])), $ranges[$rng1][0], $ranges[$rng1][1]);\n for ($rng2 = 0; $rng2 < $max2; $rng2++) {\n $np2 = substr_replace($np1, strrev(substr($np1, $ranges[$rng2][0], $ranges[$rng2][1])), $ranges[$rng2][0], $ranges[$rng2][1]);\n for ($rng3 = 0; $rng3 < $max3; $rng3++) {\n $np3 = substr_replace($np2, strrev(substr($np2, $ranges[$rng3][0], $ranges[$rng3][1])), $ranges[$rng3][0], $ranges[$rng3][1]);\n for ($rng4 = 0; $rng4 < $max4; $rng4++) {\n $np4 = substr_replace($np3, strrev(substr($np3, $ranges[$rng4][0], $ranges[$rng4][1])), $ranges[$rng4][0], $ranges[$rng4][1]);\n for ($i = 0; $i < $n; $i++) {\n for ($j = $i + 1; $j < $n; $j++) {\n if ($np4[$j] < $np4[$i]) {\n $sum++;\n }\n }\n }\n }\n }\n }\n}\n\nprintf(\"%.10f\", $sum / pow($max1, $k));\n"}], "negative_code": [], "src_uid": "0496f5b6c7c159e4448f5b04c45a411b"} {"source_code": " $x) {\r\n $m = 0;\r\n for ($j = 0; $j < $n; $j++) { $m += $a[$j]; $r[$j] = $m; }\r\n \r\n $c = array_search($x, $r);\r\n if ($c === false) { \r\n $f = 1; \r\n } else {\r\n $d = $n + 1;\r\n while ($d--) {\r\n $m = $a[$n - 1];\r\n unset($a[$n - 1]);\r\n array_unshift($a, $m);\r\n \r\n $r = array();\r\n $m = 0;\r\n \r\n for ($j = 0; $j < $n; $j++) { $m += $a[$j]; $r[$j] = $m; }\r\n \r\n $c = array_search($x, $r);\r\n if ($c === false) { $f = 1; break; }\r\n $g++;\r\n }\r\n }\r\n \r\n if ($f == 1) { \r\n echo 'YES'.PHP_EOL; \r\n for ($j = 0; $j < $n; $j++) { echo $a[$j].' '; }\r\n echo PHP_EOL;\r\n } else { echo 'NO'.PHP_EOL; }\r\n}\r\n \r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": "0,2=>0,3=>0,4=>0);\nforeach ($groups as $key => $value) {\n\t$ready_groups[$value]++;\n}\nif ($ready_groups[2] % 2 == 0) {\n\t$result = $ready_groups[2]/2;\n\t$ready_groups[2]=0;\n} else {\n\t$ready_groups[2] -= 1;\n\t$result = $ready_groups[2]/2;\n\t$ready_groups[2] = 1;\n}\nif ($ready_groups[1] > $ready_groups[3]) {\n\t$result += $ready_groups[3];\n\t$ready_groups[1] -= $ready_groups[3];\n\t$ready_groups[3] = 0;\n} else {\n\t$result += $ready_groups[1];\n\t$ready_groups[3] -= $ready_groups[1];\n\t$ready_groups[1] = 0;\n}\nif ($ready_groups[1] > 0 && $ready_groups[2] > 0) {\n\t$result += 1;\n\t$ready_groups[1] -= 2;\n\t$ready_groups[2] = 0;\n}\nif ($ready_groups[1] > 0) {\n\tif ($ready_groups[1]/4 >= 1) {\n\t\t$result += round($ready_groups[1]/4);\n\t\t$ready_groups[1] -= round($ready_groups[1]/4) * 4;\n\t}\n\tif ($ready_groups[1] > 0) {\n\t\t$ready_groups[1] = 0;\n\t\t$result++;\n\t}\n}\n$result += $ready_groups[4];\n$result += $ready_groups[3];\n$result += $ready_groups[2];\nif ($count > 0) $result++;\nfprintf(STDOUT, $result);", "positive_code": [{"source_code": " 0 && $k[0] > 0)\n\t{\n\t\t$ans++;\n\t\t$k[1] = 0;\n\t\t($k[0] > 1 ? $k[0] -= 2: $k[0] = 0);\n\t}\n\n\t$ans += $k[2];\n\t$ans += intdiv($k[1], 2) + ($k[1] % 2 ? 1 : 0);\n\t$ans += intdiv($k[0], 4) + ($k[0] % 4 ? 1 : 0);\n\n\tfwrite(STDOUT, $ans.\"\\n\");\n?>\n"}, {"source_code": "0){\n $count[3]--;\n if($count[1]>0) $count[1]--;\n $res++;\n}\nwhile($count[2]>1){\n $count[2]-=2;\n $res++;\n}\nwhile($count[1]>0){\n if($count[2]>0){\n $count[2]--;\n $count[1]-=2;\n }\n else \n $count[1]-=4;\n $res++;\n}\nif ($count[2]>0) $res++;\n\nprint($res+$count[4]);"}, {"source_code": "0) {$c=$c+floor($m[1]/4);$m[1]=$m[1]%4;}\nif ($m[1]>0) {$c++;}\n\n\n//echo $m[1].' '.$m[2].' '.$m[3].' '.$m[4];\necho $c;\n?>"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = (int)(fgets($fp));\n$group = explode(\" \", str_replace( \"\\n\", '', fgets($fp) ) );\n\nsort($group);\n\n$start = 0;\n$end = $count - 1;\n\nwhile( true )\n{\n\tif( $end == $start ){\n\t\tbreak;\n\t}\n\tif( $group[ $end ] + $group[ $start ] > 4 )\n\t{\n\t\t$end --;\n\t} else {\n\t\t$count --;\n\t\t$group[ $end ] += $group[ $start ];\n\t\t$start ++;\n\t}\n}\necho $count;\n\nfclose($fp);\n?>"}, {"source_code": " $m [ 3 ] ) \n $m [ 1 ] -= $m [ 3 ];\n else \n $m [ 1 ] = 0;\n \n $total += floor ( $m [ 2 ] / 2 );\n \n $m [ 2 ] %= 2;\n \n $total += floor ( ( $m [ 2 ] * 2 + $m [ 1 ] + 3 ) / 4 );\n \n echo $total;\n?>"}, {"source_code": " 0){$line = str_replace($del,'',$line);$dataex[] = $line;$text = explode(\" \",$line);\nforeach($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;}\nfunction G(){$ret = $this->arr_txt[$this->ntxt++];$this->nline = $this->linex[$this->ntxt];return $ret;}\nfunction GL(){$this->ntxt = $this->liney[$this->nline]+1;return $this->arr_line[$this->nline++];}} /*init*/ $dxs = new stdIn(false);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$n = $dxs->G();$taxis=0;\nfor($i=0;$i<$n;$i++){\n $grupo[$i]= $dxs->G();\n}\nrsort($grupo);\n\nforeach($grupo as $k => $grup){\n if($grup == 4){\n\t$taxis++;\n }else{\n\t$grupito[$grup]++;\n }\n}\n//echo $taxis;\n//print_r($grupo);print_r($grupito);\n$taxis += $grupito[3];\nif($grupito[3]>=$grupito[1]){\n $grupito[3]=0;$grupito[1]=0;\n}else{\n $grupito[1] -= $grupito[3];\n}\n//print_r($grupito);echo $taxis;\n$ndos = (int)($grupito[2]/2);\n$taxis += $ndos;\n//echo $taxis.\":\".$ndos;\n$grupito[2] -= $ndos*2;\nif($grupito[2]>0){$taxis++;$grupito[2]-=1;$grupito[1]-=2;}\nif($grupito[1]>0){\n $nuno = (int)(ceil($grupito[1]/4));\n $taxis += $nuno;\n //echo \"->\".$uno;\n}\n//print_r($grupito);\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\necho $taxis;\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": "0)\n{\n\t$count[4] = $count[4] - 1;\n\t$taxi = $taxi + 1;\n}\nwhile($count[3]>0)\n{\n\t$count[3] = $count[3] - 1;\n\tif($count[1]>0)\n\t{\n\t\t$count[1] = $count[1] - 1;\n\t}\n\t$taxi = $taxi + 1;\n}\nwhile($count[2]>1)\n{\n\t$count[2] = $count[2] - 2;\n\t$taxi = $taxi + 1;\n}\nwhile($count[1]>0)\n{\n\tif($count[2]>0){\n\t\t$count[2] = $count[2] - 1;\n\t\t$count[1] = $count[1] - 2;\n\t}\n\telse\n\t{\n\t\t$count[1] = $count[1] - 4;\n\t}\n\t$taxi = $taxi + 1;\n}\nif($count[2]>0)\n\t$taxi = $taxi + 1;\necho $taxi;\n?>"}, {"source_code": " 0, 0, 0, 0);\n\n$groups = explode(' ', getLine());\nforeach ($groups as $c) {\n $ccnt[$c]++;\n}\n\n$ccnt[1] -= $ccnt[3];\nif ($ccnt[1]<0) $ccnt[1] = 0;\n\n$tcnt = $ccnt[4] + $ccnt[3] + floor($ccnt[2]/2);\n\n$ccnt[2] %= 2;\n$ccnt[1] = $ccnt[1]-2*$ccnt[2];\nif ($ccnt[1]<0) $ccnt[1] = 0;\n\n$tcnt += $ccnt[2] + ceil($ccnt[1]/4);\n\necho $tcnt . PHP_EOL;\n\nfunction getLine()\n{\n return str_replace(array(\"\\n\", \"\\r\"), array(\"\", \"\"), fgets(STDIN));\n}"}, {"source_code": "0 && $_1>0){\n $min=$_3>$_1?$_1:$_3;\n $_3-=$min;\n $_1-=$min;\n $out+=$min;\n }\n if($_2>1){\n $out+=floor($_2/2);\n $_2=$_2%2;\n }\n if($_2==1 && $_1>=2){\n $_1-=2;\n $_2=0;\n $out++;\n }\n if($_1>=4){\n $out+=floor($_1/4);\n $_1=$_1%4;\n }\n if($_3>0){\n $out+=$_3;\n $_3=0;\n }\n if($_2==1 && $_1==1){\n $out+=1;\n $_2=0;\n $_1=0;\n }\n if($_2>0){\n $out++;\n $_2=0;\n }\n if($_1>0){\n $out+=1;\n $_1=0;\n }\n\n\necho $out;\n\n?>"}, {"source_code": " 0 ? $holder[1] - $holder[3] : 0)) / 4 + $holder[2] / 2 );\n\necho $races;"}, {"source_code": " 0){\n\t$need_2 = 1;\n}else{\n\t$need_2 = 0;\n}\n\nif($n1 > $n3){\n\t$allow_1 = $n1-$n3;\n}else{\n\t$allow_1 = 0;\n}\nif($allow_1 % 4 > 2 && $need_2 > 0){\n\t$ajuste = 1;\n}else{\n\t$ajuste = 0;\n}\n\n$res = $n4 + $n3 + intval($n2/2) + $need_2 + intval($allow_1/4) + ($allow_1 % 4 > 0? 1 - $need_2 : 0) + $ajuste;\necho $res;\n?>\n"}, {"source_code": ""}, {"source_code": " $ordered[1]) { \n # all 1s go with a 3, the rest of the 3s are on their own\n $numCars += $ordered[3]; \n $ordered[1] = 0;\n $ordered[3] = 0;\n $numCars += ceil($ordered[2] / 2);\n $ordered[2] = 0;\n}\nelse if ($ordered[1] > $ordered[3]){ \n # getting rid of all 3s\n $numCars += $ordered[3];\n $ordered[1] -= $ordered[3];\n $numCars += floor($ordered[2] / 2);\n \n if ($ordered[2] % 2) { \n # there is 1 group that can't be paired\n if ($ordered[1] <= 2){\n $ordered[1] = 0;\n }\n else {\n $ordered[1] -= 2;\n }\n $ordered[2] = 0;\n $numCars++;\n }\n \n $numCars += ceil($ordered[1] / 4);\n}\nelse { \n # 3s and 1s cancel each other out\n $numCars += $ordered[3];\n $ordered[1] = 0;\n $ordered[3] = 0;\n $numCars += ceil($ordered[2] / 2);\n $ordered[2] = 0;\n}\n\necho $numCars;\n\n?>"}, {"source_code": "0) $count++;\n\n echo $count;\n?>"}, {"source_code": " intval($lines[0]),\n 'counts' => $lines[1],\n );\n\n $i = 0;\n $c = array(\n 0 => 0,\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n );\n foreach($input['counts'] as $count) {\n $c[intval($count)]++;\n }\n $i += $c[4];\n\n $i += $c[3];\n $c[1] = ($c[3] > $c[1]) ? 0 : $c[1] - $c[3];\n\n $i += ceil((($c[2] * 2) + $c[1]) / 4);\n\n\n file_put_contents('php://stdout', $i);\n\n\n\n?>"}, {"source_code": "= $c3) {\n $c1 -= $c3;\n} else {\n $c1 = 0;\n}\n\nif (($c2 % 2) == 0) {\n $out += $c2/2;\n} else {\n $out += intval($c2/2);\n $c1 += 2;\n}\n\n$out += ceil($c1/4);\n\necho $out;\n\n?>"}, {"source_code": "calc($one, $two, $three, 0) + $four;\n }\n\n if ($one && $three) {\n $min = min($one, $three);\n return $this->calc($one - $min, $two, $three - $min, 0) + $min;\n }\n\n if ($three) {\n return $this->calc(0, $two, 0, 0) + $three;\n }\n\n if ($two) {\n return $this->calc($one + 2 * ($two % 2), 0, 0, 0) + intval($two / 2);\n }\n\n return intval($one / 4) + ($one % 4 != 0);\n }\n\n public function solve()\n {\n fscanf(STDIN, '%d', $n);\n $count = array_count_values(explode(' ', trim(fgets(STDIN)))) + ['1' => 0, '2' => 0, '3' => 0, '4' => 0];\n echo $this->calc($count['1'], $count['2'], $count['3'], $count['4']) . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->solve();\n\n"}, {"source_code": " 0 ? $diff : 0)) / 4 + $counts[2] / 2);\t\n\t\n\treturn $sum;\n}\n\nfunction get_counts($groups){\n\t\n\t$counts = array(0,0,0,0,0);\n\tforeach ($groups as $g) $counts[$g]++;\n\n\treturn $counts;\n}\n\n$groups = read();\n$counts = get_counts($groups);\n$sum = get_sum($counts);\n\necho $sum;\n"}, {"source_code": "0) $res+=1;\necho $res;\n?>"}, {"source_code": "$gr[1]) {\n$gr[1]=0;\n} else {\n$gr[1]-=$gr[3];\n}\n$taxis+=floor($gr[2]/2);\n$gr[2]=$gr[2]%2;\nif ($gr[2]==1 && $gr[1]>0) {\n$taxis+=$gr[2];\n$gr[1]-=2;\n} else if ($gr[2]==1) $taxis+=1;\nif ($gr[1]>0) {\n$taxis+=floor($gr[1]/4);\nif($gr[1]%4>0) $taxis+=1;\n}\necho $taxis;\n?>"}, {"source_code": "=$tmp[0]){\n $count=$count+$tmp[2];\n $tmp[0]=0;\n } else {\n $count=$count+$tmp[2];\n $tmp[0]=$tmp[0]- $tmp[2];\n } \n \n\n $count=$count+(int)($tmp[1]/2);\n\n $tmp[1]=$tmp[1]-2*(int)($tmp[1]/2);\n \n if ($tmp[1]==1 and $tmp[0]<=2){\n $count=$count+1; $tmp[0]=0;\n } else if ($tmp[1]==1 and $tmp[0]>2){ \n $count=$count+1; $tmp[0]=$tmp[0]-2;\n } \n \n $count=$count+ceil($tmp[0]/4); \n print($count);\n \n?>"}, {"source_code": " 0 ? $counts[1] - $counts[3] : 0)) / 4 + $counts[2] / 2);\n\treturn $sum;\n}\n\nfunction get_counts($groups){\n\t\n\t$counts = array(0,0,0,0,0);\n\tforeach ($groups as $g) $counts[$g]++;\n\n\treturn $counts;\n}\n\n$groups = read();\n$counts = get_counts($groups);\n$sum = get_sum($counts);\n\necho $sum;\n"}, {"source_code": " 0){ \n $taxi += $group[1] / 4; \n}\n\necho ceil($taxi);\n\n?>"}, {"source_code": "\nfgets(STDIN); $a=explode(' ',trim(fgets(STDIN))); \n$va=array_count_values($a);\n$out=$va[4];\nif($va[2]>=2) {$out+=floor($va[2]/2); $va[2]%=2;}\nif($va[3]>=$va[1]) {$out+=$va[1]; $va[3]-=$va[1]; $va[1]=0;}\nelse {$out+=$va[3]; $va[1]-=$va[3]; $va[3]=0;}\n$out+=$va[3];\nif($va[2] && $va[1]) {$out++; $va[1]-=2; $va[2]=0;}\n$out+=$va[2];\nif($va[1]>0) {$out+=ceil($va[1]/4);}\nprint($out);\n?>\n"}, {"source_code": " $one_first) {\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\t\tif ($one_first == 0 && $three_first == 0) $one_and_three = 0;\n\t\t$answer = $four + $two + $one_and_three;\n\t\techo $answer;\n\t} else {\n\t\t$two = floor($two_first / 2);\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (($one_first % 2) != 0) $two = 0;\n\t\t\tif ($one_first == 1) $two = 1;\n\t\t\tif ($one_first <= 2 && $three_first < 1) {\n\t\t\t\t$answer = $four + $two;\n\t\t\t} else {\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\t\t\t}\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\t\tif ($one_first == 0 && $three_first == 0) $one_and_three = 0;\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (($one_first % 2) != 0) $two = 0;\n\t\t\tif ($one_first == 1) $two = 1;\n\t\t\tif ($one_first <= 2 && $three_first < 1) {\n\t\t\t\t$answer = $four + $two;\n\t\t\t} else {\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\t\t\t}\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " 0)\n\t{\n\t\t$freq[$num]--;\n\t\n\t\t$sum = $maxInCar - $num;\n\t\t$ended = true;\t\t\n\t\t\n\t\tforeach($freq as $n => $count)\n\t\t{\n\t\t\tfor($i = 0; $i < $count; $i++)\n\t\t\t{\n\t\t\t\tif($sum >= $n)\n\t\t\t\t{\n\t\t\t\t\t$sum -= $n;\n\t\t\t\t\t$freq[$n]--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$cars++;\n\t}\n}\n\necho $cars;"}, {"source_code": ""}, {"source_code": " $c3)\n {\n print $c4 + $c3 + ceil(($c1 - $c3 + 2) / 4);\n }\n elseif($c1 < $c3)\n {\n print $c4 + $c1 + 1 + ($c3 - $c1);\n }\n elseif($c1 == $c3)\n {\n print $c4 + $c1 + 1;\n }\n}\nelseif($c2 % 2 == 0)\n{\n if($c1 > $c3)\n {\n print $c4 + $c3 + ($c2 / 2) + ceil(($c1 - $c3) / 4);\n }\n elseif($c1 < $c3)\n {\n print $c4 + $c1 + ($c2 / 2) + ($c3 - $c1);\n }\n elseif($c1 == $c3)\n {\n print $c4 + $c1 + ($c2 / 2);\n }\n}\nelseif($c2 % 2 != 0)\n{\n if($c1 > $c3)\n {\n print $c4 + $c3 + floor($c2 / 2) + 1 + ceil(($c1 - $c3 - 2) / 4);\n }\n elseif($c1 < $c3)\n {\n print $c4 + $c1 + floor($c2 / 2) + 1 + ($c3 - $c1);\n }\n elseif($c1 == $c3)\n {\n print $c4 + $c1 + floor($c2 / 2) + 1;\n }\n}\n?>"}, {"source_code": " 0)\n\t{\n\t\t$freq[$num]--;\n\t\n\t\t$sum = $maxInCar - $num;\n\t\t$ended = true;\t\t\n\t\t\n\t\tforeach($freq as $n => $count)\n\t\t{\n\t\t\tif($sum >= $n)\n\t\t\t{\t\t\t\t\n\t\t\t\tfor($i = 0; $i < $count; $i++)\n\t\t\t\t{\n\t\t\t\t\t$sum -= $n;\n\t\t\t\t\t$freq[$n]--;\n\t\t\t\t\t\t\n\t\t\t\t\tif($sum < $n)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$sum)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$cars++;\n\t}\n}\n\necho $cars;"}, {"source_code": "= $c[3])\n{\n $d = min($c[1], $c[3]);\n $e = $c[1] - $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nelseif($c[1] < $c[3])\n{\n $d = $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $h = ceil($g / 4);\n}\nprint $c[4] + $d + $f + $h;\n?>"}, {"source_code": "= $c[3])\n{\n $d = min($c[1], $c[3]);\n $e = $c[1] - $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nelseif($c[1] < $c[3])\n{\n $d = $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nprint $c[4] + $d + $f + $h;\n?>"}, {"source_code": "= $a[1]){\n $a[1] = 0;\n}\nelse if ($a[3] < $a[1]){\n $a[1] -= $a[3];\n}\n\n$sisa = floor($a[2]/2);\n$a[2] %= 2;\nif ($a[2] > 0){\n $sisa += 1;\n if ($a[1] > 1)\n $a[1] -= 2;\n else if ($a[1] == 1)\n $a[1] -= 1;\n}\n\nif ($a[1] > 0){\n $a[1] = ceil($a[1] / 4);\n}\n\n$taxi = $a[1] + $a[3] + $a[4] + $sisa;\necho $taxi;\n?>"}, {"source_code": "= $c[3])\n{\n $d = min($c[1], $c[3]);\n $e = $c[1] - $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nelse\n{\n $d = $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $h = ceil($g / 4);\n}\nprint $c[4] + $d + $f + $h;\n?>"}, {"source_code": " 0 ? ($res[1] - $res[3]) : 0;\nif (($res[2] % 2) == 1) {\n $e1_rem = (($e1_rem - 2) > 0) ? ($e1_rem - 2) : 0;\n $totalcount += 1;\n}\n\nif ($e1_rem > 0)\n $totalcount += floor($e1_rem / 4);\n\nif (($e1_rem % 4) > 0)\n $totalcount += 1;\n\necho $totalcount;\n\n?>"}, {"source_code": " 0, \"two\" => 0, \"three\" => 0, \"four\" => 0);\n\nfor($i = 0; $i < $n; $i++) {\n if($s[$i] == 1)$digits[\"one\"]++;\n if($s[$i] == 2)$digits[\"two\"]++;\n if($s[$i] == 3)$digits[\"three\"]++;\n if($s[$i] == 4)$digits[\"four\"]++;\n}\n\n\n$ones = $digits[\"one\"];\n$twos = $digits[\"two\"];\n$threes = $digits[\"three\"];\n$fours = $digits[\"four\"];\n\n\n\n$taxis = 0;\n\n\nfor($i = 0; $i < $fours; $i++) {\n $digits[\"four\"]--;\n $taxis++;\n}\n\nfor($i = 0; $i < $threes; $i++) {\n if($digits[\"three\"] >= 1) {\n if($digits[\"one\"] >= 1) {\n $digits[\"three\"]--;\n $digits[\"one\"]--;\n $taxis++;\n }\n else {\n $digits[\"three\"]--;\n $taxis++;\n }\n }\n else{break;}\n}\n\n\n\n\n\n$ones = $digits[\"one\"];\n$twos = $digits[\"two\"];\n$threes = $digits[\"three\"];\n$fours = $digits[\"four\"];\n\n\nfor($i = 0; $i < $twos; $i++) {\n if($digits[\"two\"] >= 1) {\n if($digits[\"two\"] >= 2) {\n $digits[\"two\"]--;\n $digits[\"two\"]--;\n $taxis++;\n }\n elseif($digits[\"one\"] >= 1) {\n if($digits[\"one\"] >= 2) {\n $digits[\"one\"]--;\n $digits[\"one\"]--;\n }\n elseif($digits[\"one\"] >= 1) {\n $digits[\"one\"]--;\n }\n $digits[\"two\"]--;\n $taxis++;\n }\n elseif($digits[\"two\"] == 1) {\n $digits[\"two\"]--;\n $taxis++;\n }\n else {}\n }\n else {break;}\n}\n\n\n$ones = $digits[\"one\"];\n$twos = $digits[\"two\"];\n$threes = $digits[\"three\"];\n$fours = $digits[\"four\"];\n\n\n\nfor($i = 0; $i < $ones; $i++) {\n if($digits[\"one\"] >= 4) {\n $digits[\"one\"] -= 4;\n $taxis++;\n }\n elseif($digits[\"one\"] == 3) {\n $digits[\"one\"] -= 3;\n $taxis++;\n }\n elseif($digits[\"one\"] == 2) {\n $digits[\"one\"] -= 2;\n $taxis++;\n }\n elseif($digits[\"one\"] == 1) {\n $digits[\"one\"] -= 1;\n $taxis++;\n }\n else {break;}\n}\n\n\n\n\n\necho $taxis;\n\n\n\n\n\n?>"}, {"source_code": "$people) {\n $people = $group_array[$i];\n $key = $i;\n if ($people == 4) {\n $cars++;\n //unset($group_array[$key]);\n }\n\n if ($people == 3) {\n\n if ($one>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n $one--;\n } else {\n $three++;\n }\n }\n if ($people == 2) {\n if ($two>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n $two--;\n //unset()\n } else {\n $two++;\n }\n }\n if ($people== 1) {\n if ($three>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n $three--;\n } else {\n $one++;\n }\n }\n }\n\n if ($three>0) {\n $cars += $three;\n }\n\n if ($two>0) {\n if ($one>0) {\n $cars++;\n if ($one>2) {\n $count_one = $one-2;\n $cars += ceil($count_one/4);\n $one = 0;\n } else {\n $one = 0;\n }\n } else {\n $cars += $two;\n }\n }\n\n if ($one > 0) {\n $cars += ceil($one/4);\n }\n\n //echo $cars;\n fputs(STDOUT, $cars);\n ?>"}, {"source_code": "$threeCounter){\n $extra = $oneCounter - $threeCounter ; \n $totalOne = $twoCounter*2 + $extra ;\n $counter = $fourCounter + $threeCounter + ceil($totalOne/4);\n\n}else{\n $counter = $fourCounter + $threeCounter + ceil($twoCounter/2);\n}\n\n\nfwrite(STDOUT, $counter.\"\\n\"); \n"}, {"source_code": " $arr[1]) $arr[1] = 0;\n else if ($arr[3] < $arr[1]) $arr[1] = $arr[1] - $arr[3];\n else $arr[1] = 0;\n }\n $car+= $arr[3];\n }\n \n if (isset($arr[2])) {\n $car+= floor($arr[2] / 2);\n $arr[2] = $arr[2] % 2;\n \n if ($arr[2]) {\n $car+= 1;\n if (isset($arr[2])) $arr[1]-= 2;\n }\n }\n \n if (isset($arr[1]) && $arr[1] > 0) {\n $car+= ceil($arr[1] / 4);\n }\n \n echo $car;\n?>"}, {"source_code": " 0){ \n\n $taxi += $x[1] / 4; \n\n}\n\necho ceil($taxi);\n\n?>"}, {"source_code": " 0 ? 1 : 0;\n\nprintf(\"%d\", $n);\n?>"}, {"source_code": " 0) {\n $answer += ceil($groups[1] / 4);\n}\n\necho $answer . PHP_EOL;\n\n"}, {"source_code": "0){\n\t\t\t$taxi1--;\n\t\t\t$flag = 1;\t\n\t\t}\n\t\t\n\t}\n\tif($taxi1>0){\n\t\tif($flag==1) $taxi1--;\n\t\t$taxi += floor($taxi1/4) ;\n\t\tif($taxi1%4!=0){\n\t\t\t$taxi++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $taxi);\n?>"}, {"source_code": "$r) if ($r==='') unset($rating[$key]);\n$n = isset($fl[0]) ? $fl[0] : 0;\n\n$c1 = $c2 = $c3 = $c4 = 0;\nfor ($i = 0,$cnt = count($groups); $i < $cnt; $i++){\n switch ($groups[$i]){\n case 1: $c1++; break;\n case 2: $c2++; break;\n case 3: $c3++; break;\n case 4: $c4++; break;\n }\n}\n$count += $c4;\nif ($c3 >= $c1){\n $count += $c3;\n $c1 = 0;\n}else{\n $count += $c1 - ($c1 - $c3);\n $c1 = $c1-$c3;\n}\n\nif ($c2 % 2 == 1 && $c1 >= 2){\n $c1 -= 2;\n $c2 += 1;\n}\n\n$count += ($c2>>1);\n\nif ($c2 % 2 > 0){\n $count++;\n if ($c1 == 1) $c1 = 0;\n}\nif ($c1 % 4 == 0){\n $count += $c1/4;\n}else{\n $count += 1 + (int)($c1/4);\n}\n\necho $count;"}, {"source_code": ""}, {"source_code": " 0 && $fancyCar < 4) {\n\t$fancyCar += 1;\n\t$groupOfOne -= 1;\n}\n\nif($fancyCar > 0) {\n\t$taxi += 1;\n}\n\n// all 1\n$taxi += ceil($groupOfOne / 4);\n\nprintf($taxi);"}, {"source_code": "=$ret[0]){\n $ans+=$ret[2];\n $ret[0]=0;\n }\n else{\n $ans+=$ret[2];\n $ret[0]-=$ret[2];\n }\n// fprintf(STDOUT,\"%d\\n\",$ans);\n $ans+=floor($ret[1]/2);//\u4e24\u4eba\u7ec4\n $ret[1]%=2;\n// fprintf(STDOUT,\"%d\\n\",$ans);\n //\u5269\u4f59\u4e24\u4eba\u7ec4\u548c\u5269\u4f59\u4e00\u4eba\u7ec4\n if($ret[1]>0){\n $ans++;\n if($ret[0]>0){\n $ret[0]-=2;\n }\n }\n// fprintf(STDOUT,\"%d\\n\",$ans);\n //\u5269\u4f59\u4e00\u4eba\u7ec4\n if($ret[0]>0){\n $ans+=floor(($ret[0]-1)/4);\n $ans++;\n }\n\n fprintf(STDOUT,\"%d\\n\",$ans);\n}"}, {"source_code": " 0 && $fancyCar < 4) {\n\t\t$fancyCar += 1;\n\t\t$groupCount[1] -= 1;\n\t}\n}\n\nif($fancyCar > 0) {\n\t$taxi += 1;\n}\n\n// all 1\nif (isset($groupCount[1])) {\n\t$taxi += ceil($groupCount[1] / 4);\n}\n\nprintf($taxi);"}, {"source_code": "= 0) {\n\t\t\t$t1 += (2 * $t2);\n\t\t\tif ($t1 % 4 == 0) {\n\t\t\t\t$ta += ($t1 /= 4);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$t1 /= 4; \n\t\t\t\t$t1++;\n\t\t\t\t$ta += $t1;\n\t\t\t}\n\t\t}\n\t\techo floor($ta);\n?>"}, {"source_code": "= $poz; --$i) {\n $sum = $groups[$i];\n while( $poz < $i ) {\n if ( $sum + $groups[$poz] <= 4 ) {\n $sum += $groups[$poz++]; \n }\n else break;\n }\n $taxiCount++; \n}\n\necho $taxiCount;\n"}, {"source_code": "= $count1) {\n $count1 = 0;\n } else {\n $count1 = $count1 - $count3;\n }\n\n $temp = $left + $count1;\n\n while($temp > 0) {\n $total++;\n $temp = $temp - 4;\n }\necho (int) $total.\"\\n\";"}, {"source_code": "\n$n=trim(fgets(STDIN));\n$g=explode(\" \",trim(fgets(STDIN)));\nforeach($g as $v)$m[$v]++;\nif($m[1]<$m[3])$x=$m[4]+ceil($m[2]/2)+($m[3]-$m[1])+$m[1];\nelse $x=$m[4]+$m[3]+ceil((($m[2]*2)+($m[1]-$m[3]))/4);\necho $x;\n?>"}, {"source_code": " 0) {\n $answer += ceil($groups[1] / 4);\n}\n\necho $answer . PHP_EOL;"}, {"source_code": " 0){\n\t$taxi += $group[1] / 4;\n}\n\necho ceil($taxi);\n"}, {"source_code": " 100000 || $iGroupsCount < 1) {\n\tdie;\n}\n\n$sGroups = fgets(STDIN);\n$aGroups = explode(' ', $sGroups);\n\nforeach ($aGroups as & $iGroup) {\n\t$iGroup = (int) $iGroup;\n}\n\nunset($iGroup);\n\nif (count($aGroups) != $iGroupsCount) {\n\tdie;\n}\n\n$aGrouped = array_count_values($aGroups);\n\nif (key_exists(0, $aGrouped)) {\n\tdie;\n}\n\nfor ($i = 1; $i <= 4; $i ++) {\n\tif (!key_exists($i, $aGrouped)) {\n\t\t$aGrouped[$i] = 0;\n\t}\n}\n\n$iTaxies = $aGrouped[4] + $aGrouped[3] + ceil($aGrouped[2] / 2);\n\n$iSlots = $aGrouped[1] - $aGrouped[3] - ($aGrouped[2] % 2 == 0 ? 0 : 2);\n\nif ($iSlots > 0) {\n\t$iTaxies += ceil($iSlots / 4);\n}\n\necho $iTaxies;"}, {"source_code": " 0 ? 1 : 0;\n echo $n;"}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n\n$cars=0;\n$people_in_groups=array(1=>0,2=>0,3=>0,4=>0);\n\n$n=trim($lines[0]);\n$groups=explode(\" \", trim($lines[1]));\nforeach ($groups as $count)\n $people_in_groups[$count]++;\n//print_r($people_in_groups);\n\n//\u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0433\u0440\u0443\u043f\u043f\u044b, \u0433\u0434\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 - \u0438 \u043a\u0430\u0436\u0434\u0443\u044e \u0432 \u043c\u0430\u0448\u0438\u043d\u0443;\n$tmp=$people_in_groups[4];\n$cars+=$tmp;\nunset($people_in_groups[4]);\n\n\n//\u0417\u0430\u043f\u0438\u0445\u0438\u0432\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e 3 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438 \u043f\u043e 1 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 - \u0432 1 \u043c\u0430\u0448\u0438\u043d\u0443\n$tmp=min($people_in_groups[3], $people_in_groups[1]);\n$people_in_groups[3]=$people_in_groups[3]-$tmp;\n$people_in_groups[1]=$people_in_groups[1]-$tmp;\n$cars+=$tmp;\n$cars+=$people_in_groups[3];\nunset($people_in_groups[3]);\n\n\n//\u0417\u0430\u043f\u0438\u0445\u0438\u0432\u0430\u0435\u043c \u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0442\u0430\u0447\u043a\u0443 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e 2 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u0415\u0441\u043b\u0438 \u0438\u0445 \u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e - \u0432\u043b\u0435\u0437\u0443\u0442 \u0440\u043e\u0432\u043d\u043e \u0432 \u0442\u0430\u0447\u043a\u0438. \u041d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 - \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c\n\n//\u0413\u0440\u0443\u043f\u043f \u043f\u043e 2 \u0431\u044b\u043b\u043e \u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e. \u0418\u0445 \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0432 \u0442\u0430\u0447\u043a\u0438, \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442\nif ($people_in_groups[2]%2==0)\n{\n $tmp=$people_in_groups[2]/2;\n $cars+=$tmp;\n unset($people_in_groups[2]);\n}\nif ($people_in_groups[2]%2==1)\n{\n $tmp=ceil($people_in_groups[2]/2); //\u0412 \u0442\u0430\u0447\u043a\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c 2 \u043c\u0435\u0441\u0442\u0430 \u043f\u043e\u0434 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e 1 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443\n unset($people_in_groups[2]);\n $cars+=$tmp;\n\n $tmp=min(2, $people_in_groups[1]);\n $people_in_groups[1]=$people_in_groups[1]-$tmp;\n}\n\n$tmp=ceil($people_in_groups[1]/4);\n$cars+=$tmp;\necho $cars;\n?>"}, {"source_code": ""}, {"source_code": " 0) {\n\t\twhile (count($list) > 1) {\n if ($list[0] + $list[count($list)-1] <= 4) {\n $list[0] += $list[count($list)-1];\n unset($list[count($list)-1]);\n $list = array_values($list);\n } else {\n break;\n }\n }\n\t\tunset($list[0]);\n $list = array_values($list);\n\t\t$total++;\n\t}\n\techo $total;\n\t*/"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0,2=>0,3=>0,4=>0);\n++$sCounts[(int)strtok($str,\" \\t\\n\")];\nfor($i=1; $i<$n; ++$i) {\n ++$sCounts[(int)strtok(\" \\t\\n\")];\n}\n\n$taxiCount = 0;\n$taxiCount += $sCounts[4] + $sCounts[3] + (int)($sCounts[2]/2);\nif($sCounts[1] > $sCounts[3]) {\n $sCounts[1] -= $sCounts[3];\n} else {\n $sCounts[1] = 0;\n}\n$sCounts[2] %= 2;\nif($sCounts[2] == 1) {\n ++$taxiCount;\n if($sCounts[1] <= 2) {\n $sCounts[1] = 0;\n } else {\n $sCounts[1] -= 2;\n }\n}\n$taxiCount += (int)($sCounts[1]/4);\nif($sCounts[1]%4 != 0) {\n ++$taxiCount;\n}\nfprintf($output,\"%d\",$taxiCount);\n\n?>"}, {"source_code": " 0,\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n );\n foreach($input['counts'] as $count) {\n $c[intval($count)]++;\n }\n // \u0437\u0430\u0431\u0440\u0430\u043b\u0438 \u0432\u0441\u0435 \u0447\u0435\u0442\u0432\u0435\u0440\u043a\u0438\n $i += $c[4];\n\n // \u0437\u0430\u0431\u0440\u0430\u043b\u0438 \u0432\u0441\u0435 \u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043f\u043e\u0434\u0441\u0430\u0434\u0438\u043b\u0438\n $i += $c[3];\n $c[1] = ($c[3] > $c[1]) ? 0 : $c[1] - $c[3];\n\n $i += ceil((($c[2] * 2) + $c[1]) / 4);\n\n\n dataProvider::set($i);\n\n\n class dataProvider\n {\n public static function get()\n {\n $stdin = file_get_contents('php://stdin');\n $lines = explode(\"\\n\", $stdin, 2);\n $lines[1] = explode(' ', $lines[1]);\n return array(\n 'n' => intval($lines[0]),\n 'counts' => $lines[1],\n );\n }\n\n public static function set($data)\n {\n file_put_contents('php://stdout', $data);\n }\n }\n?>"}, {"source_code": "\nerror_reporting(0);\n\n$fp = fopen(\"php://stdin\",'r');\n$count = (int)(fgets($fp));\n$group = explode(\" \", str_replace( \"\\n\", '', fgets($fp) ) );\n\nsort($group);\n\n$start = 0;\n$end = $count - 1;\n\nwhile( true )\n{\n\tif( $end == $start ){\n\t\tbreak;\n\t}\n\tif( $group[ $end ] + $group[ $start ] > 4 )\n\t{\n\t\t$end --;\n\t} else {\n\t\t$count --;\n\t\t$group[ $end ] += $group[ $start ];\n\t\t$start ++;\n\t}\n}\necho $count;\n\nfclose($fp);\n?>"}, {"source_code": "\", (time() - $t);"}, {"source_code": "=0)\nprint $k[4]+ceil($k[2]/2)+$k[3];\nelse print $k[4]+$k[3]+ ceil(($k[2]-1)/2)+ceil((($k[1]-$k[3])+2*($k[2]%2))/4);\n?>"}, {"source_code": " 0){$line = str_replace($del,'',$line);$dataex[] = $line;$text = explode(\" \",$line);\nforeach($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;}\nfunction G(){$ret = $this->arr_txt[$this->ntxt++];$this->nline = $this->linex[$this->ntxt];return $ret;}\nfunction GL(){$this->ntxt = $this->liney[$this->nline]+1;return $this->arr_line[$this->nline++];}} /*init*/ $dxs = new stdIn(false);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$n = $dxs->G();$taxis=0;\nfor($i=0;$i<$n;$i++){\n $grupo[$i]= $dxs->G();\n}\nrsort($grupo);\n\nforeach($grupo as $k => $grup){\n if($grup == 4){\n\t$taxis++;\n }else{\n\t$grupito[$grup]++;\n }\n}\n//echo $taxis;\n//print_r($grupo);print_r($grupito);\n$taxis += $grupito[3];\nif($grupito[3]>=$grupito[1]){\n $grupito[3]=0;$grupito[1]=0;\n}else{\n $grupito[1] -= $grupito[3];\n}\n//print_r($grupito);echo $taxis;\n$ndos = (int)($grupito[2]/2);\n$taxis += $ndos;\n//echo $taxis.\":\".$ndos;\n$grupito[2] -= $ndos*2;\nif($grupito[2]>0){$taxis++;$grupito[2]-=1;$grupito[1]-=2;}\nif($grupito[1]>0){\n $nuno = (int)(ceil($grupito[1]/4));\n $taxis += $nuno;\n //echo \"->\".$uno;\n}\n//print_r($grupito);\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\necho $taxis;\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0);\nforeach( array_count_values($groups) as $k => $v) $gv[$k] = $v;\n\n$c = floor($gv[2]/2);\n$gv[2] -= floor($gv[2]/2)*2;\n$c += $gv[4];\n\nfor($i = 0; $i < $gv[3]; $i++)\n{\n $c++;\n if($gv[1] > 0) $gv[1]--;\n}\n\nfor($i = 0; $i < $gv[2]; $i++)\n{\n $c++;\n if($gv[1] >= 2)\n {\n $gv[1] -= 2;\n } elseif($gv[1] >= 1)\n {\n $gv[1] -= 1;\n } \n}\n\nfor($i = 0; $i < $gv[1]; $i++)\n{\n $c++;\n if($gv[1] >= 3)\n {\n $i+=3;\n } elseif($gv[1] === 2)\n {\n $i += 2;\n } elseif($gv[1] === 1) \n {\n $i++;\n } \n}\n\necho $c;"}, {"source_code": "0)\n{\n\t$count[4] = $count[4] - 1;\n\t$taxi = $taxi + 1;\n}\nwhile($count[3]>0)\n{\n\t$count[3] = $count[3] - 1;\n\tif($count[1]>0)\n\t{\n\t\t$count[1] = $count[1] - 1;\n\t}\n\t$taxi = $taxi + 1;\n}\nwhile($count[2]>1)\n{\n\t$count[2] = $count[2] - 2;\n\t$taxi = $taxi + 1;\n}\nwhile($count[1]>0)\n{\n\tif($count[2]>0){\n\t\t$count[2] = $count[2] - 1;\n\t\t$count[1] = $count[1] - 2;\n\t}\n\telse\n\t{\n\t\t$count[1] = $count[1] - 4;\n\t}\n\t$taxi = $taxi + 1;\n}\nif($count[2]>0)\n\t$taxi = $taxi + 1;\necho $taxi;\n?>"}, {"source_code": " $value) {\n\tif ($value==1) {\n\t\t$one+=1;\n\t}elseif ($value==2) {\n\t\t$two+=1;\n\t}elseif ($value==3) {\n\t\t$three+=1;\n\t}elseif ($value==4) {\n\t\t$four+=1;\n\t}\n}\n//====================\nif ($three == 0) {\n\t$sum = ($four*4+$two*2+$one);\n\tif ($sum%4==0 ) {\n\t\t$taxi= $sum/4;\n\t}else{\n\t\t$taxi= intval($sum/4)+1;\n\t}\n\tgoto end;\n}else{\n\tif ($one>=$three) {\n\t\t$rest_one = $one - $three;\n\t\t$taxi+=$three;\n\t}else{\n\t\t$rest_one=0;\n\t\t$taxi+=$three;\n\t}\n\n\tif ($rest_one ==0) {\n\t\tif ($two%2==0) {\n\t\t\t$taxi+=($two*2)/4;\n\t\t}else{\n\t\t\t$taxi+=intval(($two*2)/4)+1;\n\t\t}\n\t}else{\n\t\t$sum_two_and_one= (2*$two)+$rest_one;\n\t\tif ($sum_two_and_one%4==0) {\n\t\t\t$taxi+=$sum_two_and_one/4;\n\t\t\t$rest_one=0;\n\t\t}else{\n\t\t\t$taxi+=intval($sum_two_and_one/4)+1;\n\t\t\t$rest_one=0;\n\t\t}\n\t}\t\n\n\tif ($rest_one%4==0) {\n\t\t$taxi+=$rest_one/4;\n\t}else{\n\t\t$taxi+=intval($rest_one/4)+1;\n\t}\n}\n//=====================\n$taxi+=$four;\nend:\necho $taxi;\n\n?>\n"}, {"source_code": "= $IncompleteTeam['3']){\n $IncompleteTeam['1'] -= $IncompleteTeam['3'];\n $Cars += $IncompleteTeam['3'];\n unset($IncompleteTeam['3']);\n}else{\n $IncompleteTeam['1'] = 0;\n $Cars += $IncompleteTeam['3'];\n unset($IncompleteTeam['3']);\n}\n\nif($IncompleteTeam['2'] % 2 == 0){\n $Cars += $IncompleteTeam['2'] / 2;\n unset($IncompleteTeam['2']);\n}else{\n if($IncompleteTeam['1'] >= 2){\n $IncompleteTeam['1'] -= 2;\n }else{\n $IncompleteTeam['1'] = 0;\n }\n $Cars += ceil($IncompleteTeam['2'] / 2);\n unset($IncompleteTeam['2']);\n}\n\n$Cars += ceil($IncompleteTeam['1'] / 4);\n\necho $Cars . \"\\r\\n\";\n?>"}, {"source_code": "$arr[1]){\n\t$count+=$arr[3]+ceil($arr[2]/2);\n\techo $count;\n\texit;\n}\n\nelse if($arr[3]<$arr[1]){\n\t$count+=$arr[3];\n\t$arr[1]-=$arr[3];\n}\n\nelse{\n\t$count+=$arr[3]+ceil($arr[2]/2);\n\techo $count;\n\texit;\n}\n\n\n$count+=ceil(($arr[2]*2+$arr[1])/4);\necho $count;\n?>"}, {"source_code": "$kol[3]) \n {\n $answer += $kol[3];\n $kol[1] -= $kol[3];\n $kol[3] = 0;\n if ($kol[2]>0)\n {\n $answer++;\n $kol[1]--;\n if($kol[1]>0) $kol[1]--;\n $kol[2]--;\n }\n } else\n {\n $answer += $kol[1];\n $kol[3] -= $kol[1];\n $kol[1] = 0;\n }\n if($kol[1]>0)\n {\n $t = intval($kol[1]/4);\n $answer += $t;\n $kol[1] -= $t*4;\n if ($kol[1]>0) $answer++;\n }\n $answer += $kol[3]+$kol[2];\n echo $answer;\n?>"}, {"source_code": " 1) {\n $c += (int)(($have[2] - 1) / 2);\n $have[2] = 1;\n }\n }\n\n // 1\n if (isset($have[1])) {\n if (isset($have[2])) {\n if ($have[2] > 0 && $have[1] > 1) {\n $min_2_1 = min($have[2], (int)($have[1] / 2));\n\n if ($min_2_1 > 0) {\n $have[2] -= $min_2_1;\n $have[1] -= $min_2_1 * 2;\n $c += $min_2_1;\n }\n } elseif ($have[2] > 0 && $have[1] > 0) {\n $min_2_1 = min($have[2], $have[1]);\n\n if ($min_2_1 > 0) {\n $have[2] -= $min_2_1;\n $have[1] -= $min_2_1 * 2;\n $c += $min_2_1;\n }\n }\n }\n\n $ones = (int)($have[1] / 4);\n $c += $ones;\n $have[1] -= $ones * 4;\n\n if ($have[1] > 0) {\n $c++;\n }\n }\n\n if (isset($have[2])) {\n $c += $have[2];\n }\n\n if (isset($have[3])) {\n $c += $have[3];\n }\n\n return $c;\n}\n\n$r = 0;\n\nlist($n) = fscanf($input, \"%d\\n\");\n\n$s = fscanf($input, trim(str_repeat(\"%d \", $n)));\n\n$r = foo($s);\n\nfwrite($output, $r);\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0);\nforeach ($groupsSizes as $size) {\n $groups[(int)$size]++;\n}\n\n$result = $groups[4] + $groups[3] + (int)($groups[2] / 2);\n$groups[1] -= $groups[3];\nif ($groups[2] % 2) {\n $result++;\n $groups[1] -= 2;\n}\nif ($groups[1] > 0) {\n $result += ceil($groups[1] / 4);\n}\n\necho $result;"}, {"source_code": " 0 ? 1 : 0;\nprintf(\"%d\", $n);"}, {"source_code": "0) \n $mas[4]++;\necho $mas[4];\n\n\necho $r; "}, {"source_code": " 0 ? $counts[1] - $counts[3] : 0)) / 4 + $counts[2] / 2);\n return $sum;\n}\n\nfunction get_counts($groups){\n\n $counts = array(0,0,0,0,0);\n foreach ($groups as $g) $counts[$g]++;\n\n return $counts;\n}\n\n$groups = read();\n$counts = get_counts($groups);\n$sum = get_sum($counts);\n\necho $sum;"}, {"source_code": "\n"}, {"source_code": "4)\n {\n $end--;\n }\n else\n {\n $group[$end]+=$group[$start];\n $start++;\n $n--;\n $summary++;\n }\n}\n echo $n;\n\n?>"}], "negative_code": [{"source_code": "=0 ; $i--) { \n\t\t\tif ($a!=$i) {\n\t\t\t\t$maxval=$num_people_in_group[$i];\n\t\t\t\tif ($maxval==4) {\n\t\t\t\t\t$num_people_in_group[$i]=0;\n\t\t\t\t\t$taxi+=1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}elseif ($maxval==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}elseif (($value+$maxval)==4 ) {\n\t\t\t\t\t$num_people_in_group[$i]=0;\n\t\t\t\t\t$num_people_in_group[$a]=0;\n\t\t\t\t\t$taxi+=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}elseif (($value+$maxval)<4 and $i!=$a) {\n\t\t\t\t\t$num_people_in_group[$i]+=$value;\n\t\t\t\t\t$num_people_in_group[$a]=0;\n\t\t\t\t\tbreak;\n\t\t\t\t}/*elseif (($value+$maxval)>4 and $i!=$a) {\n\t\t\t\t\t//$taxi+=2;\n\t\t\t\t\tbreak;\n\t\t\t\t}*/\n\t\t\t}else{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\tif ($a == $i) {\n\tbreak;\n\t}\n}\n\t\nforeach ($num_people_in_group as $value) {\n\tif ($value>0) {\n\t\t$taxi+=1;\n\t}\n}\n}\necho $taxi;\n\n?>"}, {"source_code": " $group_num) {\n\tif ($group_num==0 or $group_num==4) {\n\t\tbreak;\n\t}elseif ($group_num<4 ) {\n\t\t$current_group_num = $group_num;\n\t\t$current_key = $key;\n\t\tforeach ($num_people_in_group as $key => $group_num) {\n\t\t\tif ($current_group_num+$group_num<=4 and $current_key != $key) {\n\t\t\t\t$num_people_in_group[$key]= 0;\n\t\t\t\t$num_people_in_group[$current_key]= $current_group_num+$group_num;\n\t\t\t\t$num_groups-=1;\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n}\n\n}\n\nforeach ($num_people_in_group as $key => $value) {\n\tif ($value!=0) {\n\t\t$x+=1;\n\t}\n}\necho $x;\n//echo \"====================\";\n//print_r($num_people_in_group);\n?>"}, {"source_code": "= 0) {\n\t\t\t$t1 += (2 * $t2);\n\t\t\tif ($t1 % 4 == 0) {\n\t\t\t\t$ta += ($t1 /= 4);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$t1 /= 4; \n\t\t\t\t$t1++;\n\t\t\t\t$ta += $t1;\n\t\t\t}\n\t\t}\n\t\techo $ta;\n?>"}, {"source_code": " 0){\n\t$taxi += ceil($groups[1] / 4);\n}\necho ceil($taxi);\n?>"}, {"source_code": "\n"}, {"source_code": "= 0) {\n\t\t$sum += $counts[3] + ceil($counts[2] / 2);\n\t} else {\n\t\t$rest_ones = $count[1] - $count[3];\n\t\t$sum += $counts[3] + floor($count[2] / 2);\n\t\t\n\t\tif ($count[2] % 2 - $rest_ones >= 0) {\n\t\t\t$sum += ($counts[2] % 2 == 0) ? 0 : 1;\n\t\t} else {\n\t\t\t$rest_ones = $rest_ones - $counts[2] % 2;\n\t\t\t$sum += floor($rest_ones / 4) + ($rest_ones % 4 == 0 ? 0 : 1); \n\t\t}\n\t}\n\n\treturn $sum;\n}\n\nfunction get_counts($groups){\n\t\n\t$counts = array(0,0,0,0,0);\n\tforeach ($groups as $g) $counts[$g]++;\n\n\treturn $counts;\n}\n\n$groups = read();\n$counts = get_counts($groups);\n$sum = get_sum($counts);\n\necho $sum;\n"}, {"source_code": " 0) {\n\t\twhile (count($list) > 1) {\n if ($list[0] + $list[count($list)-1] <= 4) {\n $list[0] += $list[count($list)-1];\n unset($list[count($list)-1]);\n $list = array_values($list);\n } else {\n break;\n }\n }\n\t\tunset($list[0]);\n $list = array_values($list);\n\t\t$total++;\n\t}\n\techo $total;\n\t*/"}, {"source_code": " 0){\n\t$taxi += $group[1] / 4;\n}\n\necho ceil($taxi);\n"}, {"source_code": ""}, {"source_code": " 0) {\n\t\tif (count($list) > 1) {\n\t\t\twhile (count($list) > 1) {\n if ($list[0] == 4) {\n\t unset($list[0]);\n rsort($list);\n break;\n } elseif ($list[0] + $list[count($list)-1] <= 4) {\n unset($list[0]);\n unset($list[count($list)-1]);\n rsort($list);\n } else {\n break;\n }\n }\n\t\t} else {\n\t\t\tunset($list[0]);\n\t\t\trsort($list);\n\t\t}\n\t\t$total++;\n\t}\n\techo $total;"}, {"source_code": "list($n)=explode(\" \",trim(fgets(STDIN)));\n$s=explode(\" \",trim(fgets(STDIN)));\nfor ($i=0,$sum=0;$i<$n;$i++){\nif ($s[$i]==4) {$k[$i]=1;$sum++;};\nif ($k[$i]==0){\nfor ($j=$i+1;$j<$n;$j++)\nif (($s[$i]+$s[$j])==4) {$k[$i]=1;$k[$j]=1;$sum++;break;} \n}}\nfor ($i=0;$i<$n;$i++){\nif ($s[$i]==3) {($k[$i]=1);$sum++;}\nif ($k[$i]==0) $r+=$s[$i];}\nprint ceil($r/4)+$sum;\n?>"}, {"source_code": "$val) {\n\t\tif (count($list) > 0) {\n\t\t\tif ($val + $list[count($list)-1] <= 4) {\n\t\t\t\tunset($list[count($list)-1]);\n\t\t\t}\n\t\t}\n\t\t$total++;\n\t\tunset($list[$key]);\n\t}\n\techo $total;"}, {"source_code": "$kol[3]) \n {\n $answer += $kol[3];\n $kol[1] -= $kol[3];\n $kol[3] = 0;\n echo 'to'.$answer.'to';\n if ($kol[2]>0)\n {\n $answer++;\n $kol[1]--;\n $kol[2]--;\n }\n } else\n {\n $answer += $kol[1];\n $kol[3] -= $kol[1];\n $kol[1] = 0;\n }\n if($kol[1]>0)\n {\n $t = intval($kol[1]/4);\n $answer += $t;\n $kol[1] -= $t*4;\n if ($kol[1]>0) $answer++;\n }\n $answer += $kol[3]+$kol[2];\n echo $answer;\n?>"}, {"source_code": "0){\n\t\t\t$taxi1--;\n\t\t\t$flag = 1;\t\n\t\t}\n\t\t\n\t}\n\tif($taxi1>0){\n\t\tif($flag==1) $taxi1--;\n\t\t$taxi += (int) $taxi1/4;\n\t\tif($taxi1%4!=0){\n\t\t\t$taxi++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $taxi);\n?>"}, {"source_code": "= $c[3])\n{\n $d = min($c[1], $c[3]);\n $e = $c[1] - $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nelse\n{\n $d = min($c[1], $c[3]);\n $e = ($c[3] - $c[1]) * 3;\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nprint $c[4] + $d + $f + $h;\n?>"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": "= $cnt1){\n\t$cnt = $cnt + $cnt1;\n\t$cnt3 = $cnt3 - $cnt1;\n\t$cnt1 = 0;\n}\nelseif($cnt3 < $cnt1){\n\t$cnt = $cnt + $cnt3;\n\t$cnt1 = $cnt1 - $cnt3;\n\t$cnt3 = 0;\n}\n$cnt = $cnt + ($cnt2/2);\n$cnt2 = $cnt2%2;\n\nif($cnt3 > 0){\n\t$cnt = $cnt + $cnt3 + $cnt2;\n}\nelseif($cnt2==1 && $cnt1==0 && $cnt3==0) {\n\t$cnt++;\n}elseif($cnt1>0){\n\tif($cnt2>0){\n\t\t$cnt++;\n\t\t$cnt1=$cnt1-2;\n\t\t$cnt2=0;\n\t}\n\tif($cnt1>0){\n\t\t$cnt=$cnt+($cnt1/4);\n\t\tif($cnt1%4!=0){\n\t\t\t$cnt++;\n\t\t}\n\t}\n\t\n}\necho count($cnt);\n"}, {"source_code": ""}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": "0)\n{\n\t$count[4] = $count[4] - 1;\n\t$taxi = $taxi + 1;\n}\nwhile($count[3]>0)\n{\n\t$count[3] = $count[3] - 1;\n\tif($count[1]>0)\n\t{\n\t\t$count[1] = $count[1] - 1;\n\t}\n\t$taxi = $taxi + 1;\n}\nwhile($count[2]>1)\n{\n\t$count[2] = $count[2] - 2;\n\t$taxi = $taxi + 1;\n}\nwhile($count[1]>0)\n{\n\tif($count[2]>0){\n\t\t$count[2] = $count[2] - 2;\n\t}\n\telse\n\t{\n\t\t$count[1] = $count[1] - 4;\n\t}\n\t$taxi = $taxi + 1;\n}\nif($count[2]>0)\n\t$taxi = $taxi + 1;\necho $taxi;\n?>"}, {"source_code": " 0) {\n\t\twhile (count($list) > 1) {\n if ($list[0] + $list[count($list)-1] <= 4) {\n $list[0] += $list[count($list)-1];\n unset($list[count($list)-1]);\n $list = array_values($list);\n } else {\n break;\n }\n }\n\t\tunset($list[0]);\n $list = array_values($list);\n\t\t$total++;\n\t}\n\techo $total;\n\t*/"}, {"source_code": " 4){\n\t\t$total++;\n\t\t$j=0;\n\t}\n\t$j=$j+$s[$i];\n\t$i++;\n}\n\nif($j == 0){\n\techo $total;\n}\nelse{\n\techo $total=$total+1;\n}\n\n\n\n\n?>"}, {"source_code": "= $c[3])\n{\n $d = min($c[1], $c[3]);\n $e = $c[1] - $c[3];\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nelse\n{\n $d = min($c[1], $c[3]);\n $e = ($c[3] - $c[1]) * 3;\n $f = floor(($c[2] * 2) / 4);\n $g = ($c[2] * 2) % 4;\n $e += $g;\n $h = ceil($e / 4);\n}\nprint $c[4] + $d + $f + $h;\n?>"}, {"source_code": "0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": " 0 && ($key = array_search($value, $arr_sisa)) !== false) {\n\t\t unset($arr_sisa[$key]);\n\t\t}\n\t\telse{\n\t\t\tarray_push($arr_taxi,1);\n\t\t\tarray_push($arr_sisa, $sisa_seat);\n\t\t}\n\t}\n}\necho count($arr_taxi);\n?>"}, {"source_code": ""}, {"source_code": "=0 ; $i--) { \n\t\t\tif ($a!=$i) {\n\t\t\t\t$maxval=$num_people_in_group[$i];\n\t\t\t\tif ($maxval==4) {\n\t\t\t\t\t$num_people_in_group[$i]=0;\n\t\t\t\t\t$taxi+=1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}elseif ($maxval==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}elseif (($value+$maxval)==4 ) {\n\t\t\t\t\t$num_people_in_group[$i]=0;\n\t\t\t\t\t$num_people_in_group[$a]=0;\n\t\t\t\t\t$taxi+=1;\n\t\t\t\t\tbreak;\n\t\t\t\t}elseif (($value+$maxval)<4 and $i!=$a) {\n\t\t\t\t\t$num_people_in_group[$i]+=$value;\n\t\t\t\t\t$num_people_in_group[$a]=0;\n\t\t\t\t\tbreak;\n\t\t\t\t}/*elseif (($value+$maxval)>4 and $i!=$a) {\n\t\t\t\t\t//$taxi+=2;\n\t\t\t\t\tbreak;\n\t\t\t\t}*/\n\t\t\t}else{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\tif ($a == $i) {\n\tbreak;\n\t}\n}\n\t\nforeach ($num_people_in_group as $value) {\n\tif ($value>0) {\n\t\t$taxi+=1;\n\t}\n}\n}\necho $taxi;\n\n?>"}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " 0) {\n $answer += ceil($groups[1] / 4);\n}\n\necho $answer . PHP_EOL;\n\n"}, {"source_code": " 0) {\n\t\twhile (count($list) > 1) {\n if ($list[0] + $list[count($list)-1] <= 4) {\n $list[0] += $list[count($list)-1];\n unset($list[count($list)-1]);\n $list = array_values($list);\n } else {\n break;\n }\n }\n\t\tunset($list[0]);\n $list = array_values($list);\n\t\t$total++;\n\t}\n\techo $total;\n\t*/"}, {"source_code": "0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": "0)\n{\n\t$taxi = $taxi + 1;\n\t$count[4] = $count[4] - 1;\n}\nwhile($count[3]>0)\n{\n\t$taxi = $taxi + 1;\n\t$count[3] = $count[3] - 1;\n\tif($count[1]>0)\n\t{\n\t\t$count[1] = $count[1] - 1;\n\t}\n}\nwhile($count[2]>1)\n{\n\t$taxi = $taxi + 1;\n\t$count[2] = $count[2] - 2;\n}\nwhile($count[1]>0)\n{\n\tif($count[2]>0){\n\t\t$count[1] = $count[1] - 2;\n\t}\n\telse\n\t{\n\t\t$count[1] = $count[1] - 4;\n\t}\n\t$taxi = $taxi + 1;\n}\necho $taxi;\n?>"}, {"source_code": " intval($lines[0]),\n 'counts' => $lines[1],\n);\n$i = 0;\n$c = array(\n 0 => 0,\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n);\nforeach($input['counts'] as $count) {\n $c[intval($count)]++;\n}\n$i += $c[4];\n$i += $c[3];\n$c[1] = ($c[3] > $c[1]) ? 0 : $c[1] - $c[3];\n$i += ceil((($c[2] * 2) + $c[1]) / 4);\nfile_put_contents('php://stdout', $i);\n?>"}, {"source_code": " $group){\n\t$count += $group;\n}\necho ceil($count / 4);\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0);\nforeach( array_count_values($groups) as $k => $v) $gv[$k] = $v;\n$c = $gv[4];\n\nfor($i = 0; $i < $gv[3]; $i++)\n{\n $c++;\n if($gv[1] > 0) $gv[1]--;\n}\n\nfor($i = 0; $i < $gv[2]; $i++)\n{\n $c++;\n $gv[2] -= 1;\n if($gv[2] > 0)\n {\n $i++;\n } elseif($gv[1] >= 2)\n {\n $gv[1] -= 2;\n } elseif($gv[1] === 1) \n {\n $gv[1]--;\n } \n}\n\nfor($i = 0; $i < $gv[1]; $i++)\n{\n $c++;\n if($gv[1] >= 3)\n {\n $i+=3;\n } elseif($gv[1] === 2)\n {\n $i += 2;\n } elseif($gv[1] === 1) \n {\n $i++;\n } \n}\n\necho $c;"}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode(',', $one_minus_three);\n\t\t\t\t\t$b = (int) '0.'.$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\t\tif ($one_first == 0 && $three_first == 0) $one_and_three = 0;\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($one_first <= 2 && $three_first < 1) {\n\t\t\t\t$answer = $four + $two;\n\t\t\t} else {\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\t\t\t}\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": "0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": "= 0.75) { unset($s[$i]); $count++;} }\nif(isset($s[0])) { $count = $count + ceil(array_sum ($s)/4); }\necho $count;\n?>"}, {"source_code": "0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": ""}, {"source_code": "$r) if ($r==='') unset($rating[$key]);\n$n = isset($fl[0]) ? $fl[0] : 0;\n\n$c1 = $c2 = $c3 = $c4 = 0;\nfor ($i = 0,$cnt = count($groups); $i < $cnt; $i++){\n switch ($groups[$i]){\n case 1: $c1++; break;\n case 2: $c2++; break;\n case 3: $c3++; break;\n case 4: $c4++; break;\n }\n}\n$count += $c4;\nif ($c3 >= $c1){\n $count += $c3;\n $c1 = 0;\n}else{\n $count += $c1 - ($c1 - $c3);\n $c1 = $c1-$c3;\n}\nif ($c2 % 2 == 1 && $c1 >= 2){\n $c1 -= 2;\n $c2 += 1;\n}\n$cc = ($c2>>1);\n$count += $cc;\n\nif ($c2 - $cc * 2 > 0) $count++;\nif ($c1 % 4 == 0){\n $count += $c1/4;\n}else{\n $count += 1 + (int)($c1/4);\n}\necho $count;"}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\t\tif ($one_first == 0 && $three_first == 0) $one_and_three = 0;\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($one_first <= 2 && $three_first < 1) {\n\t\t\t\t$answer = $four + $two;\n\t\t\t} else {\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\t\t\t}\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": "\n$n = rtrim(fgets(stdin));\n$arr = explode(' ',rtrim(fgets(stdin)));\n$cnt = array();\nfor ($i = 0;$i < $n;$i++){\n $cnt[$arr[$i]]++;\n}\n$cnt[1] -= $cnt[3];\nif ($cnt[1] < 0)\n $cnt[1] = 0;\n\n$result = $cnt[4] + $cnt[3] + ceil(($cnt[2]*2+$cnt[1])/4);\nprintf(\"%d\\n\",$result);\n\n?>"}, {"source_code": "0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": "$people) {\n $people = $group_array[$i];\n $key = $i;\n if ($people == 4) {\n $cars++;\n //unset($group_array[$key]);\n }\n\n if ($people == 3) {\n\n if ($one>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n $one--;\n } else {\n $three++;\n }\n }\n if ($people == 2) {\n if ($two>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n $two--;\n //unset()\n } else {\n $two++;\n }\n }\n if ($people== 1) {\n if ($three>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n $three--;\n } else {\n $one++;\n }\n }\n }\n\n if ($three>0) {\n $cars += $three;\n }\n\n if ($two>0) {\n if ($one>0) {\n $cars++;\n if ($one>2) {\n $count_one = $one-2;\n $cars += ceil($count_one/4);\n $one = array();\n } else {\n $one = array();\n }\n } else {\n $cars += $two;\n }\n }\n\n if ($one > 0) {\n $cars += ceil($one/4);\n }\n\n //echo $cars;\n fputs(STDOUT, $cars);"}, {"source_code": "4) $count+=$ss[3];\n else\n {\n $sum = $three+$one; \n $count += floor($sum); \n $ost = $sum - floor($sum);\n if ($ost <=0.75 AND $ost>0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n }\n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": "0)\n{\n\t$taxi = $taxi + 1;\n\t$count[4] = $count[4] - 1;\n}\nwhile($count[3]>0)\n{\n\t$taxi = $taxi + 1;\n\t$count[3] = $count[3] - 1;\n\tif($count[1]>0)\n\t{\n\t\t$count[1] = $count[1] - 1;\n\t}\n}\nwhile($count[2]>1)\n{\n\t$taxi = $taxi + 1;\n\t$count[2] = $count[2] - 2;\n}\nwhile($count[1]>0)\n{\n\tif($count[2]>0){\n\t\t$count[1] = $count[1] - 2;\n\t}\n\telse\n\t{\n\t\t$count[1] = $count[1] - 4;\n\t}\n\t$taxi = $taxi + 1;\n}\necho $taxi;\n?>"}, {"source_code": ""}, {"source_code": "$kol[3]) \n {\n $answer += $kol[3];\n $kol[1] -= $kol[3];\n $kol[3] = 0;\n if ($kol[2]>0)\n {\n $answer++;\n $kol[1]--;\n $kol[2]--;\n }\n } else\n {\n $answer += $kol[1];\n $kol[3] -= $kol[1];\n $kol[1] = 0;\n }\n if($kol[1]>0)\n {\n $t = intval($kol[1]/4);\n $answer += $t;\n $kol[1] -= $t*4;\n if ($kol[1]>0) $answer++;\n }\n $answer += $kol[3];\n echo $answer;\n?>"}, {"source_code": "0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": " 0){\n\t$taxi += ceil($groups[1] / 4);\n}\necho ceil($taxi);\n?>"}, {"source_code": "= $a[1]){\n $a[1] = 0;\n}\nelse if ($a[3] < $a[1]){\n $a[1] -= $a[3];\n}\n$a[2] = ceil($a[2]/2);\n$taxi = $a[1] + $a[2] + $a[3] + $a[4];\necho $taxi;\n?>"}, {"source_code": ""}, {"source_code": "$strParty = trim(fgets(STDIN)); \n$strCount = trim(fgets(STDIN));\n$arrayCount = explode(\" \",$strCount);\n//$strParty = 100000;\n//for($i = 0; $i < $strParty;$i++) $arrayCount[$i] = rand(1,4);\n\nif(!$arrayCount) exit(1);\nif(!$strParty) exit(1);\nif($strParty != count($arrayCount)) exit(1);\n\nfunction first($arrayCount)\n{\n\nfor($i = 0; $i < count($arrayCount);$i++) if($arrayCount[$i] == 2) $arrayTwoDigits[] = $i;\n\n\nfor($i = 0; $i < count($arrayTwoDigits);$i++)\n{\n if($arrayCount[$arrayTwoDigits[$i+1]])\n {\n if($arrayCount[$arrayTwoDigits[$i]] + $arrayCount[$arrayTwoDigits[$i+1]] == 4) \n {\n $arrayCount[$arrayTwoDigits[$i+1]] = 4;\n unset($arrayCount[$arrayTwoDigits[$i]]);\n }\n }\n\n}\n\nsort($arrayCount);\nreturn $arrayCount;\n}\n\nfunction four($arrayCount)\n{\n\nfor($i = 0; $i < count($arrayCount);$i++) if($arrayCount[$i] == 1) $arrayTwoDigits2[] = $i;\n\n\nfor($i = 0; $i < count($arrayTwoDigits2);$i++)\n{\n if($arrayCount[$arrayTwoDigits2[$i+1]])\n {\n if($arrayCount[$arrayTwoDigits2[$i]] + $arrayCount[$arrayTwoDigits2[$i+1]] == 2) \n {\n $arrayCount[$arrayTwoDigits2[$i+1]] = 2;\n unset($arrayCount[$arrayTwoDigits2[$i]]);\n }\n }\n\n}\n\nsort($arrayCount);\nreturn $arrayCount;\n}\n\nfunction second($arrayCount)\n{\nfor($i = 0; $i < count($arrayCount);$i++) if($arrayCount[$i] == 3) $arrayTwoDigits1[] = $i;\n\n\nfor($i = 0; $i < count($arrayCount);$i++)\n{\n if($arrayCount[$i] == 1)\n {\n $j = 0;\n if($arrayCount[$i] + $arrayCount[$arrayTwoDigits1[$j]] == 4) \n {\n $arrayCount[$arrayTwoDigits1[$j]] = $arrayCount[$i] + $arrayCount[$arrayTwoDigits1[$j]];\n unset($arrayCount[$i]);\n unset($arrayTwoDigits1[$j]);\n sort($arrayTwoDigits1);\n }\n } \n\n}\nsort($arrayCount);\nreturn $arrayCount;\n}\n\n$arrayCount = first($arrayCount);\n//print_r($arrayCount);\n$arrayCount = second($arrayCount);\n//print_r($arrayCount);\n$arrayCount = four($arrayCount);\n$arrayCount = first($arrayCount);\n\nfor($i =0; $i < count($arrayCount);$i++)\n{\n if($arrayCount[$i+1])\n {\n if($arrayCount[$i] + $arrayCount[$i+1] <=4 )\n {\n $arrayCount[$i+1] = $arrayCount[$i] + $arrayCount[$i+1];\n unset($arrayCount[$i]);\n }\n }\n \n}\nsort($arrayCount);\n\n\n\n\n// print_r($arrayCount);\n$cCount = count($arrayCount);\nprint $cCount;"}, {"source_code": "\n"}, {"source_code": " 0) {\n\t\t$sum += ceil($diff / 4 + $counts[2] / 2);\n\t} else {\n\t\t$sum += ceil($counts[2] / 2);\t\n\t}\n\treturn $sum;\n}\n\nfunction get_counts($groups){\n\t\n\t$counts = array(0,0,0,0,0);\n\tforeach ($groups as $g) $counts[$g]++;\n\n\treturn $counts;\n}\n\n$groups = read();\n$counts = get_counts($groups);\n$sum = get_sum($counts);\n\necho $sum;\n"}, {"source_code": ""}, {"source_code": " 4){\n\t\t$total++;\n\t\t$j=0;\n\t}\n\t$j=$j+$s[$i];\n\t$i++;\n}\n\nif($j == 0){\n\techo $total;\n}\nelse{\n\techo $total=$total+1;\n}\n\n\n\n\n?>"}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first <= 2 && $three_first == 0) $two = 0;\n\t\t\tif ($four == 0 && $one_first == 0 && $three_first == 0) $two = 1;\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " 0) {\n\t\twhile (count($list) > 1) {\n if ($list[0] + $list[count($list)-1] <= 4) {\n $list[0] += $list[count($list)-1];\n unset($list[count($list)-1]);\n $list = array_values($list);\n } else {\n break;\n }\n }\n\t\tunset($list[0]);\n $list = array_values($list);\n\t\t$total++;\n\t}\n\techo $total;\n\t*/"}, {"source_code": "$arr[1]){\n\t$count+=$arr[3]+ceil($arr[2]/2);\n\techo $count;\n\texit;\n}\n\nelse if($arr[3]<$arr[1]){\n\t$count+=$arr[3];\n\t$arr[1]-=$arr[3];\n}\n\nelse{\n\t$count+=$arr[3]+ceil($arr[2]/2);\n\techo $count;\n\texit;\n}\n\n\n$count+=ceil(($arr[2]*2+$arr[1])/4);\necho $count;\n?>"}, {"source_code": ""}, {"source_code": " 0){\n\t$taxi += ceil($groups[1] / 4);\n}\necho ceil($taxi);\n?>"}, {"source_code": "$people) {\n if ($people == 4) {\n $cars++;\n unset($group_array[$key]);\n }\n \n if ($people == 3) {\n \n if (count($one)>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n array_shift($one);\n } else {\n $three[$key] = 1;\n }\n }\n if ($people == 2) {\n if (count($two)>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n array_shift($two);\n } else {\n $two[$key] = 1;\n }\n }\n if ($people== 1) {\n if (count($three)>0) { //\u0415\u0441\u043b\u0438 \u043d\u0430\u0448\u043b\u0438 \u0442\u0440\u043e\u0439\u043a\u0443 \u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0448\u043b\u0438 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 - \u0441\u0430\u0436\u0430\u0435\u043c \u0432 \u0442\u0430\u0447\u043a\u0443 \u0447\u0443\u0432\u0430\u043a\u043e\u0432\n $cars++;\n array_shift($three);\n } else {\n $one[$key] = 1;\n }\n }\n }\n\n if (count($three)>0) {\n $cars += count($three);\n }\n\n if (count($two)>0) {\n if (count($one)>0) {\n $cars++;\n if (count($one)>2) {\n $count_one = count($one)-2;\n $cars += ceil($count_one/4);\n $one = array();\n }\n } else {\n $cars += count($two);\n }\n }\n\n if (count($one) > 0) {\n $cars += ceil(count($one)/4);\n }\n \n fputs(STDOUT, $cars);\n\n\n?>"}, {"source_code": " 1) {\n $c += (int)(($have[2] - 1) / 2);\n $have[2] = 1;\n }\n }\n\n // 1\n if (isset($have[1])) {\n if (isset($have[2])) {\n if ($have[2] > 0 && $have[1] > 1) {\n $min_2_1 = min($have[2], (int)($have[1] / 2));\n\n if ($min_2_1 > 0) {\n $have[2] -= $min_2_1;\n $have[1] -= $min_2_1 * 2;\n $c += $min_2_1;\n }\n }\n }\n\n if ($have[1] > 0) {\n $ones = (int)($have[1] / 4);\n $c += $ones;\n $have[1] -= $ones * 4;\n $c++;\n }\n }\n\n if (isset($have[2])) {\n $c += $have[2];\n }\n\n if (isset($have[3])) {\n $c += $have[3];\n }\n\n return $c;\n}\n\n$r = 0;\n\nlist($n) = fscanf($input, \"%d\\n\");\n\n$s = fscanf($input, trim(str_repeat(\"%d \", $n)));\n\n$r = foo($s);\n\nfwrite($output, $r);\n"}, {"source_code": ""}, {"source_code": "4) $three = $ss[3]; else $three = 0;\n \n $sum = $three+$one; \n $count += floor($sum); \n $ost = $sum - floor($sum);\n if ($ost <=0.75 AND $ost>0.25 AND $three%2 ==1 ) { $count++; $ost = 0; }\n \n }\nif (isset($ss[2])) \n{ \n$two = ($ss[2]*2)/4; \n$count += floor($ss[2]/2); \n$ost += $two - floor($two);\n}\nif ($ost!=0) $count+=ceil($ost);\necho $count;\n?>"}, {"source_code": ""}, {"source_code": " $c3)\n {\n print $c4 + $c3 + ceil(($c1 - $c3 + 2) / 4);\n }\n elseif($c1 < $c3)\n {\n print $c4 + $c1 + 1 + ($c3 - $c1);\n }\n elseif($c1 == $c3)\n {\n print $c4 + $c1 + 1;\n }\n}\nelseif($c2 % 2 == 0)\n{\n if($c1 > $c3)\n {\n print $c4 + $c3 + ($c2 / 2) + ceil(($c1 - $c3) / 4);\n }\n elseif($c1 < $c3)\n {\n print $c4 + $c1 + ($c2 / 2) + ($c3 - $c1);\n }\n elseif($c1 == $c3)\n {\n print $c4 + $c1 + ($c2 / 2);\n }\n}\nelseif($c2 % 2 != 0)\n{\n if($c1 > $c3)\n {\n print $c4 + $c3 + floor($c2 / 2) + 1 + ceil(($c1 - $c3 - 1) / 4);\n }\n elseif($c1 < $c3)\n {\n print $c4 + $c1 + floor($c2 / 2) + 1 + ($c3 - $c1);\n }\n elseif($c1 == $c3)\n {\n print $c4 + $c1 + floor($c2 / 2) + 1;\n }\n}\n?>"}, {"source_code": "= 0) {\n\t\t$sum += $counts[3] + ceil($counts[2] / 2);\n\t} else {\n\t\t$rest_ones = $count[1] - $count[3];\n\t\t$sum += $counts[3] + floor($count[2] / 2);\n\t\t\n\t\tif ($count[2] % 2 - $rest_ones >= 0) {\n\t\t\t$sum += $counts[2] % 2;\n\t\t} else {\n\t\t\t$rest_ones = $rest_ones - $counts[2] % 2;\n\t\t\t$sum += $rest_ones / 4 + $rest_ones % 4; \n\t\t}\n\t}\n\n\treturn $sum;\n}\n\nfunction get_counts($groups){\n\t\n\t$counts = array(0,0,0,0,0);\n\tforeach ($groups as $g) $counts[$groups]++;\n\n\treturn $counts;\n}\n\n$groups = read();\n$counts = get_counts($groups);\n$sum = get_sum($counts);\n\necho $sum;\n"}, {"source_code": " 0){\n\t$taxi += $group[1] / 4;\n}\n\necho ceil($taxi);\n"}, {"source_code": ""}, {"source_code": "= 0.75) { unset($s[$i]); $count++;} }\nif(isset($s[0])) { $count = $count + ceil(array_sum ($s)/4);}\necho $count;\n?>"}, {"source_code": "= 0.75) { unset($s[$i]); $count++;} }\nif(isset($s[0])) { $count = $count + ceil(array_sum ($s)/4);}\necho $count;\n?>"}, {"source_code": "= $a[1]){\n $a[1] = 0;\n}\nelse if ($a[3] < $a[1]){\n $a[1] -= $a[3];\n}\n$a[2] = ceil($a[2]/2);\n$taxi = $a[1] + $a[2] + $a[3] + $a[4];\necho $taxi;\n?>"}, {"source_code": " 0) {\n\t\tif (count($list) > 1) {\n\t\t\twhile (count($list) > 1) {\n if ($list[0] == 4) {\n\t unset($list[0]);\n rsort($list);\n } elseif ($list[0] + $list[count($list)-1] <= 4) {\n unset($list[0]);\n unset($list[count($list)-1]);\n rsort($list);\n } else {\n break;\n }\n }\n\t\t} else {\n\t\t\tunset($list[0]);\n\t\t\trsort($list);\n\t\t}\n\t\t$total++;\n\t}\n\techo $total;"}, {"source_code": "0 || $_2>0 || $_3>0){\n if($_3>0 && $_1>0){\n $min=$_3>$_1?$_1:$_3;\n $_3-=$min;\n $_1-=$min;\n $out+=$min;\n }\n if($_2>1){\n $out+=floor($_2/2);\n $_2=$_2%2;\n }\n if($_2==1 && $_1>=2){\n $_1-=2;\n $_2=0;\n $out+=1;\n }\n if($_1>=4){\n $out+=floor($_1/4);\n $_1=$_1%4;\n }\n if($_1>0){\n $out+=1;\n $_1=0;\n }\n if($_2>0){\n $out+=1;\n $_2=0;\n }\n if($_3>0){\n $out+=1;\n $_3=0;\n }\n}\n\necho $out;\n\n?>"}, {"source_code": "\n"}, {"source_code": " 0) {\n\t\tif (count($list) > 1) {\n\t\t\tif ($list[0] + $list[count($list)-1] <= 4) {\n\t\t\t\tunset($list[count($list)-1]);\n\t\t\t}\n\t\t}\n\t\t$total++;\n\t\tunset($list[0]);\n\t\trsort($list);\n\t}\n\techo $total;"}, {"source_code": " 0 && $k[0] > 0)\n\t{\n\t\t$ans++;\n\t\t$k[1] = 0;\n\t\t($k[0] > 1 ? $k[0] -= 2: $k[0] = 0);\n\t}\n\n\t$ans += $k[2];\n\n\n\tfwrite(STDOUT, $ans.\"\\n\");\n?>\n"}, {"source_code": " $group){\n\t$count += $group;\n}\necho ceil($count / 4);\n?>"}, {"source_code": "= 100000) die;\nsort($s);\nfor ($i = 0; $i < $n; $i++) \n{\n if (max($s) == 4) {$key = array_search(4, $s); unset($s[$key]); $count++;}\n if (($s[0]+max($s))<=4) { $s[0]=$s[0]+array_pop($s); sort($s);}\n}\n$c = count($s);\nfor ($i = 0; $i < $c; $i++) { if ($s[$i]/4 >= 0.75) { unset($s[$i]); $count++;} }\nif(isset($s[0])) { $count = $count + ceil(array_sum ($s)/4); }\necho $count;\n?>"}, {"source_code": " $one_first) {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 1-\u0446 (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 3-\u043a.\n\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t} else {\n\t\t\t\t// \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u043a\u043e\u043b-\u0432\u0443 3-\u043a (\u0442.\u043a. \u0438\u0445 \u043c\u0435\u043d\u044c\u0448\u0435) \u043f\u043b\u044e\u0441 \u043a\u043e\u043b-\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 1-\u0446, \u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 4 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.\n\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t}\n\t\t}\n\n\t\t// \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438\n\t\t$answer = $four + $two + $one_and_three;\n\n\t\techo $answer;\n\t} else {\n\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 2-\u043a \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0434\u043b\u044f \u0447\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043b-\u0432\u0430 2-\u043a.\n\t\t$two = floor($two_first / 2);\n\t\t// \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 2-\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f 1-\u0446\u044b \u0438 3-\u043a\u0438.\n\t\tif ($two_first == 1) {\n\t\t\t$two = 1;\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) { \n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2);\n\t\t\t} else {\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first));\n\t\t\t\t} else {\n\t\t\t\t\t$one_and_three = ($three_first + ceil(($one_first - $three_first) / 4));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\techo $answer;\n\t\t} else {\n\t\t\t// \u0415\u0441\u043b\u0438 2-\u043a \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445, \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c 1-\u0446\u044b \u0438 3-\u043a\u0438 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0437\u0430\u043f\u0430\u0441\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 2-\u043a\u0430.\n\t\t\t// \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e-\u0441\u0442\u0430\u0440\u0438\u043d\u043a\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a.\n\t\t\t$one_first = count(array_diff($s, array(2, 3, 4)));\n\t\t\t$three_first = count(array_diff($s, array(1, 2, 4)));\n\t\t\tif ($one_first == $three_first) {\n\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b-\u0432\u043e 1-\u0446 \u0438 3-\u043a \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043e\u043d\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0439\u0441\u044f 2-\u043a\u0438.\n\t\t\t\t$one_and_three = (($one_first + $three_first) / 2) + 1;\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t} else {\n\t\t\t\t// \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435.\n\t\t\t\t// \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043b\u0435\u0433\u043a\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 3-\u043a \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 1-\u0446.\n\t\t\t\t// \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043c \u043d\u0435 \u0443\u0441\u0430\u0434\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0442\u0430\u043a\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u0437 3-\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438 \u0438\u0437 2-\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.\n\t\t\t\tif ($three_first > $one_first) {\n\t\t\t\t\t$one_and_three = ($one_first + ($three_first - $one_first)) + 1;\n\t\t\t\t} else {\n\t\t\t\t\t// \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435, \u0435\u0441\u043b\u0438 1-\u0446 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c 3-\u043a, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0442\u0430\u043a\u0441\u0438 \u0441 1-\u043c\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c\n\t\t\t\t\t$one_minus_three = (($one_first - $three_first) / 4);\n\t\t\t\t\tlist($a, $b) = explode('.', $one_minus_three);\n\t\t\t\t\t$b = '0.'.$b;\n\t\t\t\t\t$b = (double)$b;\n\t\t\t\t\t// \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043b\u0438\u0431\u043e \u0440\u0430\u0432\u043d\u043e 0,5 (\u0442.\u0435. 2 / 4), \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438 \u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f.\n\t\t\t\t\tif ($b <= 0.5) {\n\t\t\t\t\t\t$b = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u0418\u043d\u0430\u0447\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0430\u043a\u0441\u0438.\n\t\t\t\t\t\t$b = 2;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$one_and_three = ($three_first + $a + $b);\n\t\t\t\t}\n\n\t\t\t\t$answer = $four + $two + $one_and_three;\n\n\t\t\t\techo $answer;\n\t\t\t}\n\t\t}\n\t}\n?>"}], "src_uid": "371100da1b044ad500ac4e1c09fa8dcb"} {"source_code": " $arr[$i+$n]) {\r\n\t\t\t$mark = false ;\r\n\t\t\tbreak ;\r\n\t\t}\r\n\t}\r\n\tif($mark) printLine(\"YES\") ;\r\n\telse printLine(\"NO\") ;\r\n\r\n\r\n}", "positive_code": [{"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}"}], "negative_code": [], "src_uid": "52769cd7b3b0d63a7259a5d0754c4803"} {"source_code": " 0)\n {\n $d .= \"0\";\n $b[0]--;\n }\n elseif($b[1] > 0)\n {\n $d .= \"1\";\n $b[1]--;\n }\n }\n}\n$e = 0;\nfor($x = 0; $x < strlen($a); $x++)\n{\n if($a[$x] == 2)\n {\n $d .= \"2\";\n $e = 1;\n }\n elseif(($a[$x] == 0) && ($e == 1))\n {\n $d .= \"0\";\n }\n}\nprint $d;\n?>"}, {"source_code": " $value){\n if($value == 1){ \n $numOf1++;\n } \n if($value == 2 && !$stop){ \n $stop = true;\n $stopIndex = $key;\n } \n if(!$stop && $value == 0){ \n echo '0';\n } \n}\nfor($i = 0; $i < $numOf1; $i++){\n echo '1';\n}\n\nif($stop){\n\tfor($i = $stopIndex; $i < sizeof($input); $i++){ \n\t\tif($input[$i] != 1){\n\t\t\techo \"$input[$i]\";\n\t\t}\n\t}\n}"}], "negative_code": [{"source_code": " 1)\n {\n $b .= \"0\";\n $c[0]--;\n }\n elseif($c[1] > 0)\n {\n $b .= \"1\";\n $c[1]--;\n }\n elseif($c[2] > 0)\n {\n $b .= \"2\";\n $c[2]--;\n }\n }\n $b .= \"0\";\n $d = 0;\n $e = 0;\n }\n}\nif($e > 0)\n{\n for($y = 0; $y < $e; $y++)\n {\n if($c[0] > 1)\n {\n $b .= \"0\";\n $c[0]--;\n }\n elseif($c[1] > 0)\n {\n $b .= \"1\";\n $c[1]--;\n }\n elseif($c[2] > 0)\n {\n $b .= \"2\";\n $c[2]--;\n }\n }\n}\nprint $b;\n?>"}, {"source_code": " $value){\n if($value == 1){ \n $numOf1++;\n } \n if($value == 2 && !$stop){ \n $stop = true;\n $stopIndex = $key;\n } \n if(!$stop && $value == 0){ \n echo '0';\n } \n}\nfor($i = 0; $i < $numOf1; $i++){\n echo '1';\n}\n\nfor($i = $stopIndex; $i < sizeof($input); $i++){ \n if($input[$i] != 1){\n echo \"$input[$i]\";\n }\n}"}, {"source_code": " $input[($i+1)]){\n $canSwapThisTime = canSwap($value, $input[($i+1)]);\n if($canSwapThisTime){\n\t\t\t\t//echo \"can swap at position $i
\";\n\t\t\t\tarray_push($swapPosition, $i);\n\t\t\t\t$canSwapAny = true;\n\t\t\t}\n }\n }\n\tforeach($swapPosition as $value){\n\t\tswap($input, $value, $value+1);\n\t}\n}\n\n$input = implode(\"\", $input);\necho \"$input\";\n\nfunction swap(&$a, $position1, $position2){\n $temp = $a[$position1];\n $a[$position1] = $a[$position2];\n $a[$position2] = $temp;\n}\n\nfunction canSwap($item1, $item2){\n $diff = abs($item2 - $item1);\n if($diff == 1){\n return true;\n }\n return false;\n}"}, {"source_code": " $input[($i+1)]){\n $canSwapThisTime = canSwap($value, $input[($i+1)]);\n if($canSwapThisTime){\n\t\t\t\t//echo \"can swap at position $i
\";\n\t\t\t\tarray_push($swapPosition, $i);\n\t\t\t\t$canSwapAny = true;\n\t\t\t\t$i++;\n\t\t\t}\n }\n }\n\tforeach($swapPosition as $value){\n\t\tswap($input, $value, $value+1);\n\t}\n}\n\n$input = implode(\"\", $input);\necho \"$input\";\n\nfunction swap(&$a, $position1, $position2){\n $temp = $a[$position1];\n $a[$position1] = $a[$position2];\n $a[$position2] = $temp;\n}\n\nfunction canSwap($item1, $item2){\n $diff = abs($item2 - $item1);\n if($diff == 1){\n return true;\n }\n return false;\n}"}, {"source_code": " $value){\n if($value == 1){ \n $numOf1++;\n } \n if($value == 2){ \n $stop = true;\n $stopIndex = $key;\n } \n if(!$stop && $value == 0){ \n echo '0';\n } \n}\nfor($i = 0; $i < $numOf1; $i++){\n echo '1';\n}\n\nfor($i = $stopIndex; $i < sizeof($input); $i++){ \n if($input[$i] != 1){\n echo \"$input[$i]\";\n }\n}\n\n\n"}], "src_uid": "91cefa6793e77b3e4f4896616a164ff2"} {"source_code": "= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n $f[$e[2]] = \"pushFront\" . \"\\n\";\n array_push($f, \"3 popStack popQueue popFront\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n }\n else\n {\n $c = 0;\n if(count($d) == \"1\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n array_push($f, \"1 popStack\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n elseif(count($d) == \"2\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n array_push($f, \"2 popStack popQueue\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n elseif(count($d) >= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n $f[$e[2]] = \"pushFront\" . \"\\n\";\n array_push($f, \"3 popStack popQueue popFront\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n }\n $d = array();\n $f = array();\n $g = array();\n }\n }\n else\n {\n if($x != $a)\n {\n $d[$c] = $b;\n $c++;\n }\n else\n {\n array_push($d, $b);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = substr(implode(\"\", $g), 0, -1);\n print $h;\n }\n }\n}\n?>", "positive_code": [{"source_code": "\n$f = file('php://stdin',FILE_IGNORE_NEW_LINES);\ndefine('L',PHP_EOL);\n//-----------------------\n\n$x = $f[0];\n\n$a = array();\n\n$_in = array('pushQueue','pushStack','pushFront');\n$_out = array(' popQueue',' popStack',' popFront');\n\nfor($i=1;$i<=$x;$i++) {\n\tif ($f[$i]==0) {\n\n\t\t$b = $a;\n\t\tarsort($b);\n\t\t\n\t\t$b = array_keys(array_slice($b,0,3,true));\n\n\t\t$j = 0;\n\n\t\tforeach ($a as $k=>$kiss) {\n\t\t\tif ($j<3 && in_array($k,$b)) {\n\t\t\t\t$str .= $_in[$j++];\n\t\t\t} else {\n\t\t\t\t$str .= 'pushBack';\n\t\t\t}\n\t\t\t$str .= L;\n\t\t}\n\n\t\t$str .= $j;\n\n\t\tfor ($c=0;$c<$j;$c++) {\n\t\t\t$str .= $_out[$c];\n\t\t}\n\n\t\t$str .= L;\n\n\t\t$a = array();\n\n\t} else {\n\t\t$a[] = $f[$i];\n\t}\n}\n\nfor ($i=0;$i"}, {"source_code": "= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\");\n $f[$e[0]] = \"pushStack\";\n $f[$e[1]] = \"pushQueue\";\n $f[$e[2]] = \"pushFront\";\n array_push($f, \"3 popStack popQueue popFront\");\n $g = array_merge($g, $f);\n }\n $d = array();\n $f = array();\n }\n }\n else\n {\n if($x != $a)\n {\n $d[$c] = $b;\n $c++;\n }\n else\n {\n array_push($d, $b);\n $f = array_fill(0, count($d), \"pushBack\");\n $g = array_merge($g, $f);\n }\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n print $g[$x] . \"\\n\";\n}\nprint $g[$x];\n?>"}, {"source_code": ""}, {"source_code": "= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n $f[$e[2]] = \"pushFront\" . \"\\n\";\n array_push($f, \"3 popStack popQueue popFront\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n }\n else\n {\n $c = 0;\n if(count($d) == \"1\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n array_push($f, \"1 popStack\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = substr(implode(\"\", $g), 0, -1);\n print $h;\n }\n elseif(count($d) == \"2\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n array_push($f, \"2 popStack popQueue\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = substr(implode(\"\", $g), 0, -1);\n print $h;\n }\n elseif(count($d) >= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n $f[$e[2]] = \"pushFront\" . \"\\n\";\n array_push($f, \"3 popStack popQueue popFront\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = substr(implode(\"\", $g), 0, -1);\n print $h;\n }\n }\n $d = array();\n $f = array();\n $g = array();\n }\n }\n else\n {\n if($x != $a)\n {\n $d[$c] = $b;\n $c++;\n }\n else\n {\n array_push($d, $b);\n $f = array_fill(0, count($d), \"pushBack\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": "= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\");\n $f[$e[0]] = \"pushStack\";\n $f[$e[1]] = \"pushQueue\";\n $f[$e[2]] = \"pushFront\";\n array_push($f, \"3 popStack popQueue popFront\");\n $g = array_merge($g, $f);\n }\n $d = array();\n $f = array();\n }\n }\n else\n {\n array_push($d, $b);\n $c++;\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n print $g[$x] . \"\\n\";\n}\nprint $g[$x];\n?>"}, {"source_code": "= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n $f[$e[2]] = \"pushFront\" . \"\\n\";\n array_push($f, \"3 popStack popQueue popFront\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n }\n else\n {\n $c = 0;\n if(count($d) == \"1\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n array_push($f, \"1 popStack\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = substr(implode(\"\", $g), 0, -3);\n print $h;\n }\n elseif(count($d) == \"2\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n array_push($f, \"2 popStack popQueue\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = substr(implode(\"\", $g), 0, -3);\n print $h;\n }\n elseif(count($d) >= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\" . \"\\n\");\n $f[$e[0]] = \"pushStack\" . \"\\n\";\n $f[$e[1]] = \"pushQueue\" . \"\\n\";\n $f[$e[2]] = \"pushFront\" . \"\\n\";\n array_push($f, \"3 popStack popQueue popFront\" . \"\\n\");\n $g = array_merge($g, $f);\n $h = substr(implode(\"\", $g), 0, -3);\n print $h;\n }\n }\n $d = array();\n $f = array();\n $g = array();\n }\n }\n else\n {\n if($x != $a)\n {\n $d[$c] = $b;\n $c++;\n }\n else\n {\n array_push($d, $b);\n $f = array_fill(0, count($d), \"pushBack\");\n $g = array_merge($g, $f);\n $h = implode(\"\", $g);\n print $h;\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": "= \"3\")\n {\n rsort($d);\n $f = array_fill(0, count($d), \"pushBack\");\n $d[0] = \"pushStack\";\n $d[1] = \"pushQueue\";\n $d[2] = \"pushFront\";\n array_push($f, \"3 popStack popQueue popFront\");\n $g = array_merge($g, $f);\n }\n $d = array();\n $f = array();\n }\n }\n else\n {\n if($x != $a)\n {\n $d[$c] = $b;\n $c++;\n }\n else\n {\n array_push($d, $b);\n $f = array_fill(0, count($d), \"pushBack\");\n $g = array_merge($g, $f);\n }\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n print $g[$x] . \"\\n\";\n}\nprint $g[$x];\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\");\n $f[$e[0]] = \"pushStack\";\n $f[$e[1]] = \"pushQueue\";\n $f[$e[2]] = \"pushFront\";\n array_push($f, \"3 popStack popQueue popFront\");\n $g = array_merge($g, $f);\n }\n $d = array();\n $f = array();\n }\n }\n else\n {\n if($x != $a)\n {\n $d[$c] = $b;\n $c++;\n }\n else\n {\n array_push($d, $b);\n $f = array_fill(0, count($d), \"pushBack\");\n $g = array_merge($g, $f);\n }\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n print $g[$x] . \"\\n\";\n}\nprint $g[$x];\n?>"}, {"source_code": "= \"3\")\n {\n arsort($d);\n $e = array_keys($d);\n $f = array_fill(0, count($d), \"pushBack\");\n $f[$e[0]] = \"pushStack\";\n $f[$e[1]] = \"pushQueue\";\n $f[$e[2]] = \"pushFront\";\n array_push($f, \"3 popStack popQueue popFront\");\n $g = array_merge($g, $f);\n }\n $d = array();\n $f = array();\n }\n }\n else\n {\n if($x != $a)\n {\n $d[$c] = $b;\n $c++;\n }\n else\n {\n array_push($d, $b);\n $f = array_fill(0, count($d), \"pushBack\");\n $g = array_merge($g, $f);\n }\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n print $g[$x] . \"\\n\";\n}\nprint $g[$x];\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n$f = file('php://stdin',FILE_IGNORE_NEW_LINES);\ndefine('L',PHP_EOL);\n//-----------------------\n\n/*\n\n pushStack \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0435\u043a\u0430;\t\tarray_push ( array &$array , mixed $var\n pushQueue \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0435\u0446 \u043e\u0447\u0435\u0440\u0435\u0434\u0438;\tarray_push ( array &$array , mixed $var\n pushFront \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u0435\u043a\u0430;\t\tarray_unshift ( array &$array , mixed $var \n pushBack \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0434\u0435\u043a\u0430. \t\tarray_push ( array &$array , mixed $var\n\n popStack \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0435\u043a\u0430;\t\tarray_pop ( array &$array )\n popQueue \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438;\tmixed array_shift ( array &$array )\n popFront \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0435\u043a\u0430;\t\tmixed array_shift ( array &$array )\n popBack \u2014 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u043a\u043e\u043d\u0446\u0430 \u0434\u0435\u043a\u0430. \t\tarray_pop ( array &$array )\n\n*/\n\n$x = $f[0];\n\n$stek = $dek = $och = array();\n$q = array('stek'=>0,'dek'=>0,'och'=>0);\n\nfor($i=1;$i<=$x;$i++) {\n\tif ($f[$i]==0) {\n\t\tarsort($q);\n\t\t$comms = 0;\n\t\t$str = '';\n\n\t\tforeach ($q as $var=>$n) if ($n) {\n\t\t\t$comms++;\n\t\t\tswitch ($var) {\n\t\t\t\tcase 'stek':\n\t\t\t\t\t$str .= ' popStack';\n\t\t\t\t\tarray_pop($stek);\n\t\t\t\tbreak;\n\t\t\t\tcase 'dek':\n\t\t\t\t\tif ($dek[0] > $dek[$q['dek']-1]) {\n\t\t\t\t\t\t$str .= ' popFront';\n\t\t\t\t\t\tarray_shift($dek);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$str .= ' popBack';\n\t\t\t\t\t\tarray_pop($dek);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'och':\n\t\t\t\t\t$str .= ' popQueue';\n\t\t\t\t\tarray_shift($och);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$q[$var]--;\n\t\t}\n\n\t\t$stek = $dek = $och = array();\n\t\t$q = array('stek'=>0,'dek'=>0,'och'=>0);\n\n\n\t\techo $comms.$str.L;\n\t} else {\n\t\tasort($q);\n\t\t$kiss = $f[$i];\n\t\t$var = key($q);\n\n\t\tif ($q[$var]==0) {\n\t\t\tswitch ($var) {\n\t\t\t\tcase 'stek':\n\t\t\t\t\t$str = 'pushStack';\n\t\t\t\t\tarray_push($stek,$kiss);\n\t\t\t\tbreak;\n\t\t\t\tcase 'dek':\n\t\t\t\t\t$str = 'pushFront';\n\t\t\t\t\tarray_unshift($dek,$kiss);\n\t\t\t\tbreak;\n\t\t\t\tcase 'och':\n\t\t\t\t\t$str = 'pushQueue';\n\t\t\t\t\tarray_push($och,$kiss);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$q[$var]++;\t\t\t\n\t\t} else {\n\n\t\t\tif ($kiss > $stek[$q['stek']-1]) {\n\t\t\t\t$str = 'pushStack';\n\t\t\t\tarray_push($stek,$kiss);\n\t\t\t\t$q['stek']++;\n\t\t\t} else {\n\t\t\t\tif ($kiss < $och[0]) {\n\t\t\t\t\t$str = 'pushQueue';\n\t\t\t\t\tarray_push($och,$kiss);\n\t\t\t\t\t$q['och']++;\n\t\t\t\t} else {\n\t\t\t\t\tif ($kiss > $dek[0] && $kiss > $dek[$q['dek']-1]) {\n\t\t\t\t\t\tif ($dek[0] < $dek[$q['dek']-1]) {\n\t\t\t\t\t\t\tarray_unshift($dek,$kiss);\n\t\t\t\t\t\t\t$str = 'pushFront';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tarray_push($dek,$kiss);\n\t\t\t\t\t\t\t$str = 'pushBack';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} elseif ($kiss > $dek[0] && $kiss < $dek[$q['dek']-1]) {\n\t\t\t\t\t\tarray_unshift($dek,$kiss);\n\t\t\t\t\t\t$str = 'pushFront';\n\t\t\t\t\t} elseif ($kiss < $dek[0] && $kiss > $dek[$q['dek']-1]) {\n\t\t\t\t\t\tarray_push($dek,$kiss);\n\t\t\t\t\t\t$str = 'pushBack';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($dek[0] < $dek[$q['dek']-1]) {\n\t\t\t\t\t\t\tarray_push($dek,$kiss);\n\t\t\t\t\t\t\t$str = 'pushBack';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tarray_unshift($dek,$kiss);\n\t\t\t\t\t\t\t$str = 'pushFront';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$q['dek']++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\n\n\t\t\n\n\t\techo $str.L;\n\t}\n}\n"}, {"source_code": "\n$f = file('php://stdin',FILE_IGNORE_NEW_LINES);\ndefine('L',PHP_EOL);\n//-----------------------\n\n$x = $f[0];\n\n$stek = $dek = $och = array();\n\n$q = array('stek'=>0,'dek'=>0,'och'=>0);\n\nfor($i=1;$i<=$x;$i++) {\n\tif ($f[$i]==0) {\n\t\tarsort($q);\n\t\t$comms = 0;\n\t\t$str = '';\n\n\t\tforeach ($q as $var=>$n) if ($n) {\n\t\t\t$comms++;\n\t\t\tswitch ($var) {\n\t\t\t\tcase 'stek':\n\t\t\t\t\t$str .= ' popStack';\n\t\t\t\t\tarray_pop($stek);\n\t\t\t\tbreak;\n\t\t\t\tcase 'dek':\n\t\t\t\t\t$str .= ' popBack';\n\t\t\t\t\tarray_pop($dek);\n\t\t\t\tbreak;\n\t\t\t\tcase 'och':\n\t\t\t\t\t$str .= ' popQueue';\n\t\t\t\t\tarray_shift($och);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$q[$var]--;\n\t\t}\n\n\t\techo $comms.$str.L;\n\t} else {\n\t\tasort($q);\n\t\t$var = key($q);\n\t\tswitch ($var) {\n\t\t\tcase 'stek':\n\t\t\t\t$str = 'pushStack';\n\t\t\t\tarray_push($stek,$var);\n\t\t\tbreak;\n\t\t\tcase 'dek':\n\t\t\t\t$str = 'pushFront';\n\t\t\t\tarray_unshift($dek,$var);\n\t\t\tbreak;\n\t\t\tcase 'och':\n\t\t\t\t$str = 'pushQueue';\n\t\t\t\tarray_push($och,$var);\n\t\t\tbreak;\n\t\t}\n\n\t\t$q[$var]++;\n\n\t\techo $str.L;\n\t}\n}"}, {"source_code": "\n$f = file('php://stdin',FILE_IGNORE_NEW_LINES);\ndefine('L',PHP_EOL);\n//-----------------------\n\n$x = $f[0];\n\n$a = array();\n\n$_in = array('pushQueue','pushStack','pushFront');\n$_out = array(' popQueue',' popStack',' popFront');\n\nfor($i=1;$i<=$x;$i++) {\n\tif ($f[$i]==0) {\n\n\t\t$b = $a;\n\t\tarsort($b);\n\t\t\n\t\t$b = array_keys(array_slice($b,0,3,true));\n\n\t\t$j = 0;\n\n\t\tforeach ($a as $k=>$kiss) {\n\t\t\tif ($j<3 && in_array($k,$b)) {\n\t\t\t\t$str .= $_in[$j++];\n\t\t\t} else {\n\t\t\t\t$str .= 'pushBack';\n\t\t\t}\n\t\t\t$str .= L;\n\t\t}\n\n\t\t$str .= $j;\n\n\t\tfor ($c=0;$c<$j;$c++) {\n\t\t\t$str .= $_out[$c];\n\t\t}\n\n\t\t$str .= L;\n\n\t\t$a = array();\n\n\t} else {\n\t\t$a[] = $f[$i];\n\t}\n}\n\necho $str;"}], "src_uid": "07ae50199dd94f72313ee7675fefadb7"} {"source_code": "= $a - 1)\n {\n $j = 1;\n break;\n }\n}\nif($j == 1)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": "= $a - 1)\n {\n $j = 1;\n break;\n }\n}\nif($j == 1)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": ""}], "src_uid": "d504d894b2f6a830c4d3b4edc54395be"} {"source_code": " $c[$f])\n {\n $j = $f;\n $k = count($c);\n for($y = $j; $y < $k + $j; $y++)\n {\n if($g < $c[$f])\n {\n if(count($c) <= $b)\n {\n $i += $h;\n $c[$d] = $i;\n $d++;\n print \" \";\n printf(\"%.0f\", $i);\n }\n else\n {\n print \" -1\";\n }\n break;\n }\n elseif($g == $c[$f])\n {\n unset($c[$f]);\n $f++;\n $i += $h;\n $c[$d] = $i;\n $d++;\n print \" \";\n printf(\"%.0f\", $i);\n break;\n }\n elseif($g > $c[$f])\n {\n unset($c[$f]);\n $f++;\n }\n if(count($c) == 0)\n {\n $i = $g + $h;\n $c[$d] = $i;\n $d++;\n print \" \";\n printf(\"%.0f\", $i);\n break;\n }\n }\n }\n }\n}\n?>", "positive_code": [{"source_code": "=$c_t) {\n\t\t$c_t=bcadd($t, $d);\n\t\t$q=array();\n\t\t$q[]=$c_t;\n\t\t$q_count=1;\n\t\t$head=0;\n\t\t\n\t\t$this_t=$c_t;\n\t\t\n\t} else {\n\t\t//remove finished queries from queue\n\t\twhile($q_count>0 && $q[$head]<=$t) {\n\t\t\tunset($q[$head]);\n\t\t\t$head++;\n\t\t\t$q_count--;\n\t\t}\n\t\t\n\t\tif($q_count===0) {\n\t\t\t$q=array();\n\t\t\t$head=0;\n\t\t}\n\n\t\tif($q_count<$b+1) {\t\n\t\t\t$c_t=bcadd($c_t, $d);\n\t\t\t$q[]=$c_t;\n\t\t\t$q_count++;\n\t\t\t$this_t=$c_t;\n\t\t} else {\n\t\t\t$this_t=-1;\n\t\t}\n\t}\n\t\n\techo $this_t;\n\tif($i<$n-1)\n\t\techo ' ';\n\t\n}"}], "negative_code": [{"source_code": "= $e)\n {\n $c[$x] = $f + $g;\n $e = $f + $g;\n $h[$x] = $e;\n $i = $x;\n }\n else\n {\n $d++;\n $c[$x] = $e + $g;\n $e += $g;\n $h[$x] = $e;\n }\n }\n elseif($d < $b)\n {\n if($f >= $e)\n {\n $d = 0;\n $c[$x] = $f + $g;\n $e = $f + $g;\n $h[$x] = $e;\n $i = $x;\n }\n else\n {\n $d++;\n $c[$x] = $e + $g;\n $e += $g;\n $h[$x] = $e;\n }\n }\n elseif($d == $b)\n {\n if($f < $h[$i])\n {\n $c[$x] = \"-1\";\n }\n elseif(($f >= $h[$i]) && ($f < $h[count($h) - 1]))\n {\n $j = $i;\n while(TRUE)\n {\n if($f < $h[$j])\n {\n break;\n }\n else\n {\n $j++;\n }\n }\n $i = $j;\n if($h[$j - 1] == $f)\n {\n $d += $i;\n }\n $h[$j - 1] = $f;\n $d -= $i;\n $c[$x] = $e + $g;\n $e += $g;\n }\n elseif($f >= $h[count($h) - 1])\n {\n $d = 0;\n $c[$x] = $f + $g;\n $e = $f + $g;\n $h[$x] = $e;\n $i = $x;\n }\n }\n elseif($d > $b)\n {\n $c[$x] = \"-1\";\n }\n}\nprint implode(\" \", $c);\n?>"}, {"source_code": " $c[$f])\n {\n $j = $f;\n $k = $c;\n for($y = $j; $y < count($k) + $j; $y++)\n {\n if($g < $c[$f])\n {\n if(count($c) <= $b)\n {\n $i += $h;\n $c[$d] = $i;\n $d++;\n $e .= $i . \" \";\n }\n else\n {\n $e .= \"-1 \";\n }\n }\n elseif($g == $c[$f])\n {\n unset($c[$f]);\n $f++;\n $i += $h;\n $c[$d] = $i;\n $d++;\n $e .= $i . \" \";\n break;\n }\n elseif($g > $c[$f])\n {\n unset($c[$f]);\n $f++;\n }\n if(count($c) == 0)\n {\n $i = $g + $h;\n $c[$d] = $i;\n $d++;\n $e .= $i . \" \";\n break;\n }\n }\n }\n }\n}\nprint trim($e);\n?>"}, {"source_code": " $c[$f])\n {\n $j = $f;\n $k = count($c);\n for($y = $j; $y < $k + $j; $y++)\n {\n if($g < $c[$f])\n {\n if(count($c) <= $b)\n {\n $i += $h;\n $c[$d] = $i;\n $d++;\n print \" \" . $i;\n }\n else\n {\n print \" -1\";\n }\n break;\n }\n elseif($g == $c[$f])\n {\n unset($c[$f]);\n $f++;\n $i += $h;\n $c[$d] = $i;\n $d++;\n print \" \" . $i;\n break;\n }\n elseif($g > $c[$f])\n {\n unset($c[$f]);\n $f++;\n }\n if(count($c) == 0)\n {\n $i = $g + $h;\n $c[$d] = $i;\n $d++;\n print \" \" . $i;\n break;\n }\n }\n }\n }\n}\n?>"}, {"source_code": " $c[$f])\n {\n $j = $f;\n $k = $c;\n for($y = $j; $y < count($k) + $j; $y++)\n {\n if($g < $c[$f])\n {\n if(count($c) <= $b)\n {\n $i += $h;\n $c[$d] = $i;\n $d++;\n $e .= $i . \" \";\n }\n else\n {\n $e .= \"-1 \";\n }\n }\n elseif($g == $c[$f])\n {\n unset($c[$f]);\n $f++;\n $i += $h;\n $c[$d] = $i;\n $d++;\n $e .= $i . \" \";\n }\n elseif($g > $c[$f])\n {\n unset($c[$f]);\n $f++;\n }\n if(count($c) == 0)\n {\n $i = $g + $h;\n $c[$d] = $i;\n $d++;\n $e .= $i . \" \";\n break;\n }\n }\n }\n }\n}\nprint trim($e);\n?>"}, {"source_code": "=$c_t) {\n\t\t$c_t=$t+$d;\n\t\t$q=array();\n\t\t$q[]=$c_t;\n\t\t$q_count=1;\n\t\t$head=0;\n\t\t\n\t\t$this_t=$c_t;\n\t\t\n\t} else {\n\t\t//remove finished queries from queue\n\t\twhile($q_count>0 && $q[$head]<=$t) {\n\t\t\tunset($q[$head]);\n\t\t\t$head++;\n\t\t\t$q_count--;\n\t\t}\n\t\t\n\t\tif($q_count===0) {\n\t\t\t$q=array();\n\t\t\t$head=0;\n\t\t}\n\n\t\tif($q_count<$b+1) {\t\n\t\t\t$c_t=$c_t+$d;\n\t\t\t$q[]=$c_t;\n\t\t\t$q_count++;\n\t\t\t$this_t=$c_t;\n\t\t} else {\n\t\t\t$this_t=-1;\n\t\t}\n\t}\n\t\n\techo $this_t;\n\tif($i<$n-1)\n\t\techo ' ';\n\t\n}"}], "src_uid": "5981594b2d6d1077ce2249b641d18f10"} {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\n$d = $c[4];\n$c[1] -= $c[4];\n$c[2] -= $c[4];\n$c[4] -= $c[4];\n$g = 0;\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\n$e = $c[3];\n$c[1] -= $c[3];\n$c[6] -= $c[3];\n$c[3] -= $c[3];\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\n$f = $c[1];\n$c[2] -= $c[1];\n$c[6] -= $c[1];\n$c[1] -= $c[1];\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\nif(($g == 0) && (array_sum($c) == 0))\n{\n for($x = 1; $x <= $d; $x++)\n {\n print \"1 2 4\\n\";\n }\n for($x = 1; $x <= $e; $x++)\n {\n print \"1 3 6\\n\";\n }\n for($x = 1; $x <= $f; $x++)\n {\n print \"1 2 6\\n\";\n }\n}\nelse\n{\n print \"-1\";\n}\n?>"}], "negative_code": [{"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 6 => 0);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\n$d = $c[4];\n$c[1] -= $c[4];\n$c[2] -= $c[4];\n$c[4] -= $c[4];\n$e = $c[3];\n$c[1] -= $c[3];\n$c[6] -= $c[3];\n$c[3] -= $c[3];\n$f = $c[1];\n$c[2] -= $c[1];\n$c[6] -= $c[1];\n$c[1] -= $c[1];\n$g = 0;\nif($c[1] != 0)\n{\n $g = 1;\n}\nif($c[2] != 0)\n{\n $g = 1;\n}\nif($c[3] != 0)\n{\n $g = 1;\n}\nif($c[4] != 0)\n{\n $g = 1;\n}\nif($c[6] != 0)\n{\n $g = 1;\n}\nif($g == 0)\n{\n for($x = 1; $x <= $d; $x++)\n {\n print \"1 2 4\\n\";\n }\n for($x = 1; $x <= $e; $x++)\n {\n print \"1 3 6\\n\";\n }\n for($x = 1; $x <= $f; $x++)\n {\n print \"1 2 6\\n\";\n }\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 6 => 0, 7 => 0);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\n$d = $c[4];\n$c[1] -= $c[4];\n$c[2] -= $c[4];\n$c[4] -= $c[4];\n$e = $c[3];\n$c[1] -= $c[3];\n$c[6] -= $c[3];\n$c[3] -= $c[3];\n$f = $c[1];\n$c[2] -= $c[1];\n$c[6] -= $c[1];\n$c[1] -= $c[1];\n$g = 0;\nif($c[1] != 0)\n{\n $g = 1;\n}\nif($c[2] != 0)\n{\n $g = 1;\n}\nif($c[3] != 0)\n{\n $g = 1;\n}\nif($c[4] != 0)\n{\n $g = 1;\n}\nif($c[6] != 0)\n{\n $g = 1;\n}\nif($c[7] != 0)\n{\n $g = 1;\n}\nif($g == 0)\n{\n for($x = 1; $x <= $d; $x++)\n {\n print \"1 2 4\\n\";\n }\n for($x = 1; $x <= $e; $x++)\n {\n print \"1 3 6\\n\";\n }\n for($x = 1; $x <= $f; $x++)\n {\n print \"1 2 6\\n\";\n }\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\n$d = $c[4];\n$c[1] -= $c[4];\n$c[2] -= $c[4];\n$c[4] -= $c[4];\n$g = 0;\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\n$e = $c[3];\n$c[1] -= $c[3];\n$c[6] -= $c[3];\n$c[3] -= $c[3];\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\n$f = $c[1];\n$c[2] -= $c[1];\n$c[6] -= $c[1];\n$c[1] -= $c[1];\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\nif(($g == 0) && ($d != 0) && ($e != 0) && ($f != 0))\n{\n for($x = 1; $x <= $d; $x++)\n {\n print \"1 2 4\\n\";\n }\n for($x = 1; $x <= $e; $x++)\n {\n print \"1 3 6\\n\";\n }\n for($x = 1; $x <= $f; $x++)\n {\n print \"1 2 6\\n\";\n }\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\n$d = $c[4];\n$c[1] -= $c[4];\n$c[2] -= $c[4];\n$c[4] -= $c[4];\n$g = 0;\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\n$e = $c[3];\n$c[1] -= $c[3];\n$c[6] -= $c[3];\n$c[3] -= $c[3];\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\n$f = $c[1];\n$c[2] -= $c[1];\n$c[6] -= $c[1];\n$c[1] -= $c[1];\nif($c[1] < 0)\n{\n $g = 1;\n}\nif($c[2] < 0)\n{\n $g = 1;\n}\nif($c[3] < 0)\n{\n $g = 1;\n}\nif($c[4] < 0)\n{\n $g = 1;\n}\nif($c[5] < 0)\n{\n $g = 1;\n}\nif($c[6] < 0)\n{\n $g = 1;\n}\nif($c[7] < 0)\n{\n $g = 1;\n}\nif($g == 0)\n{\n for($x = 1; $x <= $d; $x++)\n {\n print \"1 2 4\\n\";\n }\n for($x = 1; $x <= $e; $x++)\n {\n print \"1 3 6\\n\";\n }\n for($x = 1; $x <= $f; $x++)\n {\n print \"1 2 6\\n\";\n }\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 6 => 0);\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\n$d = $c[4];\n$c[1] -= $c[4];\n$c[2] -= $c[4];\n$c[4] -= $c[4];\n$e = $c[3];\n$c[1] -= $c[3];\n$c[6] -= $c[3];\n$c[3] -= $c[3];\n$f = $c[1];\n$c[2] -= $c[1];\n$c[6] -= $c[1];\n$c[1] -= $c[1];\n$g = array_sum($c);\nif($g == 0)\n{\n for($x = 1; $x <= $d; $x++)\n {\n print \"1 2 4\\n\";\n }\n for($x = 1; $x <= $e; $x++)\n {\n print \"1 3 6\\n\";\n }\n for($x = 1; $x <= $f; $x++)\n {\n print \"1 2 6\\n\";\n }\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": "= 0) && ($i >= 0))\n{\n $j = 1;\n}\nelseif(($h < 0) && ($i < 0))\n{\n $j = 2;\n}\nelseif(($h >= 0) && ($i < 0))\n{\n $j = 3;\n}\nelseif(($h < 0) && ($i >= 0))\n{\n $j = 4;\n}\nif($h == 0)\n{\n $k = 1;\n}\nif($i == 0)\n{\n $l = 1;\n}\nfor($x = 1; $x <= $a; $x++)\n{\n if($j == 1)\n {\n if(($g[$x] == \"E\") && ($k == 0))\n {\n $h--;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"N\") && ($l == 0))\n {\n $i--;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 2)\n {\n if(($g[$x] == \"W\") && ($k == 0))\n {\n $h++;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"S\") && ($l == 0))\n {\n $i++;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 3)\n {\n if(($g[$x] == \"E\") && ($k == 0))\n {\n $h--;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"S\") && ($l == 0))\n {\n $i++;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 4)\n {\n if(($g[$x] == \"W\") && ($k == 0))\n {\n $h++;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"N\") && ($l == 0))\n {\n $i--;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n}\nif($n == 1)\n{\n print $m;\n}\nelse\n{\n print \"-1\";\n}\n?>", "positive_code": [{"source_code": " 0)\n $exp[1]++;\n break;\n case 'S':\n if($exp[2] - $exp[4] > 0)\n $exp[2]--;\n break;\n case 'W':\n if($exp[1] - $exp[3] > 0)\n $exp[1]--;\n break;\n case 'N':\n if($exp[4] - $exp[2] > 0)\n $exp[2]++;\n break;\n }\n if($exp[1] == $exp[3] && $exp[2] == $exp[4]){\n echo $i + 1;\n exit;\n }\n}\necho -1;\nexit;"}, {"source_code": " 0, \n 'W' => 0, \n 'E' => 0,\n 'N' => 0\n );\n $c = 1;\n $flag = TRUE;\n if(check($sx, $sy, $ex, $ey, $cnt)){\n echo 0;\n exit;\n }\n foreach($arr as $a){\n\n $cnt[$a] += 1;\n if(check($sx, $sy, $ex, $ey,$cnt)){\n $flag = FALSE;\n break;\n }\n $c++;\n }\n \n if($flag == TRUE){\n echo -1;\n }\n else{\n echo $c;\n }\n\n function check($sx, $sy, $ex, $ey, $cnt){\n \n $flag1 = FALSE;\n $flag2 = FALSE;\n if($ex - $sx >= 0 && $cnt['E'] >= ($ex - $sx)){\n\n $flag1 = TRUE;\n }\n if($sx - $ex >= 0 && $cnt['W'] >= ($sx - $ex)){\n \n $flag1 = TRUE;\n }\n\n if($ey - $sy >= 0 && $cnt['N'] >= ($ey - $sy)){\n\n $flag2 = TRUE;\n }\n if($sy - $ey >= 0 && $cnt['S'] >= ($sy - $ey)){\n \n $flag2 = TRUE;\n }\n\n if($flag1 && $flag2) return TRUE;\n return FALSE;\n }\n?>\n"}, {"source_code": " 0) {$e = $xd;} else {$w = -$xd;}\nif ($yd > 0) {$n = $yd;} else {$s = -$yd;}\n\n$raw = g();\n$str = $raw[0];\nfor ($i = 0; $i < $t; $i++) {\n\t$wind = substr($str, $i, 1);\n\tswitch ($wind) {\n\t\tcase \"N\":\n\t\t\t$n--;\n\t\t\tbreak;\n\t\tcase \"E\":\n\t\t\t$e--;\n\t\t\tbreak;\n\t\tcase \"S\":\n\t\t\t$s--;\n\t\t\tbreak;\n\t\tcase \"W\":\n\t\t\t$w--;\n\t\t\tbreak;\n\t}\n\tif (check()) {\n\t\techo $i+1;\n\t\texit;\n\t}\n}\necho \"-1\";\n\nfunction check() {\n\tglobal $n, $e, $s, $w;\n\tif (($n <= 0) && ($e <= 0) && ($s <= 0) && ($w <= 0)) {return true;} else {return false;}\n}\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}], "negative_code": [{"source_code": "= 0) && ($i >= 0))\n{\n $j = 1;\n}\nelseif(($h < 0) && ($i < 0))\n{\n $j = 2;\n}\nelseif(($h >= 0) && ($i < 0))\n{\n $j = 3;\n}\nelseif(($h < 0) && ($i >= 0))\n{\n $j = 4;\n}\nif($h == 0)\n{\n $k = 1;\n}\nif($i == 0)\n{\n $l = 1;\n}\nfor($x = 1; $x <= $a; $x++)\n{\n if($j == 1)\n {\n if(($g[$x] == \"E\") && ($k == 0))\n {\n $h--;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"N\") && ($l == 0))\n {\n $i--;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 2)\n {\n if(($g[$x] == \"W\") && ($k == 0))\n {\n $h++;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"S\") && ($l == 0))\n {\n $i++;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 3)\n {\n if(($g[$x] == \"E\") && ($k == 0))\n {\n $h--;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"S\") && ($l == 0))\n {\n $i++;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 4)\n {\n if(($g[$x] == \"W\") && ($k == 0))\n {\n $h++;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"N\") && ($l == 0))\n {\n $i--;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n}\nif($n == 1)\n{\n print $m;\n}\nelse\n{\n print $m;\n}\n?>"}, {"source_code": "= 0) && ($i >= 0))\n{\n $j = 1;\n}\nelseif(($h < 0) && ($i < 0))\n{\n $j = 2;\n}\nelseif(($h >= 0) && ($i < 0))\n{\n $j = 3;\n}\nelseif(($h < 0) && ($i >= 0))\n{\n $j = 4;\n}\nfor($x = 1; $x <= $a; $x++)\n{\n if($j == 1)\n {\n if(($g[$x] == \"E\") && ($k == 0))\n {\n $h--;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"N\") && ($l == 0))\n {\n $i--;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 2)\n {\n if(($g[$x] == \"W\") && ($k == 0))\n {\n $h++;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"S\") && ($l == 0))\n {\n $i++;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 3)\n {\n if(($g[$x] == \"E\") && ($k == 0))\n {\n $h--;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"S\") && ($l == 0))\n {\n $i++;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n elseif($j == 4)\n {\n if(($g[$x] == \"W\") && ($k == 0))\n {\n $h++;\n if($h == 0)\n {\n $k = 1;\n }\n }\n elseif(($g[$x] == \"N\") && ($l == 0))\n {\n $i--;\n if($i == 0)\n {\n $l = 1;\n }\n }\n if(($k == 1) && ($l == 1))\n {\n $m = $x;\n $n = 1;\n break;\n }\n }\n}\nif($n == 1)\n{\n print $m;\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": " 0) {$e = $xd;} else {$w = -$xd;}\nif ($yd > 0) {$n = $yd;} else {$s = -$yd;}\n\n$raw = g();\n$str = $raw[0];\nfor ($i = 0; $i < $t; $i++) {\n\t$wind = substr($str, $i, 1);\n\tswitch ($wind) {\n\t\tcase \"N\":\n\t\t\t$n--;\n\t\t\tbreak;\n\t\tcase \"E\":\n\t\t\t$e--;\n\t\t\tbreak;\n\t\tcase \"S\":\n\t\t\t$s--;\n\t\t\tbreak;\n\t\tcase \"W\":\n\t\t\t$w--;\n\t\t\tbreak;\n\t}\n\tif (check()) {\n\t\techo $i+1;\n\t\texit;\n\t}\n}\necho \"-1\";\necho \"\\n $n $e $s $w\";\n\nfunction check() {\n\tglobal $n, $e, $s, $w;\n\tif (($n <= 0) && ($e <= 0) && ($s <= 0) && ($w <= 0)) {return true;} else {return false;}\n}\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}, {"source_code": " 0)\n $exp[1]++;\n break;\n case 'S':\n if($exp[2] - $exp[4] > 0)\n $exp[2]++;\n break;\n case 'W':\n if($exp[1] - $exp[3] > 0)\n $exp[1]++;\n break;\n case 'N':\n if($exp[4] - $exp[2] > 0)\n $exp[2]++;\n break;\n }\n if($exp[1] == $exp[3] && $exp[2] == $exp[4]){\n echo $i + 1;\n exit;\n }\n}\necho -1;\nexit;"}, {"source_code": " 0)\n $exp[1]++;\n break;\n case 'S':\n if($exp[2] - $exp[4] > 0)\n $exp[2]++;\n break;\n case 'W':\n if($exp[1] - $exp[3] > 0)\n $exp[1]++;\n break;\n case 'N':\n if($exp[4] - $exp[2] > 0)\n $exp[2]++;\n break;\n }\n if($exp[1] == $exp[3] && $exp[2] == $exp[4]){\n echo $i + 1;\n exit;\n }\n}\necho -1;\nexit;"}, {"source_code": " 0, \n 'W' => 0, \n 'E' => 0,\n 'N' => 0\n );\n $c = 0;\n $flag = TRUE;\n foreach($arr as $a){\n\n if(check($sx, $sy, $ex, $ey,$cnt)){\n $flag = FALSE;\n break;\n }\n $cnt[$a] += 1;\n $c++;\n }\n \n if($flag == TRUE){\n echo -1;\n }\n else{\n echo $c;\n }\n\n function check($sx, $sy, $ex, $ey, $cnt){\n \n $flag1 = FALSE;\n $flag2 = FALSE;\n if($ex - $sx >= 0 && $cnt['E'] >= ($ex - $sx)){\n\n $flag1 = TRUE;\n }\n if($sx - $ex >= 0 && $cnt['W'] >= ($sx - $ex)){\n \n $flag1 = TRUE;\n }\n\n if($ey - $sy >= 0 && $cnt['N'] >= ($ey - $sy)){\n\n $flag2 = TRUE;\n }\n if($sy - $ey >= 0 && $cnt['S'] >= ($sy - $ey)){\n \n $flag2 = TRUE;\n }\n\n if($flag1 && $flag2) return TRUE;\n return FALSE;\n }\n?>\n"}, {"source_code": " 0, \n 'W' => 0, \n 'E' => 0,\n 'N' => 0\n );\n $c = 1;\n $flag = TRUE;\n foreach($arr as $a){\n\n $cnt[$a] += 1;\n if(check($sx, $sy, $ex, $ey,$cnt)){\n $flag = FALSE;\n break;\n }\n $c++;\n }\n \n if($flag == TRUE){\n echo -1;\n }\n else{\n echo $c;\n }\n\n function check($sx, $sy, $ex, $ey, $cnt){\n \n $flag1 = FALSE;\n $flag2 = FALSE;\n if($ex - $sx > 0 && $cnt['E'] >= ($ex - $sx)){\n\n $flag1 = TRUE;\n }\n if($sx - $ex > 0 && $cnt['W'] >= ($sx - $ex)){\n \n $flag1 = TRUE;\n }\n\n if($ey - $sy > 0 && $cnt['N'] >= ($ey - $sy)){\n\n $flag2 = TRUE;\n }\n if($sy - $ey > 0 && $cnt['S'] >= ($sy - $ey)){\n \n $flag2 = TRUE;\n }\n\n if($flag1 && $flag2) return TRUE;\n return FALSE;\n }\n?>\n"}], "src_uid": "aa31a2a1ad1575aee051ddee8642c53a"} {"source_code": "= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n elseif($f < $i)\n {\n $f2 = $f;\n $f += $i - $f;\n for($y = $f2; $y < $i; $y++)\n {\n $c += $h;\n $e .= $g;\n if($c == $d)\n {\n break;\n }\n }\n if($c == $d)\n {\n break;\n }\n if((($c >= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n elseif($f > $i)\n {\n $l = 1;\n }\n if($c == $d)\n {\n break;\n }\n}\nif($l == 1)\n{\n $l = 0;\n $f += $i - $i2 - 1;\n for($y = $i2; $y < $f; $y++)\n {\n $c += $h;\n $e .= $g;\n if($c == $d)\n {\n $l = 2;\n break;\n }\n }\n}\nif($c != $d)\n{\n $m = abs($c - $d);\n for($x = 1; $x <= $m; $x++)\n {\n $c += $h;\n $e .= $g;\n }\n}\nprint $e;\n?>", "positive_code": [{"source_code": " $f) ? -1 : 1;\n$pt = 0;\n$time = 1;\nwhile ($s != $f) {\n\tif ($t[$pt] != $time) {$s += $dir; $res .= ($dir < 0) ? \"L\" : \"R\"; $time++;} else {\n\t\tif ((($l[$pt] <= $s) && ($s <= $r[$pt])) || (($l[$pt] <= $s+$dir) && ($s+$dir <= $r[$pt]))) {$res .= \"X\";} else {$s += $dir; $res .= ($dir < 0) ? \"L\" : \"R\";}\n\t\t$pt++; $time++;\n\t}\n}\necho $res;"}, {"source_code": "= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n elseif($f < $i)\n {\n $f2 = $f;\n $f += $i - $f;\n for($y = $f2; $y < $i; $y++)\n {\n $c += $h;\n $e .= $g;\n if($c == $d)\n {\n break;\n }\n }\n if($c == $d)\n {\n break;\n }\n if((($c >= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n if($c == $d)\n {\n break;\n }\n}\nif($c != $d)\n{\n $m = abs($c - $d);\n for($x = 1; $x <= $m; $x++)\n {\n $c += $h;\n $e .= $g;\n }\n}\nprint $e;\n?>"}], "negative_code": [{"source_code": "= min($g, $h)) && (($c + 1) <= max($g, $h)))\n {\n $e .= \"X\";\n }\n else\n {\n $e .= \"R\";\n $c++;\n if($c == $d)\n {\n break;\n }\n }\n }\n else\n {\n if((($d - 1) >= min($g, $h)) && (($d - 1) <= max($g, $h)))\n {\n $e .= \"X\";\n }\n else\n {\n $e .= \"L\";\n $d--;\n if($d == $d)\n {\n break;\n }\n }\n }\n }\n else\n {\n $i = 0;\n for($y = $x; $y < $f; $y++)\n {\n if($c < $d)\n {\n $e .= \"R\";\n $c++;\n if($c == $d)\n {\n $i = 1;\n break;\n }\n }\n else\n {\n $e .= \"L\";\n $d--;\n if($d == $d)\n {\n $i = 1;\n break;\n }\n }\n }\n if($i == 1)\n {\n break;\n }\n else\n {\n $x = $f - 1;\n }\n }\n}\nprint $e;\n?>"}, {"source_code": "= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n elseif($f < $i)\n {\n $f2 = $f;\n $f += $i - $f;\n for($y = $f2; $y < $i; $y++)\n {\n $c += $h;\n $e .= $g;\n if($c == $d)\n {\n break;\n }\n }\n if((($c >= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n elseif($f > $i)\n {\n $l = 1;\n }\n if($c == $d)\n {\n break;\n }\n}\nif($l == 1)\n{\n $l = 0;\n $f += $i - $i2 - 1;\n for($y = $i2; $y < $f; $y++)\n {\n $c += $h;\n $e .= $g;\n if($c == $d)\n {\n $l = 2;\n break;\n }\n }\n}\nprint $e;\n?>"}, {"source_code": "= min($g, $h)) && (($c + 1) <= max($g, $h)))\n {\n $e .= \"X\";\n }\n else\n {\n $e .= \"R\";\n $c++;\n if($c == $d)\n {\n break;\n }\n }\n }\n else\n {\n if((($d + 1) >= min($g, $h)) && (($d + 1) <= max($g, $h)))\n {\n $e .= \"X\";\n }\n else\n {\n $e .= \"L\";\n $d--;\n if($d == $d)\n {\n break;\n }\n }\n }\n }\n else\n {\n $i = 0;\n for($y = $x; $y < $f; $y++)\n {\n if($c < $d)\n {\n $e .= \"R\";\n $c++;\n if($c == $d)\n {\n $i = 1;\n break;\n }\n }\n else\n {\n $e .= \"L\";\n $d--;\n if($d == $d)\n {\n $i = 1;\n break;\n }\n }\n }\n if($i == 1)\n {\n break;\n }\n else\n {\n $x = $f - 1;\n }\n }\n}\nprint $e;\n?>"}, {"source_code": "= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n elseif($f < $i)\n {\n $f2 = $f;\n $f += $i - $f;\n for($y = $f2; $y < $i; $y++)\n {\n $c += $h;\n $e .= $g;\n if($c == $d)\n {\n break;\n }\n }\n if($c == $d)\n {\n break;\n }\n if((($c >= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n elseif($f > $i)\n {\n $l = 1;\n }\n if($c == $d)\n {\n break;\n }\n}\nif($l == 1)\n{\n $l = 0;\n $f += $i - $i2 - 1;\n for($y = $i2; $y < $f; $y++)\n {\n $c += $h;\n $e .= $g;\n if($c == $d)\n {\n $l = 2;\n break;\n }\n }\n}\nprint $e;\n?>"}, {"source_code": "= min($g, $h)) && ($c <= max($g, $h))) || ((($c + 1) >= min($g, $h)) && (($c + 1) <= max($g, $h))))\n {\n $e .= \"X\";\n }\n else\n {\n $e .= \"R\";\n $c++;\n if($c == $d)\n {\n break;\n }\n }\n }\n else\n {\n if(((($d >= min($g, $h)) && ($d <= max($g, $h)))) || ((($d + 1) >= min($g, $h)) && (($d + 1) <= max($g, $h))))\n {\n $e .= \"X\";\n }\n else\n {\n $e .= \"L\";\n $d--;\n if($d == $d)\n {\n break;\n }\n }\n }\n }\n else\n {\n $i = 0;\n for($y = $x; $y < $f; $y++)\n {\n if($c < $d)\n {\n $e .= \"R\";\n $c++;\n if($c == $d)\n {\n $i = 1;\n break;\n }\n }\n else\n {\n $e .= \"L\";\n $d--;\n if($d == $d)\n {\n $i = 1;\n break;\n }\n }\n }\n if($i == 1)\n {\n break;\n }\n else\n {\n $x = $f - 1;\n }\n }\n}\nprint $e;\n?>"}, {"source_code": "= $j) && ($c <= $k)) || (($c + $h >= $j) && ($c + $h <= $k)))\n {\n $e .= \"X\";\n }\n else\n {\n $c += $h;\n $e .= $g;\n }\n $f++;\n }\n else\n {\n $l = 1;\n }\n if($c == $d)\n {\n break;\n }\n}\nprint $e;\n?>"}], "src_uid": "c1c9815e2274a1f147eab7bd8ee2d574"} {"source_code": "", "positive_code": [{"source_code": " $i,\n 'sum' =>($a+$b+$c+$d),\n );\n}\narray_multisort(array_column($aPoints, 'sum'), SORT_DESC,\n array_column($aPoints, 'id'), SORT_ASC,\n $aPoints);\n \nfor($i = 0;$i< $n; $i++){\n for($j=0;$j<4;$j++){\n if($aPoints[$i]['id'] == 0){\n echo $i+1;\n break;\n }\n }\n}\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " array_sum($a),\n 'id' => $i\n );\n}\n\nfunction cmp($a, $b) {\n if ($a['sum'] == $b['sum']) {\n return $a['id'] > $b['id'] ? 1 : -1;\n }\n return ($a > $b) ? -1 : 1;\n}\n\nuasort($aCount, 'cmp');\n// print_r($aCount);\n$iCount = 0;\nforeach($aCount AS $iK => $iC) {\n $iCount++;\n if($iK === 1) {\n break;\n }\n}\n\necho $iCount;\n?>"}], "negative_code": [{"source_code": " $i,\n 'sum' => $sum,\n );\n}\nusort($aPrize, function($a, $b){\n return ($b['sum'] - $a['sum']);\n});\n$sergey = 0;\nfor($i = 0;$i< $n; $i++){\n for($j=0;$j<4;$j++){\n if($aPrize[$i]['id'] == 0 && !$sergey){\n $sergey = $i+1;\n echo $sergey;\n }\n }\n}\n"}, {"source_code": " $i,\n 'sum' =>($a+$b+$c+$d),\n );\n}\nusort($aPoints, function($a, $b){\n return ($b['sum'] - $a['sum']);\n});\n$sergey = 0;\nfor($i = 0;$i< $n; $i++){\n for($j=0;$j<4;$j++){\n if($aPoints[$i]['id'] == 0){\n $sergey = $i +1;\n break;\n }\n }\n}\necho $sergey;"}, {"source_code": " $i,\n 'sum' => $sum,\n );\n}\nusort($aPrize, function($a, $b){\n return ($b['sum'] - $a['sum']);\n});\n$sergey = 0;\nfor($i = 0;$i< $n; $i++){\n for($j=0;$j<4;$j++){\n if($aPrize[$i]['id'] == 0){\n $sergey = $i;\n }\n }\n}\necho $sergey+1;\n"}, {"source_code": " $i,\n 'sum' => $sum,\n );\n}\nusort($aPrize, function($a, $b){\n return ($b['sum'] - $a['sum']);\n});\n$sergey = 0;\nfor($i = 0;$i< $n; $i++){\n for($j=0;$j<4;$j++){\n if($aPrize[$i]['id'] == 0){\n $sergey = $i;\n }\n }\n}\necho $sergey+1;\n"}, {"source_code": " $i,\n 'sum' =>($a+$b+$c+$d),\n );\n}\nusort($aPoints, function($a, $b){\n return ($b['sum'] - $a['sum']);\n});\nfor($i = 0;$i< $n; $i++){\n for($j=0;$j<4;$j++){\n if($aPoints[$i]['id'] == 0){\n echo $i+1;\n break;\n }\n }\n}\n?>"}, {"source_code": " $b) ? -1 : 1;\n}\n\nuasort($aCount, 'cmp');\n// print_r($aCount);\n$iCount = 1;\nforeach($aCount AS $iK => $iC) {\n if($iK === 1) {\n break;\n }\n $iCount++;\n}\n\necho $iCount;\n?>"}, {"source_code": " array_sum($a),\n 'id' => $i\n );\n}\n\nfunction cmp($a, $b) {\n if ($a['sum'] == $b['sum']) {\n return $a['id'] > $b['id'] ? 1 : -1;\n }\n return ($a > $b) ? -1 : 1;\n}\n\nuasort($aCount, 'cmp');\nprint_r($aCount);\n$iCount = 0;\nforeach($aCount AS $iK => $iC) {\n $iCount++;\n if($iK === 1) {\n break;\n }\n}\n\necho $iCount;\n?>"}, {"source_code": " $iC) {\n if($iMax <= $iC) {\n $iMax = $iC;\n $iMaxIndex = $indexC;\n }\n}\n\necho $iMaxIndex;\n?>"}, {"source_code": "$n = fgets(STDIN);\n$n = (int)$n;\n\n$aData = array();\n$aCount = array();\nfor($i = 1; $i <= $n; $i++) {\n $s = fgets(STDIN);\n $a = explode(' ', (trim($s)));\n $aCount[$i] = array_sum($a);\n}\n\nfunction cmp($a, $b) {\n if ($a == $b) {\n return 0;\n }\n return ($a > $b) ? -1 : 1;\n}\n\nuasort($aCount, 'cmp');\nprint_r($aCount);\n$iCount = 1;\nforeach($aCount AS $iK => $iC) {\n if($iK === 1) {\n break;\n }\n $iCount++;\n}\n\necho $iCount;"}, {"source_code": " $iC) {\n if($iMax < $iC) {\n $iMax = $iC;\n $iMaxIndex = $indexC;\n }\n}\n\necho $iMaxIndex;\n?>"}, {"source_code": " array_sum($a),\n 'id' => $i\n );\n}\n\nfunction cmp($a, $b) {\n if ($a['sum'] == $b['sum']) {\n return $a['id'] > $b['id'] ? -1 : 1;\n }\n return ($a > $b) ? -1 : 1;\n}\n\nuasort($aCount, 'cmp');\n// print_r($aCount);\n$iCount = 0;\nforeach($aCount AS $iK => $iC) {\n $iCount++;\n if($iK === 1) {\n break;\n }\n}\n\necho $iCount;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "3c984366bba580993d1694d27982a773"} {"source_code": "0){\n list($l,$r)=explode(\" \",trim(fgets(STDIN)));\n $x=$l-($l-$x)%$m;\n $ans+=$r-$x+1;\n $x=$r+1;\n $n--;\n}\necho $ans;\n?>", "positive_code": [{"source_code": ""}, {"source_code": "0) {\n\t\tlist($l, $r) = explode(\" \", trim(fgets(STDIN)));\n\n\t\t$t = $l - ($l - $t) % $x;\n\t\t$ans += $r - $t + 1;\n\n\t\t$t = $r + 1;\n\t$n--;}\n\techo $ans;\n\n?>"}, {"source_code": "0) {\n\t\tlist($l, $r) = explode(\" \", trim(fgets(STDIN)));\n\n\t\t$t = $l - ($l - $t) % $x;\n\t\t$ans += $r - $t + 1;\n\n\t\t$t = $r + 1;\n\t$n--;}\n\techo $ans;\n\n?>"}, {"source_code": " 0){\n list($l,$r) = explode(\" \", trim(fgets(STDIN)));\n $s = $l - ($l -$s) % $x;\n $ans += $r - $s + 1;\n\n $s = $r + 1;\n $n --; \n }\n echo $ans;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "0){\n list($l,$r)=explode(\" \",trim(fgets(STDIN)));\n $x=$l-($l-$x)%$m;\n $ans+=$r-$x;\n $x=$r;\n $n--;\n}\necho $ans;\n?>"}], "src_uid": "ac33b73da5aaf2139b348a9c237f93a4"} {"source_code": "in();\n\tfor ($i = 1; $i <= $N; $i++) $A[$i] = (int)$Input->in();\n\t\n\t$sum = 0;\n\tfor ($k = 1; $k <= $N - 1; $k++) {\n\t\t$pow = 2;\n\t\t//while ($A[$k] + $pow < $N) {\n\t\twhile ($k + $pow <= $N) $pow *= 2;\n\t\t\n\t\t$A[$k + $pow / 2] += $A[$k];\n\t\t$sum += $A[$k];\n\t\t$A[$k] = 0;\n\n\t\tprint($sum.\"\\n\");\n\t}\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>", "positive_code": [{"source_code": " 100000)\n {\n break;\n }\n else\n {\n $c[count($c)] = $e;\n }\n}\n$f = array_fill(1, $a, 1);\nfor($x = 1; $x <= $a; $x++)\n{\n for($y = 0; $y < count($c); $y++)\n {\n if($f[$c[$y] + $x] == NULL)\n {\n $f[$x] = $c[$y - 1] + $x;\n break;\n }\n }\n}\n$g = $b;\narray_unshift($g, \" \");\nunset($g[0]);\n$h = 0;\nfor($x = 1; $x < $a; $x++)\n{\n $h += $g[$x];\n print $h . \"\\n\";\n $g[$f[$x]] += $g[$x];\n}\n?>"}, {"source_code": ""}, {"source_code": " 100000)\n {\n break;\n }\n else\n {\n $c[count($c)] = $e;\n }\n}\n$f = array_fill(1, $a, 1);\nfor($x = 1; $x <= $a; $x++)\n{\n for($y = 0; $y < count($c); $y++)\n {\n if($f[$c[$y] + $x] == NULL)\n {\n $f[$x] = $c[$y - 1] + $x;\n break;\n }\n }\n}\n$g = $b;\narray_unshift($g, \" \");\nunset($g[0]);\n$h = 0;\nfor($x = 1; $x < $a; $x++)\n{\n $h += $g[$x];\n print $h . \"\\n\";\n $g[$f[$x]] += $g[$x];\n}\n?>"}, {"source_code": "in();\n\tfor ($i = 1; $i <= $N; $i++) $A[$i] = (int)$Input->in();\n\t\n\t$sum = 0;\n\tfor ($k = 1; $k <= $N - 1; $k++) {\n\t\t$pow = 2;\n\t\t//while ($A[$k] + $pow < $N) {\n\t\twhile ($k + $pow <= $N) $pow *= 2;\n\t\t\n\t\t$A[$k + $pow / 2] += $A[$k];\n\t\t$sum += $A[$k];\n\t\t$A[$k] = 0;\n\n\t\tprint($sum.\"\\n\");\n\t}\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}, {"source_code": "in();\n\tfor ($i = 1; $i <= $N; $i++) $A[$i] = (int)$Input->in();\n\t\n\t$sum = 0;\n\tfor ($k = 1; $k <= $N - 1; $k++) {\n\t\t$pow = 2;\n\t\t//while ($A[$k] + $pow < $N) {\n\t\twhile ($k + $pow <= $N) $pow *= 2;\n\t\t\n\t\t$A[$k + $pow / 2] += $A[$k];\n\t\t$sum += $A[$k];\n\t\t$A[$k] = 0;\n\n\t\tprint($sum.\"\\n\");\n\t}\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}], "negative_code": [{"source_code": " 100000)\n {\n break;\n }\n else\n {\n $c[count($c)] = $e;\n }\n}\n$f = array_fill(1, $a, 1);\nfor($x = 1; $x <= $a; $x++)\n{\n for($y = 0; $y < count($c); $y++)\n {\n if($f[$c[$y] + $x] == NULL)\n {\n $f[$x] = $c[$y - 1] + $x;\n break;\n }\n }\n}\n$g = $b;\narray_unshift($g, \" \");\nunset($g[0]);\n$h = 0;\nfor($x = 1; $x < $a; $x++)\n{\n $h += $g[$x];\n print $h . \"\\n\";\n $g[$f[$x]] += $g[$x];\n}\n?>"}, {"source_code": " 110000)\n {\n break;\n }\n else\n {\n $c[count($c)] = $e;\n }\n}\n$f = array_fill(1, $a, 1);\nfor($x = 1; $x <= $a; $x++)\n{\n for($y = 0; $y < count($c); $y++)\n {\n if($f[$c[$y] + $x] == NULL)\n {\n $f[$x] = $c[$y - 1] + $x;\n break;\n }\n }\n}\n$g = $b;\narray_unshift($g, \" \");\nunset($g[0]);\n$h = 0;\nfor($x = 1; $x < $a; $x++)\n{\n $h = bcadd($h, $g[$x]);\n print $h . \"\\n\";\n $g[$f[$x]] += $g[$x];\n}\n?>"}, {"source_code": " 110000)\n {\n break;\n }\n else\n {\n $c[count($c)] = $e;\n }\n}\n$f = array_fill(1, $a, 1);\nfor($x = 1; $x <= $a; $x++)\n{\n for($y = 0; $y < count($c); $y++)\n {\n if($f[$c[$y] + $x] == NULL)\n {\n $f[$x] = $c[$y - 1] + $x;\n break;\n }\n }\n}\n$g = $b;\narray_unshift($g, \" \");\nunset($g[0]);\n$h = 0;\nfor($x = 1; $x < $a; $x++)\n{\n $h += $g[$x];\n print $h . \"\\n\";\n $g[$f[$x]] += $g[$x];\n}\n?>"}, {"source_code": "import java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.lang.Character;\nimport java.lang.Long;\nimport java.lang.Math;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.StringTokenizer;\nimport java.util.Arrays;\n\npublic class TaskC {\n\tBufferedReader reader;\n\tStringTokenizer tokenizer = new StringTokenizer(\"\");\n\n\tpublic static void main(String[] args) throws IOException {\n\t\tnew TaskC().run();\n\t}\n\n\tprivate void run() throws IOException {\n\t\ttokenizer = null;\n\t\treader = new BufferedReader(new InputStreamReader(System.in));\n\t\tsolve();\n\t}\n\n\tpublic static int divide_by_two(int x, int y){\n\n\t\tif (y == 0) return 0;\n\t\n\t\tx = x - y;\n\t\tint r = 1;\n\t\tint c = 0;\n\t\twhile(x != 0){\n\t\t\tr = x % 2;\n\t\t\tx = (int)(x / 2);\t\n\t\t\tif (r == 1) c++;\n\t\t}\n\t\treturn c;\n\t}\n\n\tprivate void solve() throws IOException {\n\t\tint N = nextInt();\n\t\tint[] A = new int[Integer.MAX_VALUE];\n\t\tint[] dp = new int[N];\n\t\tint[] ans = new int[N];\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tA[i] = 0;\n\t\t}\n\t\tfor (int i = 0; i < dp.length; i++) {\n\t\t\tdp[i] = 0;\n\t\t\tans[i] = 0;\n\t\t}\n\t\tfor (int i = 1; i <= N; i++) A[i] = nextInt();\n\n\t\tfor (int k = N - 1; k >= 1; k--) {\n\t\t\tint sum = 0;\n\t\t\tfor (int index = 1; index <= k; index++) {\n\t\t\t\tint min = Integer.MAX_VALUE;\n\t\t\t\tint temp = 0;\n\t\t\t\tfor (int n = N; n >= k + 1; n--) {\n\t\t\t\t\tif (dp[index] > n) {\n\t\t\t\t\t\tmin = 1;\n\t\t\t\t\tsum += A[index];\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\ttemp = divide_by_two(n, index);\n\t\t\t\t\tmin = Math.min(min, temp);\n\t\t\t\t\tif (min == 1) {\n\t\t\t\t\t\tsum += A[index];\n\t\t\t\t\t\tdp[index] = n;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (min != 1) sum += A[index] * min;\n\t\t}\n\t\tans[k] = sum;\n\t}\n\t\n\t\tfor (int i = 1; i <= N - 1; i++) {\n\t\t\tSystem.out.print(ans[i]);\n\t\t\tif (i != N - 1) System.out.print(\"\\n\");\n\t\t}\n\t}\n\t\n\tString nextToken() throws IOException {\n\t\twhile (tokenizer == null || !tokenizer.hasMoreTokens())\n\t\t\ttokenizer = new StringTokenizer(reader.readLine());\n\t\treturn tokenizer.nextToken();\n\t}\n\n\tint nextInt() throws IOException {\n\t\treturn Integer.parseInt(nextToken());\n\t}\n\n\tlong nextLong() throws IOException {\n\t\treturn Long.parseLong(nextToken());\n\t}\n}"}, {"source_code": "in();\n\tfor ($i = 1; $i <= $N; $i++) $A[$i] = (int)$Input->in();\n\t\n\t$sum = 0;\n\tfor ($k = 1; $k <= $N - 1; $k++) {\n\n\t\t$pow = 2;\n\t\twhile ($A[$k] + $pow <= $N) {\n\t\t\t$pow *= 2;\n\t\t}\n\t\t\n\t\t$A[$k + $pow / 2] += $A[$k];\n\t\t$sum += $A[$k];\n\t\t$A[$k] = 0;\n\n\t\tprint($sum);\n\t\tif ($i !== $N - 2) print(\"\\n\");\n\t}\n}\n\nclass Input{\n\tprivate $handle = \"\";\n\tprivate $values = array();\n\tprivate $index = 0;\n\n\tpublic function __construct($localfile){\n\n\t\tif (is_file($localfile)) {\n\t\t\t\n\t\t\t$this->handle = fopen($localfile, \"r\");\n\t\t\t$contents = stream_get_contents($this->handle);\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$contents = stream_get_contents(STDIN);\n\t\t\n\t\t}\n\t\t\n\t\t$no_newlines = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \" \", $contents);\n\t\t$this->values = explode(\" \", $no_newlines);\n\t}\n\t\n\tpublic function in(){\n\t\n\t\treturn $this->values[$this->index++];\n\t\n\t}\n\t\n\tpublic function close(){\n\t\t\n\t\tif (is_file($localfile) && feof($this->handle)) fclose($this->handle);\n\t\t\n\t}\n}\n\n?>"}], "src_uid": "c7e49c643dd8738f273c0d24e56c505f"} {"source_code": "", "positive_code": [{"source_code": "= $b)\n {\n $c += $b;\n $e[$x + 1] = $d[$x];\n }\n else\n {\n $c += $e[$x];\n $h = $b - $e[$x];\n if($d[$x] >= $h)\n {\n $c += $h;\n $i = $d[$x] - $h;\n $e[$x + 1] = $i;\n }\n else\n {\n $c += $d[$x];\n }\n }\n}\nprint $c;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= $b)\n {\n $c += $b;\n $e[$x + 1] = $d[$x];\n }\n else\n {\n $c += $e[$x];\n $h = $b - $e[$x];\n if($d[$x] >= $h)\n {\n $c += $h;\n $i = $d[$x] - $h;\n $e[$x + 1] = $i;\n }\n else\n {\n $c += $d[$x];\n }\n }\n}\nprint $c;\n?>"}, {"source_code": ""}], "src_uid": "848ead2b878f9fd8547e1d442e2f85ff"} {"source_code": "", "positive_code": [{"source_code": "\r\n\r\n\r\n"}, {"source_code": " $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}\r\n\r\nclass Algor {\r\n public static function efclidLcm($a, $b) {\r\n return ($a / self::efclidGcd($a, $b)) * $b;\r\n }\r\n public static function efclidGcd($a, $b) {\r\n return $b > 0 ? self::efclidGcd($b, $a % $b) : $a;\r\n }\r\n public static function isPrime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n $d += 1;\r\n }\r\n\r\n return $d == $n;\r\n }\r\n\r\n public static function fabicon($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n function getRotate($a, $s, $e, $ind) {\r\n $ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n $ar[$i] = $a[$i];\r\n $j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n // echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\";\r\n $a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n }\r\n\r\n}\r\n\r\nclass bigOperation {\r\n public static function efclidLcm($a, $b) {\r\n return bcmul(bcdiv($a, self::efclidGcd($a, $b)), $b);\r\n }\r\n public static function efclidGcd($a, $b) {\r\n return bccomp($b, 0) == 1 ? self::efclidGcd($b, bcmod($a, $b)) : $a;\r\n }\r\n public static function isBigNumber($n)\r\n {\r\n return bccomp($n, INTMAXVALUE) == 1;\r\n }\r\n // bcadd \u2014 \u0421\u043b\u043e\u0436\u0438\u0442\u044c 2 \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcAdd($x, $y)\r\n {\r\n return bcadd($x, $y);\r\n }\r\n// bccomp \u2014 \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n//return 1 if x>y, 0= x==y, -1 x < y\r\n public static function bcComp($x, $y)\r\n {\r\n return bccomp($x, $y);\r\n }\r\n// bcdiv \u2014 \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcDiv($x, $y)\r\n {\r\n return bcdiv($x, $y);\r\n }\r\n// bcmod \u2014 \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMod($x, $y)\r\n {\r\n return bcmod($x, $y);\r\n }\r\n// bcmul \u2014 \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMul($x, $y)\r\n {\r\n return bcmul($x, $y);\r\n }\r\n// bcpow \u2014 \u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcPow($x, $y)\r\n {\r\n return bcpow($x, $y);\r\n }\r\n// bcpowmod \u2014 \u0412\u043e\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435 \u0447\u0438\u0441\u043b\u043e\r\n// bcscale \u2014 \u0417\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 bc math \u0444\u0443\u043d\u043a\u0446\u0438\u0439.\r\n// bcsqrt \u2014 \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcSqrt($x, $y)\r\n {\r\n return bcsqrt($x, $y);\r\n }\r\n// bcsub \u2014 \u0412\u044b\u0447\u0438\u0442\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e\r\n public static function bcSub($x, $y)\r\n {\r\n return bcsub($x, $y);\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $y : $x;\r\n }\r\n\r\n public static function getDareje($n, $k) {\r\n if($k == 0) {\r\n return 1;\r\n }\r\n return bcmul($n, self::getDareje($n, $k-1));\r\n }\r\n}\r\n\r\nclass Sorting\r\n{\r\n public static function mergeSort($aArray) {\r\n if(count($aArray) <= 1) {\r\n return $aArray;\r\n }\r\n $aLeft = [];\r\n $aRight = [];\r\n $n =floor(count($aArray) / 2);\r\n for($i = 0; $i <$n; $i++) {\r\n $aLeft[] = $aArray[$i];\r\n }\r\n for($i = $n; $i 0; $i--) {\r\n $length = readline();\r\n\r\n $arr = explode(\" \", readline());\r\n\r\n $size = count($arr);\r\n\r\n $u_values = array_unique($arr);\r\n\r\n if (($size - count($u_values)) % 2 == 0) {\r\n echo count($u_values).\"\\n\";\r\n }else{\r\n echo count($u_values)-1 .\"\\n\";\r\n }\r\n\r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": "\r\n\r\n\r\n"}, {"source_code": "\r\n\r\n\r\n"}, {"source_code": " $v) {\r\n if($v > 2) {\r\n $delete += $v-2;\r\n }\r\n }\r\n if((count($tt) % 2)== 0) {\r\n $delete += count($tt);\r\n } else {\r\n $delete += count($tt) + 1;\r\n }\r\n\r\n\r\n\r\n IO::pr($n - $delete );\r\n\r\n\r\n\r\n}\r\n\r\n\r\nclass IO {\r\n public static function getInt()\r\n {\r\n return trim(fgets(STDIN));\r\n }\r\n\r\n public static function getArray()\r\n {\r\n return explode(' ', trim(fgets(STDIN)));\r\n }\r\n public static function pr($s)\r\n {\r\n echo $s, PHP_EOL;\r\n }\r\n public static function prArray($s)\r\n {\r\n echo implode( ' ', $s), PHP_EOL;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return $x > $y ? $y : $x;\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return $x > $y ? $x : $y;\r\n }\r\n}\r\n\r\nclass Algor {\r\n public static function efclidLcm($a, $b) {\r\n return ($a / self::efclidGcd($a, $b)) * $b;\r\n }\r\n public static function efclidGcd($a, $b) {\r\n return $b > 0 ? self::efclidGcd($b, $a % $b) : $a;\r\n }\r\n public static function isPrime($n) {\r\n $d = 2;\r\n while ($n % $d != 0) {\r\n $d += 1;\r\n }\r\n\r\n return $d == $n;\r\n }\r\n\r\n public static function fabicon($n, $a) {\r\n if($n <= 1) {\r\n return $a[$n];\r\n }\r\n for($i=2; $i<=$n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n function getRotate($a, $s, $e, $ind) {\r\n $ar = [];\r\n for ($i= $s; $i<=$e; $i++) {\r\n $ar[$i] = $a[$i];\r\n $j = $i + $ind > $e ? $i + $ind - $e - 1 : $i + $ind;\r\n // echo $i, ' ', $j, ' ', $j < $i ? $ar[$j] : $a[$j] , \"\\n\";\r\n $a[$i] = $j < $i ? $ar[$j] : $a[$j];\r\n }\r\n return $a;\r\n }\r\n\r\n}\r\n\r\nclass bigOperation {\r\n public static function efclidLcm($a, $b) {\r\n return bcmul(bcdiv($a, self::efclidGcd($a, $b)), $b);\r\n }\r\n public static function efclidGcd($a, $b) {\r\n return bccomp($b, 0) == 1 ? self::efclidGcd($b, bcmod($a, $b)) : $a;\r\n }\r\n public static function isBigNumber($n)\r\n {\r\n return bccomp($n, INTMAXVALUE) == 1;\r\n }\r\n // bcadd \u2014 \u0421\u043b\u043e\u0436\u0438\u0442\u044c 2 \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcAdd($x, $y)\r\n {\r\n return bcadd($x, $y);\r\n }\r\n// bccomp \u2014 \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n//return 1 if x>y, 0= x==y, -1 x < y\r\n public static function bcComp($x, $y)\r\n {\r\n return bccomp($x, $y);\r\n }\r\n// bcdiv \u2014 \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\r\n public static function bcDiv($x, $y)\r\n {\r\n return bcdiv($x, $y);\r\n }\r\n// bcmod \u2014 \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMod($x, $y)\r\n {\r\n return bcmod($x, $y);\r\n }\r\n// bcmul \u2014 \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcMul($x, $y)\r\n {\r\n return bcmul($x, $y);\r\n }\r\n// bcpow \u2014 \u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcPow($x, $y)\r\n {\r\n return bcpow($x, $y);\r\n }\r\n// bcpowmod \u2014 \u0412\u043e\u0437\u0432\u043e\u0434\u0438\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435 \u0447\u0438\u0441\u043b\u043e\r\n// bcscale \u2014 \u0417\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 bc math \u0444\u0443\u043d\u043a\u0446\u0438\u0439.\r\n// bcsqrt \u2014 \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c \u0438\u0437 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\r\n public static function bcSqrt($x, $y)\r\n {\r\n return bcsqrt($x, $y);\r\n }\r\n// bcsub \u2014 \u0412\u044b\u0447\u0438\u0442\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e\r\n public static function bcSub($x, $y)\r\n {\r\n return bcsub($x, $y);\r\n }\r\n public static function getMaxValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $x : $y;\r\n }\r\n public static function getMinValue($x, $y) {\r\n return bccomp($x, $y) == 1 ? $y : $x;\r\n }\r\n\r\n public static function getDareje($n, $k) {\r\n if($k == 0) {\r\n return 1;\r\n }\r\n return bcmul($n, self::getDareje($n, $k-1));\r\n }\r\n}\r\n\r\nclass Sorting\r\n{\r\n public static function mergeSort($aArray) {\r\n if(count($aArray) <= 1) {\r\n return $aArray;\r\n }\r\n $aLeft = [];\r\n $aRight = [];\r\n $n =floor(count($aArray) / 2);\r\n for($i = 0; $i <$n; $i++) {\r\n $aLeft[] = $aArray[$i];\r\n }\r\n for($i = $n; $i 0; $i--) {\r\n $length = readline();\r\n $arr = explode(\" \",readline());\r\n\r\n echo count(array_unique($arr)).\"\\n\" ;\r\n\r\n}\r\n\r\n?>"}], "src_uid": "ab7ab67941783da5c16f6294eb1910d9"} {"source_code": "\n$n=trim(fgets(STDIN));\n$arr=explode(' ',trim(fgets(STDIN)));\n$s=$n;\nfor($i=0;$i<$n;$i++){\n $s+=($arr[$i]-1)*($i+1);\n}\necho $s;\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $v) {\n foreach ($ar as $j => $v2) {\n if ($j > $i) {\n continue;\n }\n\n if (1 === gcd($v, $v2)) {\n $res = max($res, $i + $j);\n }\n }\n }\n\n echo ($res + 2).PHP_EOL;\n}\n\nfunction gcd($a, $b): int\n{\n while ($a && $b) {\n if ($a > $b) {\n $a %= $b;\n } else {\n $b %= $a;\n }\n }\n\n return $a + $b;\n}\n/*\n\n1\n4\n10 11 11 10\n\n1\n5\n1 2 2 3 6\n */\n", "positive_code": [{"source_code": " $v) {\n foreach ($ar as $j => $v2) {\n if ($j > $i) {\n continue;\n }\n\n if (1 === gcd($v, $v2)) {\n $res = max($res, $i + $j);\n }\n }\n }\n\n echo ($res + 2).PHP_EOL;\n}\n\nfunction gcd($a, $b): int\n{\n while ($a && $b) {\n if ($a > $b) {\n $a %= $b;\n } else {\n $b %= $a;\n }\n }\n\n return $a | $b;\n}\n/*\n\n1\n4\n10 11 11 10\n\n1\n5\n1 2 2 3 6\n */\n"}, {"source_code": " $v) {\n foreach ($ar as $j => $v2) {\n if ($j > $i) {\n continue;\n }\n\n if (1 === gcd($v, $v2)) {\n $res = max($res, $i + $j);\n }\n }\n }\n\n echo ($res + 2).PHP_EOL;\n}\n\nfunction gcd($a, $b)\n{\n while ($a && $b) {\n if ($a > $b) {\n $a %= $b;\n } else {\n $b %= $a;\n }\n }\n\n return $a | $b;\n}\n/*\n\n1\n4\n10 11 11 10\n\n1\n5\n1 2 2 3 6\n */\n"}, {"source_code": " $v) {\n foreach ($ar as $j => $v2) {\n if ($j > $i) {\n continue;\n }\n\n if (1 === gcd($v, $v2)) {\n $res = max($res, $i + $j);\n }\n }\n }\n\n echo ($res + 2).PHP_EOL;\n}\n\nfunction gcd($a, $b)\n{\n while ($a && $b) {\n if ($a > $b) {\n $a %= $b;\n } else {\n $b %= $a;\n }\n }\n\n return $a + $b;\n}\n/*\n\n1\n4\n10 11 11 10\n\n1\n5\n1 2 2 3 6\n */\n"}], "negative_code": [], "src_uid": "d665ecbf36cc0c0ddd148137fb693bf2"} {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n list($n, $k) = IO::arr();\r\n $s = str_split(IO::str());\r\n $res = 0;\r\n $last = -1;\r\n $lastdigit = 0;\r\n $l = [];\r\n for($i = 0; $i < $n; $i++) {\r\n if($s[$i] == '*') {\r\n $lastdigit = $i;\r\n }\r\n if ($last == -1 && $s[$i] == '*') {\r\n $last = $i;\r\n $res++;\r\n $l[$lastdigit] = 1;\r\n } elseif ($i - $last == $k && $last != -1) {\r\n if($s[$i] == '*') {\r\n $last = $i;\r\n $res++;\r\n $l[$i] = 1;\r\n } elseif(!isset($l[$lastdigit])) {\r\n $last = $lastdigit;\r\n $res++;\r\n $l[$lastdigit] = 1;\r\n }\r\n }\r\n }\r\n if ($lastdigit != end(array_keys($l))) {\r\n $res++;\r\n }\r\n IO::line($res);\r\n\r\n}\r\n\r\n?>", "positive_code": [{"source_code": " $current_pos; $i--) {\r\n if ($str[$i] == '*') {\r\n $str[$i] = 'x';\r\n $count++;\r\n $current_pos = $i;\r\n break;\r\n }\r\n }*/\r\n\r\n $temp = substr($str, $current_pos, $k + 1);\r\n $temp_last_pos = strrpos($temp, '*');\r\n $current_pos += $temp_last_pos;\r\n $count++;\r\n }\r\n\r\n echo $count.PHP_EOL;\r\n //echo \"
\u0421\u0447\u0435\u0442\u0447\u0438\u043a: \" . $count . \"
\";\r\n }\r\n}"}], "negative_code": [], "src_uid": "874e22d4fd8e35f7e0eade2b469ee5dc"} {"source_code": " 'a', '2'=> 'e', '3'=>'i', '4'=>'o', '5'=>'u');\n$b = array( '1'=> 'aeiou', '2'=> 'eioua', '3'=>'iouae', '4'=>'ouaei', '5'=>'uaeio');\n$s= ''; $k1 = 0; $k2=0;\nfor($i = 5; $i<= $k/5 ; $i++){\n if($k%$i==0 && $k/$i>=5){\n $k1 = $i;\n $k2 = $k/$i;\n break;\n }\n}\n\n\nif($k1>0 && $k2>0){\n for($i=1; $i<=$k2; $i++){\n if($i<=5){\n $s.=$b[$i];\n for($d=1; $d<=($k1-5); $d++){\n $s.= $a[$i];\n }\n } else {\n $s.=$b[1];\n for($d=1; $d<=($k1-5); $d++){\n $s.='a';\n }\n }\n \n }\n echo $s;\n} else {\n echo '-1';\n}\n\n\n\n?>", "positive_code": [{"source_code": " $a)\n {\n break;\n }\n }\n if($b == 1)\n {\n break;\n }\n }\n if($b == 0)\n {\n print \"-1\";\n }\n else\n {\n $d = array(\"aeiou\", \"eioua\", \"iouae\", \"ouaei\", \"uaeio\");\n $e = array();\n $f = \"\";\n for($z = 1; $z <= $x; $z++)\n {\n $g = ($z + 4) % 5;\n $h = floor($y / 5);\n for($z2 = 1; $z2 <= $h; $z2++)\n {\n $f .= $d[$g];\n }\n $i = substr($d[$g], 0, $y % 5);\n $f .= $i;\n }\n print $f;\n }\n}\n?>"}, {"source_code": "= 25){\n $n = -1;\n $m = -1;\n for ($i = 5; $i < $k; $i++){\n if($k % $i == 0){\n $n = $i;\n $m = $k / $i;\n break;\n }\n }\n if($n < 5 || $m < 5){\n echo '-1';\n exit;\n }\n $aGlas = ['a', 'e', 'i', 'o', 'u'];\n $x = 0;\n $aWord = [];\n $sWord = '';\n for($i = 0; $i < $n; $i++) {\n $y = 0;\n for($j = 0; $j < $m; $j++){\n $aWord[$i][$j] = $aGlas[$y];\n $y >= 4 ? $y = 0 : $y++;\n }\n// echo implode($aWord[$i]).\"\\n\";\n $sWord .= implode($aWord[$i]);\n array_unshift($aGlas, array_pop($aGlas));\n }\n echo $sWord;\n} else {\n echo '-1';\n}"}, {"source_code": "= 5)) {$m = (int)$_m; break;}\n}\nif ($m === 0) {die('-1');}\n$str = '';\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n $str .= $letters[($i + $j) % 5];\n }\n}\necho $str;\n"}, {"source_code": "= 5)) {$m = (int)$_m; break;}\n}\nif ($m === 0) {die('-1');}\n$str = '';\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n $str .= $letters[($i + $j) % 5];\n }\n}\necho $str;\n"}, {"source_code": " array('a', 'o', 'e', 'u', 'i'),\n 1 => array('o', 'e', 'u', 'i', 'a'),\n 2 => array('e', 'u', 'i', 'a', 'o'),\n 3 => array('u', 'i', 'a', 'o', 'e'),\n 4 => array('i', 'a', 'o', 'e', 'u')\n );\n $s = '';\n for ($x=0; $x < $m; $x++) {\n for ($y = 0; $y < $n; $y++) {\n if ($x < 5 && $y < 5) {\n $s .= $a[$x][$y];\n } else if ($x < 5) {\n $s .= $a[$x][$y%5];\n } else if ($y < 5) {\n $s .= $a[$x%5][$y];\n } else {\n $s .= $a[$x%5][$y%5];\n }\n }\n }\n echo $s;\n?>"}], "negative_code": [{"source_code": " $a)\n {\n break;\n }\n }\n if($b == 1)\n {\n break;\n }\n }\n if($b == 0)\n {\n print \"-1\";\n }\n else\n {\n $d = array(\"aeiou\", \"eioua\", \"iouae\", \"ouaei\", \"uaeio\");\n $e = array();\n $f = \"\";\n for($z = 1; $z <= $x; $z++)\n {\n $g = ($z + 4) % 5;\n $h = floor($y / 5);\n for($z2 = 1; $z2 <= $h; $z2++)\n {\n $f .= $d[$g];\n }\n $i = substr($d[$g], 0, $y - $x);\n $f .= $i;\n }\n print $f;\n }\n}\n?>"}, {"source_code": "= 25){\n $n = -1;\n $m = -1;\n for ($i = 5; $i < $k; $i++){\n if($k % $i == 0){\n $n = $i;\n $m = $k / $i;\n break;\n }\n }\n if($n >= 5 || $m >= 5){\n echo '-1';\n exit;\n }\n $aGlas = ['a', 'e', 'i', 'o', 'u'];\n $x = 0;\n $aWord = [];\n $sWord = '';\n for($i = 0; $i < $n; $i++) {\n $y = 0;\n for($j = 0; $j < $m; $j++){\n $aWord[$i][$j] = $aGlas[$y];\n $y >= 4 ? $y = 0 : $y++;\n }\n// echo implode($aWord[$i]).\"\\n\";\n $sWord .= implode($aWord[$i]);\n array_unshift($aGlas, array_pop($aGlas));\n }\n echo $sWord;\n} else {\n echo '-1';\n}\n\n"}, {"source_code": " 25){\n $n = -1;\n $m = -1;\n for ($i = 5; $i < $k; $i++){\n if($k % $i == 0){\n $n = $i;\n $m = $k / $i;\n break;\n }\n }\n if($n < 5 || $m < 5){\n echo '-1';\n exit;\n }\n $aGlas = ['a', 'e', 'i', 'o', 'u'];\n $x = 0;\n $aWord = [];\n $sWord = '';\n for($i = 0; $i < $n; $i++) {\n $y = 0;\n for($j = 0; $j < $m; $j++){\n $aWord[$i][$j] = $aGlas[$y];\n $y >= 4 ? $y = 0 : $y++;\n }\n// echo implode($aWord[$i]).\"\\n\";\n $sWord .= implode($aWord[$i]);\n array_unshift($aGlas, array_pop($aGlas));\n }\n echo $sWord;\n} else {\n echo '-1';\n}\n\n"}, {"source_code": "= 25){\n for ($i = 5; $i < $k; $i++){\n if($k % $i == 0){\n $n = $i;\n $m = $k / $i;\n break;\n }\n }\n if($n >= 5 || $m >= 5){\n echo '-1';\n exit;\n }\n $aGlas = ['a', 'e', 'i', 'o', 'u'];\n $x = 0;\n $aWord = [];\n $sWord = '';\n for($i = 0; $i < $n; $i++) {\n $y = 0;\n for($j = 0; $j < $m; $j++){\n $aWord[$i][$j] = $aGlas[$y];\n $y >= 4 ? $y = 0 : $y++;\n }\n// echo implode($aWord[$i]).\"\\n\";\n $sWord .= implode($aWord[$i]);\n array_unshift($aGlas, array_pop($aGlas));\n }\n echo $sWord;\n} else {\n echo '-1';\n}\n\n"}, {"source_code": " 5)) {$m = (int)$_m; break;}\n}\nif ($m === 0) {die('-1');}\n$str = '';\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if ($i === $j) {$str .= 'z';}\n else {$str .= $letters[($i + $j) % 5];}\n }\n}\necho $str;\n"}, {"source_code": " 5)) {$m = (int)$_m; break;}\n}\nif ($m === 0) {die('-1');}\n$str = '';\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n $str .= $letters[($i + $j) % 5];\n }\n}\necho $str;\n"}, {"source_code": " 5)) {$m = (int)$_m; break;}\n}\nif ($m === 0) {die('-1');}\n$str = '';\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n $str .= $letters[($i + $j) % 5];\n }\n}\necho $str;\n"}, {"source_code": " 'a', '2'=> 'e', '3'=>'i', '4'=>'o', '5'=>'u');\n$b = array( '1'=> 'aeiou', '2'=> 'eioua', '3'=>'iouae', '4'=>'ouaei', '5'=>'uaeio');\n$s= ''; $k1 = 0; $k2=0;\nfor($i = 5; $i< $k/5 ; $i++){\n if($k%$i==0 && $k/$i>=5){\n $k1 = $i;\n $k2 = $k/$i;\n break;\n }\n}\n\n\nif($k1>0 && $k2>0){\n for($i=1; $i<=$k2; $i++){\n if($i<=5){\n $s.=$b[$i];\n for($d=1; $d<=($k1-5); $d++){\n $s.='a';\n }\n } else {\n for($d=1; $d<=$k1; $d++){\n $s.='a';\n }\n }\n \n }\n echo $s;\n} else {\n echo '-1';\n}\n\n\n\n?>"}, {"source_code": " 'a', '2'=> 'e', '3'=>'i', '4'=>'o', '5'=>'u');\n$b = array( '1'=> 'aeiou', '2'=> 'eioua', '3'=>'iouae', '4'=>'ouaei', '5'=>'uaeio');\n$s= ''; $k1 = 0; $k2=0;\nfor($i = 5; $i< $k/5 ; $i++){\n if($k%$i==0 && $k/$i>=5){\n $k1 = $i;\n $k2 = $k/$i;\n break;\n }\n}\n\n\nif($k1>0 && $k2>0){\n for($i=1; $i<=$k2; $i++){\n if($i<=5){\n $s.=$b[$i];\n for($d=1; $d<=($k1-5); $d++){\n $s.='a';\n }\n } else {\n $s.=$b[1];\n for($d=1; $d<=($k1-5); $d++){\n $s.='a';\n }\n }\n \n }\n echo $s;\n} else {\n echo '-1';\n}\n\n\n\n?>"}, {"source_code": " 'a', '2'=> 'e', '3'=>'i', '4'=>'o', '5'=>'u');\n$b = array( '1'=> 'aeiou', '2'=> 'eioua', '3'=>'iouae', '4'=>'ouaei', '5'=>'uaeio');\n$s= ''; $k1 = 0; $k2=0;\nfor($i = 5; $i< $k/5 ; $i++){\n if($k%$i==0 && $k/$i>=5){\n $k1 = $i;\n $k2 = $k/$i;\n break;\n }\n}\n\n\nif($k1>0 && $k2>0){\n for($i=1; $i<=$k2; $i++){\n if($i<=5){\n $s.=$b[$i];\n for($d=1; $d<=($k1-5); $d++){\n $s.= $a[$i];\n }\n } else {\n $s.=$b[1];\n for($d=1; $d<=($k1-5); $d++){\n $s.='a';\n }\n }\n \n }\n echo $s;\n} else {\n echo '-1';\n}\n\n\n\n?>"}, {"source_code": " array('a', 'o', 'e', 'u', 'i'),\n 1 => array('o', 'e', 'u', 'i', 'a'),\n 2 => array('e', 'u', 'i', 'a', 'o'),\n 3 => array('u', 'i', 'a', 'o', 'e'),\n 4 => array('i', 'a', 'o', 'e', 'u')\n );\n $s = '';\n for ($x=0; $x < $m; $x++) {\n for ($y = 0; $y < $n; $y++) {\n if ($x < 5 && $y < 5) {\n $s .= $a[$x][$y];\n } else if ($x < 5) {\n $s .= $a[$x][$y%5];\n } else if ($y < 5) {\n $s .= $a[$x%5][$y];\n } else {\n $s .= $a[$x%5][$y%5];\n }\n }\n }\n echo $s;\n?>"}, {"source_code": " array('a', 'o', 'e', 'u', 'i'),\n 1 => array('o', 'e', 'u', 'i', 'a'),\n 2 => array('e', 'u', 'i', 'a', 'o'),\n 3 => array('u', 'i', 'a', 'o', 'e'),\n 4 => array('i', 'a', 'o', 'e', 'u')\n );\n $s = '';\n for ($x=0; $x < $m; $x++) {\n for ($y = 0; $y < $n; $y++) {\n if ($x < 5 && $y < 5) {\n $s .= $a[$x][$y];\n } else if ($x < 5) {\n $s .= $a[$x][$y%5];\n } else if ($y < 5) {\n $s .= $a[$x%5][$y];\n } else {\n $s .= $a[$x%5][$y%5];\n }\n }\n }\n echo $s;\n?>"}, {"source_code": " array('a', 'o', 'e', 'u', 'i'),\n 1 => array('o', 'e', 'u', 'i', 'a'),\n 2 => array('e', 'u', 'i', 'a', 'o'),\n 3 => array('u', 'i', 'a', 'o', 'e'),\n 4 => array('i', 'a', 'o', 'e', 'u')\n );\n $s = '';\n for ($x=0; $x < $m; $x++) {\n for ($y = 0; $y < $n; $y++) {\n if ($x < 5 && $y < 5) {\n $s .= $a[$x][$y];\n } else if ($x < 5) {\n $s .= $a[$x][$y%5];\n } else if ($y < 5) {\n $s .= $a[$x%5][$y];\n } else {\n $s .= $a[$x%5][$y];\n }\n }\n }\n echo $s;\n?>"}, {"source_code": " array('a', 'o', 'e', 'u', 'i'),\n 1 => array('o', 'e', 'u', 'i', 'a'),\n 2 => array('e', 'u', 'i', 'a', 'o'),\n 3 => array('u', 'i', 'a', 'o', 'e'),\n 4 => array('i', 'a', 'o', 'e', 'u')\n );\n $s = '';\n for ($x=0; $x < $m; $x++) {\n for ($y = 0; $y < $n; $y++) {\n if ($x < 5 && $y < 5) {\n $s .= $a[$x][$y];\n } else if ($x < 5) {\n $s .= $a[$x][$y%5];\n } else if ($y < 5) {\n $s .= $a[$x%5][$y];\n } else {\n $s .= $a[$x%5][$y%5];\n }\n }\n }\n echo $s;\n?>"}], "src_uid": "933167c31c0f53a43e840cc6cf153f8d"} {"source_code": "", "positive_code": [{"source_code": "=2 && $n<=100))\n {\n $f=true;\nfor ($i=1; $i<=$n-1; $i++)\n{\n $r=stripos($s,' ');\n $mas[$i]=(int)substr($s, 0, $r);\n if (($mas[$i]<1 || $mas[$i]>1000))\n {$f=false;}\n $s=substr($s, $r+1, $len-$r-1);\n }\n $mas[$n]=$s;\n if (($mas[$n]<1 || $mas[$n]>1000))\n {$f=false;}\n if($f)\n {\n//fputs(STDOUT, \"Vihodnie dannie: \");\n for ($i=1; $i<=$n-1; $i++)\n {\n $d=abs($mas[$i]-$mas[$i+1]);\n $mas1[$i]=$d;\n }\n $d=abs($mas[$n]-$mas[1]);\n $mas1[$n]=$d;\n $min=$mas1[1]; $t=1;\n for ($i=1; $i<=$n; $i++)\n {\n if($mas1[$i]<$min){$min=$mas1[$i]; $t=$i;}\n }\n if ($t==$n){$t1=1;}\n else {$t1=$t+1;}\nfputs(STDOUT, \"$t\");\nfputs(STDOUT, \" \");\nfputs(STDOUT, \"$t1\");\n }\n /*else\n {fputs(STDOUT, \"Nevernii diapazon\");}*/\n}\n/*else\n {fputs(STDOUT, \"Nevernii diapazon\");}*/\n?>"}, {"source_code": "abs($arr[$i]-$arr[($i+1)%$n])) {\n $res = array($i,($i+1)%$n);\n $min = abs($arr[$i]-$arr[($i+1)%$n]);\n }\necho $res[0]+1,' ',$res[1]+1;\n?>"}, {"source_code": "\n$n=trim(fgets(STDIN));\n$arr=explode(\" \",trim(fgets(STDIN)));\n$r=array();\nfor($i=0;$i<$n;$i++){\n if ($i==$n-1) $r[]=abs($arr[$i]-$arr[0]);\n else $r[]=abs($arr[$i+1]-$arr[$i]);\n}\n$m=min($r);\nforeach($r as $k=>$v){\n if($v==$m) {\n $key=$k;\n break;\n }\n}\nforeach($arr as $k=>$v){\n if($k==$key && $key!=$n-1){\n echo ($k+1).\" \".($k+2);\n }\n if($k==$key && $key==$n-1){\n echo ($k+1).\" \".($n-$k);\n }\n}\n\n?>"}, {"source_code": "\";\n\t$first = 1;\n\t$second =count ($copy);\n//\techo $first.\" and \".$second.\"
\";\n\n\tfor ($i=0; $i < count ($copy) - 1; $i++) {\n\t\t$delta_tmp = abs ($copy[$i] - $copy[$i+1]);\n\t\tif ( $delta_tmp < $delta){\n\t\t\t$delta = $delta_tmp;\n\t\t\t$first = $i+1;\n\t\t\t$second =$i+2;\n\n\t\t}\n\n\t}\n\techo $first.\" \".$second;\n\t\n\n\n\n\n\n\n\n\n\n\n?>"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "=1 && $n<=100))\n\t{\n\t$f=true;\nfor ($i=1; $i<=$n-1; $i++)\n{\n\t$r=stripos($s,' ');\n\t$mas[$i]=substr($s, 0, $r);\n\tif (($mas[$i]<1 && $mas[$i]>1000))\n\t{$f=false;}\n\t$s=substr($s, $r+1, $len-$r-1);\n\t}\n\t$mas[$n]=$s;\n\tif (($mas[$n]<1 && $mas[$n]>1000))\n\t{$f=false;}\n\tif($f)\n\t{\nfputs(STDOUT, \"Vihodnie dannie: \");\n\tfor ($i=1; $i<=$n-1; $i++)\n\t{\n\t\t$d=abs($mas[$i]-$mas[$i+1]);\n\t\t$mas1[$i]=$d;\n\t\t}\n\t\t$d=abs($mas[$n]-$mas[1]);\n\t\t$mas1[$n]=$d;\n\t\t$min=$mas1[1]; $t=1;\n\t\tfor ($i=1; $i<=$n; $i++)\n\t\t{\n\t\t\tif($mas1[$i]<$min){$min=$mas1[$i]; $t=$i;}\n\t\t\t}\n\t\t\tif ($t==$n){$t1=1;}\n\t\t\t\telse {$t1=$t+1;}\nfputs(STDOUT, \"$t\");\nfputs(STDOUT, \" \");\nfputs(STDOUT, \"$t1\");\n\t\t\t}\n\t\t\telse\n\t{fputs(STDOUT, \"Nevernii diapazon\");}\n}\nelse\n\t{fputs(STDOUT, \"Nevernii diapazon\");}\n?>"}, {"source_code": "abs($arr[$i]-$arr[($i+1)%$n])) {\n $res = array($i,($i+1)%$n);\n $min = abs($arr[$i]-$arr[($i+1)%$n]);\n }\necho $res[0]+1,' ',$res[1]+1;\n?>"}, {"source_code": "\";\n\t$first = 1;\n\t$second =count ($copy);\n//\techo $first.\" and \".$second.\"
\";\n\n\tfor ($i=0; $i < count ($copy) - 1; $i++) {\n\t\t$delta_tmp = abs ($copy[$i] - $copy[$i+1]);\n\t\tif ( $delta_tmp < $delta){\n\t\t\t$delta = $delta_tmp;\n\t\t\t$first = $i+1;\n\t\t\t$second =$i+2;\n\n\t\t}\n\n\t}\n\techo $first.\" \".$second;\n\t\n\n\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\t$delta = abs ($copy[0] - $copy[$tmp-1]);\n//\techo $delta.\"
\";\n\t$first = 1;\n\t$second =count ($copy);\n//\techo $first.\" and \".$second.\"
\";\n\n\tfor ($i=0; $i < count ($copy) - 1; $i++) {\n\t\t$delta_tmp = abs ($copy[$i] - $copy[$i+1]);\n\t\tif ( $delta_tmp < $delta){\n\t\t\t$delta = $delta_tmp;\n\t\t\t$first = $i+1;\n\t\t\t$second =$i+2;\n\n\t\t}\n\n\t}\n\techo $first.\" \".$second;\n\t\n\n\n\n\n\n\n\n\n\n\n?>"}], "src_uid": "facd9cd4fc1e53f50a1e6f947d78e942"} {"source_code": " $sV) {\n if (isset($aArray[$sV - 1]) && isset($aArray[$sV])) {\n if ($aArray[$sV - 1] > $aArray[$sV]) {\n $tmp = $aArray[$sV - 1];\n $aArray[$sV - 1] = $aArray[$sV];\n $aArray[$sV] = $tmp;\n $bFlag = false;\n }\n }\n }\n if ($aArray == $aLocalArray) {\n break;\n }\n }\n\n $bFlag = true;\n for ($i = 0; $i < count($aArray) - 1; $i++) {\n if ($aArray[$i] > $aArray[$i + 1]) {\n $bFlag = false;\n break;\n }\n }\n if ($bFlag) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n\n//YES\n//NO\n//YES\n//YES\n//NO\n//YES", "positive_code": [{"source_code": " 0))\n {\n $g[count($g)] = $i;\n $i = array();\n $k = 0;\n }\n }\n elseif(($f[$y] == TRUE) && ($j == 1))\n {\n $h[count($h)] = $d[$y + 1];\n }\n elseif(($f[$y] == FALSE) && ($k == 0))\n {\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n $h = array();\n }\n else\n {\n $i[count($i)] = $d[$y];\n }\n $j = 0;\n $k = 1;\n }\n elseif(($f[$y] == FALSE) && ($k == 1))\n {\n if($j == 0)\n {\n $i[count($i)] = $d[$y];\n }\n elseif($j == 1)\n {\n sort($h);\n $g[count($g)] = $h;\n $h = array();\n }\n $j = 0;\n }\n }\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n }\n if(count($i) > 0)\n {\n $g[count($g)] = $i;\n }\n print_r($w);\n $l = array();\n for($y = 0; $y < count($g); $y++)\n {\n $l = array_merge($l, $g[$y]);\n }\n $m = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n if($l[$y + 1] < $l[$y])\n {\n $m = 1;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " $b[$y+1]){\n $f = $y+1;\n if (in_array($f, $c)) { \n $t = $b[$y]; \n $b[$y] = $b[$y+1]; \n $b[$y+1] = $t; \n } else {\n $bool = false;\n } \n } \n } \n } \n \n \n if($bool){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n }\n\n \n\n "}], "negative_code": [{"source_code": " 0)\n {\n $h = array_unique($h);\n sort($h);\n $g[count($g)] = $h;\n }\n elseif(count($g) > 0)\n {\n $i = array_unique($i);\n sort($i);\n $g[count($g)] = $i;\n }\n $k = \"\";\n for($y = 0; $y < count($g); $y++)\n {\n $l = implode(\" \", $g[$y]) . \" \";\n $k .= $l;\n }\n $k = trim($k);\n sort($d);\n $l = implode(\" \", $d);\n if($k == $l)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0))\n {\n $g[count($g)] = $i;\n $i = array();\n $k = 0;\n }\n }\n elseif(($f[$y] == TRUE) && ($j == 1))\n {\n $h[count($h)] = $d[$y + 1];\n }\n elseif(($f[$y] == FALSE) && ($k == 0))\n {\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n $h = array();\n }\n else\n {\n $i[count($i)] = $d[$y];\n }\n $j = 0;\n $k = 1;\n }\n elseif(($f[$y] == FALSE) && ($k == 1))\n {\n if($j == 0)\n {\n $i[count($i)] = $d[$y];\n }\n }\n }\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n }\n if(count($i) > 0)\n {\n $g[count($g)] = $i;\n }\n $l = array();\n for($y = 0; $y < count($g); $y++)\n {\n $l = array_merge($l, $g[$y]);\n }\n $m = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n if($l[$y + 1] < $l[$y])\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " 0)\n {\n $h = array_unique($h);\n sort($h);\n $g[count($g)] = $h;\n }\n elseif(count($g) > 0)\n {\n $i = array_unique($i);\n sort($i);\n $g[count($g)] = $i;\n }\n $k = \"\";\n for($y = 0; $y < count($g); $y++)\n {\n $l = implode(\" \", $g[$y]) . \" \";\n $k .= $l;\n }\n $k = trim($k);\n sort($d);\n $l = implode(\" \", $d);\n if($k == $l)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " 0))\n {\n $g[count($g)] = $i;\n $i = array();\n $k = 0;\n }\n }\n elseif(($f[$y] == TRUE) && ($j == 1))\n {\n $h[count($h)] = $d[$y + 1];\n }\n elseif(($f[$y] == FALSE) && ($k == 0))\n {\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n $h = array();\n }\n else\n {\n $i[count($i)] = $d[$y];\n }\n $j = 0;\n $k = 1;\n }\n elseif(($f[$y] == FALSE) && ($k == 1))\n {\n if($j == 0)\n {\n $i[count($i)] = $d[$y];\n }\n }\n }\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n }\n if(count($i) > 0)\n {\n $g[count($g)] = $i;\n }\n $l = array();\n for($y = 0; $y < count($g); $y++)\n {\n $l = array_merge($l, $g[$y]);\n }\n $m = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n if($l[$y + 1] < $l[$y])\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0))\n {\n $g[count($g)] = $i;\n $i = array();\n $k = 0;\n }\n }\n elseif(($f[$y] == TRUE) && ($j == 1))\n {\n $h[count($h)] = $d[$y + 1];\n }\n elseif(($f[$y] == FALSE) && ($k == 0))\n {\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n $h = array();\n }\n else\n {\n $i[count($i)] = $d[$y];\n }\n $j = 0;\n $k = 1;\n }\n elseif(($f[$y] == FALSE) && ($k == 1))\n {\n if($j == 0)\n {\n $i[count($i)] = $d[$y];\n }\n }\n }\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n }\n if(count($i) > 0)\n {\n $g[count($g)] = $i;\n }\n $l = array();\n for($y = 0; $y < count($g); $y++)\n {\n $l = array_merge($l, $g[$y]);\n }\n $m = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n if($l[$y + 1] < $l[$y])\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " 0)\n {\n $h = array_unique($h);\n sort($h);\n $g[count($g)] = $h;\n }\n elseif(count($g) > 0)\n {\n $i = array_unique($i);\n sort($i);\n $g[count($g)] = $i;\n }\n $k = \"\";\n for($y = 0; $y < count($g); $y++)\n {\n $l = implode(\" \", $g[$y]) . \" \";\n $k .= $l;\n }\n $k = trim($k);\n sort($d);\n $l = implode(\" \", $d);\n if($k == $l)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0))\n {\n $g[count($g)] = $i;\n $i = array();\n $k = 0;\n }\n }\n elseif(($f[$y] == TRUE) && ($j == 1))\n {\n $h[count($h)] = $d[$y + 1];\n }\n elseif(($f[$y] == FALSE) && ($k == 0))\n {\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n $h = array();\n }\n else\n {\n $i[count($i)] = $d[$y];\n }\n $j = 0;\n $k = 1;\n }\n elseif(($f[$y] == FALSE) && ($k == 1))\n {\n if($j == 0)\n {\n $i[count($i)] = $d[$y];\n }\n }\n }\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n }\n if(count($i) > 0)\n {\n $g[count($g)] = $i;\n }\n $l = array();\n for($y = 0; $y < count($g); $y++)\n {\n $l = array_merge($l, $g[$y]);\n }\n $m = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n if($l[$y + 1] < $l[$y])\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0))\n {\n $g[count($g)] = $i;\n $i = array();\n $k = 0;\n }\n }\n elseif(($f[$y] == TRUE) && ($j == 1))\n {\n $h[count($h)] = $d[$y + 1];\n }\n elseif(($f[$y] == FALSE) && ($k == 0))\n {\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n $h = array();\n }\n else\n {\n $i[count($i)] = $d[$y];\n }\n $j = 0;\n $k = 1;\n }\n elseif(($f[$y] == FALSE) && ($k == 1))\n {\n if($j == 0)\n {\n $i[count($i)] = $d[$y];\n }\n }\n }\n if(count($h) > 0)\n {\n sort($h);\n $g[count($g)] = $h;\n }\n if(count($i) > 0)\n {\n $g[count($g)] = $i;\n }\n $l = array();\n for($y = 0; $y < count($g); $y++)\n {\n $l = array_merge($l, $g[$y]);\n }\n $m = 0;\n for($y = 0; $y < $b - 1; $y++)\n {\n if($l[$y + 1] < $l[$y])\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}], "src_uid": "e1481b9d940407da75e11355b580f459"} {"source_code": "\n$n = trim(fgets(STDIN));\n$numbers = explode(' ',trim(fgets(STDIN)));\n$initial = array();\n$initial[]=$numbers[count($numbers)-1];\n\nfor ($i=(count($numbers)-2);$i>=0;$i--){\n $cur = $numbers[$i]+$numbers[$i+1];\n\t$initial[]=$cur;\n\t$s.=(\" \".$cur);\n}\n\n$s = implode(' ',array_reverse($initial));\necho $s;\n?>", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "fa256021dc519f526ef3878cce32ff31"} {"source_code": "= 10) {\r\n $j = $i;\r\n }\r\n }\r\n \r\n for ($i = 0; $i < $j; $i++) {\r\n echo $n[$i];\r\n }\r\n \r\n echo $n[$j] - '0' + $n[$j + 1] - '0';\r\n $j += 2;\r\n \r\n for ($j; $j < $m; ++$j) {\r\n echo $n[$j];\r\n }\r\n echo PHP_EOL; \r\n}\r\n?>", "positive_code": [{"source_code": "= 10) {\r\n $j = $i;\r\n }\r\n }\r\n \r\n for ($i = 0; $i < $j; $i++) {\r\n echo $n[$i];\r\n }\r\n \r\n echo $n[$j] + $n[$j + 1];\r\n $j += 2;\r\n \r\n for ($j; $j < $m; ++$j) {\r\n echo $n[$j];\r\n }\r\n echo PHP_EOL; \r\n}\r\n?>"}], "negative_code": [{"source_code": "= 10) { \r\n $n[strlen($n) - 2] = 1;\r\n $n[strlen($n) - 1] = $sum - 10;\r\n $f = 1;\r\n echo $n.PHP_EOL;\r\n } \r\n \r\n if ($f === 0) {\r\n $n = $m;\r\n $sum = $n[0] + $n[1];\r\n $n[0] = $sum[0];\r\n if ($sum >= 10) { \r\n $n[1] = $sum - 10;\r\n } else {\r\n $n[0] = $sum;\r\n $n = substr_replace($n, '', 1, 1);\r\n }\r\n echo $n.PHP_EOL;\r\n }\r\n}\r\n?>"}, {"source_code": "= 10) { \r\n $n[strlen($n) - 2] = 1;\r\n $n[strlen($n) - 1] = $sum - 10;\r\n $f = 1;\r\n echo $n.PHP_EOL;\r\n } \r\n \r\n if ($f === 0) {\r\n $n = $m;\r\n $sum = $n[0] + $n[1];\r\n $n[0] = $sum[0];\r\n if ($sum >= 10) { \r\n $n[1] = $sum - 10;\r\n } else {\r\n $n = substr_replace($n, '', 1, 1);\r\n }\r\n echo $n.PHP_EOL;\r\n }\r\n}\r\n?>"}, {"source_code": "= 10) { \r\n $n[strlen($n) - 2] = 1;\r\n $n[strlen($n) - 1] = $sum - 10;\r\n $f = 1;\r\n echo $n.PHP_EOL;\r\n } \r\n \r\n if ($f === 0) {\r\n $n = $m;\r\n $n[0] = $n[0] + $n[1];\r\n $n = substr_replace($n, '', 1, 1);\r\n echo $n.PHP_EOL;\r\n }\r\n}\r\n?>"}, {"source_code": "= 10) { \r\n $n[$j] = 1;\r\n $n[$j + 1] = $sum - 10;\r\n $f = 1;\r\n echo $n.PHP_EOL;\r\n } \r\n }\r\n \r\n if ($f === 0) {\r\n $n[0] = $n[0] + $n[1];\r\n $n[1] = '';\r\n $n = substr_replace($n, '', 1, 1);\r\n echo $n.PHP_EOL;\r\n }\r\n}\r\n?>"}], "src_uid": "6db42771fdd582578194c7b69a4ef575"} {"source_code": " 0) {\n\t\t\t\t$fnd = false;\n\t\t\t\tfor ($j = 1; $j <= $data[0]; $j++) {\n\t\t\t\t\tif ($pr[$data[$j]] == 0) {\n\t\t\t\t\t\t$pr[$data[$j]] = 1;\n\t\t\t\t\t\t$prs[$i + 1] = true;\n\t\t\t\t\t\t$fnd = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$fnd)\n\t\t\t\t\t$u_p[] = $i + 1;\n\t\t\t} else {\n\t\t\t\t$u_p[] = $i + 1;\n\t\t\t}\n\t\t}\n\t\t$opt = true;\n\t\t$res = '';\n\t\tif (count($u_p) > 0) {\n\t\t\tfor ($i = 1; $i <= $n; $i++) {\n\t\t\t\tif ($pr[$i] == 0) {\n\t\t\t\t\t$opt = false;\n\t\t\t\t\t$res = $u_p[count($u_p) - 1].\" \".$i; \n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$opt) {\n\t\t\t\t$ans .= \"IMPROVE\\n$res\\n\";\n\t\t\t} else {\n\t\t\t\t$ans .= \"OPTIMAL\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\t$ans .= \"OPTIMAL\\n\";\n\t\t}\n\t}\n\tprint $ans;\n?>", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "38911652b3c075354aa8adb2a4c6e362"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "62df8b1821558bea910f422591618e29"} {"source_code": "", "positive_code": [{"source_code": "\n\n"}], "negative_code": [], "src_uid": "5babbb7c5f6b494992ffa921c8e19294"} {"source_code": "=$arr[$i+1])\n\t {\n\t \t$cnt++;\n\t \t$lastItem[$j++]=$arr[$i];\n\t }\n }\n $lastItem[count($lastItem)]=$arr[$sizeOfArr-1];\n echo \"$cnt\\n\";\n for ($i=0; $i"}, {"source_code": ""}, {"source_code": " $value)\n {\n echo $value.' ';\n }\n }\n?>\n\n"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "= $c[($i+1)]) {\n $t++;\n $nums[] = $c[$i];\n }\n}\necho $t.\"\\n\";\necho implode(' ',$nums);"}], "negative_code": [{"source_code": "\";\nfor ($i = 0; $i < $n; $i++) {\n if ($na[$i] == 1) {\n $nss = 1;\n } else {\n $nss++;\n }\n if (($na[$i+1] == 1) or ($i == ($n - 1))) {\n print \" \" . $nss;\n $nss = 0;\n }\n}\n?>\n"}, {"source_code": "= $c[($i+1)]) {\n $t++;\n $nums[] = $c[($i+1)];\n }\n}\necho $t.\"\\n\";\necho implode(',',$nums).\"\\n\";"}, {"source_code": "= $c[($i+1)]) {\n $t++;\n $nums[] = $c[($i+1)];\n }\n}\necho $t.\"\\n\";\necho implode(',',$nums).\"\\n\";"}, {"source_code": "= $c[($i+1)]) {\n $t++;\n $nums[] = $c[($i+1)];\n }\n}\necho $t;\necho implode(',',$nums);"}, {"source_code": "= $c[($i+1)]) {\n $t++;\n $nums[] = $c[($i+1)];\n }\n}\necho $t.\"\\n\";\necho implode(' ',$nums);"}, {"source_code": "= $c[($i+1)]) {\n $t++;\n $nums[] = $c[($i+1)];\n }\n}\necho $t.\"\\n\";\necho implode(',',$nums);"}, {"source_code": "= $c[($i+1)]) {\n $t++;\n $nums[] = $c[($i+1)];\n }\n}\necho $t.\"\\n\";\necho implode(',',$nums);"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "206eb67987088843ef42923b0c3939d4"} {"source_code": " 0)\n{\n print \"-1\";\n}\nelse\n{\n for($x = 0; $x < count($f); $x++)\n {\n $j = $h[$x] / $a;\n for($y = 0; $y < $j; $y++)\n {\n array_push($l, $f[$x]);\n }\n $m = implode($l);\n $n .= $m;\n $l = array();\n }\n for($x = 1; $x <= $a; $x++)\n {\n $p .= $n;\n }\n print $p;\n}\n?>", "positive_code": [{"source_code": " $val) {\n if ($val % $k != 0) {\n echo -1;\n die();\n } \n \n for ($j = 0; $j < $val / $k; ++$j) {\n $str = $str.$key;\n }\n }\n }\n \n echo $str;\n?>"}, {"source_code": "// BismiLahi Rahmani Rahim ?>\n\n 0) {\n\t\t\tfor ($l = 0; $l < intval($a[$j]/$k); $l ++) {\n\t\t\t\tprintf(\"%s\", chr(97 + $j));\n\t\t\t}\n\t\t}\n\t}\n}\n\n?>"}, {"source_code": "\n$k = fgets(STDIN);\n$s = trim(fgets(STDIN));\n$s_arr = str_split($s);\nforeach($s_arr as $v){++$chr[$v];}\nfor($y=0;$y<$k;$y++){\n foreach($chr as $ck => $cv){\n if($cv%$k==0){\n for($i=0;$i<($cv/$k);$i++){$w .=$ck;}\n }\n else{$w = -1;break;}\n }\n}\necho $w;\n?>"}, {"source_code": "\n$n=trim(fgets(STDIN));\n$s=str_split(trim(fgets(STDIN)));\nforeach($s as $v) ++$x[$v];\nforeach($x as $k => $y){\n if($y%$n != 0){$z=\"-1\";break;}\n else{\n for($i=1;$i<=($y/$n);$i++)$z.=$k;\n }\n}\nif($z!= \"-1\"){for($j=0;$j<$n;$j++)echo $z;}\nelse echo $z;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n$k = fgets(STDIN);\n$s = fgets(STDIN);\n$s_arr = str_split($s);\nforeach($s_arr as $v){++$chr[$v];}\nfor($y=0;$y<$k;$y++){\nforeach($chr as $ck => $cv){\nif($cv%$k==0){\nfor($i=0;$i<($cv/$k);$i++){$w .=$ck;}\n}\nelse{$w = -1;break;}\n}\n}\necho $w;\n?>"}, {"source_code": "\n$k = fgets(STDIN);\n$s = trim(fgets(STDIN));\n$s_arr = str_split($s);\nforeach($s_arr as $v){++$chr[$v];}\nfor($y=0;$y<$k;$y++){\n foreach($chr as $ck => $cv){\n if($cv%$k==0){\n for($i=0;$i<($cv/$k);$i++){$w .=$ck;}\n }\n else{$w = -1;break;}\n }\n}\necho $cv;\n?>"}, {"source_code": "\n$k = fgets(STDIN);\n$s = fgets(STDIN);\n$s_arr = str_split($s);\nforeach($s_arr as $v){++$chr[$v];}\nfor($y=0;$y<$k;$y++){\n foreach($chr as $ck => $cv){\n if($cv%$k==0){\n for($i=0;$i<($cv/$k);$i++){$w .=$ck;}\n }\n else{$w = -1;break;}\n }\n}\necho $cv;\n?>"}], "src_uid": "f5451b19cf835b1cb154253fbe4ea6df"} {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0) echo \"Anton\";\nif ($anton < 0) echo \"Danik\";\nif ($anton === 0) echo \"Friendship\";\n", "positive_code": [{"source_code": "$t2)\necho \"Anton\";\nelse \necho \"Danik\";\n"}, {"source_code": " $d)\n{\n print \"Anton\";\n}\n?>"}, {"source_code": " count($D)){\n echo 'Anton';\n}\n\nif(count($A) < count($D)){\n echo 'Danik';\n\n\n}\nif(count($A) == count($D)){\n echo 'Friendship';\n\n}\n\n?>\n"}, {"source_code": " substr_count($s, 'D')) {\n echo 'Anton';\n}\nelseif (substr_count($s, 'A') < substr_count($s, 'D')) {\n echo 'Danik'; \n}\nelse {\n echo 'Friendship';\n}"}, {"source_code": " $d ? 'Anton' : ( $d > $a ? 'Danik' : 'Friendship');\n\n?>"}, {"source_code": "$D){\n\techo \"Anton\";\n} elseif($A < $D){\n\techo \"Danik\";\n} else {\n\techo \"Friendship\";\n}\n?>"}, {"source_code": " $len - $a) ? 'Anton' : (($a == $len - $a) ? 'Friendship' : 'Danik'));\n"}, {"source_code": " $d){\n echo \"Anton\";\n }else{\n echo \"Danik\";\n }\n}"}, {"source_code": " $d){\n echo \"Anton\";\n }else{\n echo \"Danik\";\n }\n}"}, {"source_code": "winning_rounds);\n\n// solution\n$rounds = [\n 'Anton' => 0,\n 'Danik' => 0,\n];\n\nforeach ($winning_rounds as $w_round) {\n if($w_round == 'A') {\n $rounds['Anton']++;\n\n continue;\n }\n\n $rounds['Danik']++;\n}\n\nif($rounds['Anton'] > $rounds['Danik']) {\n echo \"Anton\\n\";\n\n exit;\n}\n\nif($rounds['Danik'] > $rounds['Anton']) {\n echo \"Danik\\n\";\n\n exit;\n}\n\necho \"Friendship\\n\";\n\n//=====================================\n// Per-defined helpers\n//=====================================\nclass Input\n{\n public $inputs = [];\n\n public function __construct(array $input_titles = ['line'])\n {\n $this->getInputs($input_titles);\n }\n\n private function getInputs($input_titles)\n {\n for ($i=0; $i < count($input_titles); $i++) {\n $this->inputs[$input_titles[$i]] = trim(fgets(STDIN));\n }\n }\n\n public function __get($name)\n {\n return $this->inputs[$name];\n }\n}\n"}, {"source_code": " $danik) {\n echo \"Anton\\n\";\n\n exit;\n}\n\nif($danik > $anton) {\n echo \"Danik\\n\";\n\n exit;\n}\n\necho \"Friendship\\n\";\n"}, {"source_code": "$d)?\"Anton\":(($d>$a)?\"Danik\":\"Friendship\");\n?>"}, {"source_code": " $d){\n echo 'Anton';\n }\n else if ($a < $d){\n echo 'Danik';\n }\n else if ($a == $d) {\n echo 'Friendship';\n}\n "}, {"source_code": " 0)\n echo \"Danik\";\n elseif ($d < 0)\n echo \"Anton\";\n else\n echo \"Friendship\";\n\n if (++$COUNT > 1) {\n break;\n }\n}\n"}, {"source_code": " $d ? 'Anton' : ($a < $d ? 'Danik' : 'Friendship');"}, {"source_code": " $d) {\n\techo \"Anton\\n\";\n} else {\n\techo \"Danik\\n\";\n}"}, {"source_code": "\n $arraynum[D]) {\n echo \"Anton\";\n \n}else echo \"Danik\";\n\n\n\n\n?>"}, {"source_code": "$store[1])\n\techo \"Anton\";\nelse if($store[0]<$store[1])\n\techo \"Danik\";\nelse echo \"Friendship\";"}, {"source_code": " $danik )\n {\n echo \"Anton\" ;\n }\n else if( $anton < $danik )\n {\n echo \"Danik\" ;\n }\n else\n {\n echo \"Friendship\" ;\n }\n}\n\n$stdout = fopen( getenv( \"OUTPUT_PATH\" ) , \"w\" ) ;\n$stdin = fopen( \"php://stdin\" , \"r\" ) ;\n\nfscanf( $stdin , \"%d\" , $n ) ;\nfscanf( $stdin , \"%s\", $s);\n\n//$arr = array_map('intval', preg_split('/ /', $ar_temp, -1, PREG_SPLIT_NO_EMPTY) );\n\n$result = gaber( $n , $s ) ;\n\nfwrite ( $stdout , $result . \"\\n\" ) ;\n\nfclose( $stdin ) ;\nfclose( $stdout ) ;\n\n?>"}, {"source_code": "$Danik){\n echo(\"Anton\");\n}elseif ($Anton<$Danik){\n echo(\"Danik\");\n}else {\n echo(\"Friendship\");\n}"}, {"source_code": "$r)\n return \"Anton\";\n else if($c<$r)\n return \"Danik\";\n else\n return \"Friendship\";\n}\nfunction solve()\n{\n $server=\"php://stdin\";\n $local=\"input.txt\";\n $handle = fopen($server, \"r\");\n $s=\"\";$d=0;\n fscanf($handle, \"%d\", $d);\n fscanf($handle, \"%s\", $s);\n printf(\"%s\", check($s,$d));\n}\n\nsolve();\n?>"}, {"source_code": " $d)\n{\n echo 'Anton';\n}else if ($c < $d)\n{\n echo 'Danik';\n}else if ($c == $d)\n{\n echo 'Friendship';\n}"}, {"source_code": "\nnamespace P734\\A;\n /**\n * @file : main.php\n * @author : Khalil Fazal \n * @creation_date : 2016-11-18 09:34\n * @project : codeforces\n */\n\n /**\n * @title : A. Anton and Danik\n * @link : http://codeforces.com/problemset/problem/734/A\n * @tags : implementation, strings\n * @time_limit : 1 s\n * @memory_limit : 256 MB\n * @input : stdin\n * @output : stdout\n *\n * Anton likes to play chess, and so does his friend Danik.\n *\n * Once they have played n games in a row. For each game it's known who was the winner \u2014 Anton or Danik.\n * None of the games ended with a tie.\n *\n * Now Anton wonders, who won more games, he or Danik? Help him determine this.\n *\n * Input\n * The first line of the input contains a single integer n (1\u2009\u2264\u2009n\u2009\u2264\u20091e5) \u2014 the number of games played.\n * The second line contains a string s, consisting of n uppercase English letters 'A' and 'D'\n * \u2014 the outcome of each of the games.\n * The i-th character of the string is equal to 'A' if the Anton won the i-th game\n * and 'D' if Danik won the i-th game.\n *\n * Output\n * If Anton won more games than Danik, print \"Anton\" (without quotes) in the only line of the output.\n * If Danik won more games than Anton, print \"Danik\" (without quotes) in the only line of the output.\n * If Anton and Danik won the same number of games, print \"Friendship\" (without quotes).\n */\n\n/**\n * @param string $string\n * @param string $char\n *\n * @return int\n */\nfunction freq($string, $char): int {\n return count_chars($string, 0)[ord($char)];\n}\n\n$stdin = fopen(\"php://stdin\", \"r\");\nfgets($stdin);\n$games = fgets($stdin);\n\nswitch (freq($games, \"A\") <=> freq($games, \"D\")) {\n case -1:\n echo \"Danik\";\n break;\n case 0:\n echo \"Friendship\";\n break;\n case 1:\n echo \"Anton\";\n break;\n}"}, {"source_code": " substr_count($b,\"A\")) echo \"Danik\";\nelse if( substr_count($b,\"D\")< substr_count($b,\"A\")) echo \"Anton\";\nelse echo \"Friendship\";\n\n\n?>\n"}, {"source_code": " $d) {\n \n echo \"Anton\";\n \n}elseif($a < $d) {\n \n echo \"Danik\";\n \n}else {\n \n echo \"Friendship\";\n \n}"}, {"source_code": " $W_D) {\n echo \"Anton\";\n }elseif ($W_A == $W_D) {\n echo \"Friendship\";\n }else {\n echo \"Danik\";\n }\n ?>"}, {"source_code": " $d){\n\tprint_r(\"Anton\");\n}elseif ($d > $a) {\n\tprint_r(\"Danik\");\n}else{\n\tprint_r(\"Friendship\");\n}"}, {"source_code": " $danik) {\n echo \"Anton\\n\";\n} else if ($danik > $anton) {\n echo \"Danik\\n\";\n} else {\n echo \"Friendship\\n\";\n}\n"}, {"source_code": " $d ? 'Anton' : ($a < $d ? 'Danik' : 'Friendship');\n?>"}, {"source_code": " $c) {\n\techo \"Anton\";\n}elseif($b == $c){\n\techo \"Friendship\";\n}else{\n\techo \"Danik\";\n}"}, {"source_code": " substr_count($str,'D')) {\n echo 'Anton';\n} elseif(substr_count($str, 'A') < substr_count($str,'D')) {\n echo 'Danik';\n} else echo 'Friendship';"}, {"source_code": "$ac)\n{\n echo\"Anton\";\n}\nelse{\n echo \"Danik\";\n}\n?>"}], "negative_code": [{"source_code": " $c) {\n\techo \"Anton\";\n}elseif($b == $c){\n\techo \"FriendShip\";\n}else{\n\techo \"Danik\";\n}"}, {"source_code": " substr_count('D', $str)) {\n echo 'Anton';\n} elseif(substr_count('A' , $str) < substr_count('D', $str)) {\n echo 'Danik';\n} else echo 'Friendship';"}, {"source_code": "$ac)\n{\n echo\"Anton\";\n}\nelse{\n \"Danik\";\n}\n?>"}, {"source_code": "$ac)\n{\n echo\"Anton\";\n}\nelse{\n echo \"Danik\";\n}\n?>"}, {"source_code": "$ac)\n{\n echo\"Anton\";\n}\nelse{\n \"Danik\";\n}\n?>"}, {"source_code": " $d ? 'Anton' : ( $d > $a ? 'Danik' : 'Friendship');\n\n?>"}, {"source_code": "0){\n\techo \"Anton\";\n} elseif($line0 - $A < 0){\n\techo \"Danik\";\n} else {\n\techo \"Friendship\";\n}\n?>"}, {"source_code": "0){\n\techo \"Anton\";\n} elseif($A - $line0 < 0){\n\techo \"Danik\";\n} else {\n\techo \"Friendship\";\n}\n?>"}, {"source_code": " $d){\n echo \"Anton\";\n }else{\n echo \"Danik\";\n }\n}"}, {"source_code": " $d){\n echo \"Anton\";\n }else{\n echo \"Danik\";\n }\n}"}, {"source_code": " $d ? 'Anton' : $a < $d ? 'Danik' : 'Friendship';"}, {"source_code": " $d) {\n\techo \"Anton\\n\";\n} else {\n\techo \"Danik\\n\";\n}"}, {"source_code": "$N = rtrim(fgets(STDIN)); \n$string = rtrim(fgets(STDIN));\n$Anton = substr_count($string,\"A\");\n$Danik = substr_count($string,\"D\");\nif($Anton>$Danik){\n echo(\"Anton\");\n}elseif ($Anton<$Danik){\n echo(\"Danik\");\n}else {\n echo(\"Friendship\");\n}"}, {"source_code": "$_N = rtrim(fgets(STDIN)); \n$string = rtrim(fgets(STDIN));\n$Anton = substr_count($string,\"A\");\n$Danik = substr_count($string,\"D\");\nif($Anton>$Danik){\n echo(\"Anton\");\n}elseif ($Anton<$Danik){\n echo(\"Danik\");\n}else {\n echo(\"Friendship\");\n}"}, {"source_code": "$r)\n return \"Anton\";\n else if($c<$r)\n return \"Danik\";\n else\n return \"Friendship\";\n}\nfunction solve()\n{\n $server=\"php://stdin\";\n $local=\"input.txt\";\n $handle = fopen($server, \"r\");\n $s=\"\";\n fscanf($handle, \"%s\", $s);\n printf(\"%s\", check($s));\n}\n\nsolve();\n?>"}, {"source_code": " substr_count($b,\"A\")) echo \"Danik\"; else echo \"Anton\";\n\n\n?>\n"}, {"source_code": " $W_D) {\n echo \"Anton\";\n }elseif ($W_A == $W_D) {\n echo \"Friendship\";\n }else {\n echo \"Danik\";\n }\n ?>"}], "src_uid": "0de32a7ccb08538a8d88239245cef50b"} {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n list($n, $m) = IO::arr();\r\n $a = IO::arr();\r\n $f = $a[0];\r\n $b = array_flip($a);\r\n sort($a);\r\n $res = 1;\r\n for ($i = 1; $i < $n; $i++) {\r\n if ($i == 0) {\r\n if ($f != $a[$i]) {\r\n $res++;\r\n }\r\n } else {\r\n $x = $a[$i];\r\n $y = $a[$i - 1];\r\n if ($b[$x] - $b[$y] !== 1) {\r\n $res++;\r\n }\r\n }\r\n }\r\n\r\n if ($res <= $m) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n\r\n}\r\n\r\n\r\n?>\r\n\r\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n list($n, $m) = IO::arr();\r\n $a = IO::arr();\r\n $f = $a[0];\r\n $b = array_flip($a);\r\n sort($a);\r\n $res = 0;\r\n for ($i = 0; $i < $n; $i++) {\r\n if ($i == 0) {\r\n if ($f != $a[$i]) {\r\n $res++;\r\n }\r\n } else {\r\n $x = $a[$i];\r\n $y = $a[$i - 1];\r\n if ($b[$x] - $b[$y] !== 1) {\r\n $res++;\r\n }\r\n }\r\n }\r\n\r\n if ($res <= $m) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n\r\n}\r\n\r\n\r\n?>\r\n\r\n"}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n list($n, $m) = IO::arr();\r\n $a = IO::arr();\r\n $res = 0;\r\n $last = $a[0];\r\n for($i = 0; $i < $n; $i++) {\r\n if(!isset($a[$i+1])) {\r\n continue;\r\n }\r\n if ($a[$i] > $a[$i+1]) {\r\n $res++;\r\n } elseif ($a[$i+1] < $last) {\r\n $res++;\r\n }\r\n if ($last < $a[$i + 1]) {\r\n $last = $a[$i+1];\r\n }\r\n }\r\n if ($res <= $m) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n\r\n}\r\n\r\n\r\n?>\r\n\r\n"}, {"source_code": "= $i) {\r\n $z[$i] = min($z[$i - $l], $r - $i + 1);\r\n }\r\n while ($z[$i] + $i < $n && $s[$z[$i]] == $s[$z[$i] + $i]) {\r\n $z[$i]++;\r\n }\r\n if ($i + $z[$i] - 1 > $r) {\r\n $l = $i;\r\n $r = $i + $z[$i] - 1;\r\n }\r\n }\r\n return $z;\r\n }\r\n public static function getCountOfDiffSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $n = count($s);\r\n $count = 0;\r\n $t = '';\r\n for ($i = $n - 1; $i >= 0; $i--) {\r\n $t = $s[$i] . $t;\r\n $count += $i + 1 - max(self::z($t));\r\n }\r\n return $count;\r\n }\r\n public static function getMinPeriodOfSubstrWithZ($sString)\r\n {\r\n $s = str_split($sString);\r\n $res = count($s);\r\n $z = self::z($sString);\r\n foreach ($z as $iI => $sV) {\r\n if ((int) $iI + $z[$iI] == $res && $res % (int) $iI == 0) {\r\n $res = $iI;\r\n break;\r\n }\r\n }\r\n return $res;\r\n }\r\n\r\n //Other functions\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n public static function lcm($x, $y) {\r\n $p = $x;\r\n $q = $y;\r\n while ($x != $y)\r\n {\r\n if ($x > $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n\r\n}\r\n\r\n//$iQueryCount = 1;\r\n$iQueryCount = IO::str();\r\n$aAllResults = [];\r\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n list($n, $m) = IO::arr();\r\n $a = IO::arr();\r\n $res = 0;\r\n $last = $a[0];\r\n for($i = 0; $i < $n; $i++) {\r\n if(!isset($a[$i+1])) {\r\n continue;\r\n }\r\n if ($a[$i] > $a[$i+1]) {\r\n $res++;\r\n } elseif ($a[$i] < $last) {\r\n $res++;\r\n }\r\n if ($a[$i] > $last) {\r\n $last = $a[$i];\r\n }\r\n }\r\n if ($res <= $m) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n\r\n}\r\n\r\n\r\n?>"}], "src_uid": "255d6fca1379ae40b03e761802f36664"} {"source_code": "= $ktx) || (($krx == $ktx) && $krx >= $shx) || (($shx == $ktx) && $shx >= $krx)){\n\tdie(\"Draw\\n\");\n}else{\n\tif($ktx > $shx && $ktx > $krx){\n\t\techo \"Katie\\n\";\n\t}elseif($krx > $ktx && $krx > $shx){\n\t\techo \"Kuro\\n\";\n\t}else{\n\t\techo \"Shiro\\n\";\n\t}\n}", "positive_code": [{"source_code": " $e2) && ($e > $e3))\n{\n print \"Kuro\";\n}\nelseif(($e2 > $e) && ($e2 > $e3))\n{\n print \"Shiro\";\n}\nelseif(($e3 > $e) && ($e3 > $e2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}], "negative_code": [{"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($a == 68183)\n{\n print $h . \" \" . $i . \" \" . $j . \"\\n\";\n print $k . \" \" . $l . \" \" . $m . \"\\n\";\n}\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n if($a == 68183)\n {\n print implode(\" \", $g) . \"\\n\";\n }\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = strlen($b);\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = strlen($c);\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = strlen($d);\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$k = max($h, $i, $j);\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = strlen($c) - 1;\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $i;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = strlen($e) - 1;\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $j;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = strlen($g) - 1;\n }\n}\nelse\n{\n $j += $a;\n}\nif($a == 73130)\n{\n print $h . \" \" . $i . \" \" . $j . \" \". strlen($c) . \"\\n\";\n}\n$k = max($h, $i, $j);\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\n$f = max($e);\n$e2 = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($c); $x++)\n{\n $e2[$c[$x]]++;\n}\n$f2 = max($e2);\n$e3 = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($d); $x++)\n{\n $e3[$d[$x]]++;\n}\n$f3 = max($e3);\n$g = strlen($b) - $f;\n$g2 = strlen($c) - $f2;\n$g3 = strlen($d) - $f3;\nif($a <= $g)\n{\n $g -= $a;\n}\nelse\n{\n $a -= $g;\n $h = $a % 2;\n if($h == 0)\n {\n $g = 0;\n }\n else\n {\n $g = 1;\n }\n}\nif($a <= $g2)\n{\n $g2 -= $a;\n}\nelse\n{\n $a -= $g2;\n $h2 = $a % 2;\n if($h2 == 0)\n {\n $g2 = 0;\n }\n else\n {\n $g2 = 1;\n }\n}\nif($a < $g3)\n{\n $g3 -= $a;\n}\nelse\n{\n $a -= $g3;\n $h3 = $a % 2;\n if($h3 == 0)\n {\n $g3 = 0;\n }\n else\n {\n $g3 = 1;\n }\n}\nif((($g == 0) && ($g2 != 0) && ($g3 != 0)) || (($g < $g2) && ($g < $g3)))\n{\n print \"Kuro\";\n}\nelseif(($g != 0) && ($g2 == 0) && ($g3 != 0) || (($g2 < $g) && ($g2 < $g3)))\n{\n print \"Shiro\";\n}\nelseif(($g != 0) && ($g2 != 0) && ($g3 == 0) || (($g3 < $g) && ($g3 < $g2)))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = strlen($c) - 1;\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $i;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = strlen($e) - 1;\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $j;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = strlen($g) - 1;\n }\n}\nelse\n{\n $j += $a;\n}\n$k = max($h, $i, $j);\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n if($a == 68183)\n {\n print strlen($b) . \" \" . $e[$x] . \"\\n\";\n }\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\nif($a == 73130)\n{\n print $h . \" \" . $i . \" \" . $j . \" \". strlen($c) . \"\\n\";\n}\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = strlen($c) - 1;\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $i;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = strlen($e) - 1;\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $j;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = strlen($g) - 1;\n }\n}\nelse\n{\n $j += $a;\n}\n$k = max($h, $i, $j);\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0))\n {\n $e = strlen($b);\n }\n else\n {\n $e = strlen($b) - 1;\n }\n }\n}\n$b2 = trim(fgets(STDIN));\n$c2 = array();\nfor($x = 0; $x < strlen($b2); $x++)\n{\n $c2[$b2[$x]]++;\n}\nrsort($c2);\n$d2 = strlen($b2) - $c2[0];\nif($a <= $d2)\n{\n $e2 = $c2[0] + $a;\n}\nelse\n{\n $f2 = $a - $d2;\n $g2 = $f2 % 2;\n if($g2 == 0)\n {\n $e2 = strlen($b2);\n }\n else\n {\n if(($c2[1] == TRUE) && ($f2 > 0))\n {\n $e2 = strlen($b2);\n }\n else\n {\n $e2 = strlen($b2) - 1;\n }\n }\n}\n$b3 = trim(fgets(STDIN));\n$c3 = array();\nfor($x = 0; $x < strlen($b3); $x++)\n{\n $c3[$b3[$x]]++;\n}\nrsort($c3);\n$d3 = strlen($b3) - $c3[0];\nif($a <= $d3)\n{\n $e3 = $c3[0] + $a;\n}\nelse\n{\n $f3 = $a - $d3;\n $g3 = $f3 % 2;\n if($g3 == 0)\n {\n $e3 = strlen($b3);\n }\n else\n {\n if(($c3[1] == TRUE) && ($f3 > 0))\n {\n $e3 = strlen($b3);\n }\n else\n {\n $e3 = strlen($b3) - 1;\n }\n }\n}\nif(($e > $e2) && ($e > $e3))\n{\n print \"Kuro\";\n}\nelseif(($e2 > $e) && ($e2 > $e3))\n{\n print \"Shiro\";\n}\nelseif(($e3 > $e) && ($e3 > $e2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\n$h = max($e);\n$i = max($f);\n$j = max($g);\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $n = strlen($b) - 1;\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n = $a - $l;\n $o = $n % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $n2 = strlen($c) - 1;\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n = $a - $m;\n $o = $n % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $n3 = strlen($d) - 1;\n }\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " $e2) && ($e > $e3))\n{\n print \"Kuro\";\n}\nelseif(($e2 > $e) && ($e2 > $e3))\n{\n print \"Shiro\";\n}\nelseif(($e3 > $e) && ($e3 > $e2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n if($a == 68183)\n {\n print implode(\" \", $g) . \"\\n\";\n print $m . \"\\n\";\n }\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($a == 68183)\n {\n print implode(\" \", $f) . \"\\n\";\n print $l . \"\\n\";\n }\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = strlen($c) - 1;\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $i;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = strlen($e) - 1;\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $j;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = strlen($g) - 1;\n }\n}\nelse\n{\n $j += $a;\n}\n$k = max($h, $i, $j);\nif($a == 73130)\n{\n print $h . \" \" . $i . \" \" . $j . \"\\n\";\n}\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($a == 68183)\n {\n print $p . \"\\n\";\n }\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = strlen($c) - 1;\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $i;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = strlen($e) - 1;\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $j;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = strlen($g) - 1;\n }\n}\nelse\n{\n $j += $a;\n}\n$k = max($h, $i, $j);\nif($a == 73130)\n{\n print $h . \" \" . $i . \" \" . $k . \"\\n\";\n}\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = strlen($c) - 1;\n }\n else\n {\n $i = strlen($c);\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $i;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = strlen($e) - 1;\n }\n else\n {\n $i = strlen($e);\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $j;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = strlen($g) - 1;\n }\n else\n {\n $i = strlen($g);\n }\n}\nelse\n{\n $j += $a;\n}\nif($a == 73130)\n{\n print $h . \" \" . $i . \" \" . $j . \" \". strlen($c) . \"\\n\";\n}\n$k = max($h, $i, $j);\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\n$f = max($e);\n$e2 = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($c); $x++)\n{\n $e2[$c[$x]]++;\n}\n$f2 = max($e2);\n$e3 = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($d); $x++)\n{\n $e3[$d[$x]]++;\n}\n$f3 = max($e3);\n$g = strlen($b) - $f;\n$g2 = strlen($c) - $f2;\n$g3 = strlen($d) - $f3;\nif($a2 <= $g)\n{\n $g -= $a2;\n}\nelse\n{\n $a2 -= $g;\n $h = $a2 % 2;\n if($h == 0)\n {\n $g = 1;\n }\n else\n {\n $g = 0;\n }\n}\nif($a3 <= $g2)\n{\n $g2 -= $a3;\n}\nelse\n{\n $a3 -= $g2;\n $h2 = $a3 % 2;\n if($h2 == 0)\n {\n $g2 = 1;\n }\n else\n {\n $g2 = 0;\n }\n}\nif($a4 < $g3)\n{\n $g3 -= $a4;\n}\nelse\n{\n $a4 -= $g3;\n $h3 = $a4 % 2;\n if($h3 == 0)\n {\n $g3 = 1;\n }\n else\n {\n $g3 = 0;\n }\n}\nif((($g == 0) && ($g2 != 0) && ($g3 != 0)) || (($g < $g2) && ($g < $g3)))\n{\n print \"Kuro\";\n}\nelseif(($g != 0) && ($g2 == 0) && ($g3 != 0) || (($g2 < $g) && ($g2 < $g3)))\n{\n print \"Shiro\";\n}\nelseif(($g != 0) && ($g2 != 0) && ($g3 == 0) || (($g3 < $g) && ($g3 < $g2)))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\n$f = max($e);\n$e2 = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($c); $x++)\n{\n $e2[$c[$x]]++;\n}\n$f2 = max($e2);\n$e3 = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($d); $x++)\n{\n $e3[$d[$x]]++;\n}\n$f3 = max($e3);\n$g = strlen($b) - $f;\n$g2 = strlen($c) - $f2;\n$g3 = strlen($d) - $f3;\nif($g <= $a)\n{\n $g -= $a;\n}\nelse\n{\n $g -= $a;\n $h = $g % 2;\n if($h == 0)\n {\n $g = 0;\n }\n else\n {\n $g = 1;\n }\n}\nif($g2 <= $a)\n{\n $g2 -= $a;\n}\nelse\n{\n $g2 -= $a;\n $h2 = $g2 % 2;\n if($h2 == 0)\n {\n $g2 = 0;\n }\n else\n {\n $g2 = 1;\n }\n}\nif($g3 <= $a)\n{\n $g3 -= $a;\n}\nelse\n{\n $g3 -= $a;\n $h3 = $g3 % 2;\n if($h3 == 0)\n {\n $g3 = 0;\n }\n else\n {\n $g3 = 1;\n }\n}\nif(($g == 0) && ($g2 != 0) && ($g3 != 0))\n{\n print \"Kuro\";\n}\nelseif(($g != 0) && ($g2 == 0) && ($g3 != 0))\n{\n print \"Shiro\";\n}\nelseif(($g != 0) && ($g2 != 0) && ($g3 == 0))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n if($a == 68183)\n {\n print implode(\" \", $e) . \"\\n\";\n }\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif($a == 68183)\n{\n print $n . \" \" . $n2 . \" \" . $n3 . \"\\n\";\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($a >= $s)\n {\n $t = 1;\n }\n break;\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = $a - 1;\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = $a - 1;\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = $a - 1;\n }\n}\nelse\n{\n $j += $a;\n}\n$k = max($h, $i, $j);\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}, {"source_code": " $ktx) || (($krx == $ktx) && $krx > $shx) || (($shx == $ktx) && $shx > $krx)){\n\tdie(\"Draw\\n\");\n}else{\n\tif($ktx > $shx && $ktx > $krx){\n\t\techo \"Katie\\n\";\n\t}elseif($krx > $ktx && $krx > $shx){\n\t\techo \"Kuro\\n\";\n\t}else{\n\t\techo \"Shiro\\n\";\n\t}\n}"}, {"source_code": " $ktx) || (($krx == $ktx) && $krx > $shx) || (($shx == $ktx) && $shx > $krx)){\n\tdie(\"Draw\\n\");\n}else{\n\tif($ktx > $shx && $ktx > $krx){\n\t\techo \"Katie\\n\";\n\t}elseif($krx > $ktx && $krx > $shx){\n\t\techo \"Kuro\\n\";\n\t}else{\n\t\techo \"Shiro\\n\";\n\t}\n}"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\nfor($x = 0; $x < strlen($b); $x++)\n{\n $e[$b[$x]]++;\n}\nfor($x = 0; $x < strlen($c); $x++)\n{\n $f[$c[$x]]++;\n}\nfor($x = 0; $x < strlen($d); $x++)\n{\n $g[$d[$x]]++;\n}\nrsort($e);\nrsort($f);\nrsort($g);\n$h = $e[0];\n$i = $f[0];\n$j = $g[0];\n$k = strlen($b) - $h;\n$l = strlen($c) - $i;\n$m = strlen($d) - $j;\nif($k >= $a)\n{\n $n = $h + $a;\n}\nelse\n{\n $n = $a - $k;\n $o = $n % 2;\n if($o == 0)\n {\n $n = strlen($b);\n }\n else\n {\n $p = $h % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 1)\n {\n $s = strlen($b) - $e[$x];\n if($s >= $a)\n {\n $t = 1;\n break;\n }\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n $r = $e[$x] % 2;\n if($r == 0)\n {\n $s = strlen($b) - $e[$x];\n if($s >= $a)\n {\n $t = 1;\n break;\n }\n }\n }\n if($t == 0)\n {\n $n = strlen($b) - 1;\n }\n else\n {\n $n = strlen($b);\n }\n }\n }\n}\nif($l >= $a)\n{\n $n2 = $i + $a;\n}\nelse\n{\n $n2 = $a - $l;\n $o = $n2 % 2;\n if($o == 0)\n {\n $n2 = strlen($c);\n }\n else\n {\n $p = $i % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 1)\n {\n $s = strlen($c) - $f[$x];\n if($s >= $a)\n {\n $t = 1;\n break;\n }\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($f); $x++)\n {\n $r = $f[$x] % 2;\n if($r == 0)\n {\n $s = strlen($c) - $f[$x];\n if($s >= $a)\n {\n $t = 1;\n break;\n }\n }\n }\n if($t == 0)\n {\n $n2 = strlen($b) - 1;\n }\n else\n {\n $n2 = strlen($b);\n }\n }\n }\n}\nif($m >= $a)\n{\n $n3 = $j + $a;\n}\nelse\n{\n $n3 = $a - $m;\n $o = $n3 % 2;\n if($o == 0)\n {\n $n3 = strlen($d);\n }\n else\n {\n $p = $j % 2;\n if($p == 0)\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 1)\n {\n $s = strlen($d) - $g[$x];\n if($s >= $a)\n {\n $t = 1;\n break;\n }\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n else\n {\n $t = 0;\n for($x = 0; $x < count($g); $x++)\n {\n $r = $g[$x] % 2;\n if($r == 0)\n {\n $s = strlen($d) - $g[$x];\n if($s >= $a)\n {\n $t = 1;\n break;\n }\n }\n }\n if($t == 0)\n {\n $n3 = strlen($b) - 1;\n }\n else\n {\n $n3 = strlen($b);\n }\n }\n }\n}\nif(($n > $n2) && ($n > $n3))\n{\n print \"Kuro\";\n}\nelseif(($n2 > $n) && ($n2 > $n3))\n{\n print \"Shiro\";\n}\nelseif(($n3 > $n) && ($n3 > $n2))\n{\n print \"Katie\";\n}\nelse\n{\n print \"Draw\";\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$c = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($c); $x++)\n{\n $b[$c[$x]]++;\n}\n$d = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$e = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($e); $x++)\n{\n $d[$e[$x]]++;\n}\n$f = array(a => 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0, A => 0, B => 0, C => 0, D => 0, E => 0, F => 0, G => 0, H => 0, I => 0, J => 0, K => 0, L => 0, M => 0, N => 0, O => 0, P => 0, Q => 0, R => 0, S => 0, T => 0, U => 0, V => 0, W => 0, X => 0, Y => 0, Z => 0);\n$g = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($g); $x++)\n{\n $f[$g[$x]]++;\n}\n$h = max($b);\n$i = max($d);\n$j = max($f);\n$l = strlen($c) - $h;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $h = $a - 1;\n }\n}\nelse\n{\n $h += $a;\n}\n$l = strlen($e) - $i;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $i = $a - 1;\n }\n}\nelse\n{\n $i += $a;\n}\n$l = strlen($g) - $j;\nif($a > $l)\n{\n $a2 = $a;\n $a2 -= $l;\n $m = $a2 % 2;\n if($m != 0)\n {\n $j = $a - 1;\n }\n}\nelse\n{\n $j += $a;\n}\n$k = max($h, $i, $j);\nif((($h == $k) && ($i == $k)) || (($h == $k) && ($j == $k)) || (($i == $k) && ($j == $k)))\n{\n print \"Draw\";\n}\nelseif(($h > $i) && ($h > $j))\n{\n print \"Kuro\";\n}\nelseif(($i > $h) && ($i > $j))\n{\n print \"Shiro\";\n}\nelseif(($j > $h) && ($j > $i))\n{\n print \"Katie\";\n}\n?>"}], "src_uid": "9b277feec7952947357b133a152fd599"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n$lines=file_get_contents(\"input.txt\");\n$lines = trim($lines);\n\n\n$lines=explode(\"\\n\", $lines);\n\n$dir=trim($lines[0]);\n$por=trim($lines[1]);\n\nif ($dir==\"front\")\n $res=($por==1)?\"L\":\"R\";\nif ($dir==\"back\")\n $res=($por==1)?\"R\":\"L\";\nfile_put_contents(\"output.txt\", $res);\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "77093f12ff56d5f404e9c87650d4aeb4"} {"source_code": "", "positive_code": [{"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\n$d = -1;\nfor($x = 0; $x < strlen($c); $x++)\n{\n if($c[$x] == \"*\")\n {\n $d = $x;\n break;\n }\n}\n$e = trim(fgets(STDIN));\nif($d == \"-1\")\n{\n for($x = 1; $x <= $e; $x++)\n {\n $f = trim(fgets(STDIN));\n if(strlen($c) == strlen($f))\n {\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if(($c[$y] == \"?\") && ($a[$f[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $f[$y]))\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\nelse\n{\n if($d == 0)\n {\n $c = strrev($c);\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = strrev(trim(fgets(STDIN)));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n elseif($d == strlen($c) - 1)\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n $i = 0;\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < $d; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($y2 = strlen($h) - 1; $y2 > strlen($h) - (strlen($c) - $d); $y2--)\n {\n if(($c[strlen($c) - 1 - $i] == \"?\") && ($a[$h[$y2]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[strlen($c) - 1 - $i] != \"?\") && ($c[strlen($c) - 1 - $i] != $h[$y2]))\n {\n $g = 1;\n break;\n }\n $i++;\n }\n for($z = $y; $z <= $y2; $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\n$d = -1;\nfor($x = 0; $x < strlen($c); $x++)\n{\n if($c[$x] == \"*\")\n {\n $d = $x;\n break;\n }\n}\n$e = trim(fgets(STDIN));\nif(($b == \"y\") && ($c[0] == \"a\"))\n{\n print strlen($c) . \" \" . $d . \"\\n\";\n for($x = 1; $x <= 8; $x++)\n {\n $f = trim(fgets(STDIN));\n if($x == 8)\n {\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n}\nif($d == \"-1\")\n{\n for($x = 1; $x <= $e; $x++)\n {\n $f = trim(fgets(STDIN));\n if(strlen($c) == strlen($f))\n {\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if(($c[$y] == \"?\") && ($a[$f[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $f[$y]))\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\nelse\n{\n if($d == 0)\n {\n $c = strrev($c);\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = strrev(trim(fgets(STDIN)));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n elseif($d == strlen($c) - 1)\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n $i = 0;\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < $d; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($y2 = strlen($h) - 1; $y2 > strlen($h) - (strlen($c) - $d); $y2--)\n {\n if(($c[strlen($c) - 1 - $i] == \"?\") && ($a[$h[$y2]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[strlen($c) - 1 - $i] != \"?\") && ($c[strlen($c) - 1 - $i] != $h[$y2]))\n {\n $g = 1;\n break;\n }\n $i++;\n }\n for($z = $y; $z < $y2; $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\n$d = -1;\nfor($x = 0; $x < strlen($c); $x++)\n{\n if($c[$x] == \"*\")\n {\n $d = $x;\n break;\n }\n}\n$e = trim(fgets(STDIN));\nif($d == \"-1\")\n{\n for($x = 1; $x <= $e; $x++)\n {\n $f = trim(fgets(STDIN));\n if(strlen($c) == strlen($f))\n {\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if(($c[$y] == \"?\") && ($a[$f[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $f[$y]))\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\nelse\n{\n if($d == 0)\n {\n $c = strrev($c);\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = strrev(trim(fgets(STDIN)));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n elseif($d == strlen($c) - 1)\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n $i = 0;\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < $d; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($y2 = strlen($h) - 1; $y2 > strlen($h) - (strlen($c) - $d); $y2--)\n {\n if(($c[strlen($c) - 1 - $i] == \"?\") && ($a[$h[$y2]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[strlen($c) - 1 - $i] != \"?\") && ($c[strlen($c) - 1 - $i] != $h[$y2]))\n {\n $g = 1;\n break;\n }\n $i++;\n }\n for($z = $y; $z < $y2; $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\n$d = 0;\nfor($x = 0; $x < strlen($c); $x++)\n{\n if($c[$x] == \"*\")\n {\n $d = 1;\n $e = $x;\n $e2 = $x - 1;\n $e3 = $x + 1;\n break;\n }\n}\n$f = trim(fgets(STDIN));\nfor($x = 0; $x < $f; $x++)\n{\n $g = trim(fgets(STDIN));\n if($d == 0)\n {\n if(strlen($c) != strlen($g))\n {\n print \"NO\\n\";\n }\n else\n {\n $h = 0;\n for($y = 0; $y < strlen($g); $y++)\n {\n if($c[$y] == \"?\")\n {\n if($a[$g[$y]] == 0)\n {\n $h = 1;\n break;\n }\n }\n else\n {\n if($c[$y] != $g[$y])\n {\n $h = 1;\n break;\n }\n }\n }\n if($h == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n if(strlen($g) < strlen($c) - 1)\n {\n print \"NO\\n\";\n }\n else\n {\n if(strlen($c) - 1 == strlen($g))\n {\n $j = substr($c, 0, $e);\n $k = substr($c, $e + 1);\n $c = $j . $k;\n }\n $i = 0;\n $l = strlen($g) - $e3;\n $m = 1;\n for($y = 0; $y < strlen($g); $y++)\n {\n if(($y >= 0) && ($y <= $e2))\n {\n if($c[$y] == \"?\")\n {\n if($a[$g[$y]] == 0)\n {\n $i = 1;\n break;\n }\n }\n else\n {\n if($c[$y] != $g[$y])\n {\n $i = 1;\n break;\n }\n }\n }\n elseif($y >= $l)\n {\n if($c[$y - $m + 1] == \"?\")\n {\n if($a[$g[$y]] == 0)\n {\n $i = 1;\n break;\n }\n }\n else\n {\n if($c[$y - $m + 1] != $g[$y])\n {\n $i = 1;\n break;\n }\n }\n }\n elseif($y > $e2)\n {\n if(strlen($g) - strlen($c) != 1)\n {\n $m++;\n if($a[$g[$y]] == 1)\n {\n $i = 1;\n break;\n }\n }\n else\n {\n $m--;\n }\n }\n }\n if($i == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\n$d = -1;\nfor($x = 0; $x < strlen($c); $x++)\n{\n if($c[$x] == \"*\")\n {\n $d = $x;\n break;\n }\n}\n$e = trim(fgets(STDIN));\nif(($b == \"y\") && ($c[0] == \"a\"))\n{\n print strlen($c) . \" \" . $d . \"\\n\";\n for($x = 1; $x <= 8; $x++)\n {\n $f = trim(fgets(STDIN));\n if($x == 8)\n {\n print $f . \"\\n\";\n }\n }\n}\nif($d == \"-1\")\n{\n for($x = 1; $x <= $e; $x++)\n {\n $f = trim(fgets(STDIN));\n if(strlen($c) == strlen($f))\n {\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if(($c[$y] == \"?\") && ($a[$f[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $f[$y]))\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\nelse\n{\n if($d == 0)\n {\n $c = strrev($c);\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = strrev(trim(fgets(STDIN)));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n elseif($d == strlen($c) - 1)\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n $i = 0;\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < $d; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($y2 = strlen($h) - 1; $y2 > strlen($h) - (strlen($c) - $d); $y2--)\n {\n if(($c[strlen($c) - 1 - $i] == \"?\") && ($a[$h[$y2]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[strlen($c) - 1 - $i] != \"?\") && ($c[strlen($c) - 1 - $i] != $h[$y2]))\n {\n $g = 1;\n break;\n }\n $i++;\n }\n for($z = $y; $z < $y2; $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\nif($b == \"y\")\n{\n print strlen($c) . \"\\n\";\n}\nelse\n{\n $d = -1;\n for($x = 0; $x < strlen($c); $x++)\n {\n if($c[$x] == \"*\")\n {\n $d = $x;\n break;\n }\n }\n $e = trim(fgets(STDIN));\n if($d == \"-1\")\n {\n for($x = 1; $x <= $e; $x++)\n {\n $f = trim(fgets(STDIN));\n if(strlen($c) == strlen($f))\n {\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if(($c[$y] == \"?\") && ($a[$f[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $f[$y]))\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n if($d == 0)\n {\n $c = strrev($c);\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = strrev(trim(fgets(STDIN)));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n elseif($d == strlen($c) - 1)\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n $i = 0;\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < $d; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($y2 = strlen($h) - 1; $y2 > strlen($h) - (strlen($c) - $d); $y2--)\n {\n if(($c[strlen($c) - 1 - $i] == \"?\") && ($a[$h[$y2]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[strlen($c) - 1 - $i] != \"?\") && ($c[strlen($c) - 1 - $i] != $h[$y2]))\n {\n $g = 1;\n break;\n }\n $i++;\n }\n for($z = $y; $z < $y2; $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\nif(($b == \"y\") && ($c[0] == \"a\"))\n{\n print strlen($c) . \"\\n\";\n}\nelse\n{\n $d = -1;\n for($x = 0; $x < strlen($c); $x++)\n {\n if($c[$x] == \"*\")\n {\n $d = $x;\n break;\n }\n }\n $e = trim(fgets(STDIN));\n if($d == \"-1\")\n {\n for($x = 1; $x <= $e; $x++)\n {\n $f = trim(fgets(STDIN));\n if(strlen($c) == strlen($f))\n {\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if(($c[$y] == \"?\") && ($a[$f[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $f[$y]))\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n if($d == 0)\n {\n $c = strrev($c);\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = strrev(trim(fgets(STDIN)));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n elseif($d == strlen($c) - 1)\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n $i = 0;\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < $d; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($y2 = strlen($h) - 1; $y2 > strlen($h) - (strlen($c) - $d); $y2--)\n {\n if(($c[strlen($c) - 1 - $i] == \"?\") && ($a[$h[$y2]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[strlen($c) - 1 - $i] != \"?\") && ($c[strlen($c) - 1 - $i] != $h[$y2]))\n {\n $g = 1;\n break;\n }\n $i++;\n }\n for($z = $y; $z < $y2; $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 0, b => 0, c => 0, d => 0, e => 0, f => 0, g => 0, h => 0, i => 0, j => 0, k => 0, l => 0, m => 0, n => 0, o => 0, p => 0, q => 0, r => 0, s => 0, t => 0, u => 0, v => 0, w => 0, x => 0, y => 0, z => 0);\n$b = trim(fgets(STDIN));\nfor($x = 0; $x < strlen($b); $x++)\n{\n $a[$b[$x]] = 1;\n}\n$c = trim(fgets(STDIN));\n$d = -1;\nfor($x = 0; $x < strlen($c); $x++)\n{\n if($c[$x] == \"*\")\n {\n $d = $x;\n break;\n }\n}\nif(($b == \"y\") && ($c[0] == \"a\"))\n{\n print strlen($c) . \" \" . $d . \"\\n\";\n}\n$e = trim(fgets(STDIN));\nif($d == \"-1\")\n{\n for($x = 1; $x <= $e; $x++)\n {\n $f = trim(fgets(STDIN));\n if(strlen($c) == strlen($f))\n {\n $g = 0;\n for($y = 0; $y < strlen($f); $y++)\n {\n if(($c[$y] == \"?\") && ($a[$f[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $f[$y]))\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\nelse\n{\n if($d == 0)\n {\n $c = strrev($c);\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = strrev(trim(fgets(STDIN)));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n elseif($d == strlen($c) - 1)\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < strlen($c) - 1; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($z = $y; $z < strlen($h); $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n else\n {\n for($x = 1; $x <= $e; $x++)\n {\n $g = 0;\n $h = trim(fgets(STDIN));\n $i = 0;\n if(strlen($h) < strlen($c) - 1)\n {\n $g = 1;\n }\n else\n {\n for($y = 0; $y < $d; $y++)\n {\n if(($c[$y] == \"?\") && ($a[$h[$y]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[$y] != \"?\") && ($c[$y] != $h[$y]))\n {\n $g = 1;\n break;\n }\n }\n for($y2 = strlen($h) - 1; $y2 > strlen($h) - (strlen($c) - $d); $y2--)\n {\n if(($c[strlen($c) - 1 - $i] == \"?\") && ($a[$h[$y2]] == 0))\n {\n $g = 1;\n break;\n }\n elseif(($c[strlen($c) - 1 - $i] != \"?\") && ($c[strlen($c) - 1 - $i] != $h[$y2]))\n {\n $g = 1;\n break;\n }\n $i++;\n }\n for($z = $y; $z < $y2; $z++)\n {\n if($a[$h[$z]] == 1)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\n?>"}], "src_uid": "c6633581d7424d670eaa0f8a5c8cc366"} {"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n$a = $ir->readArrayOfInt($n);\n$b = [];\n\nfor ($i=0; $i<$n; $i++) {\n\tif (!isset($b[$a[$i]])) {\n\t\t$b[$a[$i]] = [];\n\t}\n\t\n\t$b[$a[$i]][] = $i;\n}\n\n\n$d = 0;\n$cs = $a;\nforeach ($b as $v=>$g) {\n\tif (count($g) > $k) {\n\t\techo \"NO\";\n\t\texit();\n\t}\n\t\n\tforeach ($g as $ind) {\n\t\t$cs[$ind] = ($d%$k)+1;\n\t\t$d++;\n\t}\n}\n\nif ($d>=$k) {\n\techo \"YES\\n\";\n\techo implode(' ', $cs);\n} else {\n\techo \"NO\\n\";\n}\n", "positive_code": [{"source_code": " $b)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n asort($c);\n $f = array_keys($c);\n $g = 1;\n for($x = 0; $x < $a; $x++)\n {\n if($g > $b)\n {\n $g = 1;\n }\n $c[$f[$x]] = $g;\n $g++;\n }\n ksort($c);\n print implode(\" \", $c);\n}\n?>"}], "negative_code": [{"source_code": "_fh = $fileHandler;}\n\tpublic function readInt() {$d = trim(fgets($this->_fh));return (int)$d;}\n\tpublic function readArrayOfInt($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n\tpublic function readArrayOfString($size, $indexFrom = 0) {$a = [];$ind = $indexFrom;foreach (explode(' ', fgets($this->_fh)) as $item) {$a[$ind++] = $item;}return $a;}\n}\n\nclass Utils {\n\t/* Perform action N times. Can return values in array */\n\tstatic public function ntimes($n, $func, $returnResults = false) {$a = [];for ($i=1; $i<=$n; $i++) {$result = $func();if ($returnResults) {$a[$i] = $result;}}return $a;}\n\t/* Integral. Keys preserved. By reference. */\n\tstatic public function cumsum(&$a){$sum = 0;foreach($a as $k=>$v) {$a[$k] += $sum;$sum = $a[$k];}}\n\t/* Difference. Keys preserved. By reference. */\n\tstatic public function diff(&$a){$prev = 0;foreach($a as $k=>$v) {$buf=$a[$k];$a[$k]-=$prev;$prev = $buf;}}\n\tstatic public function bitCount($n){$cnt = 0;for ($j=$n; $j; $j>>=1){$cnt += $j&1;}return $cnt;}\n}\n\nclass PrimeUtils {static protected $divisors = [1 => [1=>true],2 => [1=>true, 2=>true],];static protected $primes = []; \n\tstatic public function primes($limit){$a = str_repeat(chr(85), ($limit>>3) + 1);$a[0] = chr(83);for ($i=3; $i*$i < $limit; $i+=2) {if (ord($a[$i>>3]) & (1<<($i%8))) {;} else {for ($k=$i; $k*$i<$limit; $k++) {$n = $k*$i;$a[$n>>3] = chr(ord($a[$n>>3]) | (1<<($n%8)));}}}yield 2;for ($i=3; $i<$limit; $i+=2) {if (!(ord($a[$i>>3]) & (1<<($i%8)))) {yield $i;}}}\n\tstatic public function divisors($n, $lp = 2) {if (isset(self::$divisors[$n])) {return self::$divisors[$n];}if (empty(self::$primes)) {$primes = [];foreach (self::primes(1e3) as $prime) {$primes[$prime] = $prime;}self::$primes = $primes;}$r = [];foreach (self::$primes as $p) {if ($p>=$lp) {if ($n < $p*$p) {$r = [1=>true, $n=>true];break;} elseif ($n%$p==0) {foreach([1, $p] as $pre) {foreach(self::divisors(intdiv($n,$p), $p) as $nxt=>$v) {$r[$nxt*$pre] = true;}}break;}}}self::$divisors[$n] = $r;return self::$divisors[$n];}\n}\n\n/*****************************************/\n\n$ir = new InputReader();\n\n/* TASK */\n\nlist($n, $k) = $ir->readArrayOfInt(2);\n$a = $ir->readArrayOfInt($n);\n\n$cs = [];\nfor ($i=0; $i<$n; $i++) {\n\tif (!isset($cs[$a[$i]])) {\n\t\t$cs[$a[$i]] = 1;\n\t}\n\t\n\t$cs[$a[$i]]++;\n\t$a[$i] = $cs[$a[$i]]-1;\n}\n\n$m = max($cs);\nif ($m==$k+1) {\n\techo \"YES\\n\";\n\techo implode(' ', $a);\n} else {\n\techo \"NO\\n\";\n}\n"}], "src_uid": "3d4df21eebf32ce15841179bb85e6f2f"} {"source_code": "\r\n= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 + $bigint2\r\n */\r\n public static function add($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcadd($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcadd($bigint1, $bigint2);\r\n return bcsub(bcadd($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 - $bigint2\r\n */\r\n public static function sub($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcsub($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcsub($bigint1, $bigint2);\r\n return bcsub(bcsub($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsub($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @param string $scale (ceil or floor or round)\r\n * @return string $bigint1 * $bigint2\r\n */\r\n public static function mul($bigint1, $bigint2, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcmul($bigint1, $bigint2);\r\n case 'round':\r\n $sResult = bcmul($bigint1, $bigint2);\r\n return bcsub(bcmul($bigint1, $bigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcmul ($bigint1, $bigint2);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint1\r\n * @param string $bigint2\r\n * @return string $bigint1 % $bigint2\r\n */\r\n public static function mod($bigint1, $bigint2) {\r\n return bcmod($bigint1, $bigint2);\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $scale (ceil or floor or round)\r\n * @return string sqrt($bigint)\r\n */\r\n public static function sqrt($bigint, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n return bcadd(bcsqrt ($bigint), 1);\r\n case 'floor':\r\n return bcsqrt($bigint);\r\n case 'round':\r\n $sResult = bcsqrt($bigint);\r\n return bcsub(bcsqrt($bigint, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcsqrt($bigint);\r\n }\r\n }\r\n\r\n /**\r\n * @param string $bigint\r\n * @param string $exponent\r\n * @param string $scale (ceil or floor or round)\r\n * @return string pow($bigint, $exponent)\r\n */\r\n public static function pow($bigint, $exponent, $scale = '') {\r\n switch ($scale) {\r\n case 'ceil':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) == 0 ? $sResult : bcadd($sResult, 1);\r\n case 'floor':\r\n return bcpow($bigint, $exponent);\r\n case 'round':\r\n $sResult = bcpow($bigint, $exponent);\r\n return bcsub(bcpow($bigint, $exponent, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcpow ($bigint, $exponent);\r\n }\r\n }\r\n}\r\n\r\nclass Algorithms\r\n{\r\n\r\n /** \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f - \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438\r\n * @param int $n\r\n * @return array\r\n */\r\n public static function factorization($n)\r\n {\r\n $a = [];\r\n for ($i = 2; $i * $i <= $n; ++$i) {\r\n $cnt = 0;\r\n while (bcmod($n, $i) == 0) {\r\n ++$cnt;\r\n $n = bcdiv($n, $i);\r\n }\r\n if ($cnt > 0) {\r\n $a[$i] = $cnt;\r\n }\r\n }\r\n if ($n > 1) {\r\n $a[$n] = 1;\r\n }\r\n\r\n return $a;\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (\u041d\u041e\u0414)\r\n */\r\n public static function gcd($a, $b)\r\n {\r\n if ($b == 0) {\r\n return $a;\r\n } else {\r\n $a = $a % $b;\r\n return self::gcd($b, $a);\r\n }\r\n }\r\n\r\n /**\r\n * @param int $a\r\n * @param int $b\r\n * @return int \u041d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (\u041d\u041e\u041a)\r\n */\r\n public static function lcm($a, $b)\r\n {\r\n return abs($a * $b) / self::gcd($a, $b);\r\n }\r\n\r\n /**\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987\r\n * return \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438{n}\r\n * @param int $n\r\n * @return int\r\n */\r\n public static function fibonacci($n)\r\n {\r\n $a = [0, 1];\r\n\r\n for ($i = 2; $i <= $n; $i++) {\r\n $a[$i] = $a[$i-1] + $a[$i-2];\r\n }\r\n\r\n return $a[$n];\r\n }\r\n\r\n}\r\n\r\n?>", "positive_code": [{"source_code": " 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $b = str_split(IO::str());\r\n $last = -1;\r\n $res = '';\r\n for ($i = 0; $i < $n; $i++) {\r\n $r = 1;\r\n if ($last != -1) {\r\n if ($last == $r + $b[$i]) {\r\n $r = 0;\r\n }\r\n }\r\n $res .= $r;\r\n $last = $b[$i] + $r;\r\n }\r\n IO::line($res);\r\n}\r\n"}, {"source_code": ""}, {"source_code": " $value)\r\n\t{\r\n\t\tif($LAST == -1 || $LAST == 0)\r\n\t\t\t$X = 1;\r\n\t\telse if($LAST == 1)\r\n\t\t{\r\n\t\t\tif($value == 1)\r\n\t\t\t\t$X = 1;\r\n\t\t\telse\r\n\t\t\t\t$X = 0;\r\n\t\t}\r\n\t\telse if($LAST == 2)\r\n\t\t{\r\n\t\t\tif($value == 1)\r\n\t\t\t\t$X = 0;\r\n\t\t\telse\r\n\t\t\t\t$X = 1;\r\n\t\t}\r\n\t\t$a .= $X;\r\n\t\t$LAST = $value + $X;\t\t\r\n\t}\r\n\tprint($a.\"\\n\");\r\n}\r\n//$end = readline();\r\n?>"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "942123e43a83d5a4cea95a6781064e28"} {"source_code": " true, 'b' => true, 'c' => true];\n\tif($i > 0) {\n\t\tif(isset($avail[$arr[$i - 1]])) {\n\t\t\tunset($avail[$arr[$i - 1]]);\n\t\t}\n\t}\n\t\n\tif($i < (strlen($arr) - 1)) {\n\t\t$q = $arr[$i + 1];\n\t\tif(isset($avail[$q])) {\n\t\t\tunset($avail[$q]);\n\t\t}\n\t}\n\treturn array_keys($avail)[0];\n}\n\nfgets(STDIN);\n\nwhile($f = trim(fgets(STDIN))){\n\t$a = [];\n\t//$f = str_explode($f);\n for($i = 0; $i < strlen($f); $i++) {\n \tif($f[$i] != \"?\") {\n \t\t$a[] = $f[$i];\n \t\tif($i === 0) {\n \t\t\tcontinue;\n \t\t}\n \t\t\n \t\tif($f[$i - 1] == $f[$i]) {\n \t\t\t$a = null;\n \t\t\tbreak;\n \t\t}\n \t} else {\n \t\t$f[$i] = getAllowed($f, $i);\n \t\t$a[] = $f[$i];\n \t}\n }\n \n echo ($a) ? implode('', $a) : \"-1\";\n echo PHP_EOL;\n}", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $val)\n { \n if($k == 0 || $val == \"?\") {\n if($val == \"?\") $prev = \"?\";\n continue;\n } \n \n if($val == $prev && $prev != \"?\")\n return false;\n $prev = $chars[$k];\n }\n return true;\n}\n\nfunction makeNice($string)\n{\n $chars = str_split($string);\n unset($chars[count($chars) - 1]);\n $prev = \"\";\n $lastChanged = -1;\n foreach($chars as $k => $val)\n {\n if($val == \"?\")\n { \n $first = \"a\";\n if($k != count($chars) - 1)\n $last = $chars[$k + 1];\n else\n $last = $first;\n \n if($k == 0) \n $first = $last;\n else\n $first = $chars[$k - 1];\n \n $fl = array($first, $last);\n if(!in_array(\"a\", $fl))\n $val = \"a\";\n if(!in_array(\"b\", $fl))\n $val = \"b\";\n if(!in_array(\"c\", $fl))\n $val = \"c\";\n \n \n $chars[$k] = $val; \n }\n $prev = $val;\n }\n return implode(\"\", $chars);\n}\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": " $val)\n {\n if($k == 0 || $val == \"?\") continue;\n //echo $val.\" \".$prev;\n if($val == $prev && $prev != \"?\")\n return false;\n $prev = $chars[$k];\n }\n return true;\n}\n\nfunction makeNice($string)\n{\n $chars = str_split($string);\n unset($chars[count($chars) - 1]);\n $prev = \"\";\n $lastChanged = -1;\n foreach($chars as $k => $val)\n {\n if($val == \"?\")\n {\n /*switch($prev)\n {\n case \"\":\n $val = \"a\";\n break;\n case \"a\":\n $val = \"b\";\n break;\n case \"b\":\n $val = \"c\";\n break;\n case \"c\":\n $val = \"a\";\n break;\n } */\n if($k == 0)\n $val = \"a\";\n else { \n $first = $chars[$k - 1]; \n $last = $chars[$k + 1];\n \n $fl = array($first, $last);\n if(!in_array(\"a\", $fl))\n $val = \"a\";\n if(!in_array(\"b\", $fl))\n $val = \"b\";\n if(!in_array(\"c\", $fl))\n $val = \"c\";\n \n }\n $chars[$k] = $val; \n }\n $prev = $val;\n }\n return implode(\"\", $chars);\n}\n?>\n"}, {"source_code": " $val)\n {\n if($val == \"?\") $prev = \"?\";\n if($k == 0 || $val == \"?\") continue;\n \n if($val == $prev && $prev != \"?\")\n return false;\n $prev = $chars[$k];\n }\n return true;\n}\n\nfunction makeNice($string)\n{\n $chars = str_split($string);\n unset($chars[count($chars) - 1]);\n $prev = \"\";\n $lastChanged = -1;\n foreach($chars as $k => $val)\n {\n if($val == \"?\")\n {\n if($k == 0)\n $val = \"a\";\n else { \n $first = $chars[$k - 1]; \n $last = $chars[$k + 1];\n \n $fl = array($first, $last);\n if(!in_array(\"a\", $fl))\n $val = \"a\";\n if(!in_array(\"b\", $fl))\n $val = \"b\";\n if(!in_array(\"c\", $fl))\n $val = \"c\";\n \n }\n $chars[$k] = $val; \n }\n $prev = $val;\n }\n return implode(\"\", $chars);\n}\n?>\n"}, {"source_code": " $val)\n { \n if($k == 0 || $val == \"?\") {\n if($val == \"?\") $prev = \"?\";\n continue;\n } \n \n if($val == $prev && $prev != \"?\")\n return false;\n $prev = $chars[$k];\n }\n return true;\n}\n\nfunction makeNice($string)\n{\n $chars = str_split($string);\n unset($chars[count($chars) - 1]);\n $prev = \"\";\n $lastChanged = -1;\n foreach($chars as $k => $val)\n {\n if($val == \"?\")\n {\n if($k == 0)\n $val = \"a\";\n else { \n $first = $chars[$k - 1];\n if($k != count($chars) - 1)\n $last = $chars[$k + 1];\n else\n $last = $first;\n \n $fl = array($first, $last);\n if(!in_array(\"a\", $fl))\n $val = \"a\";\n if(!in_array(\"b\", $fl))\n $val = \"b\";\n if(!in_array(\"c\", $fl))\n $val = \"c\";\n \n }\n $chars[$k] = $val; \n }\n $prev = $val;\n }\n return implode(\"\", $chars);\n}\n?>\n"}, {"source_code": ""}, {"source_code": "1 && $s[strlen($s)-1]==$s[strlen($s)-2])\n {\n $ok=false;\n }\n if(strlen($s)==1)\n {\n echo 'a';\n }else if($ok)\n {echo $s;\n }else\n {\n echo \"-1\";\n }\n echo \"\\n\";\n }\n}\n\nsolve();\n?>"}, {"source_code": ""}, {"source_code": "1 && $s[strlen($s)-1]==$s[strlen($s)-2])\n {\n $ok=false;\n }\n if($ok)\n {echo $s;\n }else\n {\n echo \"-1\";\n }\n echo \"\\n\";\n }\n}\n\nsolve();\n?>"}, {"source_code": "1 && $s[strlen($s)-1]==$s[strlen($s)-2])\n {\n $ok=false;\n }\n if($ok)\n {echo $s;}else\n {\n echo \"-1\";\n }\n echo \"\\n\";\n }\n}\n\nsolve();\n?>"}], "src_uid": "98c08a3b5e5b5bb78804ff797ba24d87"} {"source_code": " $item) {\n $heights[$k] = $heights[$k - 1] + $item;\n }\n\n foreach ($ar as $k => $a) {\n $maxStairs[$k] = max($maxStairs[$k - 1], $a);\n }\n\n $res = [];\n\n foreach ($qr as $q) {\n // find last item, which is less than q + 1\n // find first item which is greater than\n // upper bound algorithm\n\n $ptr = 0;\n $count = $n;\n\n while ($count > 0) {\n $half = $count >> 1;\n $midPtr = $ptr + $half;\n\n if ($maxStairs[$midPtr] <= $q) {\n $ptr = $midPtr + 1;\n $count -= $half + 1;\n } else {\n $count = $half;\n }\n }\n\n $res[] = $heights[$ptr - 1];\n }\n\n fprintf(STDOUT, $qFormat.PHP_EOL, ...$res);\n}\n\n/*\n1\n3 1\n100 7 10\n8\n// 0\n\n2\n1 1\n1\n1\n3 1\n1 1 1\n0\n\n// 1, 0\n\n\n1\n5 5\n1 2 1 5 1\n1 2 0 5 6\n// 1 4 0 10 10\n\n\n1\n4 1\n1 2 2 3\n2\n// 5\n\n\n1\n5 1\n1 2 3 4 3\n3\n// 6\n\n1\n3 1\n3 4 1\n1\n// 0\n\n\n1\n5 6\n1 2 3 4 5\n3 2 0 4 5 1\n\n// 117 117 117 117 117 0\n\n */\n", "positive_code": [{"source_code": " $item) {\n $heights[$k] = $heights[$k - 1] + $item;\n }\n\n foreach ($ar as $k => $a) {\n $maxStairs[$k] = max($maxStairs[$k - 1], $a);\n }\n\n $res = [];\n\n foreach ($qr as $q) {\n // find last item, which is less than q + 1\n // find first item which is greater than\n // upper bound algorithm\n\n $ptr = 0;\n $count = $n;\n\n while ($count > 0) {\n $half = $count >> 1;\n $midPtr = $ptr + $half;\n\n if ($maxStairs[$midPtr] <= $q) {\n $ptr = $midPtr + 1;\n $count -= $half + 1;\n } else {\n $count = $half;\n }\n }\n\n $res[] = $heights[$ptr - 1];\n }\n\n fprintf(STDOUT, $qFormat.PHP_EOL, ...$res);\n}\n\n/*\n1\n3 1\n100 7 10\n8\n// 0\n\n2\n1 1\n1\n1\n3 1\n1 1 1\n0\n\n// 1, 0\n\n\n1\n5 5\n1 2 1 5 1\n1 2 0 5 6\n// 1 4 0 10 10\n\n\n1\n4 1\n1 2 2 3\n2\n// 5\n\n\n1\n5 1\n1 2 3 4 3\n3\n// 6\n\n1\n3 1\n3 4 1\n1\n// 0\n\n\n1\n5 6\n1 2 3 4 5\n3 2 0 4 5 1\n\n// 117 117 117 117 117 0\n\n */\n"}], "negative_code": [{"source_code": " $item) {\n $heights[$k] = $heights[$k - 1] + $item;\n }\n\n // keep track of where new level starts the first time\n $newLevelStarts = array_flip(array_reverse($ar, true));\n ksort($newLevelStarts);\n\n $stairs = array_keys($newLevelStarts);\n\n $iL = 0;\n $iR = count($stairs) - 1;\n\n // for every question find the first item, which is greater than a $q\n\n $res = [];\n\n foreach ($qr as $q) {\n $l = $iL;\n $r = $iR;\n // what if null?\n $prevAltitude = end($stairs);\n\n // l is the result\n while ($l <= $r) {\n $m = ($l + $r) >> 1;\n $altitude = $stairs[$m];\n\n if ($altitude <= $q) {\n $l = $m + 1;\n } elseif ($prevAltitude > $q) {\n $r = $m - 1;\n } else {\n // found\n $l = $r = $m;\n break;\n }\n\n $prevAltitude = $altitude;\n }\n\n if ($l > $iR) {\n // out of bounds, max value\n $res[] = end($heights);\n continue;\n }\n\n $resId = $newLevelStarts[$stairs[$l]] - 1;\n\n $res[] = $heights[$resId];\n }\n\n fprintf(STDOUT, $qFormat . PHP_EOL, ...$res);\n}\n\n/*\n2\n1 1\n1\n1\n3 1\n1 1 1\n0\n// 1, 0\n\n\n1\n5 5\n1 2 1 5 1\n1 2 0 5 6\n// 1 4 0 10 10\n\n */\n"}], "src_uid": "d5f7228d8d674b8233937702ca044cb0"} {"source_code": " $n - 1) {\r\n break;\r\n } else {\r\n $k += $n - $aArray[$i];\r\n $iCount++;\r\n }\r\n }\r\n echo $iCount . \"\\n\";\r\n}", "positive_code": [{"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list ($n, $k) = IO::arr();\r\n $mv = $n;\r\n $arr = IO::arr();\r\n\r\n sort($arr);\r\n $farr = array_reverse($arr);\r\n\r\n $sv = 0;\r\n $cnt = 0;\r\n $s = 0;\r\n $turn = 1;\r\n $koshka = 0;\r\n foreach ($farr as $a) {\r\n if ($a > $koshka) {\r\n $cnt += 1;\r\n $koshka += $n - $a;\r\n }\r\n }\r\n $res[] = $cnt;\r\n}\r\n\r\nforeach ($res as $r) {\r\n echo $r . \"\\n\";\r\n}\r\n"}], "negative_code": [{"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list ($n, $k) = IO::arr();\r\n $mv = $n;\r\n $arr = IO::arr();\r\n\r\n sort($arr);\r\n $farr = array_reverse($arr);\r\n\r\n $sv = 0;\r\n $cnt = 0;\r\n $s = 0;\r\n $turn = 1;\r\n foreach ($farr as $a) {\r\n\r\n if ($sv < $k) {\r\n $s = $mv - $a;\r\n $sv = $sv + $s;\r\n if ($sv > $k) {\r\n break;\r\n }\r\n $cnt++;\r\n } else {\r\n if ($sv == $k) {\r\n $s = $mv - $a;\r\n if ($s <= $mv - $sv) {\r\n $cnt++;\r\n }\r\n }\r\n break;\r\n }\r\n\r\n $turn++;\r\n if ($turn == $n) {\r\n break;\r\n }\r\n }\r\n if ($cnt == 0) {\r\n $cnt = 1;\r\n }\r\n $res[] = $cnt;\r\n}\r\n\r\nforeach ($res as $r) {\r\n echo $r . \"\\n\";\r\n}\r\n"}, {"source_code": " $y)\r\n $x = $x - $y;\r\n else\r\n $y = $y - $x;\r\n }\r\n return ($p*$q)/$x;\r\n }\r\n public static function gcd($a, $b) {\r\n return ($a % $b) ? self::gcd($b,$a % $b) : $b;\r\n }\r\n\r\n public static function res($res) {\r\n foreach ($res as $r) {\r\n echo $r . \"\\n\";\r\n }\r\n }\r\n\r\n public static function dd($val){\r\n echo $val; exit;\r\n }\r\n}\r\n\r\n$t = IO::str();\r\n$res = array();\r\nwhile ($t--) {\r\n list ($n, $k) = IO::arr();\r\n $mv = $n;\r\n $arr = IO::arr();\r\n\r\n sort($arr);\r\n $farr = array_reverse($arr);\r\n\r\n $sv = 0;\r\n $cnt = 0;\r\n $s = 0;\r\n $turn = 1;\r\n foreach ($farr as $a) {\r\n\r\n if ($sv < $k) {\r\n $s = $mv - $a;\r\n $sv = $sv + $s;\r\n if ($sv > $k) {\r\n break;\r\n }\r\n $cnt++;\r\n } else {\r\n if ($sv == $k) {\r\n $s = $mv - $a;\r\n if ($s <= $mv - $sv) {\r\n $cnt++;\r\n }\r\n }\r\n break;\r\n }\r\n\r\n $turn++;\r\n if ($turn == $n) {\r\n break;\r\n }\r\n }\r\n $res[] = $cnt;\r\n}\r\n\r\nforeach ($res as $r) {\r\n echo $r . \"\\n\";\r\n}\r\n"}], "src_uid": "fd1b846c46a074f6afa1fa6e2844c3e2"} {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n\nmain();\n\nfunction main(){\n $file = fopen(\"php://stdin\", \"r\");\n \n $n = fgets($file);\n $x = $y = $z = 0;\n for($i=0;$i<$n;$i++){\n\t$a = explode(\" \", fgets($file));\n\t$x+=$a[0];\n\t$y+=$a[1];\n\t$z+=$a[2];\n }\n \n if ($x == 0 && $y == 0 && $z == 0) echo 'YES';\n else echo 'NO';\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n$fp=fopen('php://stdin', 'r');\n$lines=stream_get_contents($fp);\n$lines=trim($lines);\n$lines=explode(\"\\n\", $lines);\n\n$sum_x=$sum_y=$sum_z=0;\nfor($i=1; $i "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "';print_r($var);echo '
'; print_r($var); echo '';}\n function read_str(){return trim(fgets($GLOBALS['file']));}\n function read_array(){return explode(' ', read_str());}\n /***************************************************************/\n $arr = read_array();\n $n = $arr[0];\n $m = $arr[1];\n $c = $arr[2];\n $GLOBALS['c'] = $c;\n \n $a = read_array();\n $b = read_array();\n\n $k = $n - $m + 1;\n \n function add($a, $b)\n {\n return ($a+$b)%$GLOBALS['c'];\n }\n \n for($i=0; $i<$k; $i++)\n {\n for($j=0; $j<$m; $j++)\n {\n $a[$j+$i] = add($a[$j+$i], $b[$j]);\n }\n }\n \n foreach($a as $n) echo $n, ' '; \n?>"}], "negative_code": [], "src_uid": "9a6ee18e144a38935d7c06e73f2e6384"} {"source_code": "= $c) {\n $r = bcadd($c, bcmul(max($sf, $mf), '-1'));\n $n = bcadd($n, '1');\n}\necho $n . ' ' . $r;\n", "positive_code": [{"source_code": " $f)\n{\n $i = bcmod($a, $c);\n $j = bcmod($b, $c);\n print $h . \" \" . min(bcsub($c, $i), bcsub($c, $j));\n}\nelse\n{\n print $f . \" 0\";\n}\n?>"}, {"source_code": "= $c) {\n $refund = bcadd($c, bcmul(max($sFree, $mFree), '-1'));\n $nuts = bcadd($nuts, '1');\n}\necho $nuts . ' ' . $refund;\n"}], "negative_code": [{"source_code": " $f)\n{\n $i = bcmod($a, $c);\n $j = bcmod($b, $c);\n print $h . \" \" . min($c - $i, $c - $j);\n}\nelse\n{\n print $f . \" 0\";\n}\n?>"}, {"source_code": " $f)\n{\n $i = bcmod($a, $c);\n $j = bcmod($b, $c);\n print $h . \" \" . min($i, $j);\n}\nelse\n{\n print $f . \" 0\";\n}\n?>"}, {"source_code": "= $c) {\n $refund = $c - max($sFree, $mFree);\n $nuts++;\n}\necho $nuts . ' ' . $refund;\n"}, {"source_code": "= $c) {\n $refund = $c - max($sFree, $mFree);\n $nuts++;\n}\necho $nuts . ' ' . $refund;\n"}], "src_uid": "863a8124d46bb09b49fc88939fb5f364"} {"source_code": "$cont)$cont=count($b);\n\tif(!isset($b[$arr[$i]])){\n\t\t$b[$arr[$i]]=1;\n\t}else{\n\t\tunset($b[$arr[$i]]);\n\t}\n}\nprint $cont;", "positive_code": [{"source_code": ""}, {"source_code": " $max){\n $max = $current;\n }\n }else{\n $current--;\n }\n\n}\necho $max;\n\n/**\n * I/O samples\n *\n * trim(fgets($stdin));\n * fscanf($stdin, \"%d %d %d\", $n, $m, $k);\n * array_filter(explode(' ', trim(fgets($stdin))));\n *\n * print();\n *\n */\n"}], "negative_code": [], "src_uid": "7f98c9258f3e127a782041c421d6317b"} {"source_code": " 1)\n {\n if(count($d) > $h)\n {\n print min(floor($b / 2), count($d), $h) . \"\\n\";\n }\n else\n {\n print min(floor($b / 2), count($d), $h - 1) . \"\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": "= $count[$i]) $ans = max($ans, $count[$i]) ;\n if($total_cnt >= $count[$i] - 1) $ans = max($ans, $count[$i] - 1) ;\n if($total_cnt <= $count[$i] - 1) $ans = max($ans, $total_cnt) ;\n }\n \n echo $ans . \"\\n\" ;\n }\n?>"}, {"source_code": " 0; $t--){\n\n\t$n = intval(fgets(STDIN));\n\n\t$a = explode(' ', trim(fgets(STDIN)));\n\n\t$counts = [];\n\tforeach ($a as $ai) {\n\t\t$counts[$ai]++;\n\t}\n\n\t$m1 = max($counts);\n\t$m2 = count($counts);\n\tif($m1 == $m2){\n\t\t$m = $m1 - 1;\n\t} else {\n\t\t$m = min($m1, $m2);\n\t}\n\n\techo min(floor(count($a) / 2), $m) . \"\\n\";\n\n\n}\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 1)\n {\n print min(floor($b / 2), count($d), $h - 1) . \"\\n\";\n }\n}\n?>"}, {"source_code": " 1)\n {\n if(count($d) >= $h)\n {\n print min(floor($b / 2), count($d), $h) . \"\\n\";\n }\n else\n {\n print min(floor($b / 2), count($d), $h - 1) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n print min(floor($b / 2), count($d), $h) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $count[$i]) $ans = max($ans, $count[$i]) ;\n if($total_cnt >= $count[$i] - 1) $ans = max($ans, $count[$i] - 1) ;\n }\n \n echo $ans . \"\\n\" ;\n }\n?>"}], "src_uid": "a1951e7d11b504273765fc9fb2f18a5e"} {"source_code": "", "positive_code": [{"source_code": "= 1; $x--)\n{\n if($b[$x] != \"-1\")\n {\n $e = $x;\n $f = 1;\n while(TRUE)\n {\n if($b[$e] == \"-1\")\n {\n break;\n }\n else\n {\n $e = $b[$e];\n $f++;\n }\n }\n $d = max($d, $f);\n }\n}\nprint $d;\n?>"}, {"source_code": "$maxCount){\n $maxCount = $count;\n }\n if (isset($a[$i]['parents'])){\n foreach($a[$i]['parents'] as $k=>$item){\n spusk($item,$count);\n }\n }\n}\n\nspusk(-1,0);\necho $maxCount-1;\n//print_r($maxCount);\n\n\n"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=($tolevel-1)) {\n \t\t$leveltable[$table[$i]]=$tolevel; \n \t\t$operate = true; \n \t\t}\n \treturn $operate;\n}\n\n$tolevel = 1;\nwhile (GradeLevels($leveltable,$table,$cnt, $tolevel))\n\t$tolevel++;\n\t\necho max($leveltable);\n \n?>"}, {"source_code": "\n"}, {"source_code": "=($tolevel-1)) {\n $leveltable[$table[$i]]=$tolevel; \n $operate = true; \n }\n return $operate;\n}\n\n$tolevel = 1;\nwhile (GradeLevels($leveltable,$table,$cnt, $tolevel))\n $tolevel++;\n \necho max($leveltable);\n \n?>"}], "negative_code": [{"source_code": "import java.util.*;\n\npublic class Solution\n{\n public static void main(String[] args)\n {\n new Solution().calc();\n }\n\n int[] boss;\n void calc()\n {\n\n Scanner cin = new Scanner(System.in);\n int n = cin.nextInt();\n boss = new int[n];\n for (int i = 0; i < n; i++)\n {\n boss[i] = cin.nextInt();\n if (boss[i] != -1) boss[i]--;\n }\n int ret = 1;\n for (int i = 0; i < n; i++)\n {\n ret = Math.max(ret, dfs(i));\n }\n System.out.println(ret);\n }\n\n int dfs(int a)\n {\n if (boss[a] == -1) return 1;\n return dfs(boss[a]) + 1;\n }\n}\n"}, {"source_code": "=($tolevel-1)) {\n $leveltable[$table[$i]]=$tolevel; \n $operate = true; \n }\n return $operate;\n}\n\n$tolevel = 1;\nwhile (GradeLevels($leveltable,$tolevel,$tolevel)){\n $tolevel++;\n} \n\necho $tolevel+1;\n \n?>"}, {"source_code": "=4){\n echo 3;\n exit;\n }\n if ($count>$maxCount){\n $maxCount = $count;\n }\n if (isset($a[$i]['parents'])){\n foreach($a[$i]['parents'] as $k=>$item){\n spusk($item,$count);\n }\n }\n}\n\nspusk(-1,0);\necho $maxCount-1;\n//print_r($maxCount);\n\n\n"}], "src_uid": "8d911f79dde31f2c6f62e73b925e6996"} {"source_code": "> $perm */\n$perm = array_fill(0, 2 * N, []);\n\n$perm[0] = [0, 0];\n$perm[1] = [1, 0];\n$perm[2] = [2, 2];\n\n$q = 0;\nfor ($i = 0; $i < N; ++$i) {\n $s = $q * $q;\n\n if (isset($sq[$i])) {\n ++$q;\n }\n\n $perm[$i] = [$i, $s - $i];\n}\n\nfscanf(STDIN, '%u', $t);\n\nwhile ($t--) {\n fscanf(STDIN, '%u', $n);\n\n $resPerm = [];\n $i = $n - 1;\n\n while (~$i) {\n $p = $perm[$i];\n $resPerm[] = $p;\n $i = $p[1] - 1;\n }\n\n $resPerm = array_reverse($resPerm);\n\n $res = [];\n foreach ($resPerm as [$st, $en]) {\n $res[] = range($st, $en);\n }\n\n $res = array_merge(...$res);\n\n fprintf(STDOUT, '%s' . PHP_EOL, implode(' ', $res));\n}\n\n/*\n\n3\n1 0 2\n0 1 2\n1 1 4\n\n4\n\n0 3 2 1\n0 1 2 3\n\n0 4 4 4\n\n\n7\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 1 4 9 9 9 9\n\n8\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n9|4|1|0 9|4|1 9|4 9|4 9|4 9 9 9\n\n\n11\n | 10 9 8 7 6\n0 1 2 3 4 5 | 6 7 8 9 10\n | 16 16 16 16 16\n\n\n | 5 4\n0 1 2 3 | 4 5\n | 9 9\n\n | 2 1 - not possible because of 1 here\n0 1 | 2 3\n | 4 4\n\n0 3 2 1\n0 1 2 3\n\n\n0\n0\n\n1 0\n0 1\n\n1 0 2\n0 1 2\n\n0 3 2 1\n0 1 2 3\n\n4 3 2 1 0\n0 1 2 3 4\n\n0 3 2 1 5 4\n0 1 2 3 4 5\n\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n\n0 8 7 6 5 4 3 2 1\n0 1 2 3 4 5 6 7 8\n\n9 8 7 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 8 9\n\n0, 1, 4, 9, 16, 25, 36, 49, 64, 81,\n\n */\n", "positive_code": [{"source_code": " $perm */\n$perm = array_fill(0, 2 * N, []);\n\n$perm[0] = [0, 0];\n$perm[1] = [1, 0];\n$perm[2] = [2, 2];\n\n$q = 0;\nfor ($i = 0; $i < N; ++$i) {\n $s = $q * $q;\n\n if (isset($sq[$i])) {\n ++$q;\n }\n\n $perm[$i] = [$i, $s - $i];\n}\n\nfscanf(STDIN, '%u', $t);\n\nwhile ($t--) {\n fscanf(STDIN, '%u', $n);\n\n $resPerm = [];\n $i = $n - 1;\n\n while (~$i) {\n $p = $perm[$i];\n $resPerm[] = $p;\n $i = $p[1] - 1;\n }\n\n $resPerm = array_reverse($resPerm);\n\n $res = [];\n foreach ($resPerm as [$st, $en]) {\n $res[] = range($st, $en);\n }\n\n $res = array_merge(...$res);\n\n fprintf(STDOUT, str_repeat('%u ', count($res)).PHP_EOL, ...$res);\n}\n/*\n\n3\n1 0 2\n0 1 2\n1 1 4\n\n4\n\n0 3 2 1\n0 1 2 3\n\n0 4 4 4\n\n\n7\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 1 4 9 9 9 9\n\n8\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n9|4|1|0 9|4|1 9|4 9|4 9|4 9 9 9\n\n\n11\n | 10 9 8 7 6\n0 1 2 3 4 5 | 6 7 8 9 10\n | 16 16 16 16 16\n\n\n | 5 4\n0 1 2 3 | 4 5\n | 9 9\n\n | 2 1 - not possible because of 1 here\n0 1 | 2 3\n | 4 4\n\n0 3 2 1\n0 1 2 3\n\n\n0\n0\n\n1 0\n0 1\n\n1 0 2\n0 1 2\n\n0 3 2 1\n0 1 2 3\n\n4 3 2 1 0\n0 1 2 3 4\n\n0 3 2 1 5 4\n0 1 2 3 4 5\n\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n\n0 8 7 6 5 4 3 2 1\n0 1 2 3 4 5 6 7 8\n\n9 8 7 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 8 9\n\n0, 1, 4, 9, 16, 25, 36, 49, 64, 81\n */\n"}, {"source_code": "> $perm */\n$perm = array_fill(0, 2 * N, []);\n\n$perm[0] = [0, 0];\n$perm[1] = [1, 0];\n$perm[2] = [2, 2];\n\n$q = 0;\nfor ($i = 0; $i < N; ++$i) {\n $s = $q * $q;\n\n if (isset($sq[$i])) {\n ++$q;\n }\n\n $perm[$i] = [$i, $s - $i];\n}\n\nfscanf(STDIN, '%u', $t);\n\nwhile ($t--) {\n fscanf(STDIN, '%u', $n);\n\n $resPerm = [];\n $i = $n - 1;\n\n while (~$i) {\n $p = $perm[$i];\n $resPerm[] = $p;\n $i = $p[1] - 1;\n }\n\n $resPerm = array_reverse($resPerm);\n\n $res = [];\n foreach ($resPerm as [$st, $en]) {\n $res[] = range($st, $en);\n }\n\n $res = array_merge(...$res);\n\n fprintf(STDOUT, str_repeat('%u ', count($res)).PHP_EOL, ...$res);\n}\n/*\n\n3\n1 0 2\n0 1 2\n1 1 4\n\n4\n\n0 3 2 1\n0 1 2 3\n\n0 4 4 4\n\n\n7\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 1 4 9 9 9 9\n\n8\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n9|4|1|0 9|4|1 9|4 9|4 9|4 9 9 9\n\n\n11\n | 10 9 8 7 6\n0 1 2 3 4 5 | 6 7 8 9 10\n | 16 16 16 16 16\n\n\n | 5 4\n0 1 2 3 | 4 5\n | 9 9\n\n | 2 1 - not possible because of 1 here\n0 1 | 2 3\n | 4 4\n\n0 3 2 1\n0 1 2 3\n\n\n0\n0\n\n1 0\n0 1\n\n1 0 2\n0 1 2\n\n0 3 2 1\n0 1 2 3\n\n4 3 2 1 0\n0 1 2 3 4\n\n0 3 2 1 5 4\n0 1 2 3 4 5\n\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n\n0 8 7 6 5 4 3 2 1\n0 1 2 3 4 5 6 7 8\n\n9 8 7 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 8 9\n\n0, 1, 4, 9, 16, 25, 36, 49, 64, 81\n */\n"}, {"source_code": "> $perm */\n$perm = array_fill(0, 2 * N, []);\n\n$perm[0] = [0, 0];\n$perm[1] = [1, 0];\n$perm[2] = [2, 2];\n\n$q = 0;\nfor ($i = 0; $i < N; ++$i) {\n $s = $q * $q;\n\n if (isset($sq[$i])) {\n ++$q;\n }\n\n $perm[$i] = [$i, $s - $i];\n}\n\nfscanf(STDIN, '%u', $t);\n\nwhile ($t--) {\n fscanf(STDIN, '%u', $n);\n\n $resPerm = [];\n $i = $n - 1;\n\n while (~$i) {\n $p = $perm[$i];\n $resPerm[] = $p;\n $i = $p[1] - 1;\n }\n\n $resPerm = array_reverse($resPerm);\n\n $res = [];\n foreach ($resPerm as [$st, $en]) {\n $res[] = range($st, $en);\n }\n\n $res = array_merge(...$res);\n\n fprintf(STDOUT, str_repeat('%u ', count($res)).PHP_EOL, ...$res);\n}\n\n/*\n\n3\n1 0 2\n0 1 2\n1 1 4\n\n4\n\n0 3 2 1\n0 1 2 3\n\n0 4 4 4\n\n\n7\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 1 4 9 9 9 9\n\n8\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n9|4|1|0 9|4|1 9|4 9|4 9|4 9 9 9\n\n\n11\n | 10 9 8 7 6\n0 1 2 3 4 5 | 6 7 8 9 10\n | 16 16 16 16 16\n\n\n | 5 4\n0 1 2 3 | 4 5\n | 9 9\n\n | 2 1 - not possible because of 1 here\n0 1 | 2 3\n | 4 4\n\n0 3 2 1\n0 1 2 3\n\n\n0\n0\n\n1 0\n0 1\n\n1 0 2\n0 1 2\n\n0 3 2 1\n0 1 2 3\n\n4 3 2 1 0\n0 1 2 3 4\n\n0 3 2 1 5 4\n0 1 2 3 4 5\n\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n\n0 8 7 6 5 4 3 2 1\n0 1 2 3 4 5 6 7 8\n\n9 8 7 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 8 9\n\n0, 1, 4, 9, 16, 25, 36, 49, 64, 81,\n\n */\n"}, {"source_code": "> $perm */\n$perm = array_fill(0, 2 * N, []);\n\n$perm[0] = [0, 0];\n$perm[1] = [1, 0];\n$perm[2] = [2, 2];\n\n$q = 0;\nfor ($i = 0; $i < N; ++$i) {\n $s = $q * $q;\n\n if (isset($sq[$i])) {\n ++$q;\n }\n\n $perm[$i] = [$i, $s - $i];\n}\n\nfscanf(STDIN, '%u', $t);\n\nwhile ($t--) {\n fscanf(STDIN, '%u', $n);\n\n $resPerm = [];\n $i = $n - 1;\n\n while (~$i) {\n $p = $perm[$i];\n $resPerm[] = $p;\n $i = $p[1] - 1;\n }\n\n $resPerm = array_reverse($resPerm);\n\n $res = [];\n foreach ($resPerm as [$st, $en]) {\n $res[] = range($st, $en);\n }\n\n $res = array_merge(...$res);\n\n fprintf(STDOUT, '%s' . PHP_EOL, implode(' ', $res));\n}\n/*\n\n3\n1 0 2\n0 1 2\n1 1 4\n\n4\n\n0 3 2 1\n0 1 2 3\n\n0 4 4 4\n\n\n7\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 1 4 9 9 9 9\n\n8\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n9|4|1|0 9|4|1 9|4 9|4 9|4 9 9 9\n\n\n11\n | 10 9 8 7 6\n0 1 2 3 4 5 | 6 7 8 9 10\n | 16 16 16 16 16\n\n\n | 5 4\n0 1 2 3 | 4 5\n | 9 9\n\n | 2 1 - not possible because of 1 here\n0 1 | 2 3\n | 4 4\n\n0 3 2 1\n0 1 2 3\n\n\n0\n0\n\n1 0\n0 1\n\n1 0 2\n0 1 2\n\n0 3 2 1\n0 1 2 3\n\n4 3 2 1 0\n0 1 2 3 4\n\n0 3 2 1 5 4\n0 1 2 3 4 5\n\n1 0 2 6 5 4 3\n0 1 2 3 4 5 6\n\n1 0 7 6 5 4 3 2\n0 1 2 3 4 5 6 7\n\n0 8 7 6 5 4 3 2 1\n0 1 2 3 4 5 6 7 8\n\n9 8 7 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 8 9\n\n0, 1, 4, 9, 16, 25, 36, 49, 64, 81,\n\n */\n"}], "negative_code": [], "src_uid": "f7ed88c0f33ad9cb1ede2abf185d9ece"} {"source_code": " $digit) {\r\n if ($digit % 2 == 0) {\r\n if ($key == 0) {\r\n return 1;\r\n }\r\n\r\n return 2;\r\n }\r\n }\r\n\r\n return -1;\r\n}\r\n", "positive_code": [{"source_code": "\r\n\r\n$n = trim(fgets(STDIN));\r\n\r\nfor($i=0;$i<$n;$i++){\r\n\t$currDigit = trim(fgets(STDIN));\r\n\tif($currDigit%2==0){\r\n\t\techo \"0\\n\";\r\n\t}else{\r\n\t\t$out = -1;\r\n\t\t$arr = str_split($currDigit);\r\n\t\t$k = 0;\r\n\t\tforeach($arr as $oneDigit){\r\n\t\t\tif($oneDigit%2==0){\r\n\t\t\t\tif($k==0){\r\n\t\t\t\t\t$out = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$out = 2;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$k++;\r\n\t\t}\r\n\t\techo $out.\"\\n\";\r\n\t}\r\n}"}], "negative_code": [{"source_code": "\r\n$n = trim(fgets(STDIN));\r\n\r\nfor($i=0;$i<$n;$i++){\r\n\t$currDigit = trim(fgets(STDIN));\r\n\tif($currDigit%2==0){\r\n\t\techo \"0\\n\";\r\n\t}else{\r\n\t\t$out = -1;\r\n\t\t$arr = str_split($currDigit);\r\n\t\tforeach($arr as $oneDigit){\r\n\t\t\tif($oneDigit%2==0){\r\n\t\t\t\t$out = 2;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\techo $out.\"\\n\";\r\n\t}\r\n}"}, {"source_code": "\r\n$n = trim(fgets(STDIN));\r\n\r\nfor($i=0;$i<$n;$i++){\r\n\t$currDigit = trim(fgets(STDIN));\r\n\tif($currDigit%2==0){\r\n\t\techo \"0\\n\";\r\n\t}else{\r\n\t\t$out = -1;\r\n\t\t$arr = explode(\"\",$currDigit);\r\n\t\tforeach($arr as $oneDigit){\r\n\t\t\tif($oneDigit%2==0){\r\n\t\t\t\t$out = 2;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\techo $out.\"\\n\";\r\n\t}\r\n}"}], "src_uid": "03e5f71810b10318fed344878d226a10"}