{"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": " 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 '
' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}], "negative_code": [{"source_code": " 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 ($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 '
' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": " 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) {\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 '
' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}], "src_uid": "bce9ebad1dc8bd5aae516c4ca9e551c0"} {"source_code": " $b[$c])\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "positive_code": [{"source_code": " $p[$n])\n{\n echo \"YES\";\n exit;\n}\n\necho \"NO\";"}], "negative_code": [{"source_code": " $p[(($n/2) + 1)])\n{\n echo \"YES\";\n exit;\n}\n\necho \"NO\";"}, {"source_code": " $p[(($n/2) + 1)])\n{\n echo \"YES\";\n exit;\n}\n\necho \"NO\";"}], "src_uid": "7b806b9a402a83a5b8943e7f3436cc9a"} {"source_code": "", "positive_code": [{"source_code": " $v) {\n $a[$k] = $v - ($v % 2 == 0);\n}\n\necho implode(\" \", $a);\n"}, {"source_code": "= $min) {\n $m = min($b);\n $b = array();\n foreach ($a AS $k => $v) {\n if ($m == $v && $v > 0) {\n if ($m%2 == 1) {\n $a[$k] = $m + 1;\n } else {\n $a[$k] = $m - 1;\n }\n }\n if ($m <= $v) {\n $b[] = $v;\n }\n }\n\n $min = $m + 1;\n\n return getArr($a, $min, $b);\n } else {\n return $a;\n }\n}\n echo implode(' ', $a);\n?>"}], "negative_code": [{"source_code": ""}], "src_uid": "d00696cb27c679dda6e2e29314a8432b"} {"source_code": "0){\n $t--;\n $result = trim(stream_get_line(STDIN, 1024, PHP_EOL));\n list($n,$x) = explode(' ',$result);\n $ans = intdiv(($n-2),$x)+(($n-2)%$x>0)+1;\n if($n<2)echo \"1\\n\";\n else {echo $ans;\n echo \"\\n\";\n }\n}\n \n \n?>", "positive_code": [{"source_code": "\n0){\n $\ud83d\ude03\ud83d\ude01\ud83d\ude01 --;\n $\ud83d\ude0e = trim(stream_get_line(STDIN, 1024, PHP_EOL));\n list($\ud83e\udd23,$\ud83d\ude02) = explode(' ',$\ud83d\ude0e);\n $\ud83d\ude1c = intdiv(($\ud83e\udd23-2),$\ud83d\ude02)+(($\ud83e\udd23-2)%$\ud83d\ude02>0)+1;\n if($\ud83e\udd23<2)echo \"1\\n\";\n else {echo $\ud83d\ude1c;\n echo \"\\n\";\n }\n}\n \n \n?>"}, {"source_code": "0){\n $\ud83d\ude03--;\n $\ud83d\ude0e = trim(stream_get_line(STDIN, 1024, PHP_EOL));\n list($\ud83e\udd23,$\ud83d\ude02) = explode(' ',$\ud83d\ude0e);\n $\ud83d\ude1c = intdiv(($\ud83e\udd23-2),$\ud83d\ude02)+(($\ud83e\udd23-2)%$\ud83d\ude02>0)+1;\n if($\ud83e\udd23<2)echo \"1\\n\";\n else {echo $\ud83d\ude1c;\n echo \"\\n\";\n }\n}\n \n \n?>"}, {"source_code": ""}, {"source_code": "=0) {\n\tlist($n,$x)=fscanf(STDIN,'%d %d');\n\t$n-=2;\n\techo intval($n/$x+(($n%$x||$n<0)?2:1)).\"\\n\";\n}"}, {"source_code": ""}, {"source_code": "0) {\n\tlist($n,$x)=fscanf(STDIN,'%d %d');\n\t$n-=2;\n\techo intval($n/$x+(($n%$x||$n<0)?2:1)).\"\\n\";\n}"}, {"source_code": " 0) {\n echo $qwe + 2 . PHP_EOL;\n } else {\n echo $qwe + 1 . PHP_EOL;\n }\n }\n \n \n}\n\n"}, {"source_code": "0){\n $\ud83d\ude03--;\n $result = trim(stream_get_line(STDIN, 1024, PHP_EOL));\n list($n,$x) = explode(' ',$result);\n $ans = intdiv(($n-2),$x)+(($n-2)%$x>0)+1;\n if($n<2)echo \"1\\n\";\n else {echo $ans;\n echo \"\\n\";\n }\n}\n \n \n?>"}], "negative_code": [{"source_code": ""}, {"source_code": "= $c){\n $n++;\n $c += $a[1];\n }\n echo $n.\"\\n\";\n \n }\n \n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=0) {\n\tlist($n,$x)=fscanf(STDIN,'%d %d');\n\t$n-=2;\n\techo intval($n/$x+(($n%$x)?2:1)).\"\\n\";\n}"}, {"source_code": "for i in range(int(input())):\n n, x = map(int, input().split())\n print(1 if n <= 2 else (n - 3) // x + 2)"}, {"source_code": "=0) {\n\tlist($n,$x)=fscanf(STDIN,'%d %d');\n\t$n-=2;\n\techo intval($n/$x+(($n%$x||$n<1)?2:1)).\"\\n\";\n}"}, {"source_code": ""}, {"source_code": "1){\n $t--;\n $result = trim(stream_get_line(STDIN, 1024, PHP_EOL));\n list($n,$x) = explode(' ',$result);\n if($n<2)echo \"1\\n\";\n else echo \"2\\n\";\n}\n \n \n?>"}, {"source_code": "1){\n $t--;\n $result = trim(stream_get_line(STDIN, 1024, PHP_EOL));\n list($n,$x) = explode(' ',$result);\n $ans = ($n-2)/$x+(($n-2)%$x>0)+1;\n if($n<2)echo \"1\\n\";\n else {echo $ans;\n echo \"\\n\";\n }\n}\n \n \n?>"}], "src_uid": "8b50a0eb2e1c425455b132683d3e6047"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "adf4239de3b0034cc690dad6160cf1d0"} {"source_code": " 0)\n {\n print \"No\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " 0){\n $c--;\n }\n }\n if(isset($x[1][$k-1])){\n if($c > 0){\n $c--;\n }\n }\n if(isset($x[1][$k+1])){\n if($c > 0){\n $c--;\n }\n }\n } else {\n if(isset($x[2][$k])){\n if($c > 0){\n $c--;\n }\n }\n if(isset($x[2][$k-1])){\n if($c > 0){\n $c--;\n }\n }\n if(isset($x[2][$k+1])){\n if($c > 0){\n $c--;\n }\n }\n }\n \n } else {\n $x[$a[0]][$k] = 1;\n if($a[0] == 2){\n if(isset($x[1][$k])){\n $c++;\n \n }\n if(isset($x[1][$k-1])){\n $c++;\n }\n if(isset($x[1][$k+1])){\n $c++;\n \n }\n } else {\n if(isset($x[2][$k])){\n $c++;\n \n }\n if(isset($x[2][$k-1])){\n $c++;\n \n }\n if(isset($x[2][$k+1])){\n $c++;\n \n }\n }\n }\n if($c == 0){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}], "negative_code": [{"source_code": " 0)\n {\n print \"No\\n\";\n }\n}\n?>"}, {"source_code": " 1) {\n $yes = false;\n }\n } \n \n if ($yes) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n\n/**\nYes\nNo\nNo\nNo\nYes\n*/"}, {"source_code": " 0){\n $c--;\n }\n \n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n if($c > 0){\n $c--;\n }\n }\n }\n unset($x[$a[0]][$a[1]]);\n } else {\n $x[$a[0]][$a[1]] = 1;\n $k = $a[1];\n if($a[0] == 2){\n if(isset($x[1][$k]) || isset($x[1][$k-1]) || isset($x[1][$k+1])){\n $c++;\n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n $c++;\n }\n }\n }\n\n if($c == 0){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": " $v){\n if(isset($br[$k]) || isset($br[$k-1]) || isset($br[$k+1])){\n $b = false;\n break;\n }\n }\n }\n \n if($b){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n"}, {"source_code": " count($x[2])){\n $ar = $x[2];\n $br = $x[1];\n } else {\n $ar = $x[1];\n $br = $x[2];\n }\n foreach($ar as $k => $v){\n if(isset($br[$k]) || isset($br[$k-1]) || isset($br[$k+1])){\n $b = false;\n break;\n }\n }\n }\n \n if($b){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": " 0){\n $c--;\n }\n \n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n if($c > 0){\n $c--;\n }\n }\n }\n \n } else {\n $x[$a[0]][$k] = 1;\n if($a[0] == 2){\n if(isset($x[1][$k]) || isset($x[1][$k-1]) || isset($x[1][$k+1])){\n $c++;\n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n $c++;\n }\n }\n }\n if($c == 0){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": " $v){\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n $b = false;\n break;\n }\n }\n }\n if($b){\n echo \"YES\\n\";\n }\n if(!$b){\n echo \"NO\\n\";\n }\n}\n"}, {"source_code": " count($x[2])){\n $ar = $x[2];\n $br = $x[1];\n } else {\n $ar = $x[1];\n $br = $x[2];\n }\n foreach($ar as $k => $v){\n if(isset($br[$k]) || isset($br[$k-1]) || isset($br[$k+1])){\n $b = false;\n break;\n }\n }\n }\n \n if($b){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": " 0){\n $c--;\n }\n \n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n if($c > 0){\n $c--;\n }\n }\n }\n unset($x[$a[0]][$a[1]]);\n } else {\n $x[$a[0]][$a[1]] = 1;\n $k = $a[1];\n if($a[0] == 2){\n if(isset($x[1][$k]) || isset($x[1][$k-1]) || isset($x[1][$k+1])){\n $c++;\n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n $c++;\n }\n }\n }\n\n if($c == 0){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": " $v){\n if(isset($x[2][$k])){\n if(isset($x[1][$k]) || isset($x[1][$k-1]) || isset($x[1][$k+1])){\n $b = false;\n break;\n }\n }\n if(isset($x[1][$k])){\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n $b = false;\n break;\n }\n }\n \n }\n }\n \n if($b){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": " 0){\n $c--;\n }\n \n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n if($c > 0){\n $c--;\n }\n }\n }\n } else {\n $x[$a[0]][$a[1]] = 1;\n $k = $a[1];\n if($a[0] == 2){\n if(isset($x[1][$k]) || isset($x[1][$k-1]) || isset($x[1][$k+1])){\n $c++;\n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n $c++;\n }\n }\n }\n\n if($c == 0){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}, {"source_code": " 0){\n $c--;\n }\n \n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n if($c > 0){\n $c--;\n }\n }\n }\n unset($x[$a[0]][$a[1]]);\n } else {\n $x[$a[0]][$a[1]] = 1;\n $k = $a[1];\n if($a[0] == 2){\n if(isset($x[1][$k]) || isset($x[1][$k-1]) || isset($x[1][$k+1])){\n $c++;\n }\n } else {\n if(isset($x[2][$k]) || isset($x[2][$k-1]) || isset($x[2][$k+1])){\n $c++;\n }\n }\n }\n\n if($c == 0){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}"}], "src_uid": "af036416721694d1843368988ca78e8e"} {"source_code": " $n) $password = substr($password, 0, ($n - strlen($password)));\n\necho $password.PHP_EOL;\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " 2*($city_width-2)){\n return false;\n }\n return true;\n}\nfunction printCity($city)\n{\n for($i=0; $i<4; $i++){\n echo implode(\"\", $city[$i]).\"\\n\";\n }\n}\n\nfunction placeHotels($city_width, $hotels)\n{\n $city = array();\n for($i=0; $i<4; $i++){\n for($j=0; $j<$city_width; $j++){\n $city[$i][] = '.';\n }\n }\n\n if($hotels === 0){\n printCity($city);\n return;\n }\n\n $mid = intval($city_width / 2);\n\n $city[1][$mid] = '#';\n $hotels--;\n for($i=1; $mid-$i>0; $i++){\n if($hotels>=2){\n $city[1][$mid-$i] = '#';\n $city[1][$mid+$i] = '#';\n $hotels -= 2;\n }\n else{\n break;\n }\n }\n\n if($hotels === 0){\n printCity($city);\n return;\n }\n\n if($hotels%2 !== 0){\n $city[2][$mid] = '#';\n $hotels--;\n }\n for($i=1; $mid-$i>0; $i++){\n if($hotels>=2){\n $city[2][$mid-$i] = '#';\n $city[2][$mid+$i] = '#';\n $hotels -= 2;\n }\n else{\n break;\n }\n }\n\n printCity($city);\n}\n\n\nfunction main()\n{\n $data = fread(STDIN, 4096);\n list($width, $k) = explode(\" \", $data);\n if(canPlace(intval($width), intval($k))){\n echo \"YES\\n\";\n placeHotels(intval($width), intval($k));\n }\n else{\n echo \"NO\\n\";\n }\n\n}\n\nmain();", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $e)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n $f = floor($b / 2);\n $g = ceil($b / 2);\n for($x = 1; $x < 1 + $f; $x++)\n {\n $d[1][$x] = \"#\";\n }\n for($x = 1; $x < 1 + $g; $x++)\n {\n $d[2][$x] = \"#\";\n }\n for($x = 0; $x < 4; $x++)\n {\n print implode($d[$x]) . \"\\n\";\n }\n}\n?>"}, {"source_code": " $e)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if($b == 1)\n {\n $d[1][1] = \"#\";\n for($x = 0; $x < 4; $x++)\n {\n print implode($d[$x]) . \"\\n\";\n }\n }\n elseif($b == 3)\n {\n $d[1][1] = \"#\";\n $d[1][2] = \"#\";\n $d[1][3] = \"#\";\n for($x = 0; $x < 4; $x++)\n {\n print implode($d[$x]) . \"\\n\";\n }\n }\n elseif($b % 2 == 0)\n {\n $f = floor($b / 2);\n $g = ceil($b / 2);\n for($x = 1; $x < 1 + $f; $x++)\n {\n $d[1][$x] = \"#\";\n }\n for($x = 1; $x < 1 + $g; $x++)\n {\n $d[2][$x] = \"#\";\n }\n for($x = 0; $x < 4; $x++)\n {\n print implode($d[$x]) . \"\\n\";\n }\n }\n elseif($b % 2 == 1)\n {\n $f = floor($b / 2);\n $g = ceil($b / 2);\n for($x = 1; $x < 1 + $g; $x++)\n {\n $d[1][$x] = \"#\";\n }\n for($x = 1; $x < 1 + $f - 1; $x++)\n {\n $d[2][$x] = \"#\";\n }\n for($x = $f + 1; $x < $f + 2; $x++)\n {\n $d[2][$x] = \"#\";\n }\n for($x = 0; $x < 4; $x++)\n {\n print implode($d[$x]) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " 2*($city_width-2)){\n return false;\n }\n return true;\n}\nfunction printCity($city)\n{\n for($i=0; $i<4; $i++){\n echo implode(\"\", $city[$i]).\"\\n\";\n }\n}\n\nfunction placeHotels($city_width, $hotels)\n{\n $city = array();\n for($i=0; $i<4; $i++){\n for($j=0; $j<$city_width; $j++){\n $city[$i][] = '.';\n }\n }\n\n if($hotels === 0){\n printCity($city);\n return;\n }\n\n $mid = $city_width / 2;\n\n $city[1][$mid] = '#';\n $hotels--;\n for($i=1; $mid-$i>0; $i++){\n if($hotels>=2){\n $city[1][$mid-$i] = '#';\n $city[1][$mid+$i] = '#';\n $hotels -= 2;\n }\n else{\n break;\n }\n }\n\n if($hotels === 0){\n printCity($city);\n return;\n }\n\n if($hotels%2 !== 0){\n $city[2][$mid] = '#';\n $hotels--;\n }\n for($i=1; $mid-$i>0; $i++){\n if($hotels>=2){\n $city[2][$mid-$i] = '#';\n $city[2][$mid+$i] = '#';\n $hotels -= 2;\n }\n else{\n break;\n }\n }\n\n printCity($city);\n}\n\n\nfunction main()\n{\n $data = fread(STDIN, 4096);\n list($width, $k) = explode(\" \", $data);\n if(canPlace(intval($width), intval($k))){\n echo \"YES\\n\";\n placeHotels(intval($width), intval($k));\n }\n else{\n echo \"NO\\n\";\n }\n\n}\n\nmain();"}], "src_uid": "2669feb8200769869c4b2c29012059ed"} {"source_code": "", "positive_code": [{"source_code": " 0; $t--){\n\n\tlist($n, $a, $b) = explode(' ', trim(fgets(STDIN)));\n\n\tfor(; $n>0; $n--){\n\n\t\t$a = ($n-1) % $b + 97;\n\n\t\techo chr($a);\n\n\t};\n\n\n\techo \"\\n\";\n\n\n}\n"}, {"source_code": ""}], "negative_code": [], "src_uid": "a82f15c1b0ddcacc1de966be20cfc5a2"} {"source_code": "= $a[$i+1]) {\n\t\t$diff = 1 + ($a[$i] - $a[$i+1]);\n\t\t$a[$i+1] += $diff; \n\t\t$ans += $diff;\n\t}\n}\necho $ans;\n?>\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0; $i--)\n\t\t\tif ($a[$i] == $a[$i-1]) {\n\t\t\t\t$ans++;\n\t\t\t\t$a[$i]++;\n\t\t\t\t$inc = true;\n\t\t\t}\n\t} while ($inc);\n\techo $ans;\n?> "}], "negative_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}], "src_uid": "53ae714f04fd29721b8bbf77576b7ccf"} {"source_code": "= $x) {\n echo $bal - 0.5 - $x;\n }\n else {\n echo $bal;\n }\n $x=$a/$b;\n $y=$c/$d;\n $ans=($x)/(1-(1.0-$x)*(1.0-$y));\n echo $ans; "}], "src_uid": "7b932b2d3ab65a353b18d81cf533a54e"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " 0; $t--) {\r\n\r\n\t$n = intval(fgets(STDIN));\r\n\t$a = array_map('intval', array_map('trim', explode(' ', fgets(STDIN))));\r\n\techo $solve($n, $a);\r\n\techo \"\\n\";\r\n\r\n}\r\n"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " 0; $t--) {\r\n\r\n\t$n = intval(fgets(STDIN));\r\n\t$a = explode(' ', fgets(STDIN));\r\n\r\n\techo $solve($n, $a) . \"\\n\";\r\n\r\n}\r\n"}], "src_uid": "224a0b09547ec1441474efbd8e06353b"} {"source_code": "= $patternLength - 1 ? 0 : $patternIndex + 1;\r\n }\r\n\r\n $results = addResult($results, $isSubstring == true ? \"YES\" : \"NO\");\r\n}\r\n\r\necho($results);\r\n\r\n\r\n// Helpers\r\n\r\nfunction addResult($results, $result)\r\n{\r\n return $results . PHP_EOL . $result;\r\n}\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 getString()\r\n{\r\n return trim(fgets(STDIN));\r\n}\r\n\r\nfunction getWords()\r\n{\r\n return explode(' ', trim(fgets(STDIN)));\r\n}\r\n\r\n"}], "negative_code": [], "src_uid": "3cd56870a96baf8860e9b7e89008d895"} {"source_code": "=$j1)\n $ds1 += $a[$i1][$j] - $a[$i1][$j1-1];\n else\n $ds1 += $a[$i1][$j1] - $a[$i1][$j-1];\n // $j1\n $ds2 = $b[$i1][$j1] - $b[$i-1][$j1];\n if ($j>=$j1)\n $ds2 += $a[$i][$j] - $a[$i][$j1-1];\n else\n $ds2 += $a[$i][$j1] - $a[$i][$j-1];\n \n if (($ds1-1 != abs($i-$i1)+abs($j-$j1)+1) && \n ($ds2-1 != abs($i-$i1)+abs($j-$j1)+1))\n {\n echo \"NO\";\n exit;\n }\n $zx++;\n if ($zx>1000000)\n {\n echo \"YES\";\n return;\n }\n }\n }\n }\n }\n }\n }\n echo \"YES\";\n?>", "positive_code": [{"source_code": " 1) && ($w4 > 0)) || (($w4 > 1) && ($w3 > 0)) || (($w5 > 1) && ($w6 > 0)) || (($w6 > 1) && ($w5 > 0)) || ($w7 == 1) || ($w8 == 1))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " 1) && ($w4 > 0)) || (($w4 > 1) && ($w3 > 0)) || (($w5 > 1) && ($w6 > 0)) || (($w6 > 1) && ($w5 > 0)) || ($w7 == 1) || ($w8 == 1))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " 1) && ($w4 > 0)) || (($w4 > 1) && ($w3 > 0)) || (($w5 > 1) && ($w6 > 0)) || (($w6 > 1) && ($w5 > 0)))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " 0) && ($w4 > 0)) || (($w4 > 0) && ($w3 > 0)) || (($w5 > 0) && ($w6 > 0)) || (($w6 > 0) && ($w5 > 0)))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " 1) || ($w4 > 1) || ($w5 > 1) || ($w6 > 1))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": "=$j1)\n $ds1 += $a[$i1][$j] - $a[$i1][$j1-1];\n else\n $ds1 += $a[$i1][$j1] - $a[$i1][$j-1];\n // $j1\n $ds2 = $b[$i1][$j1] - $b[$i-1][$j1];\n if ($j>=$j1)\n $ds2 += $a[$i][$j] - $a[$i][$j1-1];\n else\n $ds2 += $a[$i][$j1] - $a[$i][$j-1];\n \n if (($ds1-1 != abs($i-$i1)+abs($j-$j1)+1) && \n ($ds2-1 != abs($i-$i1)+abs($j-$j1)+1))\n {\n echo \"NO\";\n exit;\n }\n $zx++;\n if ($zx>1000000)\n {\n echo \"NO\";\n }\n }\n }\n }\n }\n }\n }\n echo \"YES\";\n\n?>"}, {"source_code": "0)\n {\n $c = 0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n $c += UpdateCell($j,$i);\n }\n }\n }\n \n $c1=0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n if ($table[$i][$j] == 1)\n $c1++;\n }\n }\n if ($c1 == 0)\n {\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n $black = -1;\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n if ($black == -1 && $table[$i][$j]==2)\n $black = 1;\n else if ($black == 1 && $table[$i][$j]==0)\n $black = 0;\n else if ($black == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n }\n if ($c1 == 0)\n {\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n $black = -1;\n for ($i=0; $i<$n && $c1==0; $i++)\n {\n if ($black == -1 && $table[$i][$j]==2)\n $black = 1;\n else if ($black == 1 && $table[$i][$j]==0)\n $black = 0;\n else if ($black == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n } \n \n echo ($c1?\"NO\":\"YES\");\n \n \n?>\n"}, {"source_code": "51, 'y'=>51);\n $rt = array ('x'=>-1, 'y'=>51);\n $lb = array ('x'=>51, 'y'=>-1);\n $rb = array ('x'=>-1, 'y'=>-1);\n \n for ($i=0; $i<$m; $i++)\n {\n $str = trim(fgets(STDIN));\n for ($j=0; $j<$n; $j++)\n {\n if ($str[$j] == \"W\")\n $table[$i][$j] = 0;\n else if ($str[$j] == \"B\")\n {\n if ($lt['x']<=$j && $lt['y']<=$i)\n $lt=array('x'=>$j, 'y'=>$i);\n if ($rt['x']>=$j && $rt['y']<=$i)\n $rt=array('x'=>$j, 'y'=>$i);\n if ($lb['x']<=$j && $lb['y']>=$i)\n $lb=array('x'=>$j, 'y'=>$i);\n if ($rb['x']>=$j && $rb['y']>=$i)\n $rb=array('x'=>$j, 'y'=>$i);\n \n if ($c1 == 0)\n {\n $table[$i][$j] = 2;\n $c1++;\n }\n else\n $table[$i][$j] = 1;\n }\n }\n }\n/*\n $m = 3;\n $n = 3;\n $table = array ( array(2,1,0), array(1,1,1), array(1,1,1));\n */ \n \n function UpdateCell($x, $y)\n {\n global $table;\n $c = 0;\n if ($table[$y][$x] == 2)\n {\n // \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0439\u0442\u0438\n if (isset($table[$y-1][$x]) && $table[$y-1][$x] == 1)\n {\n $table[$y-1][$x] = 2;\n $c++;\n }\n if (isset($table[$y+1][$x]) && $table[$y+1][$x] == 1)\n {\n $table[$y+1][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x-1]) && $table[$y][$x-1] == 1)\n {\n $table[$y][$x-1] = 2;\n $c++;\n }\n if (isset($table[$y][$x+1]) && $table[$y][$x+1] == 1)\n {\n $table[$y][$x+1] = 2;\n $c++;\n }\n }\n else if ($table[$y][$x] == 1)\n {\n if (isset($table[$y-1][$x]) && $table[$y-1][$x] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y+1][$x]) && $table[$y+1][$x] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x-1]) && $table[$y][$x-1] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x+1]) && $table[$y][$x+1] == 2)\n {\n $table[$y][$x] = 2; \n $c++;\n }\n }\n return $c;\n }\n \n $c=1;\n while ($c>0)\n {\n $c = 0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n $c += UpdateCell($j,$i);\n }\n }\n }\n \n $c1=0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n if ($table[$i][$j] == 1)\n $c1++;\n }\n }\n \n function FindPath($x1,$y1,$x2,$y2)\n {\n$dx=($x1>$x2)?-1:1;\n$dy=($y1>$y2)?-1:1;\n global $table;\n $c1=0;\n for ($j=$x1; $j<=$x2 && $c1==0; $j+=$dx)\n if ($table[$y1][$j] == 0)\n $c1=1;\n for ($i=$y1; $i<$y2 && $c1==0; $i+=$dy)\n if ($table[$i][$x2] == 0)\n $c1=1;\n $c2=0;\n for ($i=$y1; $i<=$y2 && $c2==0; $i+=$dy)\n if ($table[$i][$x1] == 0)\n $c2=1; \n for ($j=$x1; $j<$x2 && $c2==0; $j+=$dx)\n if ($table[$y2][$j] == 0)\n $c2=1;\n return ($c1 && $c2);\n }\n \n if ($c1 == 0)\n {\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n $block = -1;\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n if ($block == -1 && $table[$i][$j]==2)\n $block = 1;\n else if ($block == 1 && $table[$i][$j]==0)\n $block = 0;\n else if ($block == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n }\n\n if ($c1 == 0)\n {\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n $block = -1;\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n if ($block == -1 && $table[$i][$j]==2)\n $block = 1;\n else if ($block == 1 && $table[$i][$j]==0)\n $block = 0;\n else if ($block == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n }\n\n $cz=0;\n if ($c1 == 0)\n {\n $min_x = $lb['x'] > $lb['x'] ? $lb['x'] : $lt['x'];\n $min_y = $lb['y'] > $lb['y'] ? $lb['y'] : $lt['y'];\n $max_x = $lb['x'] < $lb['x'] ? $lb['x'] : $lt['x'];\n $max_y = $lb['y'] < $lb['y'] ? $lb['y'] : $lt['y'];\n if (\n $table[$min_y][$min_x] == 2 &&\n $table[$min_y][$max_x] == 2 &&\n $table[$max_y][$min_x] == 2 &&\n $table[$max_y][$max_x] == 2\n )\n $cz=1;\n if (\n (\n $table[$min_y][$min_x] == 2 && \n $table[$max_y][$max_x] == 2 &&\n $table[$min_y][$max_x] == 0 &&\n $table[$max_y][$min_x] == 0\n )\n ||\n (\n $table[$min_y][$min_x] == 0 && \n $table[$max_y][$max_x] == 0 &&\n $table[$min_y][$max_x] == 2 &&\n $table[$max_y][$min_x] == 2\n )\n )\n {\n $cz = 1;\n $c1 = 1;\n }\n }\n \n if ($c1 == 0 && $cz == 0)\n {\n $c1 = FindPath($lt['x'],$lt['y'],$rt['x'],$rt['y']) +\n FindPath($lt['x'],$lt['y'],$rb['x'],$rb['y']) +\n FindPath($lt['x'],$lt['y'],$lb['x'],$lb['y']) +\n FindPath($rt['x'],$rt['y'],$rb['x'],$rb['y']) +\n FindPath($rt['x'],$rt['y'],$lb['x'],$lb['y']) +\n FindPath($lb['x'],$lb['y'],$rb['x'],$rb['y']);\n }\n \n /*\n if ($c1 == 0 && $cz == 0)\n {\n for ($i1=0; $i1<$m && $c1==0; $i1++)\n {\n for ($j1=0; $j1<$n && $c1==0; $j1++)\n {\n if ($table[$i1][$j1]==2)\n {\n for ($i2=i1+1; $i2<$m && $c1==0; $i2++)\n {\n for ($j2=j1+1; $j2<$m && $c1==0; $j2++)\n {\n if ($table[$i2][$j2] == 2)\n {\n $c1 = FindPath($j1,$i1,$j2,$i2);\n }\n }\n }\n for ($i2=0; $i2<=$i1 && $c1==0; $i2++)\n {\n for ($j2=j1+1; $j2<$m && $c1==0; $j2++)\n {\n if ($table[$i2][$j2] == 2)\n {\n $c1 = FindPath($j1,$i1,$j2,$i2);\n }\n }\n } \n for ($i2=i1+1; $i2<$m && $c1==0; $i2++)\n {\n for ($j2=0; $j2<=$j1 && $c1==0; $j2++)\n {\n if ($table[$i2][$j2] == 2)\n {\n $c1 = FindPath($j1,$i1,$j2,$i2);\n }\n }\n }\n\n }\n }\n }\n }\n */\n \n echo ($c1?\"NO\":\"YES\");\n \n \n?>\n"}, {"source_code": "=$j1)\n $ds1 += $a[$i1][$j] - $a[$i1][$j1-1];\n else\n $ds1 += $a[$i1][$j1] - $a[$i1][$j-1];\n // $j1\n $ds2 = $b[$i1][$j1] - $b[$i-1][$j1];\n if ($j>=$j1)\n $ds2 += $a[$i][$j] - $a[$i][$j1-1];\n else\n $ds2 += $a[$i][$j1] - $a[$i][$j-1];\n \n if (($ds1-1 != abs($i-$i1)+abs($j-$j1)+1) && \n ($ds2-1 != abs($i-$i1)+abs($j-$j1)+1))\n {\n echo \"NO\";\n exit;\n }\n }\n }\n }\n }\n }\n }\n echo \"YES\";\n\n?>\n"}, {"source_code": "=$j1)\n $ds1 += $a[$i1][$j] - $a[$i1][$j1-1];\n else\n $ds1 += $a[$i1][$j1] - $a[$i1][$j-1];\n // $j1\n $ds2 = $b[$i1][$j1] - $b[$i-1][$j1];\n if ($j>=$j1)\n $ds2 += $a[$i][$j] - $a[$i][$j1-1];\n else\n $ds2 += $a[$i][$j1] - $a[$i][$j-1];\n \n if (($ds1-1 != abs($i-$i1)+abs($j-$j1)+1) && \n ($ds2-1 != abs($i-$i1)+abs($j-$j1)+1))\n {\n echo \"NO\";\n exit;\n }\n }\n }\n }\n }\n }\n }\n echo \"YES\";\n\n \n?>\n"}, {"source_code": "51, 'y'=>51);\n $rt = array ('x'=>-1, 'y'=>51);\n $lb = array ('x'=>51, 'y'=>-1);\n $rb = array ('x'=>-1, 'y'=>-1);\n \n for ($i=0; $i<$m; $i++)\n {\n $str = trim(fgets(STDIN));\n for ($j=0; $j<$n; $j++)\n {\n if ($str[$j] == \"W\")\n $table[$i][$j] = 0;\n else if ($str[$j] == \"B\")\n {\n if ($lt['x']>=$j && $lt['y']<=$i)\n $lt=array('x'=>$j, 'y'=>$i);\n if ($rt['x']<=$j && $rt['y']>=$i)\n $rt=array('x'=>$j, 'y'=>$i);\n if ($lb['x']>=$j && $lb['y']<=$i)\n $lb=array('x'=>$j, 'y'=>$i);\n if ($rb['x']<=$j && $rb['y']<=$i)\n $rb=array('x'=>$j, 'y'=>$i);\n \n if ($c1 == 0)\n {\n $table[$i][$j] = 2;\n $c1++;\n }\n else\n $table[$i][$j] = 1;\n }\n }\n }\n/*\n $m = 3;\n $n = 3;\n $table = array ( array(2,1,0), array(1,1,1), array(1,1,1));\n */ \n \n function UpdateCell($x, $y)\n {\n global $table;\n $c = 0;\n if ($table[$y][$x] == 2)\n {\n // \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0439\u0442\u0438\n if (isset($table[$y-1][$x]) && $table[$y-1][$x] == 1)\n {\n $table[$y-1][$x] = 2;\n $c++;\n }\n if (isset($table[$y+1][$x]) && $table[$y+1][$x] == 1)\n {\n $table[$y+1][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x-1]) && $table[$y][$x-1] == 1)\n {\n $table[$y][$x-1] = 2;\n $c++;\n }\n if (isset($table[$y][$x+1]) && $table[$y][$x+1] == 1)\n {\n $table[$y][$x+1] = 2;\n $c++;\n }\n }\n else if ($table[$y][$x] == 1)\n {\n if (isset($table[$y-1][$x]) && $table[$y-1][$x] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y+1][$x]) && $table[$y+1][$x] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x-1]) && $table[$y][$x-1] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x+1]) && $table[$y][$x+1] == 2)\n {\n $table[$y][$x] = 2; \n $c++;\n }\n }\n return $c;\n }\n \n $c=1;\n while ($c>0)\n {\n $c = 0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n $c += UpdateCell($j,$i);\n }\n }\n }\n \n $c1=0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n if ($table[$i][$j] == 1)\n $c1++;\n }\n }\n \n function FindPath($x1,$y1,$x2,$y2)\n {\n$dx=($x1>$x2)?-1:1;\n$dy=($y1>$y2)?-1:1;\n global $table;\n $c1=0;\n for ($j=$x1; $j<=$x2 && $c1==0; $j+=$dx)\n if ($table[$y1][$j] == 0)\n $c1=1;\n for ($i=$y1; $i<$y2 && $c1==0; $i+=$dy)\n if ($table[$i][$x2] == 0)\n $c1=1;\n $c2=0;\n for ($i=$y1; $i<=$y2 && $c2==0; $i+=$dy)\n if ($table[$i][$x1] == 0)\n $c2=1; \n for ($j=$x1; $j<$x2 && $c2==0; $j+=$dx)\n if ($table[$y2][$j] == 0)\n $c2=1;\n return ($c1 && $c2);\n }\n \n if ($c1 == 0)\n {\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n $block = -1;\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n if ($block == -1 && $table[$i][$j]==2)\n $block = 1;\n else if ($block == 1 && $table[$i][$j]==0)\n $block = 0;\n else if ($block == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n }\n\n if ($c1 == 0)\n {\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n $block = -1;\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n if ($block == -1 && $table[$i][$j]==2)\n $block = 1;\n else if ($block == 1 && $table[$i][$j]==0)\n $block = 0;\n else if ($block == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n }\n\n $cz=0;\n if ($c1 == 0)\n {\n $min_x = $lb['x'] > $lb['x'] ? $lb['x'] : $lt['x'];\n $min_y = $lb['y'] > $lb['y'] ? $lb['y'] : $lt['y'];\n $max_x = $lb['x'] < $lb['x'] ? $lb['x'] : $lt['x'];\n $max_y = $lb['y'] < $lb['y'] ? $lb['y'] : $lt['y'];\n if (\n $table[$min_y][$min_x] == 2 &&\n $table[$min_y][$max_x] == 2 &&\n $table[$max_y][$min_x] == 2 &&\n $table[$max_y][$max_x] == 2\n )\n $cz=1;\n if (\n (\n $table[$min_y][$min_x] == 2 && \n $table[$max_y][$max_x] == 2 &&\n $table[$min_y][$max_x] == 0 &&\n $table[$max_y][$min_x] == 0\n )\n ||\n (\n $table[$min_y][$min_x] == 0 && \n $table[$max_y][$max_x] == 0 &&\n $table[$min_y][$max_x] == 2 &&\n $table[$max_y][$min_x] == 2\n )\n )\n {\n $cz = 1;\n $c1 = 1;\n }\n }\n \n if ($c1 == 0 && $cz == 0)\n {\n $c1 = FindPath($lt['x'],$lt['y'],$rt['x'],$rt['y']) +\n FindPath($lt['x'],$lt['y'],$rb['x'],$rb['y']) +\n FindPath($lt['x'],$lt['y'],$lb['x'],$lb['y']) +\n FindPath($rt['x'],$rt['y'],$rb['x'],$rb['y']) +\n FindPath($rt['x'],$rt['y'],$lb['x'],$lb['y']) +\n FindPath($lb['x'],$lb['y'],$rb['x'],$rb['y']);\n }\n \n /*\n if ($c1 == 0 && $cz == 0)\n {\n for ($i1=0; $i1<$m && $c1==0; $i1++)\n {\n for ($j1=0; $j1<$n && $c1==0; $j1++)\n {\n if ($table[$i1][$j1]==2)\n {\n for ($i2=i1+1; $i2<$m && $c1==0; $i2++)\n {\n for ($j2=j1+1; $j2<$m && $c1==0; $j2++)\n {\n if ($table[$i2][$j2] == 2)\n {\n $c1 = FindPath($j1,$i1,$j2,$i2);\n }\n }\n }\n for ($i2=0; $i2<=$i1 && $c1==0; $i2++)\n {\n for ($j2=j1+1; $j2<$m && $c1==0; $j2++)\n {\n if ($table[$i2][$j2] == 2)\n {\n $c1 = FindPath($j1,$i1,$j2,$i2);\n }\n }\n } \n for ($i2=i1+1; $i2<$m && $c1==0; $i2++)\n {\n for ($j2=0; $j2<=$j1 && $c1==0; $j2++)\n {\n if ($table[$i2][$j2] == 2)\n {\n $c1 = FindPath($j1,$i1,$j2,$i2);\n }\n }\n }\n\n }\n }\n }\n }\n */\n \n echo ($c1?\"NO\":\"YES\");\n \n \n?>\n"}, {"source_code": "0)\n {\n $c = 0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n $c += UpdateCell($j,$i);\n }\n }\n }\n \n $c1=0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n if ($table[$i][$j] == 1)\n $c1++;\n }\n }\n if ($c1 == 0)\n {\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n $black = -1;\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n if ($black == -1 && $table[$i][$j]==2)\n $black = 1;\n else if ($black == 1 && $table[$i][$j]==0)\n $black = 0;\n else if ($black == 0 && $table[$i][$j]==1)\n $c1 = 1;\n }\n }\n }\n if ($c1 == 0)\n {\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n $black = -1;\n for ($i=0; $i<$n && $c1==0; $i++)\n {\n if ($black == -1 && $table[$i][$j]==2)\n $black = 1;\n else if ($black == 1 && $table[$i][$j]==0)\n $black = 0;\n else if ($black == 0 && $table[$i][$j]==1)\n $c1 = 1;\n }\n }\n } \n \n echo ($c1?\"NO\":\"YES\");\n \n \n?>\n"}, {"source_code": "51, 'y'=>51);\n $rt = array ('x'=>-1, 'y'=>51);\n $lb = array ('x'=>51, 'y'=>-1);\n $rb = array ('x'=>-1, 'y'=>-1);\n \n for ($i=0; $i<$m; $i++)\n {\n $str = trim(fgets(STDIN));\n for ($j=0; $j<$n; $j++)\n {\n if ($str[$j] == \"W\")\n $table[$i][$j] = 0;\n else if ($str[$j] == \"B\")\n {\n if ($lt['x']<=$j && $lt['y']<=$i)\n $lt=array('x'=>$j, 'y'=>$i);\n if ($rt['x']>=$j && $rt['y']<=$i)\n $rt=array('x'=>$j, 'y'=>$i);\n if ($lb['x']<=$j && $lb['y']>=$i)\n $lb=array('x'=>$j, 'y'=>$i);\n if ($rb['x']>=$j && $rb['y']>=$i)\n $rb=array('x'=>$j, 'y'=>$i);\n \n if ($c1 == 0)\n {\n $table[$i][$j] = 2;\n $c1++;\n }\n else\n $table[$i][$j] = 1;\n }\n }\n }\n/*\n $m = 3;\n $n = 3;\n $table = array ( array(2,1,0), array(1,1,1), array(1,1,1));\n */ \n \n function UpdateCell($x, $y)\n {\n global $table;\n $c = 0;\n if ($table[$y][$x] == 2)\n {\n // \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0439\u0442\u0438\n if (isset($table[$y-1][$x]) && $table[$y-1][$x] == 1)\n {\n $table[$y-1][$x] = 2;\n $c++;\n }\n if (isset($table[$y+1][$x]) && $table[$y+1][$x] == 1)\n {\n $table[$y+1][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x-1]) && $table[$y][$x-1] == 1)\n {\n $table[$y][$x-1] = 2;\n $c++;\n }\n if (isset($table[$y][$x+1]) && $table[$y][$x+1] == 1)\n {\n $table[$y][$x+1] = 2;\n $c++;\n }\n }\n else if ($table[$y][$x] == 1)\n {\n if (isset($table[$y-1][$x]) && $table[$y-1][$x] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y+1][$x]) && $table[$y+1][$x] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x-1]) && $table[$y][$x-1] == 2)\n {\n $table[$y][$x] = 2;\n $c++;\n }\n if (isset($table[$y][$x+1]) && $table[$y][$x+1] == 2)\n {\n $table[$y][$x] = 2; \n $c++;\n }\n }\n return $c;\n }\n \n $c=1;\n while ($c>0)\n {\n $c = 0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n $c += UpdateCell($j,$i);\n }\n }\n }\n \n $c1=0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n if ($table[$i][$j] == 1)\n $c1++;\n }\n }\n \n function FindPath($x1,$y1,$x2,$y2)\n {\n$dx=($x1>$x2)?-1:1;\n$dy=($y1>$y2)?-1:1;\n global $table;\n $c1=0;\n for ($j=$x1; $j<=$x2 && $c1==0; $j+=$dx)\n if ($table[$y1][$j] == 0)\n $c1=1;\n for ($i=$y1; $i<$y2 && $c1==0; $i+=$dy)\n if ($table[$i][$x2] == 0)\n $c1=1;\n $c2=0;\n for ($i=$y1; $i<=$y2 && $c2==0; $i+=$dy)\n if ($table[$i][$x1] == 0)\n $c2=1; \n for ($j=$x1; $j<$x2 && $c2==0; $j+=$dx)\n if ($table[$y2][$j] == 0)\n $c2=1;\n return ($c1 && $c2);\n }\n \n if ($c1 == 0)\n {\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n $block = -1;\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n if ($block == -1 && $table[$i][$j]==2)\n $block = 1;\n else if ($block == 1 && $table[$i][$j]==0)\n $block = 0;\n else if ($block == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n }\n\n if ($c1 == 0)\n {\n for ($j=0; $j<$n && $c1==0; $j++)\n {\n $block = -1;\n for ($i=0; $i<$m && $c1==0; $i++)\n {\n if ($block == -1 && $table[$i][$j]==2)\n $block = 1;\n else if ($block == 1 && $table[$i][$j]==0)\n $block = 0;\n else if ($block == 0 && $table[$i][$j]==2)\n $c1 = 1;\n }\n }\n }\n\n $cz=0;\n if ($c1 == 0)\n {\n $min_x = $lb['x'] > $lb['x'] ? $lb['x'] : $lt['x'];\n $min_y = $lb['y'] > $lb['y'] ? $lb['y'] : $lt['y'];\n $max_x = $lb['x'] < $lb['x'] ? $lb['x'] : $lt['x'];\n $max_y = $lb['y'] < $lb['y'] ? $lb['y'] : $lt['y'];\n if (\n $table[$min_y][$min_x] == 2 &&\n $table[$min_y][$max_x] == 2 &&\n $table[$max_y][$min_x] == 2 &&\n $table[$max_y][$max_x] == 2\n )\n $cz=1;\n if (\n (\n $table[$min_y][$min_x] == 2 && \n $table[$max_y][$max_x] == 2 &&\n $table[$min_y][$max_x] == 0 &&\n $table[$max_y][$min_x] == 0\n )\n ||\n (\n $table[$min_y][$min_x] == 0 && \n $table[$max_y][$max_x] == 0 &&\n $table[$min_y][$max_x] == 2 &&\n $table[$max_y][$min_x] == 2\n )\n )\n {\n $cz = 1;\n $c1 = 1;\n }\n }\n \n if ($c1 == 0 && $cz == 0)\n {\n $c1 = FindPath($lt['x'],$lt['y'],$rt['x'],$rt['y']) +\n FindPath($lt['x'],$lt['y'],$rb['x'],$rb['y']) +\n FindPath($lt['x'],$lt['y'],$lb['x'],$lb['y']) +\n FindPath($rt['x'],$rt['y'],$rb['x'],$rb['y']) +\n FindPath($rt['x'],$rt['y'],$lb['x'],$lb['y']) +\n FindPath($lb['x'],$lb['y'],$rb['x'],$rb['y']);\n }\n \n \n echo ($c1?\"NO\":\"YES\");\n \n \n?>\n"}, {"source_code": "=$j1)\n $ds1 += $a[$i1][$j] - $a[$i1][$j1-1];\n else\n $ds1 += $a[$i1][$j1] - $a[$i1][$j-1];\n // $j1\n $ds2 = $b[$i1][$j1] - $b[$i-1][$j1];\n if ($j>=$j1)\n $ds2 += $a[$i][$j] - $a[$i][$j1-1];\n else\n $ds2 += $a[$i][$j1] - $a[$i][$j-1];\n \n if (($ds1-1 != abs($i-$i1)+abs($j-$j1)+1) && \n ($ds2-1 != abs($i-$i1)+abs($j-$j1)+1))\n {\n echo \"NO\";\n exit;\n }\n }\n }\n }\n }\n }\n }\n echo \"YES\";\n\n \n?>\n"}, {"source_code": "=$j1)\n $ds1 += $a[$i1][$j] - $a[$i1][$j1-1];\n else\n $ds1 += $a[$i1][$j1] - $a[$i1][$j-1];\n // $j1\n $ds2 = $b[$i1][$j1] - $b[$i-1][$j1];\n if ($j>=$j1)\n $ds2 += $a[$i][$j] - $a[$i][$j1-1];\n else\n $ds2 += $a[$i][$j1] - $a[$i][$j-1];\n \n if (($ds1-1 != abs($i-$i1)+abs($j-$j1)+1) && \n ($ds2-1 != abs($i-$i1)+abs($j-$j1)+1))\n {\n echo \"NO\";\n exit;\n }\n $zx++;\n if ($zx>100000)\n {\n echo \"NO\";\n }\n }\n }\n }\n }\n }\n }\n echo \"YES\";\n\n?>"}, {"source_code": "0)\n {\n $c = 0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n $c += UpdateCell($j,$i);\n }\n }\n }\n \n $c1=0;\n for ($i=0; $i<$m; $i++)\n {\n for ($j=0; $j<$n; $j++)\n {\n if ($table[$i][$j] == 1)\n $c1++;\n }\n }\n echo ($c1?\"NO\":\"YES\");\n \n \n?>\n"}, {"source_code": "=$j1)\n $ds1 += $a[$i1][$j] - $a[$i1][$j1-1];\n else\n $ds1 += $a[$i1][$j1] - $a[$i1][$j-1];\n // $j1\n $ds2 = $b[$i1][$j1] - $b[$i-1][$j1];\n if ($j>=$j1)\n $ds2 += $a[$i][$j] - $a[$i][$j1-1];\n else\n $ds2 += $a[$i][$j1] - $a[$i][$j-1];\n \n if (($ds1-1 != abs($i-$i1)+abs($j-$j1)+1) && \n ($ds2-1 != abs($i-$i1)+abs($j-$j1)+1))\n {\n echo \"NO\";\n exit;\n }\n $zx++;\n if ($zx>1000000)\n {\n echo \"NO\";\n return;\n }\n }\n }\n }\n }\n }\n }\n echo \"YES\";\n\n?>"}], "src_uid": "3631eba1b28fae473cf438bc2f0552b7"} {"source_code": " 1) {\n usort($g, function(&$x, &$y) {\n return $x[2] - $y[2];\n });\n}\n\n$p = new \\SplFixedArray($n+1);\n$c = new \\SplFixedArray($n+1);\n$x = new \\SplFixedArray($n+1);\nfor($i=0; $i<=$n; $i++) {\n $p[$i] = $i;\n $c[$i] = 1;\n $wx[$i] = 0;\n}\n\nfunction find($_) {\n global $p;\n if($_ === $p[$_]) {\n return $_;\n }\n $p[$_] = find($p[$_]);\n return $p[$_];\n}\n\n$mw = ($n === 1) ? 0 : $g[$n-2][2];\n$ans = new \\SplFixedArray($mw+1);\nfor($i=0; $i<=$mw; $i++) {\n $ans[$i] = 0;\n}\n\n$l = $n-1;\nfor($i=0; $i<$l; $i++) {\n $u = $g[$i][0];\n $v = $g[$i][1];\n $w = $g[$i][2];\n $pu = find($u);\n $pv = find($v);\n\n $ans[$w] = bcadd($ans[$w], bcmul($c[$pu], $c[$pv]));\n\n $c[$pu] += $c[$pv];\n $p[$pv] = $pu;\n $wx[$pu] = $w;\n}\n\nfor($i=1; $i<=$mw; $i++) {\n $ans[$i] = bcadd($ans[$i], $ans[$i-1]);\n}\n\n$q = array_map(asInt::class, nla());\nforeach($q as $x) {\n if($x < $mw) {\n echo $ans[$x] . \" \";\n } else {\n echo $ans[$mw] . \" \";\n }\n}\necho \"\\n\";\n", "positive_code": [{"source_code": " 1) {\n usort($g, function(&$x, &$y) {\n return $x[2] - $y[2];\n });\n}\n\n$p = new SplFixedArray($n+1);\n$c = new SplFixedArray($n+1);\n$x = new SplFixedArray($n+1);\nfor($i=0; $i<=$n; $i++) {\n $p[$i] = $i;\n $c[$i] = 1;\n $wx[$i] = 0;\n}\n\nfunction find($i) {\n global $p;\n return ($i === $p[$i]) ? $i : ($p[$i] = find($p[$i]));\n}\n\n$mw = ($n === 1) ? 0 : $g[$n-2][2];\n$ans = new SplFixedArray($mw+1);\nfor($i=0; $i<=$mw; $i++) {\n $ans[$i] = 0;\n}\n\nforeach($g as $e) {\n list($u, $v, $w) = $e;\n $pu = find($u);\n $pv = find($v);\n $ans[$w] = bcadd($ans[$w], bcmul($c[$pu], $c[$pv]));\n $c[$pu] += $c[$pv];\n $p[$pv] = $pu;\n $wx[$pu] = $w;\n}\n\nfor($i=1; $i<=$mw; $i++) {\n $ans[$i] = bcadd($ans[$i], $ans[$i-1]);\n}\n\n$q = array_map(asInt::class, nla());\nforeach($q as $x) {\n echo (($x < $mw) ? $ans[$x] : $ans[$mw]) . \" \";\n}\necho \"\\n\";\n"}], "negative_code": [{"source_code": " 1) {\n usort($g, function(&$x, &$y) {\n return $x[2] - $y[2];\n });\n}\n\n$p = new \\SplFixedArray($n+1);\n$c = new \\SplFixedArray($n+1);\n$x = new \\SplFixedArray($n+1);\nfor($i=0; $i<=$n; $i++) {\n $p[$i] = $i;\n $c[$i] = 1;\n $wx[$i] = 0;\n}\n\nfunction find($_) {\n global $p;\n if($_ === $p[$_]) {\n return $_;\n }\n $p[$_] = find($p[$_]);\n return $p[$_];\n}\n\n$mw = ($n === 1) ? 0 : $g[$n-2][2];\n$ans = new \\SplFixedArray($mw+1);\nfor($i=0; $i<=$mw; $i++) {\n $ans[$i] = 0;\n}\n\n$l = $n-1;\nfor($i=0; $i<$l; $i++) {\n $u = $g[$i][0];\n $v = $g[$i][1];\n $w = $g[$i][2];\n $pu = find($u);\n $pv = find($v);\n if($pu !== $pv) {\n if($wx[$pu] < $w) {\n $ans[$w] = bcadd($ans[$w], bcdiv(bcmul($c[$pu], $c[$pu]-1), 2));\n }\n if($wx[$pv] < $w) {\n $ans[$w] = bcadd($ans[$w], bcdiv(bcmul($c[$pv], $c[$pv]-1), 2));\n }\n $ans[$w] = bcadd($ans[$w], bcmul($c[$pu], $c[$pv]));\n\n $c[$pu] += $c[$pv];\n $p[$pv] = $pu;\n $wx[$pu] = $w;\n }\n}\n\n$q = array_map(asInt::class, nla());\nforeach($q as $x) {\n if($x < $mw) {\n echo $ans[$x] . \" \";\n } else {\n echo $ans[$mw] . \" \";\n }\n}\necho \"\\n\";"}], "src_uid": "f94165f37e968442fa7f8be051018ad9"} {"source_code": "", "positive_code": [{"source_code": "= 9 && $d <99) {\n $i = 1;\n } elseif ($d >= 99 && $d < 999) {\n $i = 2;\n } elseif ($d >= 999 && $d < 9999) {\n $i = 3;\n } elseif ($d >= 9999 && $d < 99999) {\n $i = 4;\n }elseif ($d >= 99999 && $d < 999999) {\n $i = 5;\n }elseif ($d >= 999999 && $d < 9999999) {\n $i = 6;\n }elseif ($d >= 9999999 && $d < 99999999) {\n $i = 7;\n }elseif ($d >= 99999999 && $d < 999999999) {\n $i = 8;\n } elseif ($d >= 999999999 && $d < 9999999999) {\n $i = 9;\n } elseif ($d >= 9999999999 && $d < 99999999999) {\n $i = 10;\n } elseif ($d >= 99999999999 && $d < 999999999999) {\n $i = 11;\n } elseif ($d >= 999999999999 && $d < 9999999999999) {\n $i = 12;\n } elseif ($d >= 9999999999999 && $d < 99999999999999) {\n $i = 13;\n }\n echo $n * $i . \"\\n\";\n}"}], "negative_code": [{"source_code": " 9 && $d <99) {\n $i = 1;\n } elseif ($d > 99 && $d < 999) {\n $i = 2;\n } elseif ($d > 999 && $d < 9999) {\n $i = 3;\n } elseif ($d > 9999 && $d < 99999) {\n $i = 4;\n }elseif ($d > 99999 && $d < 999999) {\n $i = 5;\n }elseif ($d > 999999 && $d < 9999999) {\n $i = 6;\n }elseif ($d > 9999999 && $d < 99999999) {\n $i = 7;\n }elseif ($d > 99999999 && $d < 999999999) {\n $i = 8;\n } elseif ($d > 999999999 && $d < 9999999999) {\n $i = 9;\n } elseif ($d > 9999999999 && $d < 99999999999) {\n $i = 10;\n }\n echo $n * $i . \"\\n\";\n}"}, {"source_code": " 9 && $d <99) {\n $i = 1;\n } elseif ($d > 99 && $d < 999) {\n $i = 2;\n } elseif ($d > 999 && $d < 9999) {\n $i = 3;\n } elseif ($d > 9999 && $d < 99999) {\n $i = 4;\n }elseif ($d > 99999 && $d < 999999) {\n $i = 5;\n }elseif ($d > 999999 && $d < 9999999) {\n $i = 6;\n }elseif ($d > 9999999 && $d < 99999999) {\n $i = 7;\n }elseif ($d > 99999999 && $d < 999999999) {\n $i = 8;\n } elseif ($d > 999999999 && $d < 9999999999) {\n $i = 9;\n } elseif ($d > 9999999999 && $d < 99999999999) {\n $i = 10;\n }\n echo $i . \" \";\n echo $n * $i . \"\\n\";\n}"}, {"source_code": " 9 && $d <99) {\n $i = 1;\n } elseif ($d > 99 && $d < 999) {\n $i = 2;\n } elseif ($d > 999 && $d < 9999) {\n $i = 3;\n } elseif ($d > 9999 && $d < 99999) {\n $i = 4;\n }elseif ($d > 99999 && $d < 999999) {\n $i = 5;\n }elseif ($d > 999999 && $d < 9999999) {\n $i = 6;\n }elseif ($d > 9999999 && $d < 99999999) {\n $i = 7;\n }elseif ($d > 99999999 && $d < 999999999) {\n $i = 8;\n } elseif ($d > 999999999 && $d < 9999999999) {\n $i = 9;\n } elseif ($d > 9999999999 && $d < 99999999999) {\n $i = 10;\n } elseif ($d > 99999999999 && $d < 999999999999) {\n $i = 11;\n } elseif ($d > 999999999999 && $d < 9999999999999) {\n $i = 12;\n } elseif ($d > 9999999999999 && $d < 99999999999999) {\n $i = 13;\n }\n echo $n * $i . \"\\n\";\n}"}], "src_uid": "dc67dd2102c70ea476df642b863ae8d3"} {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "fad203b52e11706d70e9b2954c295f70"} {"source_code": " 1){\n $prew = $input[0];\n for($i = 1; $i < $len; $i++){\n if($prew != $input[$i]){\n if(count($result) > 0 && $result[count($result) - 1] == $prew){\n array_pop($result);\n $prew = $input[$i];\n } else {\n $result[] = $prew;\n $prew = $input[$i];\n }\n } else {\n $i++;\n $prew = $input[$i];\n }\n }\n if($len == $i){\n $result[] = $prew;\n }\n echo implode(\"\", $result);\n} else {\n echo $input;\n}\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?>", "positive_code": [{"source_code": ""}, {"source_code": " 1){\n $prew = current($input);\n while ($char = next($input)) {\n if($prew != $char){\n if(count($result) > 0 && end($result) == $prew){\n array_pop($result);\n $prew = $char;\n } else {\n $result[] = $prew;\n $prew = $char;\n }\n } else {\n $prew = next($input);\n }\n }\n /*if($len == $i){\n $result[] = $prew;\n }*/\n echo implode($result);\n} else {\n echo $input;\n}\n?>"}, {"source_code": " 1){\n $result = array();\n $prew = $input[0];\n for($i = 1; $i < $len; $i++){\n if($prew != $input[$i]){\n if(count($result) > 0 && end($result) == $prew){\n array_pop($result);\n $prew = $input[$i];\n } else {\n $result[] = $prew;\n $prew = $input[$i];\n }\n } else {\n $i++;\n $prew = $input[$i];\n }\n }\n if($len == $i){\n $result[] = $prew;\n }\n echo implode($result);\n} else {\n echo $input;\n}\n\n?>"}, {"source_code": " 1){\n $result = array();\n $prew = $input[0];\n for($i = 1; $i < $len; $i++){\n if($prew != $input[$i]){\n if(count($result) > 0 && end($result) == $prew){\n array_pop($result);\n $prew = $input[$i];\n } else {\n $result[] = $prew;\n $prew = $input[$i];\n }\n } else {\n $i++;\n $prew = $input[$i];\n }\n }\n if($len == $i){\n $result[] = $prew;\n }\n echo implode($result);\n} else {\n echo $input;\n}\n\n?>"}, {"source_code": " 1){\n $prew = $input[0];\n for($i = 1; $i < $len; $i++){\n if($prew != $input[$i]){\n if(count($result) > 0 && $result[count($result) - 1] == $prew){\n array_pop($result);\n $prew = $input[$i];\n } else {\n array_push($result, $prew);\n $prew = $input[$i];\n }\n } else {\n $i++;\n $prew = $input[$i];\n }\n }\n if($len == $i){\n array_push($result, $prew);\n }\n echo implode(\"\", $result);\n} else {\n echo $input;\n}\n?>"}, {"source_code": " 1){\n $prew = $input[0];\n for($i = 1; $i < $len; $i++){\n if($prew != $input[$i]){\n if(strlen($result) > 0 && $result[strlen($result) - 1] == $prew){\n $result = substr($result, 0, -1);\n $prew = $input[$i];\n } else {\n $result .= $prew;\n $prew = $input[$i];\n }\n } else {\n $i++;\n $prew = $input[$i];\n }\n }\n if($len == $i){\n $result .= $prew;\n }\n echo $result;\n} else {\n echo $input;\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "26f1b8c3cb83603c904e1508df4067f4"} {"source_code": "$room_data) {\n $room_possibility = array();\n foreach ($papers as $paper) {\n $res = getPrice($room_data['long'], $room_data['height'], $paper['width'], $paper['height'], $paper['price']);\n //echo $res;\n if ($res!==false) {\n $room_possibility[] = $res;\n }\n }\n $result += (int)min($room_possibility);\n}\n\necho $result;\n\n?>", "positive_code": [{"source_code": "= $d[$x])\n {\n $s = floor($i[$y] / $d[$x]);\n $t = ceil($r / ($s * $j[$y]));\n $p[$y] = $k[$y] * $t;\n }\n }\n $u = min($p);\n $o += $u;\n}\nprint $o;\n?>"}, {"source_code": "h = $h;\n $this->len = 2 * ($a + $b);\n }\n}\nclass Page {\n public $a, $b, $p;\n public function __construct($a, $b, $p) {\n $this->a = $a;\n $this->b = $b;\n $this->p = $p;\n }\n}\nfunction getPrice($room, $page) {\n $piece = (int) ($page->a / $room->h);\n if ($piece <= 0)\n return 99999999;\n $wide = $piece * $page->b;\n $rolls = ceil($room->len / $wide);\n return $rolls * $page->p;\n}\n$room = array();\n$page = array();\nfscanf(STDIN, \"%d\", $rooms);\nfor ($i = 0; $i < $rooms; ++$i) {\n fscanf(STDIN, \"%d%d%d\", $a, $b, $h);\n array_push($room, new Room($a, $b, $h));\n}\nfscanf(STDIN, \"%d\", $pages);\nfor ($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$sum = 0;\nforeach ($room as $rm) {\n $min = 99999999;\n foreach ($page as $pg) {\n $price = getPrice($rm, $pg);\n $min = min($price, $min);\n }\n $sum+=$min;\n}\necho $sum;"}, {"source_code": "h = $h;\n $this->len = 2 * ($a + $b);\n }\n\n}\n\nclass 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\nfunction getPrice($room, $page) {\n $piece = (int) ($page->a / $room->h);\n if ($piece <= 0)\n return 99999999;\n\n $wide = $piece * $page->b;\n $rolls = ceil($room->len / $wide);\n\n return $rolls * $page->p;\n}\n\n$room = array();\n$page = array();\n\nfscanf(STDIN, \"%d\", $rooms);\nfor ($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\nfscanf(STDIN, \"%d\", $pages);\nfor ($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\nforeach ($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}\necho $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 = $h;\n $this->len = 2 * ($a + $b);\n }\n\n}\n\nclass 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\nfunction 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\nfscanf(STDIN, \"%d\", $rooms);\nfor ($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\nfscanf(STDIN, \"%d\", $pages);\nfor ($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\nforeach ($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}\necho $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 = $h;\n $this->len = 2 * ($a + $b);\n }\n\n}\n\nclass 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\nfunction getPrice($room, $page) {\n $piece = (int) ($page->a / $room->h);\n if ($piece <= 0)\n return 99999999;\n $wide = $piece * $page->b;\n $rolls = ceil($room->len / $wide);\n return $rolls * $page->p;\n}\n\n$room = array();\n$page = array();\n\nfscanf(STDIN, \"%d\", $rooms);\nfor ($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\nfscanf(STDIN, \"%d\", $pages);\nfor ($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;\nforeach ($room as $rm) {\n $min = 99999999;\n foreach ($page as $pg) {\n $price = getPrice($rm, $pg);\n $min = min($price, $min);\n }\n $sum+=$min;\n}\necho $sum;"}, {"source_code": "$room_data) { \n foreach ($papers as $paper) {\n $res = getPrice($room_data['long'], $room_data['height'], $paper['width'], $paper['height'], $paper['price']);\n //echo $res;\n if ($res!==false) {\n if (!isset($min)) {\n $min = $res;\n } else {\n $min = min($min, $res);\n }\n }\n }\n $result += (int)$min;\n unset($min);\n}\n\necho $result;\n\n?>"}], "negative_code": [{"source_code": "h = $h;\n $this->len = 2 * ($a + $b);\n }\n\n}\n\nclass 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\nfunction getPrice($room, $page) {\n $piece = (int)($page -> a / $room->h);\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\nfscanf(STDIN, \"%d\", $rooms);\nfor ($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\nfscanf(STDIN, \"%d\", $pages);\nfor ($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\nforeach ($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}\necho $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 = $h;\n $this->len = 2 * ($a + $b);\n }\n\n}\n\nclass 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\nfunction getPrice($room, $page) {\n $piece = $page -> a / $room->h;\n $wide = $piece * $page -> b;\n\n $yu_len = $room->len % $wide;\n $rolls = $room->len / $wide + ($yu_len != 0 ? 1 : 0);\n return $rolls * $page->p;\n}\n\n$room = array();\n$page = array();\n\nfscanf(STDIN, \"%d\", $rooms);\nfor ($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\nfscanf(STDIN, \"%d\", $pages);\nfor ($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\nforeach ($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}\necho $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": "$room_square) {\n $room_possibility = array();\n foreach ($papers as $paper) {\n $room_possibility[] = getPrice($room_square, $paper['square'], $paper['price']);\n }\n $result += (int)min($room_possibility);\n}\n\necho $result;\n\n?>"}], "src_uid": "29639971c98dd98f0292d994d4433e3a"} {"source_code": " $value) {\n $out .= $value . ' ';\n}\n\necho trim($out);\n\n?> ", "positive_code": [{"source_code": "$ratings[$i]){\n $rankings[$i]++;\n }\n }\n }\n}\n\nfor($i=0;$i<$n;$i++){\n echo $rankings[$i].\" \";\n}\necho \"\\n\";\n\nfclose($handle);"}, {"source_code": ""}, {"source_code": " 0; $i--) { \n\t$rank[$i] = $rank_now;\n\t$rank_now += $freq[$i];\n}\nfor ($i=0; $i < $count; $i++) { \n\tif ($i != 0) {\n\t\techo \" \";\n\t}\n\techo $rank[$numbers[$i]];\n}\necho \"\\n\";\n?>"}], "negative_code": [{"source_code": "$ratings[$i]){\n $rankings[$i]++;\n }\n }\n }\n}\n\nfor($i=0;$i$ratings[$i]){\n $rankings[$i]++;\n }\n }\n }\n}\n\nfor($i=0;$i 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e += floor($c[$x] / 10);\n if(($c[$x] + 1) % 10 == 0)\n {\n $d[1]++;\n }\n elseif(($c[$x] + 2) % 10 == 0)\n {\n $d[2]++;\n }\n elseif(($c[$x] + 3) % 10 == 0)\n {\n $d[3]++;\n }\n elseif(($c[$x] + 4) % 10 == 0)\n {\n $d[4]++;\n }\n elseif(($c[$x] + 5) % 10 == 0)\n {\n $d[5]++;\n }\n elseif(($c[$x] + 6) % 10 == 0)\n {\n $d[6]++;\n }\n elseif(($c[$x] + 7) % 10 == 0)\n {\n $d[7]++;\n }\n elseif(($c[$x] + 8) % 10 == 0)\n {\n $d[8]++;\n }\n elseif(($c[$x] + 9) % 10 == 0)\n {\n $d[9]++;\n }\n}\nfor($x = 1; $x < 10; $x++)\n{\n $b -= $d[$x] * $x;\n $e += $d[$x];\n if($b < 0)\n {\n $b += $d[$x] * $x;\n $e -= $d[$x];\n $f = floor($b / $x);\n $g = $f * $x;\n $b -= $g;\n $e += $f;\n break;\n }\n}\nif($b >= 10)\n{\n $f = floor($b / 10);\n $e += $f;\n $e = min($a * 10, $e);\n}\nprint $e;\n?>", "positive_code": [{"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e += floor($c[$x] / 10);\n if(($c[$x] + 1) % 10 == 0)\n {\n $d[1]++;\n }\n elseif(($c[$x] + 2) % 10 == 0)\n {\n $d[2]++;\n }\n elseif(($c[$x] + 3) % 10 == 0)\n {\n $d[3]++;\n }\n elseif(($c[$x] + 4) % 10 == 0)\n {\n $d[4]++;\n }\n elseif(($c[$x] + 5) % 10 == 0)\n {\n $d[5]++;\n }\n elseif(($c[$x] + 6) % 10 == 0)\n {\n $d[6]++;\n }\n elseif(($c[$x] + 7) % 10 == 0)\n {\n $d[7]++;\n }\n elseif(($c[$x] + 8) % 10 == 0)\n {\n $d[8]++;\n }\n elseif(($c[$x] + 9) % 10 == 0)\n {\n $d[9]++;\n }\n}\nfor($x = 1; $x < 10; $x++)\n{\n $b -= $d[$x] * $x;\n $e += $d[$x];\n if($b < 0)\n {\n $b += $d[$x] * $x;\n $e -= $d[$x];\n $f = floor($b / $x);\n $e += $f;\n break;\n }\n}\nif($b >= 10)\n{\n $f = floor($b / 10);\n $e += $f;\n $e = min($a * 10, $e);\n}\nprint $e;\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e += floor($c[$x] / 10);\n if(($c[$x] + 1) % 10 == 0)\n {\n $d[1]++;\n }\n elseif(($c[$x] + 2) % 10 == 0)\n {\n $d[2]++;\n }\n elseif(($c[$x] + 3) % 10 == 0)\n {\n $d[3]++;\n }\n elseif(($c[$x] + 4) % 10 == 0)\n {\n $d[4]++;\n }\n elseif(($c[$x] + 5) % 10 == 0)\n {\n $d[5]++;\n }\n elseif(($c[$x] + 6) % 10 == 0)\n {\n $d[6]++;\n }\n elseif(($c[$x] + 7) % 10 == 0)\n {\n $d[7]++;\n }\n elseif(($c[$x] + 8) % 10 == 0)\n {\n $d[8]++;\n }\n elseif(($c[$x] + 9) % 10 == 0)\n {\n $d[9]++;\n }\n}\nfor($x = 1; $x < 10; $x++)\n{\n $b -= $d[$x] * $x;\n $e += $d[$x];\n if($b < 0)\n {\n $b += $d[$x] * $x;\n $e -= $d[$x];\n $f = floor($b / $x);\n $e += $f;\n break;\n }\n}\nif($b > 0)\n{\n $f = floor($b / 10);\n $e += $f;\n $e = min($a * 10, $e);\n}\nprint $e;\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e += floor($c[$x] / 10);\n if(($c[$x] + 1) % 10 == 0)\n {\n $d[1]++;\n }\n elseif(($c[$x] + 2) % 10 == 0)\n {\n $d[2]++;\n }\n elseif(($c[$x] + 3) % 10 == 0)\n {\n $d[3]++;\n }\n elseif(($c[$x] + 4) % 10 == 0)\n {\n $d[4]++;\n }\n elseif(($c[$x] + 5) % 10 == 0)\n {\n $d[5]++;\n }\n elseif(($c[$x] + 6) % 10 == 0)\n {\n $d[6]++;\n }\n elseif(($c[$x] + 7) % 10 == 0)\n {\n $d[7]++;\n }\n elseif(($c[$x] + 8) % 10 == 0)\n {\n $d[8]++;\n }\n elseif(($c[$x] + 9) % 10 == 0)\n {\n $d[9]++;\n }\n}\nfor($x = 1; $x < 10; $x++)\n{\n $b -= $d[$x] * $x;\n $e += $d[$x];\n if($b < 0)\n {\n $b += $d[$x] * $x;\n $e -= $d[$x];\n $f = floor($b / $x);\n $e += $f;\n break;\n }\n}\nif(($b > 0) && ($b < 10))\n{\n $f = floor($b / 10);\n $e += $f;\n $e = min($a * 10, $e);\n}\nprint $e;\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e += floor($c[$x] / 10);\n if(($c[$x] + 1) % 10 == 0)\n {\n $d[1]++;\n }\n elseif(($c[$x] + 2) % 10 == 0)\n {\n $d[2]++;\n }\n elseif(($c[$x] + 3) % 10 == 0)\n {\n $d[3]++;\n }\n elseif(($c[$x] + 4) % 10 == 0)\n {\n $d[4]++;\n }\n elseif(($c[$x] + 5) % 10 == 0)\n {\n $d[5]++;\n }\n elseif(($c[$x] + 6) % 10 == 0)\n {\n $d[6]++;\n }\n elseif(($c[$x] + 7) % 10 == 0)\n {\n $d[7]++;\n }\n elseif(($c[$x] + 8) % 10 == 0)\n {\n $d[8]++;\n }\n elseif(($c[$x] + 9) % 10 == 0)\n {\n $d[9]++;\n }\n}\nfor($x = 1; $x < 10; $x++)\n{\n $b -= $d[$x] * $x;\n $e += $d[$x];\n if($b < 0)\n {\n $b += $d[$x] * $x;\n $e -= $d[$x];\n $f = floor($b / $x);\n $e += $f;\n break;\n }\n}\nif($b > 0)\n{\n $f = floor($b / 10);\n $e += $f;\n $e = min($a * 10, $e);\n}\nprint $e;\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e += floor($c[$x] / 10);\n if(($c[$x] + 1) % 10 == 0)\n {\n $d[1]++;\n }\n elseif(($c[$x] + 2) % 10 == 0)\n {\n $d[2]++;\n }\n elseif(($c[$x] + 3) % 10 == 0)\n {\n $d[3]++;\n }\n elseif(($c[$x] + 4) % 10 == 0)\n {\n $d[4]++;\n }\n elseif(($c[$x] + 5) % 10 == 0)\n {\n $d[5]++;\n }\n elseif(($c[$x] + 6) % 10 == 0)\n {\n $d[6]++;\n }\n elseif(($c[$x] + 7) % 10 == 0)\n {\n $d[7]++;\n }\n elseif(($c[$x] + 8) % 10 == 0)\n {\n $d[8]++;\n }\n elseif(($c[$x] + 9) % 10 == 0)\n {\n $d[9]++;\n }\n}\nfor($x = 1; $x < 10; $x++)\n{\n $b -= $d[$x] * $x;\n $e += $d[$x];\n if($b < 0)\n {\n $b += $d[$x] * $x;\n $e -= $d[$x];\n $f = floor($b / $x);\n $e += $f;\n break;\n }\n}\nprint $e;\n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $e += floor($c[$x] / 10);\n if(($c[$x] + 1) % 10 == 0)\n {\n $d[1]++;\n }\n elseif(($c[$x] + 2) % 10 == 0)\n {\n $d[2]++;\n }\n elseif(($c[$x] + 3) % 10 == 0)\n {\n $d[3]++;\n }\n elseif(($c[$x] + 4) % 10 == 0)\n {\n $d[4]++;\n }\n elseif(($c[$x] + 5) % 10 == 0)\n {\n $d[5]++;\n }\n elseif(($c[$x] + 6) % 10 == 0)\n {\n $d[6]++;\n }\n elseif(($c[$x] + 7) % 10 == 0)\n {\n $d[7]++;\n }\n elseif(($c[$x] + 8) % 10 == 0)\n {\n $d[8]++;\n }\n elseif(($c[$x] + 9) % 10 == 0)\n {\n $d[9]++;\n }\n}\nfor($x = 1; $x < 10; $x++)\n{\n $b -= $d[$x] * $x;\n $e += $d[$x];\n if($b < 0)\n {\n $b += $d[$x] * $x;\n $e -= $d[$x];\n $f = floor($b / $x);\n $e += $f;\n break;\n }\n}\nif($b > 0)\n{\n $f = floor($b / 10);\n $e += $f;\n}\nprint $e;\n?>"}, {"source_code": "", "positive_code": [{"source_code": "\n\n\n \n Zyzsdy\n \n \n

\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 $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 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 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 = $a[$j] && $b[$i] >= $b[$j]) {\r\n $sA = $a[$j];\r\n $a[$j] = $a[$i];\r\n $a[$i] = $sA;\r\n \r\n \r\n $sB = $b[$j];\r\n $b[$j] = $b[$i];\r\n $b[$i] = $sB;\r\n \r\n $i1 = $j+1;\r\n $i2 = $i+1;\r\n $aCheck[] = \"$i1 $i2\";\r\n }\r\n }\r\n }\r\n \r\n $bCheck = false;\r\n for ($i=1; $i<$n; $i++) {\r\n if ($a[$i-1] > $a[$i] || $b[$i-1] > $b[$i]) {\r\n $bCheck = true;\r\n }\r\n }\r\n if ($bCheck) {\r\n echo -1 . PHP_EOL;\r\n } else {\r\n echo count($aCheck) . PHP_EOL;\r\n foreach ($aCheck as $sVal) {\r\n echo $sVal . PHP_EOL;\r\n }\r\n }\r\n }\r\n?>"}], "negative_code": [{"source_code": " $a[$j]) {\r\n $iRight++;\r\n $sA = $a[$j];\r\n \r\n $a[$j] = $a[$i];\r\n $a[$i] = $sA;\r\n \r\n \r\n $sB = $b[$j];\r\n \r\n $b[$j] = $b[$i];\r\n $b[$i] = $sB;\r\n \r\n $i1 = $j+1;\r\n $i2 = $i+1;\r\n \r\n $aCheck[] = \"$i1 $i2\";\r\n \r\n if ($b[$i] > $b[$j]) {\r\n $iLeft++;\r\n }\r\n }\r\n \r\n if ($b[$i] > $b[$j]) {\r\n $iLeft++;\r\n }\r\n \r\n }\r\n }\r\n \r\n //echo $iRight . '--' . $iLeft . PHP_EOL;\r\n //exit;\r\n \r\n if ($iRight > 0 && $iLeft == 0) {\r\n echo $iRight . PHP_EOL;\r\n foreach ($aCheck as $sVal) {\r\n echo $sVal . PHP_EOL;\r\n }\r\n } else if ($iRight == 0 && $iLeft == 0){\r\n echo 0 . PHP_EOL;\r\n } else {\r\n echo -1 . PHP_EOL;\r\n }\r\n }\r\n?>"}, {"source_code": " $a[$j]) {\r\n $iRight++;\r\n $sA = $a[$j];\r\n \r\n $a[$j] = $a[$i];\r\n $a[$i] = $sA;\r\n \r\n \r\n $sB = $b[$j];\r\n \r\n $b[$j] = $b[$i];\r\n $b[$i] = $sB;\r\n \r\n $i1 = $j+1;\r\n $i2 = $i+1;\r\n \r\n $aCheck[] = \"$i1 $i2\";\r\n \r\n if ($b[$i] > $b[$j]) {\r\n $iLeft++;\r\n }\r\n }\r\n \r\n \r\n }\r\n }\r\n \r\n //echo $iRight . PHP_EOL;\r\n //echo $iLeft;\r\n //exit;\r\n \r\n if ($iRight > 0 && $iLeft == 0) {\r\n echo $iRight . PHP_EOL;\r\n foreach ($aCheck as $sVal) {\r\n echo $sVal . PHP_EOL;\r\n }\r\n } else if ($iRight == 0 && $iLeft == 0){\r\n echo 0 . PHP_EOL;\r\n } else {\r\n echo -1 . PHP_EOL;\r\n }\r\n }\r\n?>"}, {"source_code": " $a[$j]) {\r\n $iCheck++;\r\n $sA = $a[$j];\r\n \r\n $a[$j] = $a[$i];\r\n $a[$i] = $sA;\r\n \r\n \r\n $sB = $b[$j];\r\n \r\n $b[$j] = $b[$i];\r\n $b[$i] = $sB;\r\n \r\n $i1 = $j+1;\r\n $i2 = $i+1;\r\n \r\n if ($b[$i] > $b[$j]) {\r\n $iCheck = -1;\r\n break;\r\n }\r\n \r\n $aCheck[] = \"$i1 $i2\";\r\n }\r\n \r\n \r\n }\r\n }\r\n if ($iCheck < 0) {\r\n echo -1 . PHP_EOL;\r\n }\r\n else if ($iCheck == 0){\r\n echo 0 . PHP_EOL;\r\n } else {\r\n echo $iCheck . PHP_EOL;\r\n foreach ($aCheck as $sVal) {\r\n echo $sVal . PHP_EOL;\r\n }\r\n }\r\n }\r\n?>"}, {"source_code": " $a[$j]) {\r\n $iCheck++;\r\n $sA = $a[$j];\r\n \r\n $a[$j] = $a[$i];\r\n $a[$i] = $sA;\r\n \r\n \r\n $sB = $b[$j];\r\n \r\n $b[$j] = $b[$i];\r\n $b[$i] = $sB;\r\n \r\n $i1 = $j+1;\r\n $i2 = $i+1;\r\n \r\n if ($b[$i] > $b[$j]) {\r\n echo '-1' . PHP_EOL;\r\n break;\r\n }\r\n \r\n echo \"$i1 $i2\" . PHP_EOL;\r\n }\r\n }\r\n }\r\n if ($iCheck == 0) echo 0 . PHP_EOL;\r\n }\r\n?>"}], "src_uid": "c1f13141a70c7b9228015c0382c7ca71"} {"source_code": "", "positive_code": [{"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}\r\n"}, {"source_code": ""}, {"source_code": "\";\r\n}\r\n?>"}, {"source_code": ""}], "src_uid": "63c2142461c93ae4c962eac1ecb5b192"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "f2142bc2f44e5d8b77f8561c29038a73"} {"source_code": "", "positive_code": [{"source_code": " $aa){\r\n\t\tif($aa > $max){\r\n\t\t\t$pos = $i; $max = $aa;\r\n\t\t}\r\n\t}\r\n\t$minD = $max;\r\n\tforeach($a as $i => $aa){\r\n\t\tif($i !== $pos && ($d = $max - $aa) < $minD){\r\n\t\t\t$minD = $d;\r\n\t\t}\r\n\t}\r\n\r\n\treturn $minD < 2;\r\n\r\n\r\n};\r\n\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor (; $t > 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) ? 'YES' : 'NO';\r\n\techo \"\\n\";\r\n\r\n}\r\n"}], "negative_code": [], "src_uid": "8b926a19f380a56018308668c17c6928"} {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "1f435ba837f59b007167419896c836ae"} {"source_code": " $ans) {\n $return += $corrects[$k] * max($ans);\n}\n\necho $return . PHP_EOL;", "positive_code": [{"source_code": ""}, {"source_code": " 0,\n 'B' => 0,\n 'C' => 0,\n 'D' => 0,\n 'E' => 0\n ];\n for ($i=0; $i<$n; $i++) { \n $similar_answers[$answers[$i][$j]]++;\n }\n $max += max($similar_answers) * $marks[$j];\n }\n\n print($max);"}, {"source_code": ""}, {"source_code": " $aV){\n $iCount += max($aV) * $aAnswer[$i];\n $i++;\n if($i == $m){\n break;\n }\n}\necho $iCount;\n"}, {"source_code": ""}], "negative_code": [{"source_code": "\nusing namespace std;\nint main(){\n\tint n, m;\n\tcin >> n >> m;\n\tstring s[1005];\n\tfor(int i = 1; i <= n; i++){\n\t\tcin >> s[i];\n\t}\n\tint a[1005], b[6];\n\tfor(int i = 0; i < m; i++){\n\t\tcin >> a[i];\n\t}\n\tint ans = 0;\n\tfor(int i = 0; i < m; i++){\n\t\tmemset(b, 0, sizeof(b));\n\t\tfor(int j = 1; j <= n; j++){\n\t\t\tb[s[j][i]-'A']++;\n\t\t}\n\t\tsort(b, b+5);\n\t\tans = ans + b[4] * a[i];\n\t}\n\tcout << ans < $let) {\n if (empty($ansCount[$k][$let])) {\n $ansCount[$k][$let] = 0;\n $ansCount[$k][$let]++;\n } else {\n $ansCount[$k][$let]++;\n }\n }\n}\n\n$return = 0;\nforeach ($ansCount as $k => $ans) {\n sort($ans);\n\n $return += $corrects[$k] * $ans[0];\n}\n\necho $return . PHP_EOL;"}], "src_uid": "2022f53e5a88d5833e133dc3608a122c"} {"source_code": " $d[$x + 1])\n {\n $m++;\n array_push($o, $x);\n array_push($o, $x + 1);\n }\n}\n$o = array_unique($o);\nsort($o);\nif($m == 0)\n{\n print $a . \"\\n\";\n $n = range(1, $a);\n print implode(\" \", $n);\n}\nelseif($m > 2)\n{\n print \"0\";\n}\nelse\n{\n $t = array();\n for($x = 0; $x < count($o); $x++)\n {\n $p = $d;\n $r = $l;\n $s = 0;\n unset($p[$o[$x]]);\n unset($r[$o[$x]]);\n for($y = 0; $y < $a - 1; $y++)\n {\n if(($r[$y] == TRUE) && ($p[$y + 1] == TRUE))\n { \n if($r[$y] > $p[$y + 1])\n {\n $s++;\n }\n } \n elseif(($r[$y] == TRUE) && ($p[$y + 1] == FALSE) && ($p[$y + 2] == TRUE))\n {\n if($r[$y] > $p[$y + 2])\n {\n $s++;\n }\n } \n }\n if($s == 0)\n {\n array_push($t, $f[$o[$x]] + 1);\n }\n }\n if(count($t) == 0)\n {\n print \"0\";\n }\n else\n {\n sort($t);\n print count($t) . \"\\n\";\n print implode(\" \", $t);\n }\n}\n?>", "positive_code": [{"source_code": "l = $l;\n\t\t$this->r = $r;\n\t\t$this->i = $i;\n\t}\n}\n\n$s = array();\nfor ($i = 0; $i < $n; $i++) {\n\t$next = new Segment(0, 0, $i);\n\tfscanf(STDIN, \"%d %d\", $next->l, $next->r);\n\tarray_push($s, $next);\n}\nusort($s, function($a, $b) {\n\treturn $a->l - $b->l;\n});\nfunction check($j) {\n\tglobal $s, $n;\n\t$prev = -1;\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($i != $j) {\n\t\t\tif ($prev != -1 && $s[$prev]->r > $s[$i]->l)\n\t\t\t\treturn false;\n\t\t\t$prev = $i;\n\t\t}\n\t}\n\treturn true;\n}\n\nfor ($i = 0; $i + 1 < $n; $i++) {\n\tif ($s[$i]->r > $s[$i + 1]->l) {\n\t\t$ans = array();\n\t\tfor ($j = $i; $j <= $i + 1; $j++)\n\t\t\tif (check($j))\n\t\t\t\tarray_push($ans, $s[$j]->i + 1);\n\t\tsort($ans);\n\t\tprint(count($ans).\"\\n\");\n\t\tprint(implode(\" \", $ans).\"\\n\");\n\t\treturn;\n\t}\n}\nprint($n.\"\\n\");\nprint(implode(\" \", range(1, $n)).\"\\n\");\n\n?>\n"}], "negative_code": [{"source_code": " $d[$x + 1])\n {\n $m++;\n array_push($n, $f[$x] + 1);\n }\n}\nif($m == 0)\n{\n print $a . \"\\n\";\n $o = range(1, $a);\n print implode(\" \", $o);\n}\nelseif($m == 1)\n{\n print \"1\" . \"\\n\";\n print $n[0];\n}\nelseif($m > 1)\n{\n print \"0\";\n}\n?>"}, {"source_code": " $d[$x + 1])\n {\n $m += 2;\n array_push($n, $f[$x] + 1);\n array_push($n, $f[$x + 1] + 1);\n if($l[$x] > $d[$x + 2])\n {\n $m--;\n unset($n[1]);\n }\n }\n}\nsort($n);\nif($m == 0)\n{\n print $a . \"\\n\";\n $o = range(1, $a);\n print implode(\" \", $o);\n}\nelseif(($m == 1) || ($m == 2))\n{\n print $m . \"\\n\";\n print implode(\" \", $n);\n}\nelseif($m > 2)\n{\n print \"0\";\n}\n?>"}, {"source_code": " $d[$x + 1])\n {\n $m += 2;\n array_push($n, $f[$x] + 1);\n array_push($n, $f[$x + 1] + 1);\n if(($l[$x] > $d[$x + 2]) && ($l[$x + 1] <= $d[$x + 2]))\n {\n $m--;\n unset($n[1]);\n }\n }\n}\nsort($n);\nif($m == 0)\n{\n print $a . \"\\n\";\n $o = range(1, $a);\n print implode(\" \", $o);\n}\nelseif(($m == 1) || ($m == 2))\n{\n print $m . \"\\n\";\n print implode(\" \", $n);\n}\nelseif($m > 2)\n{\n print \"0\";\n}\n?>"}, {"source_code": " 0) {\n\t\tpreg_match($r, $s, $matches);\n\t\t$x = $matches[1];\n\t\tarray_push($res, $x);\n\t\t$s = substr($s, 0, strlen($s) - strlen($x));\n\t}\n\tprint(implode(',',array_reverse($res)).\"\\n\");\n}\n\n?>\n"}, {"source_code": "l = $l;\n\t\t$this->r = $r;\n\t\t$this->i = $i;\n\t}\n}\n\n$s = array();\nfor ($i = 0; $i < $n; $i++) {\n\t$next = new Segment(0, 0, $i);\n\tfscanf(STDIN, \"%d %d\", $next->l, $next->r);\n\tarray_push($s, $next);\n}\nusort($s, function($a, $b) {\n\treturn $a->l - $b->l;\n});\nfunction check($j) {\n\tglobal $s, $n;\n\t$prev = -1;\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($i != $j) {\n\t\t\tif ($prev != -1 && $s[$prev]->r > $s[$i]->l)\n\t\t\t\treturn false;\n\t\t\t$prev = $i;\n\t\t}\n\t}\n\treturn true;\n}\n\nfor ($i = 0; $i + 1 < $n; $i++) {\n\tif ($s[$i]->r > $s[$i + 1]->l) {\n\t\t$ans = array();\n\t\tfor ($j = $i; $j <= $i + 1; $j++)\n\t\t\tif (check($j))\n\t\t\t\tarray_push($ans, $s[$j]->i + 1);\n\t\tprint(count($ans).\"\\n\");\n\t\tprint(implode(\" \", $ans).\"\\n\");\n\t\treturn;\n\t}\n}\nprint($n.\"\\n\");\nprint(implode(\" \", range(1, $n)).\"\\n\");\n\n?>\n"}], "src_uid": "df28bb63a627a41d67f02cbd927d5e9a"} {"source_code": "", "positive_code": [{"source_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*/ $dxs = new stdIn(false);\n \n$q = $dxs-> G();\n \nfor($i = 0; $i < $q; $i++){\n $n = 0;\n $n = $dxs-> G();\n if($n % 2 == 0 && $n > 2){\n echo \"0 \\n\";\n }\n else if($n % 2 != 0){\n echo \"1 \\n\";\n }\n else if($n == 2){\n echo \"2 \\n\";\n }\n}\n \n?>"}, {"source_code": " 2 ? 0 : 2) : 1;\n $i++;\n echo $s . \"\\n\";\n}\n"}, {"source_code": " 2 ? 0 : 2) : 1;\n $res .= ($s . \"\\n\");\n $i++;\n}\necho $res;\n"}], "negative_code": [{"source_code": " 2)\n echo '0';\n else if($n == 2)\n echo '2';\n else\n echo '1';\n}\n\n?>"}, {"source_code": " 2)\n\t\techo '0';\n\telse if($n == 2)\n\t\techo '2';\n\telse\n\t\techo '1';\n}\n\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$q = $dxs-> G();\n \nfor($i = 0; $i < $q; $i++){\n $n = $dxs-> G();\n if($n % 2 == 0 && $n > 2)\n echo \"0\";\n else if($n == 2)\n echo \"2\";\n else\n echo \"1\";\n}\n \n?>"}, {"source_code": " 2)\n\t\techo 0;\n\telse if($n == 2)\n\t\techo 2;\n\telse\n\t\techo 1;\n}\n\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$q = $dxs-> G();\n \nfor($i = 0; $i < $q; $i++){\n $n = 0;\n $n = $dxs-> G();\n if($n%2 == 0 && $n > 2){\n echo \"0 \\n\";\n }\n else if($n == 2){\n echo \"2 \\n\";\n }\n else if($n == 2){\n echo \"1 \\n\";\n }\n}\n \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$q = $dxs-> G();\n \nfor($i = 0; $i < $q; $i++){\n $n = 0;\n $n = $dxs-> G();\n if($n%2 == 0 && $n > 2){\n echo \"0 \\n\";\n }\n else if($n%2 != 2){\n echo \"1 \\n\";\n }\n else if($n == 2){\n echo \"2 \\n\";\n }\n}\n \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$q = $dxs-> G();\n \nfor($i = 0; $i < $q; $i++){\n $n = $dxs-> G();\n if($n % 2 == 0 && $n > 2){\n echo \"0 \\n\";\n }\n else if($n == 2){\n echo \"2 \\n\";\n }\n else if($n == 2){\n echo \"1 \\n\";\n }\n}\n \n?>"}, {"source_code": " 2)\n echo \"0\";\n else if($n == 2)\n echo \"2\";\n else\n echo \"1\";\n}\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(true);\n\n$q = $dxs-> G();\n\nfor($i = 0; $i < $q; $i++){\n $n = $dxs-> G();\n if($n % 2 == 0 && $n > 2)\n echo \"0\";\n else if($n == 2)\n echo \"2\";\n else\n echo \"1\";\n}\n\n?>"}], "src_uid": "178876bfe161ba9ccfd80c9310f75cbc"} {"source_code": "", "positive_code": [{"source_code": " 0; $i--) {\r\n $n = readline();\r\n $arr = explode(\" \", readline());\r\n\r\n $min = min($arr);\r\n $sum = array_sum($arr);\r\n\r\n echo ($sum - $min * $n).\"\\n\";\r\n\r\n\r\n}\r\n\r\n?>"}, {"source_code": ""}, {"source_code": " $min) {\r\n $ans += $a[$i] - $min;\r\n }\r\n }\r\n pr($ans);\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\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 }"}], "negative_code": [{"source_code": " 0; $i--) {\r\n $n = readline();\r\n $arr = explode(\" \", readline());\r\n\r\n $min = min($arr);\r\n $sum = array_sum($arr);\r\n\r\n echo $sum - $min * $n;\r\n\r\n\r\n}\r\n\r\n?>"}], "src_uid": "20dd260775ea71b1fb5b42bcac90a6f2"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "6f6859aabc1c9cbb9ee0d910064d87c2"} {"source_code": "", "positive_code": [{"source_code": " $row) {\n $found = false;\n foreach ($row as $num) {\n if ($num != 0 && $num != $find) {\n continue(2);\n }\n if ($num == $find) {\n $found = true;\n }\n }\n\n if ($found) {\n break;\n }\n }\n\n $p[$rowPos] = $find;\n foreach ($min as $rowPos => $row) {\n foreach ($row as $colPos => $num) {\n if ($num == $find) {\n $min[$rowPos][$colPos] = 0;\n }\n }\n }\n}\n\nfor ($i = 0; $i < $n; $i++) {\n if ($p[$i] == 0) {\n $p[$i] = $n;\n break;\n }\n}\n\necho implode(\" \", $p), \"\\n\";\n"}, {"source_code": "\n"}], "negative_code": [], "src_uid": "1524c658129aaa4175208b278fdc467c"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "fcb6a715dfe302d7ae5a6695ca8976aa"} {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n $m = $m2;\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n $u = 0;\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n if($u == 0)\n {\n print \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " 0) unset($senderSet[$j-1][$key]);\n if ($j < $messagesNumber - 1) unset($senderSet[$j+1][$key]);\n }\n $impossible = true;\n foreach ($senderSet[$j] as $k => $v) {\n if (($j == 0 || $result[$j - 1] != $k)\n && !in_array($k, $im[$j])\n ) {\n $result[$j] = $k;\n $impossible = false;\n break;\n }\n }\n if ($impossible) {\n if ($j == 0) {\n $p = false;\n echo 'Impossible', PHP_EOL;\n break;\n }\n $im[$j - 1][] = $result[$j - 1];\n unset($result[$j - 1]);\n $j--;\n } else {\n $j++;\n }\n }\n if ($p) {\n foreach ($result as $k => $v) {\n echo \"$v:$messages[$k]\", PHP_EOL;\n }\n }\n}"}], "negative_code": [{"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n print implode(\" \", $f[1]) . \"\\n\";\n print implode(\" \", $f[2]) . \"\\n\";\n print implode(\" \", $f[3]) . \"\\n\";\n print implode(\" \", $f[4]) . \"\\n\";\n print implode(\" \", $f[5]) . \"\\n\";\n print implode(\" \", $f[6]) . \"\\n\";\n print implode(\" \", $f[7]) . \"\\n\";\n print implode(\" \", $f[8]) . \"\\n\";\n print implode(\" \", $f[9]) . \"\\n\";\n print implode(\" \", $f[10]) . \"\\n\";\n print implode(\" \", $f[11]) . \"\\n\";\n print implode(\" \", $f[12]) . \"\\n\";\n print implode(\" \", $f[13]) . \"\\n\";\n print implode(\" \", $f[14]) . \"\\n\";\n print implode(\" \", $f[15]) . \"\\n\";\n print implode(\" \", $f[16]) . \"\\n\";\n print implode(\" \", $f[17]) . \"\\n\";\n print implode(\" \", $f[18]) . \"\\n\";\n print implode(\" \", $f[19]) . \"\\n\";\n print implode(\" \", $f[20]) . \"\\n\";\n print implode(\" \", $f[21]) . \"\\n\";\n print implode(\" \", $f[22]) . \"\\n\";\n print implode(\" \", $f[23]) . \"\\n\";\n print implode(\" \", $f[24]) . \"\\n\";\n print implode(\" \", $f[25]) . \"\\n\";\n print implode(\" \", $f[26]) . \"\\n\";\n print implode(\" \", $f[27]) . \"\\n\";\n print implode(\" \", $f[28]) . \"\\n\";\n print implode(\" \", $f[29]) . \"\\n\";\n print implode(\" \", $f[30]) . \"\\n\";\n print implode(\" \", $f[31]) . \"\\n\";\n print implode(\" \", $f[32]) . \"\\n\";\n print implode(\" \", $f[33]) . \"\\n\";\n print implode(\" \", $f[34]) . \"\\n\";\n print implode(\" \", $f[35]) . \"\\n\";\n print implode(\" \", $f[36]) . \"\\n\";\n print implode(\" \", $f[37]) . \"\\n\";\n print implode(\" \", $f[38]) . \"\\n\";\n print implode(\" \", $f[39]) . \"\\n\";\n print implode(\" \", $f[40]) . \"\\n\";\n print implode(\" \", $f[41]) . \"\\n\";\n print implode(\" \", $f[42]) . \"\\n\";\n print implode(\" \", $f[43]) . \"\\n\";\n print implode(\" \", $f[44]) . \"\\n\";\n print implode(\" \", $f[45]) . \"\\n\";\n print implode(\" \", $f[46]) . \"\\n\";\n print implode(\" \", $f[47]) . \"\\n\";\n print implode(\" \", $f[48]) . \"\\n\";\n print implode(\" \", $f[49]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n print implode(\" \", $f[1]) . \"\\n\";\n print implode(\" \", $f[2]) . \"\\n\";\n print implode(\" \", $f[3]) . \"\\n\";\n print implode(\" \", $f[4]) . \"\\n\";\n print implode(\" \", $f[5]) . \"\\n\";\n print implode(\" \", $f[6]) . \"\\n\";\n print implode(\" \", $f[7]) . \"\\n\";\n print implode(\" \", $f[8]) . \"\\n\";\n print implode(\" \", $f[9]) . \"\\n\";\n print implode(\" \", $f[10]) . \"\\n\";\n print implode(\" \", $f[11]) . \"\\n\";\n print implode(\" \", $f[12]) . \"\\n\";\n print implode(\" \", $f[13]) . \"\\n\";\n print implode(\" \", $f[14]) . \"\\n\";\n print implode(\" \", $f[15]) . \"\\n\";\n print implode(\" \", $f[16]) . \"\\n\";\n print implode(\" \", $f[17]) . \"\\n\";\n print implode(\" \", $f[18]) . \"\\n\";\n print implode(\" \", $f[19]) . \"\\n\";\n print implode(\" \", $f[20]) . \"\\n\";\n print implode(\" \", $f[21]) . \"\\n\";\n print implode(\" \", $f[22]) . \"\\n\";\n print implode(\" \", $f[23]) . \"\\n\";\n print implode(\" \", $f[24]) . \"\\n\";\n print implode(\" \", $f[25]) . \"\\n\";\n print implode(\" \", $f[26]) . \"\\n\";\n print implode(\" \", $f[27]) . \"\\n\";\n print implode(\" \", $f[28]) . \"\\n\";\n print implode(\" \", $f[29]) . \"\\n\";\n print implode(\" \", $f[30]) . \"\\n\";\n print implode(\" \", $f[31]) . \"\\n\";\n print implode(\" \", $f[32]) . \"\\n\";\n print implode(\" \", $f[33]) . \"\\n\";\n print implode(\" \", $f[34]) . \"\\n\";\n print implode(\" \", $f[35]) . \"\\n\";\n print implode(\" \", $f[36]) . \"\\n\";\n print implode(\" \", $f[37]) . \"\\n\";\n print implode(\" \", $f[38]) . \"\\n\";\n print implode(\" \", $f[39]) . \"\\n\";\n print implode(\" \", $f[40]) . \"\\n\";\n print implode(\" \", $f[41]) . \"\\n\";\n print implode(\" \", $f[42]) . \"\\n\";\n print implode(\" \", $f[43]) . \"\\n\";\n print implode(\" \", $f[44]) . \"\\n\";\n print implode(\" \", $f[45]) . \"\\n\";\n print implode(\" \", $f[46]) . \"\\n\";\n print implode(\" \", $f[47]) . \"\\n\";\n print implode(\" \", $f[48]) . \"\\n\";\n print implode(\" \", $f[49]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n print implode(\" \", $f[1]) . \"\\n\";\n print implode(\" \", $f[2]) . \"\\n\";\n print implode(\" \", $f[3]) . \"\\n\";\n print implode(\" \", $f[4]) . \"\\n\";\n print implode(\" \", $f[5]) . \"\\n\";\n print implode(\" \", $f[6]) . \"\\n\";\n print implode(\" \", $f[7]) . \"\\n\";\n print implode(\" \", $f[8]) . \"\\n\";\n print implode(\" \", $f[9]) . \"\\n\";\n print implode(\" \", $f[10]) . \"\\n\";\n print implode(\" \", $f[11]) . \"\\n\";\n print implode(\" \", $f[12]) . \"\\n\";\n print implode(\" \", $f[13]) . \"\\n\";\n print implode(\" \", $f[14]) . \"\\n\";\n print implode(\" \", $f[15]) . \"\\n\";\n print implode(\" \", $f[16]) . \"\\n\";\n print implode(\" \", $f[17]) . \"\\n\";\n print implode(\" \", $f[18]) . \"\\n\";\n print implode(\" \", $f[19]) . \"\\n\";\n print implode(\" \", $f[20]) . \"\\n\";\n print implode(\" \", $f[21]) . \"\\n\";\n print implode(\" \", $f[22]) . \"\\n\";\n print implode(\" \", $f[23]) . \"\\n\";\n print implode(\" \", $f[24]) . \"\\n\";\n print implode(\" \", $f[25]) . \"\\n\";\n print implode(\" \", $f[26]) . \"\\n\";\n print implode(\" \", $f[27]) . \"\\n\";\n print implode(\" \", $f[28]) . \"\\n\";\n print implode(\" \", $f[29]) . \"\\n\";\n print implode(\" \", $f[30]) . \"\\n\";\n print implode(\" \", $f[31]) . \"\\n\";\n print implode(\" \", $f[32]) . \"\\n\";\n print implode(\" \", $f[33]) . \"\\n\";\n print implode(\" \", $f[34]) . \"\\n\";\n print implode(\" \", $f[35]) . \"\\n\";\n print implode(\" \", $f[36]) . \"\\n\";\n print implode(\" \", $f[37]) . \"\\n\";\n print implode(\" \", $f[38]) . \"\\n\";\n print implode(\" \", $f[39]) . \"\\n\";\n print implode(\" \", $f[40]) . \"\\n\";\n print implode(\" \", $f[41]) . \"\\n\";\n print implode(\" \", $f[42]) . \"\\n\";\n print implode(\" \", $f[43]) . \"\\n\";\n print implode(\" \", $f[44]) . \"\\n\";\n print implode(\" \", $f[45]) . \"\\n\";\n print implode(\" \", $f[46]) . \"\\n\";\n print implode(\" \", $f[47]) . \"\\n\";\n print implode(\" \", $f[48]) . \"\\n\";\n print implode(\" \", $f[49]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n $u = 0;\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $z;\n break;\n }\n }\n if($u == 0)\n {\n print \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = 0;\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if(($f[$y][$z] != $w[$y - 1]) && ($f[$y][$z] != $f[$y + 1][0]))\n {\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n break;\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n if($a == 10)\n {\n print $f[$y][0] . \"\\n\";\n }\n else\n {\n $n = 2;\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n else\n {\n if($a == 10)\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $f[$y][0] . \"\\n\";\n }\n else\n {\n print $f[$y][1] . \"\\n\";\n }\n }\n else\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[50]) . \"\\n\";\n print implode(\" \", $f[51]) . \"\\n\";\n print implode(\" \", $f[52]) . \"\\n\";\n print implode(\" \", $f[53]) . \"\\n\";\n print implode(\" \", $f[54]) . \"\\n\";\n print implode(\" \", $f[55]) . \"\\n\";\n print implode(\" \", $f[56]) . \"\\n\";\n print implode(\" \", $f[57]) . \"\\n\";\n print implode(\" \", $f[58]) . \"\\n\";\n print implode(\" \", $f[59]) . \"\\n\";\n print implode(\" \", $f[60]) . \"\\n\";\n print implode(\" \", $f[61]) . \"\\n\";\n print implode(\" \", $f[62]) . \"\\n\";\n print implode(\" \", $f[63]) . \"\\n\";\n print implode(\" \", $f[64]) . \"\\n\";\n print implode(\" \", $f[65]) . \"\\n\";\n print implode(\" \", $f[66]) . \"\\n\";\n print implode(\" \", $f[67]) . \"\\n\";\n print implode(\" \", $f[68]) . \"\\n\";\n print implode(\" \", $f[69]) . \"\\n\";\n print implode(\" \", $f[70]) . \"\\n\";\n print implode(\" \", $f[71]) . \"\\n\";\n print implode(\" \", $f[72]) . \"\\n\";\n print implode(\" \", $f[73]) . \"\\n\";\n print implode(\" \", $f[74]) . \"\\n\";\n print implode(\" \", $f[75]) . \"\\n\";\n print implode(\" \", $f[76]) . \"\\n\";\n print implode(\" \", $f[77]) . \"\\n\";\n print implode(\" \", $f[78]) . \"\\n\";\n print implode(\" \", $f[79]) . \"\\n\";\n print implode(\" \", $f[80]) . \"\\n\";\n print implode(\" \", $f[81]) . \"\\n\";\n print implode(\" \", $f[82]) . \"\\n\";\n print implode(\" \", $f[83]) . \"\\n\";\n print implode(\" \", $f[84]) . \"\\n\";\n print implode(\" \", $f[85]) . \"\\n\";\n print implode(\" \", $f[86]) . \"\\n\";\n print implode(\" \", $f[87]) . \"\\n\";\n print implode(\" \", $f[88]) . \"\\n\";\n print implode(\" \", $f[89]) . \"\\n\";\n print implode(\" \", $f[90]) . \"\\n\";\n print implode(\" \", $f[91]) . \"\\n\";\n print implode(\" \", $f[92]) . \"\\n\";\n print implode(\" \", $f[93]) . \"\\n\";\n print implode(\" \", $f[94]) . \"\\n\";\n print implode(\" \", $f[95]) . \"\\n\";\n print implode(\" \", $f[96]) . \"\\n\";\n print implode(\" \", $f[97]) . \"\\n\";\n print implode(\" \", $f[98]) . \"\\n\";\n print implode(\" \", $f[99]) . \"\\n\";\n print implode(\" \", $f[100]) . \"\\n\";\n print implode(\" \", $f[101]) . \"\\n\";\n print implode(\" \", $f[102]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[50]) . \"\\n\";\n print implode(\" \", $f[51]) . \"\\n\";\n print implode(\" \", $f[52]) . \"\\n\";\n print implode(\" \", $f[53]) . \"\\n\";\n print implode(\" \", $f[54]) . \"\\n\";\n print implode(\" \", $f[55]) . \"\\n\";\n print implode(\" \", $f[56]) . \"\\n\";\n print implode(\" \", $f[57]) . \"\\n\";\n print implode(\" \", $f[58]) . \"\\n\";\n print implode(\" \", $f[59]) . \"\\n\";\n print implode(\" \", $f[60]) . \"\\n\";\n print implode(\" \", $f[61]) . \"\\n\";\n print implode(\" \", $f[62]) . \"\\n\";\n print implode(\" \", $f[63]) . \"\\n\";\n print implode(\" \", $f[64]) . \"\\n\";\n print implode(\" \", $f[65]) . \"\\n\";\n print implode(\" \", $f[66]) . \"\\n\";\n print implode(\" \", $f[67]) . \"\\n\";\n print implode(\" \", $f[68]) . \"\\n\";\n print implode(\" \", $f[69]) . \"\\n\";\n print implode(\" \", $f[70]) . \"\\n\";\n print implode(\" \", $f[71]) . \"\\n\";\n print implode(\" \", $f[72]) . \"\\n\";\n print implode(\" \", $f[73]) . \"\\n\";\n print implode(\" \", $f[74]) . \"\\n\";\n print implode(\" \", $f[75]) . \"\\n\";\n print implode(\" \", $f[76]) . \"\\n\";\n print implode(\" \", $f[77]) . \"\\n\";\n print implode(\" \", $f[78]) . \"\\n\";\n print implode(\" \", $f[79]) . \"\\n\";\n print implode(\" \", $f[80]) . \"\\n\";\n print implode(\" \", $f[81]) . \"\\n\";\n print implode(\" \", $f[82]) . \"\\n\";\n print implode(\" \", $f[83]) . \"\\n\";\n print implode(\" \", $f[84]) . \"\\n\";\n print implode(\" \", $f[85]) . \"\\n\";\n print implode(\" \", $f[86]) . \"\\n\";\n print implode(\" \", $f[87]) . \"\\n\";\n print implode(\" \", $f[88]) . \"\\n\";\n print implode(\" \", $f[89]) . \"\\n\";\n print implode(\" \", $f[90]) . \"\\n\";\n print implode(\" \", $f[91]) . \"\\n\";\n print implode(\" \", $f[92]) . \"\\n\";\n print implode(\" \", $f[93]) . \"\\n\";\n print implode(\" \", $f[94]) . \"\\n\";\n print implode(\" \", $f[95]) . \"\\n\";\n print implode(\" \", $f[96]) . \"\\n\";\n print implode(\" \", $f[97]) . \"\\n\";\n print implode(\" \", $f[98]) . \"\\n\";\n print implode(\" \", $f[99]) . \"\\n\";\n print implode(\" \", $f[100]) . \"\\n\";\n print implode(\" \", $f[101]) . \"\\n\";\n print implode(\" \", $f[102]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[50]) . \"\\n\";\n print implode(\" \", $f[51]) . \"\\n\";\n print implode(\" \", $f[52]) . \"\\n\";\n print implode(\" \", $f[53]) . \"\\n\";\n print implode(\" \", $f[54]) . \"\\n\";\n print implode(\" \", $f[55]) . \"\\n\";\n print implode(\" \", $f[56]) . \"\\n\";\n print implode(\" \", $f[57]) . \"\\n\";\n print implode(\" \", $f[58]) . \"\\n\";\n print implode(\" \", $f[59]) . \"\\n\";\n print implode(\" \", $f[60]) . \"\\n\";\n print implode(\" \", $f[61]) . \"\\n\";\n print implode(\" \", $f[62]) . \"\\n\";\n print implode(\" \", $f[63]) . \"\\n\";\n print implode(\" \", $f[64]) . \"\\n\";\n print implode(\" \", $f[65]) . \"\\n\";\n print implode(\" \", $f[66]) . \"\\n\";\n print implode(\" \", $f[67]) . \"\\n\";\n print implode(\" \", $f[68]) . \"\\n\";\n print implode(\" \", $f[69]) . \"\\n\";\n print implode(\" \", $f[70]) . \"\\n\";\n print implode(\" \", $f[71]) . \"\\n\";\n print implode(\" \", $f[72]) . \"\\n\";\n print implode(\" \", $f[73]) . \"\\n\";\n print implode(\" \", $f[74]) . \"\\n\";\n print implode(\" \", $f[75]) . \"\\n\";\n print implode(\" \", $f[76]) . \"\\n\";\n print implode(\" \", $f[77]) . \"\\n\";\n print implode(\" \", $f[78]) . \"\\n\";\n print implode(\" \", $f[79]) . \"\\n\";\n print implode(\" \", $f[80]) . \"\\n\";\n print implode(\" \", $f[81]) . \"\\n\";\n print implode(\" \", $f[82]) . \"\\n\";\n print implode(\" \", $f[83]) . \"\\n\";\n print implode(\" \", $f[84]) . \"\\n\";\n print implode(\" \", $f[85]) . \"\\n\";\n print implode(\" \", $f[86]) . \"\\n\";\n print implode(\" \", $f[87]) . \"\\n\";\n print implode(\" \", $f[88]) . \"\\n\";\n print implode(\" \", $f[89]) . \"\\n\";\n print implode(\" \", $f[90]) . \"\\n\";\n print implode(\" \", $f[91]) . \"\\n\";\n print implode(\" \", $f[92]) . \"\\n\";\n print implode(\" \", $f[93]) . \"\\n\";\n print implode(\" \", $f[94]) . \"\\n\";\n print implode(\" \", $f[95]) . \"\\n\";\n print implode(\" \", $f[96]) . \"\\n\";\n print implode(\" \", $f[97]) . \"\\n\";\n print implode(\" \", $f[98]) . \"\\n\";\n print implode(\" \", $f[99]) . \"\\n\";\n print implode(\" \", $f[100]) . \"\\n\";\n print implode(\" \", $f[101]) . \"\\n\";\n print implode(\" \", $f[102]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n $u = 0;\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n if($u == 0)\n {\n print \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n $n = 2;\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n if($w == 1)\n {\n print $f[$y][0] . \"\\n\";\n }\n else\n {\n $n = 2;\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n else\n {\n if($w == 1)\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $f[$y][0] . \"\\n\";\n }\n else\n {\n print $f[$y][1] . \"\\n\";\n }\n }\n else\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = 0;\n }\n else\n {\n $u = 0;\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if(($f[$y][$z] != $w[$y - 1]) && ($f[$y][$z] != $f[$y + 1][0]))\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $z;\n break;\n }\n }\n if($u == 0)\n {\n print \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print \"2\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print \"3\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print \"1\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n $m = $m2;\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n $u = 0;\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n if($u == 0)\n {\n print \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n print_r($f);\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n if($w == 1)\n {\n print $g[$y] . \"\\n\";\n }\n else\n {\n $n = 2;\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n else\n {\n if($w == 1)\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $g[$y] . \"\\n\";\n }\n else\n {\n print $g[$y] . \"\\n\";\n }\n }\n else\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($a == 10)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \"\\n\";\n $w[$y] = 0;\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if(($f[$y][$z] != $w[$y - 1]) && ($f[$y][$z] != $f[$y + 1][0]))\n {\n print $f[$y][$z] . \"\\n\";\n break;\n }\n }\n }\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n $u = 0;\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n if($u == 0)\n {\n print \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = 0;\n }\n else\n {\n $u = 0;\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if(($f[$y][$z] != $w[$y - 1]) && ($f[$y][$z] != $f[$y + 1][0]))\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n break;\n }\n }\n if($u == 0)\n {\n print \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 55) && ($y <= 59))\n {\n print $h . \" \" . $i . \"\\n\";\n }\n if($b2 == 0)\n {\n if($h == \"?\")\n {\n $c2 = $c;\n $g[$y] = $i;\n $i = \" \" . $i;\n $i .= \" \";\n for($z = 1; $z <= $b; $z++)\n {\n $j = $c2[$z];\n for($z2 = 0; $z2 < strlen($i) - strlen($j) + 1; $z2++)\n {\n if(($i[$z2] == $j[0]) && ($i[$z2 + strlen($j) - 1] == $j[strlen($j) - 1]))\n {\n if((($i[$z2 - 1] == \" \") || ($i[$z2 - 1] == \".\") || ($i[$z2 - 1] == \",\") || ($i[$z2 - 1] == \"!\") || ($i[$z2 - 1] == \"?\")) && (($i[$z2 + strlen($j)] == \" \") || ($i[$z2 + strlen($j)] == \".\") || ($i[$z2 + strlen($j)] == \",\") || ($i[$z2 + strlen($j)] == \"!\") || ($i[$z2 + strlen($j)] == \"?\")))\n {\n $k = substr($i, $z2, strlen($j));\n if($d[$k] == TRUE)\n {\n unset($c2[$d[$k]]);\n }\n }\n }\n }\n }\n if(count($c2) == 0)\n {\n $b2 = 1;\n }\n else\n {\n $f[$y] = $c2;\n }\n }\n else\n {\n $f[$y][$d[$h]] = $h;\n $g[$y] = $i;\n }\n }\n }\n if($b2 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n for($z = 1; $z <= 100; $z++)\n {\n if($f[$y][$z] == TRUE)\n {\n $m = $f[$y][$z];\n break;\n }\n }\n for($z = $y - 1; $z >= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print \"2\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print \"3\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print \"1\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $c . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $c . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $c . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n if($a == 2)\n {\n break;\n }\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n if($w == 1)\n {\n print $g[$y] . \"\\n\";\n }\n else\n {\n $n = 2;\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n else\n {\n if($w == 1)\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $g[$y] . \"\\n\";\n }\n else\n {\n print $g[$y] . \"\\n\";\n }\n }\n else\n {\n $o = $n % 2;\n $n++;\n if($o == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n print implode(\" \", $f[1]) . \"\\n\";\n print implode(\" \", $f[2]) . \"\\n\";\n print implode(\" \", $f[3]) . \"\\n\";\n print implode(\" \", $f[4]) . \"\\n\";\n print implode(\" \", $f[5]) . \"\\n\";\n print implode(\" \", $f[6]) . \"\\n\";\n print implode(\" \", $f[7]) . \"\\n\";\n print implode(\" \", $f[8]) . \"\\n\";\n print implode(\" \", $f[9]) . \"\\n\";\n print implode(\" \", $f[10]) . \"\\n\";\n print implode(\" \", $f[11]) . \"\\n\";\n print implode(\" \", $f[12]) . \"\\n\";\n print implode(\" \", $f[13]) . \"\\n\";\n print implode(\" \", $f[14]) . \"\\n\";\n print implode(\" \", $f[15]) . \"\\n\";\n print implode(\" \", $f[16]) . \"\\n\";\n print implode(\" \", $f[17]) . \"\\n\";\n print implode(\" \", $f[18]) . \"\\n\";\n print implode(\" \", $f[19]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n print implode(\" \", $f[1]) . \"\\n\";\n print implode(\" \", $f[2]) . \"\\n\";\n print implode(\" \", $f[3]) . \"\\n\";\n print implode(\" \", $f[4]) . \"\\n\";\n print implode(\" \", $f[5]) . \"\\n\";\n print implode(\" \", $f[6]) . \"\\n\";\n print implode(\" \", $f[7]) . \"\\n\";\n print implode(\" \", $f[8]) . \"\\n\";\n print implode(\" \", $f[9]) . \"\\n\";\n print implode(\" \", $f[10]) . \"\\n\";\n print implode(\" \", $f[11]) . \"\\n\";\n print implode(\" \", $f[12]) . \"\\n\";\n print implode(\" \", $f[13]) . \"\\n\";\n print implode(\" \", $f[14]) . \"\\n\";\n print implode(\" \", $f[15]) . \"\\n\";\n print implode(\" \", $f[16]) . \"\\n\";\n print implode(\" \", $f[17]) . \"\\n\";\n print implode(\" \", $f[18]) . \"\\n\";\n print implode(\" \", $f[19]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print $b . \"\\n\";\n print implode(\" \", $c) . \"\\n\";\n print $e . \"\\n\";\n print implode(\" \", $f[0]) . \"\\n\";\n print implode(\" \", $f[1]) . \"\\n\";\n print implode(\" \", $f[2]) . \"\\n\";\n print implode(\" \", $f[3]) . \"\\n\";\n print implode(\" \", $f[4]) . \"\\n\";\n print implode(\" \", $f[5]) . \"\\n\";\n print implode(\" \", $f[6]) . \"\\n\";\n print implode(\" \", $f[7]) . \"\\n\";\n print implode(\" \", $f[8]) . \"\\n\";\n print implode(\" \", $f[9]) . \"\\n\";\n print implode(\" \", $f[10]) . \"\\n\";\n print implode(\" \", $f[11]) . \"\\n\";\n print implode(\" \", $f[12]) . \"\\n\";\n print implode(\" \", $f[13]) . \"\\n\";\n print implode(\" \", $f[14]) . \"\\n\";\n print implode(\" \", $f[15]) . \"\\n\";\n print implode(\" \", $f[16]) . \"\\n\";\n print implode(\" \", $f[17]) . \"\\n\";\n print implode(\" \", $f[18]) . \"\\n\";\n print implode(\" \", $f[19]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print \"2\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w3 == 1)\n {\n print \"3\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w3 == 1)\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w3 == 1)\n {\n print \"1\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if($a == 10)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n if((count($f[$y + 1]) == 1) && ($f[$y][0] == $f[$y + 1][0]))\n {\n print $f[$y][2] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \"\\n\";\n }\n }\n else\n {\n if((count($f[$y + 1]) == 1) && ($f[$y][0] == $f[$y + 1][0]))\n {\n print $f[$y][1] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \"\\n\";\n }\n }\n }\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n break;\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][0];\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if($f[$y][$z] != $w[$y - 1])\n {\n $u = 1;\n print $f[$y][$z] . \":\" . $g[$y] . \"\\n\";\n $w[$y] = $f[$y][$z];\n break;\n }\n }\n }\n }\n }\n }\n }\n else\n {\n if($w2 == \"R B mx WOewkgcQ\")\n {\n print implode(\" \", $f[0]) . \"\\n\";\n }\n else\n {\n print \"Impossible\\n\";\n }\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n for($y = 0; $y < count($f); $y++)\n {\n if($a == 10)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \"\\n\";\n }\n }\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $z--)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n for($z = $y + 1; $z < count($f); $z++)\n {\n if(($f[$z] != NULL) && ($f[$z][$d[$m]] == TRUE))\n {\n unset($f[$z][$d[$m]]);\n if(count($f[$z]) == 0)\n {\n $b3 = 1;\n break;\n }\n elseif(count($f[$z]) == 1)\n {\n for($z2 = 1; $z2 <= 100; $z2++)\n {\n if($f[$z][$z2] == TRUE)\n {\n $m = $f[$z][$z2];\n break;\n }\n }\n }\n elseif(count($f[$z]) > 1)\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n if($b3 == 1)\n {\n print \"Impossible\\n\";\n break;\n }\n }\n }\n if($b3 == 0)\n {\n for($y = 0; $y < count($f); $y++)\n {\n sort($f[$y]);\n }\n $w = array();\n for($y = 0; $y < count($f); $y++)\n {\n if($a == 10)\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \"\\n\";\n $w[$y] = 0;\n }\n else\n {\n for($z = 0; $z < count($f[$y]); $z++)\n {\n if(($f[$y][$z] != $w[$y - 1]) && ($f[$y][$z] != $f[$y + 1][0]))\n {\n print $f[$y][$z] . \"\\n\";\n }\n }\n }\n }\n else\n {\n if(count($f[$y]) == 1)\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n if($f[$y][0] == $f[$y - 1][0])\n {\n print $f[$y][1] . \":\" . $g[$y] . \"\\n\";\n }\n else\n {\n print $f[$y][0] . \":\" . $g[$y] . \"\\n\";\n }\n }\n }\n }\n }\n }\n else\n {\n print \"Impossible\\n\";\n }\n}\n?>"}, {"source_code": " $v) {\n echo \"$v:$messages[$k]\", PHP_EOL;\n }\n }\n}"}, {"source_code": " 0) {\n foreach ($senderSet[$j-1] as $k => $v) {\n $senderSet[$j-1][$k] = 1;\n }\n }\n } else {\n $message = str_replace(['.',',','!','?'],' ', $message);\n $words = explode(' ', $message);\n $senderSet[$j] = [];\n foreach ($senders as $sender) {\n $sender = trim($sender);\n if (!in_array($sender, $words)) {\n $senderSet[$j][$sender] = 0;\n }\n }\n if (!empty($senderSet[$j]) && $j > 0) {\n foreach ($senderSet[$j-1] as $k => $v) {\n $senderSet[$j-1][$k] = 1;\n }\n }\n }\n }\n $result = [];\n $p = true;\n for ($j = 0; $j < $messagesNumber; $j++) {\n if (empty($senderSet[$j])) {\n $p = false;\n echo 'Impossible', PHP_EOL;\n break;\n }\n $impossible = true;\n foreach ($senderSet[$j] as $k => $v) {\n if (($j == $messagesNumber-1 || $v > 0) &&\n ($j == 0 || $result[$j-1] != $k)) {\n $result[$j] = $k;\n $impossible = false;\n break;\n }\n }\n if ($impossible && $j > 0) {\n $senderSet[$j-1][$result[$j-1]] = 0;\n unset($result[$j-1]);\n $j-=2;\n }\n\n if ($impossible && $j == 0) {\n $p = false;\n echo 'Impossible', PHP_EOL;\n break;\n }\n }\n if ($p) {\n foreach ($result as $k => $v) {\n echo \"$v:$messages[$k]\", PHP_EOL;\n }\n }\n}\n\n"}, {"source_code": " $v) {\n echo \"$v:$messages[$k]\", PHP_EOL;\n }\n }\n}\n\n"}, {"source_code": " 0) {\n foreach ($senderSet[$j-1] as $k => $v) {\n $senderSet[$j-1][$k] = 1;\n }\n }\n } else {\n $message = str_replace(['.',',','!','?'],' ', $message);\n $words = explode(' ', $message);\n $senderSet[$j] = [];\n foreach ($senders as $sender) {\n $sender = trim($sender);\n if (!in_array($sender, $words)) {\n $senderSet[$j][$sender] = 0;\n }\n }\n if (!empty($senderSet[$j]) && $j > 0) {\n foreach ($senderSet[$j-1] as $k => $v) {\n $senderSet[$j-1][$k] = 1;\n }\n }\n }\n }\n $result = [];\n $p = true;\n for ($j = 0; $j < $messagesNumber; $j++) {\n if (empty($senderSet[$j])) {\n $p = false;\n echo 'Impossible', PHP_EOL;\n break;\n }\n $impossible = true;\n foreach ($senderSet[$j] as $k => $v) {\n if (($j == $messagesNumber-1 || $v > 0) &&\n ($j == 0 || $result[$j-1] != $k)) {\n $result[$j] = $k;\n $impossible = false;\n break;\n }\n }\n if ($impossible && $j > 0) {\n $senderSet[$j-1][$result[$j-1]] = 0;\n unset($result[$j-1]);\n $j-=2;\n }\n\n if ($impossible && $j == 0) {\n $p = false;\n echo 'Impossible', PHP_EOL;\n break;\n }\n }\n if ($p) {\n foreach ($result as $k => $v) {\n echo \"$v: $messages[$k]\", PHP_EOL;\n }\n }\n}\n\n"}], "src_uid": "3ac91d8fc508ee7d1afcf22ea4b930e4"} {"source_code": " 1)\n {\n $d = 1;\n break;\n }\n }\n if($d == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>", "positive_code": [{"source_code": "= 0; $i--) {\n $cur = $inputArr[$i];\n $next = $inputArr[$i - 1];\n \n if ($cur - $next <= 1 && !empty($next)) array_pop($inputArr);\n }\n \n if ( count($inputArr) === 1 ) echo \"YES\\n\";\n else echo \"NO\\n\";\n}"}, {"source_code": "\n * @link https://codeforces.com/problemset/problem/1399/A\n * @version 1.0\n */\n\n\n$tests = readline();\n$answers = [];\nfor ( $t = 1; $t <= $tests; $t ++ ) {\n\n\t$len = readline();\n\t$array = explode( ' ', readline() );\n\tsort($array);\n\t$answer = 'YES';\n\tfor ($i = 0; $i < $len-1; $i++){\n\t\tif($array[$i+1] - $array[$i] > 1){\n\t\t\t$answer = 'NO';\n\t\t\tbreak;\n\t\t}\n\t}\n\t$answers[]=$answer;\n}\nforeach ( $answers as $a ) {\n\techo $a . PHP_EOL;\n}"}], "negative_code": [], "src_uid": "ed449ba7c453a43e2ac5904dc0174530"} {"source_code": " 0)\n {\n $c++;\n }\n}\nif(($b <= 1) || ($c <= 1))\n{\n print \"Yes\";\n}\nelse\n{\n print \"No\";\n}\n?>", "positive_code": [{"source_code": " 0)\n {\n $c++;\n }\n}\nif(($b == 1) || ($c == 1))\n{\n print \"Yes\";\n}\nelse\n{\n print \"No\";\n}\n?>"}], "src_uid": "cf7bf89a6038586b69d3b8021cee0b27"} {"source_code": " 0){\n echo \"YES\\n\" . ($n - $k + 1) . \" \";\n for($i = 0; $i < $k-1 ; $i++) echo \"1 \";\n echo \"\\n\";\n }\n \n else if(($n - 2*$k + 1)&1 && ($n - 2*$k + 2) > 1){\n echo \"YES\\n\" . ($n - 2*$k + 2) . \" \";\n for($i = 0; $i < $k-1 ; $i++) echo \"2 \";\n echo \"\\n\";\n }\n \n else{\n echo \"NO\\n\";\n }\n }", "positive_code": [{"source_code": " $c)\n {\n $d = $b % $c;\n $e = floor($b / $c);\n $f = array();\n for($y = 1; $y <= $c; $y++)\n {\n $f[count($f)] = $e;\n }\n if($d == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $f) . \"\\n\";\n }\n else\n {\n $f[0] += $d;\n if($f[0] % 2 == $f[1] % 2)\n {\n print \"YES\\n\";\n print implode(\" \", $f) . \"\\n\";\n }\n else\n {\n $g = count($f);\n for($y = 1; $y < $g; $y++)\n {\n $f[0]++;\n $f[$y]--;\n }\n if(($f[0] % 2 == $f[1] % 2) && ($f[1] != 0))\n {\n print \"YES\\n\";\n print implode(\" \", $f) . \"\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n }\n}\n?>"}], "negative_code": [], "src_uid": "6b94dcd088b0328966b54acefb5c6d22"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "c37604d5d833a567ff284d7ce5eda059"} {"source_code": " 0)\n {\n $h = 1;\n break;\n }\n else\n {\n $h = 2;\n }\n }\n if($h == 2)\n {\n break;\n }\n}\nprint $d[$y];\n?>", "positive_code": [{"source_code": "\n= $len){\n $str = implode(\"\",$str);\n if(!findme($str)){\n $notfind = true;\n echo $str;\n }\n return ;\n }\n for($i = 0 ; $i < 26 ; $i++){\n if($vis[$i])continue;\n $vis[$i] = true;\n $str[$cur] = $alp[$i];\n dfs($cur+1 , $len , $str,$alp);\n $vis[$cur] = false;\n }\n \n}\nfunction findme($str){\n global $string;\n for ($i = 0 ; $i < count($string) ; $i++){\n // echo $string[$i].\",\".$str.\"\\n\";\n if (strpos($string[$i] , $str) !== false){\n return true;\n }\n }\n return false;\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);\r\n $e = 0;\r\n for($y = 0; $y < 26; $y++)\r\n {\r\n $d[$b[$y]] = $y + 1;\r\n }\r\n for($y = 0; $y < strlen($c) - 1; $y++)\r\n {\r\n $e += abs($d[$c[$y]] - $d[$c[$y + 1]]);\r\n }\r\n print $e . \"\\n\";\r\n}\r\n?>", "positive_code": [{"source_code": ""}, {"source_code": "\";\n }\n else\n {\n print $d . \">\" . \"\\n\";\n }\n $d = \"<\";\n }\n elseif($c == 1)\n {\n $d .= $b[$x];\n }\n elseif((($b[$x] != \" \") && ($b[$x - 1] == \" \") && (count($b) != 1)) || (($b[$x] != \" \") && ($x == 0) && (count($b) != 1)))\n {\n $e .= $b[$x];\n $f = 1;\n if($x == count($b) - 1)\n {\n if($x == count($b) - 1)\n {\n print $e . \">\";\n }\n else\n {\n print $e . \">\" . \"\\n\";\n }\n $e = \"<\";\n $f = 0;\n }\n }\n elseif((($f == 1) && ($b[$x] == \" \") && ($b[$x - 1] != \" \")))\n {\n if($x == count($b) - 1)\n {\n print $e . \">\";\n }\n else\n {\n print $e . \">\" . \"\\n\";\n }\n $e = \"<\";\n $f = 0;\n }\n elseif($x == count($b) - 1)\n {\n $e .= $b[$x];\n if($x == count($b) - 1)\n {\n print $e . \">\";\n }\n else\n {\n print $e . \">\" . \"\\n\";\n }\n $e = \"<\";\n $f = 0;\n }\n elseif($b[$x] != \" \")\n {\n $e .= $b[$x];\n }\n}\n?>", "positive_code": [{"source_code": " $line) {\n\n $line = \"<\".str_replace('\"', '', $line).\">\";\n $line = str_replace('=', ' ', $line);\n\n if ($k!=0) $line = \"\\n\".$line;\n\n echo $line;\n}\n\n\n\n\n\n?>"}, {"source_code": "\\n\";\n}"}, {"source_code": "\n';\n}\n?>"}, {"source_code": "\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\r\\n\";\n\t\t\n }\n}\n\nfputs($stdout, substr($null, 0, strlen($null)-2));\n?>"}, {"source_code": "\\n\";\n $i = $pos;\n }\n } else if($arr[0][$i] == ' ' && $new_command != ''){\n echo \"<\", $new_command, \">\\n\";\n $new_command = '';\n } else if($arr[0][$i] != ' '){\n $new_command .= $arr[0][$i];\n if($i + 1 == strlen($arr[0]) ){\n echo \"<\", $new_command, \">\\n\";\n }\n }\n $i++;\n}"}, {"source_code": "\\n\";\nfclose($stdin);\n\n\n\n\t\n"}, {"source_code": "\\n\";\n $flag = false;\n $sr = '';\n continue;\n \n }\n \n //\u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043f\u0440\u043e\u0431\u0435\u043b \u0438 \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043a\u0430\u0432\u044b\u0447\u043a\u0430...\n if ((!$flag)&&(!$probel)){\n for ($i = $a; $i<=$TotalChars; $i++)\n {\n if ($s{$i}==' ') break;\n $sr .= $s{$i};\n }\n $strtoinput .= \"<$sr>\\n\";\n $sr = \"\";\n $a = $i;\n } \n \n \n}\n$strtoinput = substr($strtoinput, 0, -1);\necho $strtoinput;\n}\n?>"}, {"source_code": "\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$n.= \"<\".$text[$i].\">\\r\\n\";\n\t\t\n }\n}\n\nfputs($stdout, substr($n, 0, strlen($n)-2));\n?>"}, {"source_code": "\\n\";\n }\n "}, {"source_code": "', PHP_EOL;\n $cnt++;\n $start = PHP_INT_MAX;\n }\n $quota = !$quota;\n continue;\n }\n if ($quota == false && $str[$i] == ' ') {\n if ($i - $start > 0) {\n if ($i == strlen($str) - 1) {\n echo '<', substr($str, $start), '>', PHP_EOL;\n $cnt++;\n } else {\n echo '<', substr($str, $start, $i - $start), '>', PHP_EOL;\n $cnt++;\n }\n $space = true;\n $start = $i + 1;\n continue;\n } else {\n $start = $i + 1;\n }\n }\n}\n\nif (strlen(substr($str, $start)) > 0) {\n echo '<', substr($str, $start), '>', PHP_EOL;\n}\n?>"}, {"source_code": "\"?)(?P[^\"]*?)(?P=A)(?= ) *~', \" $text \", $ans);\n foreach ($ans['result'] as $val)\n echo \"<$val>\\n\";\n}\n"}], "negative_code": [{"source_code": " $line) {\n\n $line = \"<\".str_replace('\"', '', $line).\">\";\n $line = str_replace('=', ' ', $line);\n\n if ($k!=0) $line = \"\\n\".$line;\n\n echo $line;\n}\n\n\n\n\n\n?>"}, {"source_code": "', \"\\n\";\n $new_command = '';\n break;\n case $start_quote && $arr[0][$i] != '\"':\n $new_command .= $arr[0][$i];\n break;\n case !$start_quote && !in_array($arr[0][$i], array(' ', '\"')):\n $new_command .= $arr[0][$i];\n break;\n case !$start_quote && $arr[0][$i] == ' ' && $new_command != '':\n echo '<', $new_command, '>', \"\\n\";\n $new_command = '';\n break;\n }\n}"}, {"source_code": "\\n\";\n $i = $pos;\n }\n } else if($arr[0][$i] == ' ' && $new_command != ''){\n echo \"<\", $new_command, \">\\n\";\n $new_command = '';\n } else if($arr[0][$i] != ' '){\n $new_command .= $arr[0][$i];\n }\n $i++;\n}"}, {"source_code": "\\n\";\nfclose($stdin);\n\n\n\n \n"}, {"source_code": "\";\n }\n else\n {\n print $d . \">\" . \"\\n\";\n }\n $d = \"<\";\n }\n elseif($c == 1)\n {\n $d .= $b[$x];\n }\n elseif((($b[$x] != \" \") && ($b[$x - 1] == \" \")) || (($b[$x] != \" \") && ($x == 0)))\n {\n $e .= $b[$x];\n $f = 1;\n }\n elseif(($f == 1) && ($b[$x] == \" \") && ($b[$x - 1] != \" \"))\n {\n if($x == count($b) - 1)\n {\n print $e . \">\";\n }\n else\n {\n print $e . \">\" . \"\\n\";\n }\n $e = \"<\";\n $f = 0;\n }\n elseif($b[$x] != \" \")\n {\n $e .= $b[$x];\n }\n}\n?>"}, {"source_code": "\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\r\\n\";\n\t\t\n }\n}\n\necho substr($null, 0, strlen($null)-2);\n\n?>\n"}, {"source_code": "\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\r\\n\";\n\t\t\n }\n}\n\nfputs($stdout, substr($null, 0, strlen($null)-2));\n?>"}, {"source_code": "\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\r\\n\";\n\t\t\n }\n}\n\nprint substr($null, 0, strlen($null)-2);\nfputs($stdout, substr($null, 0, strlen($null)-2));\n?>\n"}, {"source_code": "\\r\\n\";\n \n }\n }\n }\n else\n {\n $null.= \"<\".$buffer[$i].\">\\r\\n\";\n \n }\n}\nfputs($stdout, substr($null, 0, strlen($null)-2));\n?>\n"}, {"source_code": "\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\r\\n\";\n\t\t\n }\n}\n\nfputs($stdout, substr($null, 0, strlen($null)-2));\n?>\n"}, {"source_code": "\\n\";\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\techo \"<\".$buffer[$i].\">\\n\";\n }\n}\n\n?>\n"}, {"source_code": "\n<>\n< 2ne, >\n\n<.>\n< >"}, {"source_code": "\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\n\";\n\t\t\n }\n}\n\necho substr($null, 0, strlen($null)-1);\n\n?>\n"}, {"source_code": "\n<>\n< 2ne, >\n\n<.>\n< >\";exit();}\nif($buffer==' firstarg second \"\" ') {print \"\n\n<>\";exit();}\n$buffer=explode('\"', $buffer);\n$null=\"\";\n\nfor($i=0; $i\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\r\\n\";\n\t\t\n }\n}\n\nfputs($stdout, substr($null, 0, strlen($null)-2));\n?>"}, {"source_code": "\\r\";\n \n }\n }\n }\n else\n {\n $null.= \"<\".$buffer[$i].\">\\r\";\n \n }\n}\nfputs($stdout, substr($null, 0, strlen($null)-1));\n?>"}, {"source_code": "\\r\\n\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n }\n else\n {\n\t\t$null.= \"<\".$buffer[$i].\">\\r\\n\";\n\t\t\n }\n}\n\nfputs($stdout, substr($null, 0, strlen($null)-2));\n?>"}, {"source_code": "\\n\";\n $flag = false;\n $sr = '';\n continue;\n \n }\n \n //\u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043f\u0440\u043e\u0431\u0435\u043b \u0438 \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043a\u0430\u0432\u044b\u0447\u043a\u0430...\n if ((!$flag)&&(!$probel)){\n for ($i = $a; $i<$TotalChars; $i++)\n {\n if ($s{$i}==' ') break;\n $sr .= $s{$i};\n }\n $strtoinput .= \"<$sr>\\n\";\n $sr = \"\";\n $a = $i;\n } \n \n \n}\n$strtoinput = substr($strtoinput, 0, -1);\necho $strtoinput;\n}\n?>"}, {"source_code": "\\n\";\n $flag = false;\n $sr = '';\n continue;\n \n }\n \n //\u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043f\u0440\u043e\u0431\u0435\u043b \u0438 \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043a\u0430\u0432\u044b\u0447\u043a\u0430...\n if ((!$flag)&&(!$probel)){\n for ($i = $a; $i<$TotalChars; $i++)\n {\n if ($s{$i}==' ') break;\n $sr .= $s{$i};\n }\n echo \"<$sr>\\n\";\n $sr = \"\";\n $a = $i;\n } \n \n}\n\n}\n?>"}, {"source_code": "', PHP_EOL;\n }\n $quota = !$quota;\n }\n if (($quota == false && $str[$i] == ' ') || ($i == strlen($str) - 1 && $space == true)) {\n if ($space == false) {\n $start = $i + 1;\n } else if ($i - $start > 0) {\n if ($i == strlen($str) - 1)\n echo '<', substr($str, $start), '>', PHP_EOL;\n else\n echo '<', substr($str, $start, $i - $start), '>', PHP_EOL;\n $space = true;\n $start = $i + 1;\n continue;\n } else {\n $start = $i + 1;\n }\n $space = !$space;\n }\n}\n?>"}, {"source_code": "', PHP_EOL;\n }\n $quota = !$quota;\n continue;\n }\n if (($quota == false && $str[$i] == ' ') || ($i == strlen($str) - 1)) {\n if($i == strlen($str) - 1) {\n $space = true;\n }\n if ($space == false) {\n $start = $i + 1;\n } else if ($i - $start > 0) {\n if ($i == strlen($str) - 1)\n echo '<', substr($str, $start), '>', PHP_EOL;\n else\n echo '<', substr($str, $start, $i - $start), '>', PHP_EOL;\n $space = true;\n $start = $i + 1;\n continue;\n } else {\n $start = $i + 1;\n }\n $space = !$space;\n }\n}\n?>"}, {"source_code": "\\n\";\n else echo \"<\".str_replace(\"=\", \" \", $line).\">\\n\";\n}\n\n\n\n\n\n?>"}, {"source_code": " $line) {\n\n $line = \"<\".str_replace('\"', '', $line).\">\";\n $line = str_replace('=', ' ', $line);\n\n if ($k!=0) $line = \"\\n\".$line;\n\n echo $line;\n}\n\n\n\n\n\n?>"}, {"source_code": " $line) {\n\n $line = \"<\".str_replace('\"', '', $line).\">\";\n $line = str_replace('=', ' ', $line);\n\n if ($k!=0) $line = \"\\n\".$line;\n\n echo $line;\n}\n\n\n\n\n\n?>"}, {"source_code": " $line) {\n\n $line = \"<\".str_replace('\"', '', $line).\">\";\n $line = str_replace('=', ' ', $line);\n\n if ($k!=0) $line = \"\\n\".$line;\n\n echo $line;\n}\n\n\n\n\n\n"}, {"source_code": " $line) {\n\n $line = \"<\".str_replace('\"', '', $line).\">\";\n $line = str_replace('=', ' ', $line);\n\n if ($k!=0) $line = \"\\n\".$line;\n\n echo $line;\n}\n\n\n"}], "src_uid": "6c7858731c57e1b24c7a299a8eeab373"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "31d803d886c47fe681bdcfbe6c74f090"} {"source_code": " $d) {\r\n return 'NO';\r\n }\r\n\r\n $result = ($d + 1) * ($min) >= $max ? 'YES' : 'NO';\r\n\r\n\r\n return $result;\r\n}\r\n// $input = explode(' ', trim(fgets($file)));\r\n// $points = (int)$input[1];\r\n// // var_dump($input);\r\n// // while($count > 0) {\r\n// $str = trim(fgets($file));\r\n// $memo = array_reduce(explode(' ', $str), function ($memo, $data) use ($points) {\r\n// // var_dump(['data' => $data, 'memo' => $points, 'isBool' =>(int)$data > $points]);\r\n// return (int)$data >= $points ? ($memo + 1) : $memo;\r\n// }, 0);\r\n\r\n// // $count--;\r\n// // }\r\n\r\n// echo $memo;\r\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $d) echo 'no';\r\n else echo 'yes';\r\n }\r\n echo \"\\n\";\r\n}"}, {"source_code": " $d) {\r\n return 'NO';\r\n }\r\n\r\n $dmin = $min % $d;\r\n $result = ($d + 1) * ($dmin) >= $max ? 'YES' : 'NO';\r\n\r\n\r\n return $result;\r\n}\r\n// $input = explode(' ', trim(fgets($file)));\r\n// $points = (int)$input[1];\r\n// // var_dump($input);\r\n// // while($count > 0) {\r\n// $str = trim(fgets($file));\r\n// $memo = array_reduce(explode(' ', $str), function ($memo, $data) use ($points) {\r\n// // var_dump(['data' => $data, 'memo' => $points, 'isBool' =>(int)$data > $points]);\r\n// return (int)$data >= $points ? ($memo + 1) : $memo;\r\n// }, 0);\r\n\r\n// // $count--;\r\n// // }\r\n\r\n// echo $memo;\r\n"}, {"source_code": ""}, {"source_code": " $d) echo 'no';\r\n else echo 'yes';\r\n }\r\n echo \"\\n\";\r\n}"}], "src_uid": "c0ad2a6d14b0c9e09af2221d88a34d52"} {"source_code": " $c) {\n $res[] = $h * calc($b, $p) + $c * calc($b, $f);\n } else {\n $res[] = $c * calc($b, $f) + $h * calc($b, $p);\n }\n}\n\necho join(PHP_EOL, $res), PHP_EOL;\n", "positive_code": [{"source_code": " $c) {\n $hamburger = min($p, intdiv($b, 2));\n $chicken = min($f, intdiv($b - 2 * $hamburger, 2));\n } else {\n $chicken = min($f, intdiv($b, 2));\n $hamburger = min($p, intdiv($b - 2 * $chicken, 2));\n }\n echo ($hamburger * $h + $chicken * $c) . PHP_EOL;\n}"}, {"source_code": " $c){\n\t\t\t$ans = $ans + min(intval($b/2), $p) * $h;\n\t\t\t$b = $b - 2 * min(intval($b/2), $p);\n\t\t\t$ans = $ans + min(intval($b/2), $f) * $c;\n\t\t}\n\t\telse{\n\t\t\t$ans = $ans + min(intval($b/2), $f) * $c;\n\t\t\t$b = $b - 2 * min(intval($b/2), $f);\n\t\t\t$ans = $ans + min(intval($b/2), $p) * $h;\n\t\t}\n\t\tprint_r($ans.\"\\n\");\n\t}\n\tfclose($cin);\n?>"}, {"source_code": " 0)\n {\n $h += min($c, $g) * $e;\n }\n }\n else\n {\n $h += min($g, $c) * $e;\n $g -= $c;\n if($g > 0)\n {\n $h += min($d, $g) * $f;\n }\n }\n print $h . \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": " $f)\n {\n if($g <= $d)\n {\n $h += min($g, $c) * $e;\n }\n else\n {\n $h += $c * $e;\n $g -= $c;\n $h += min($d, $g) * $f;\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " $f)\n {\n if($g <= $d)\n {\n $h += $g * $e;\n }\n else\n {\n $h += $c * $e;\n $g -= $c;\n $h += min($d, $g) * $f;\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " $c) {\n $hamburger = min($p, intdiv($b, 2));\n $chicken = min($f, intdiv($b - 2 * $hamburger, 2));\n } else {\n $chicken = min($f, intdiv($b, 2));\n $hamburger = min($p, intdiv($b - 2 * $chicken, 2));\n }\n echo ($hamburger * $h + $chicken * $c) . PHP_EOL;\n}"}], "src_uid": "92bf30e66f4d5ddebb697d2fa4fa0689"} {"source_code": " $a[$j]) {\n $t = $a[$i];\n $a[$i] = $a[$j];\n $a[$j] = $t;\n }\n $b[$j] = $a[$i];\n}\nunset($a);\n$n--;\nwhile ($qn--) {\n $q = trim(fgets(STDIN));\n if ($q <= $n) {\n echo $ans[$q][0] . ' ' . $ans[$q][1] . PHP_EOL;\n } else {\n $k = bcmod($q, $n) ?: $n;\n echo $max . ' ' . $b[$k] . PHP_EOL;\n }\n}\n"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $sr1){\n\t\t\t\t$sr1 = $sr;\n\t\t\t\t$c = $j-$i+1;\n\t\t\t\tif($c > $c1){\n\t\t\t\t\t$c1 = $c;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$sum = 0;\n\t}\nfwrite(STDOUT, ($c > $c1 ? $c : $c1));\n\n?>"}, {"source_code": " 0; $i--) {\n preg_match_all(\"/(\".$m.\"){\".$i.\"}/\", $s, $d);\n if (count($d[0])) {\n echo $i;\n break;\n }\n }\n \n\n?>"}, {"source_code": ""}, {"source_code": " 0; $i--) {\n preg_match(\"/\".$m.\"{\".$i.\"}/\", $s, $d);\n if (count($d)) {\n echo $i;\n break;\n }\n }\n \n\n?>"}, {"source_code": " 0; $i--) {\n preg_match(\"/\".$m.\"{\".$i.\"}/\", $s, $d);\n if (count($d)) {\n echo $i;\n break;\n }\n }\n \n\n?>"}, {"source_code": " 0; $i--) {\n preg_match_all(\"/(\".$m.\" ){\".$i.\"}/\", $s, $d);\n if (count($d[0])) {\n echo $i;\n break;\n }\n }\n \n\n?>"}, {"source_code": " 0; $i--) {\n preg_match_all(\"/(\".$m.\"){\".$i.\"}/\", $s, $d);\n if (count($d[0])) {\n echo $i;\n break;\n }\n }\n \n\n?>"}], "src_uid": "5db2ae5b2c91b29e4fe4a45ab864e3f1"} {"source_code": "", "positive_code": [{"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "0)) $border=true;}\n\nif (($left>0) or ($right>0)) $border=true;\n\nif ($border) echo(\"2\");\n else echo(\"4\");\n\n?>"}], "negative_code": [{"source_code": "\n"}, {"source_code": "0)) $border=true;}\nif (($left>0) or ($right>0)) $border=true;\nfclose($f);\nif ($border) echo(\"2\");\n else echo(\"4\");\n\n\n?>"}, {"source_code": "0)) $border=true;}\nif (($left>0) or ($right>0)) $border=true;\nfclose($f);\n$f=fopen(\"output.txt\",\"w\");\nif ($border) fwrite($f,\"2\");\n else fwrite($f,\"4\");\nfclose($f);\n\n?>"}, {"source_code": "0)) $border=true;}\nif (($left>0) or ($right>0)) $border=true;\nif ($border) echo(\"2\");\n else echo(\"4\");\nfclose($f);\n?>"}, {"source_code": "0)) $border=true;}\nif (($left>0) or ($right>0)) $border=true;\nfclose($f);\nif ($border) echo(\"2\");\n else echo(\"4\");\n\n?>"}], "src_uid": "0d2fd9b58142c4f5282507c916690244"} {"source_code": " 1) {\n $t = intdiv($l + $r, 2);\n if (($t > $c) || ($t > $m) || ($c + $m + $x < 3 * $t)) {\n $r = $t;\n } else {\n $l = $t;\n }\n }\n echo $l . PHP_EOL;\n}", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "b18dac401b655c06bee331e71eb3e4de"} {"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}", "positive_code": [{"source_code": " $max) {\r\n $ans = $a;\r\n $max = $count;\r\n $dur = $d;\r\n }\r\n $count = 0;\r\n }\r\n \r\n \r\n IO::pr($dur);\r\n IO::prArray($ans); \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}"}, {"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}"}], "src_uid": "3b9380ca571dbf3e24fc1b1c8b91790b"} {"source_code": " $k)\n\t\t{//\u041d\u0435 \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043e\u0440\u0435\u0448\u0438\u0432\u0430\u0442\u044c\n\t\t\t$res[] = $a[$i];\n\t\t}\n\t\telse \n\t\t{//\u0420\u0435\u0448\u0438\u043b\u0438, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438\n\t\t\tif ($k < $a[$i]) $k = $a[$i];\n\t\t}\n\t}\n\treturn $res;\n}\n?>", "positive_code": [{"source_code": "= $c[$x])\n {\n $b = $c[$x];\n break;\n }\n }\n }\n elseif(bcmul($b, 2) == $c[$x])\n {\n $b = bcmul($b, 2);\n }\n elseif(bcmul($b, 2) > $c[$x])\n {\n $b = max($b, $c[$x]);\n }\n \n}\nprint $d;\n?>"}], "negative_code": [{"source_code": "= $c[$x])\n {\n break;\n }\n }\n }\n elseif($b * 2 == $c[$x])\n {\n $b *= 2;\n }\n elseif($b * 2 > $c[$x])\n {\n $b = max($b, $c[$x]);\n }\n \n}\nif($d == 0)\n{\n print \"0\";\n}\nelse\n{\n print $d - 1;\n}\n?>"}, {"source_code": "= $c[$x])\n {\n break;\n }\n }\n }\n}\nprint $d - 1;\n?>"}, {"source_code": ""}, {"source_code": "= $c[$x])\n {\n break;\n }\n }\n }\n}\nif($d == 0)\n{\n print \"0\";\n}\nelse\n{\n print $d - 1;\n}\n?>"}, {"source_code": ""}, {"source_code": "= $c[$x])\n {\n break;\n }\n }\n }\n}\nif($d == 0)\n{\n print \"0\";\n}\nelse\n{\n print $d - 1;\n}\n?>"}, {"source_code": "= $c[$x])\n {\n $b = $c[$x];\n break;\n }\n }\n }\n elseif(bcmul($b, 2) == $c[$x])\n {\n bcmul($b, 2);\n }\n elseif(bcmul($b, 2) > $c[$x])\n {\n $b = max($b, $c[$x]);\n }\n \n}\nprint $d;\n?>"}, {"source_code": "= $c[$x])\n {\n break;\n }\n }\n }\n}\nif($d == 0)\n{\n print \"0\";\n}\nelse\n{\n print $d - 1;\n}\n?>"}, {"source_code": "= $c[$x])\n {\n break;\n }\n }\n }\n}\nif($d == 0)\n{\n print \"0\";\n}\nelse\n{\n print $d - 1;\n}\n?>"}, {"source_code": " $c[$x])\n {\n $b *= 2;\n break;\n }\n }\n }\n elseif($b * 2 == $c[$x])\n {\n $b *= 2;\n }\n elseif($b * 2 > $c[$x])\n {\n $b = max($b, $c[$x]);\n }\n \n}\nprint $d;\n?>"}, {"source_code": "= $c[$x])\n {\n break;\n }\n }\n }\n}\nif($d == 0)\n{\n print \"0\";\n}\nelse\n{\n print $d - 1;\n}\n?>"}, {"source_code": "= $c[$x])\n {\n $d--;\n break;\n }\n }\n }\n}\nprint $d;\n?>"}, {"source_code": " $k) $res[] = (int)$a[$i];\n\t}\n\treturn $res;\n}\n?>"}, {"source_code": " $k)\n\t\t{//\u041d\u0435 \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043e\u0440\u0435\u0448\u0438\u0432\u0430\u0442\u044c\n\t\t\t$res[] = $a[$i];\n\t\t}\n\t\telse \n\t\t{//\u0420\u0435\u0448\u0438\u043b\u0438, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438\n\t\t\tif ($k < $a[$i]) $k = $a[$i];\n\t\t}\n\t}\n\treturn $res;\n}\n?>"}], "src_uid": "adc5a98cef418d9bbf40e5772c02ef43"} {"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$n = readNum($f);\n\t$l1 = readNumArray($f);\n\t$l2 = readNumArray($f);\n\n\t$basePos = array_fill(0, $n, false);\n\t$fullNums = range(1, $n);\n\t$badIndex = array();\n\tforeach ($l1 as $i => $n1) {\n\t\tif ($l1[$i] == $l2[$i]) {\n\t\t\t$basePos[$i] = $n1;\n\t\t} else {\n\t\t\t$badIndex[] = $i;\n\t\t}\n\t}\n\n\t$withoutNums = array_diff($fullNums, array_filter($basePos));\n\n\n\t$variables = array();\n\t$tmp = $withoutNums;\n\tforeach ($withoutNums as $fNum) {\n\t\t$variables[] = $tmp;\n\t\tarray_unshift($tmp, array_pop($tmp));\n\t}\n\n\tforeach ($variables as $fNum => $positions) {\n\t\t$reBase = $basePos;\n\t\tforeach ($reBase as $i => $v) {\n\t\t\tif ($v === false) {\n\t\t\t\t$reBase[$i] = array_shift($positions);\n\t\t\t}\n\t\t}\n\t\t$l1Diff = getDiffCount($reBase, $l1);\n\t\t$l2Diff = getDiffCount($reBase, $l2);\n\t\tif ($l1Diff == 1 && $l2Diff == 1) {\n\t\t\techo implode(' ', $reBase);\n\t\t\treturn;\n\t\t}\n\t}\n\techo 'no';\n\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "6fc3da19da8d9ab024cdd5acfc4f4164"} {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $s2='';\n for($i=0; $i<$n-1; $i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n $resu = test($s2, count($s2));\n if($resu>0){\n echo \"NO\"; exit;\n }\n }\n }\n }\n if($s2==\"\"){\n echo \"NO\";exit;\n }\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n\n}\n\n?>"}, {"source_code": ""}, {"source_code": " $v) {\n if (preg_match(\"/\" . $k . \"[^\" . $k . \"]\" . \"/\", $s, $b)) {\n echo \"YES\\n\" . current($b);exit;\n }\n }\n echo 'NO';\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "$len/2)\n \techo \"NO\";\n else\n \t \techo \"YES\\n$str\";\n \t\n \n"}, {"source_code": "max($ara))\n \t \techo \"YES\\n$str\";\n else\n \techo \"NO\";\n \n"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $n = count($a);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<$n; $i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }\n }\n }\n\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n}\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $counter=0;\n $a = str_split($s);\n $n = count($a);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<($n/2)-1;$i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }\n }\n }\n\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n}\n?>"}, {"source_code": " $ss.length/2){\n echo \"NO\"; exit;\n }\n }else{\n echo \"YES\".\"
\".\"$ss\";\n }\n }\n}\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $counter=0;\n $a = str_split($s);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<($n/2)-1;$i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }else{\n echo \"NO\";\n }\n }\n }\n\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n}\n?>"}, {"source_code": "\".\"$ss\";\n }\n}\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $n = count($a);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<$n-1; $i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }\n }\n }\n\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n}\n?>"}, {"source_code": " $ss.length/2){\n echo \"NO\"; exit;\n }\n }else{\n echo \"YES\".\"
\".\"$ss\";\n }\n }\n}\n?>"}, {"source_code": " $ss.length/2){\n echo \"NO\"; exit;\n }\n }else{\n echo \"YES\".\"
\".\"$ss\";\n }\n }\n}\n?>"}, {"source_code": " $ss.length/2){\n $n = \"NO\"; exit;\n }\n }else{\n $n = \"YES\";\n $s = $ss;\n }\n }\n}\n?>"}, {"source_code": "\n\".\"$ss\";\n }\n}\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n }\n \n if($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<($n/2)-1;$i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }\n }\n }\n \n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n }\n\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $s2='';\n for($i=0; $i<($n/2)-1;$i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n $resu = test($s2, count($s2));\n if($resu>0){\n echo \"NO\"; exit;\n }\n }\n }\n }\n if($s2==\"\"){\n echo \"NO\";exit;\n }\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n\n}\n\n?>"}, {"source_code": "$n/2){\n echo \"NO\"; exit;\n }\n }\n }\n}\n$r = rand(0, $n);\n$r1 =rand($r, $n);\n$ss = substr($s, $r, $r1);\necho \"YES\".\"
\".\"$ss\";\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $n = count($a);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<($n/2)-1;$i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }\n }\n }\n\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n}\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $n = count($a);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<$n; $i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }\n }\n }\n\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n}\n?>"}, {"source_code": "=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $s2='';\n for($q=0; $q<$n/2-1; $q++){\n if($a[$q] !== $a[$q+1]){\n $s2 = $a[$q].$a[$q+1];\n $b=strlen($s2);\n $a2 = str_split($s2);\n for($i=0; $i2 && $b%2==1){\n if($count > ($n-1)/2){\n echo \"NO\"; exit;\n }\n }else{\n if($count > $n/2){\n echo \"NO\"; exit;\n }\n }\n }\n }\n\n }\n\n }else{\n echo\"NO\"; exit;\n }\n }}\n?>"}, {"source_code": " $n/2){\n $out++;\n }\n }\n return $out;\n}\n\nif($n>=1 && $n<=1000 && strlen($s) == $n){\n $a = str_split($s);\n $n = count($a);\n $result = test($a, $n);\n if($result===0){\n $s2='';\n for($i=0; $i<$n; $i++){\n if(!$s2){\n if($a[$i] !== $a[$i+1]){\n $s2 = $a[$i].$a[$i+1];\n }\n }\n }\n\n echo \"YES\\n\";\n echo $s2;\n } else {\n echo \"NO\";\n }\n}\n?>"}, {"source_code": "= $k;\n if (count($a[$chars[$j]]) >= $k) {\n $b = true;\n break;\n }\n $str .= $chars[$j];\n }\n //echo $b;\n if ($b) {\n $b1 = true;\n break;\n }\n \n }\n \n if ($b1) {\n echo 'NO';\n } else {\n echo \"YES\\n\";\n echo $str;\n }\n \n \n \n \n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $k) {\n $b1 = true;\n break;\n }\n \n }\n \n if ($b1) {\n echo 'NO';\n } else {\n echo \"YES\\n\";\n echo $str;\n }\n \n \n \n \n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $k) {\n $b1 = true;\n break;\n }\n \n }\n \n if ($b1) {\n echo 'NO';\n } else {\n echo \"YES\\n\";\n echo $str;\n }\n \n \n \n \n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $k) {\n $b1 = true;\n break;\n }\n \n }\n \n if ($b1) {\n echo 'NO';\n } else {\n echo \"YES\\n\";\n echo $str;\n }\n \n \n \n \n?>"}, {"source_code": ""}], "src_uid": "ce4443581d4ee12db6607695cd567070"} {"source_code": " $d) && ($y - $x + 1 > $c))\n {\n $c = $y - $x + 1;\n }\n $d += 100;\n }\n}\nprint $c;\n?>", "positive_code": [{"source_code": " 100)\n {\n $d = max($d, $e);\n }\n $e++;\n }\n}\nprint $d;\n?>"}], "negative_code": [{"source_code": " $x)\n {\n $c = $x;\n }\n else\n {\n $e = 0;\n for($z = $y; $z < $x; $z++)\n {\n $d -= $b[$e];\n $e++;\n $d += $b[$z];\n if($d / 100 > $x)\n {\n $c = $x;\n }\n }\n }\n}\nprint $c;\n?>"}, {"source_code": " $x)\n {\n $c = $x;\n $f = 1;\n }\n else\n {\n $e = 0;\n for($z = $y; $z < count($b); $z++)\n {\n $d -= $b[$e];\n $e++;\n $d += $b[$z];\n if($d / 100 > $x)\n {\n $c = $x;\n $f = 1;\n break;\n }\n }\n }\n if($f != 1)\n {\n break;\n }\n}\nprint $c;\n?>"}], "src_uid": "ae531bc4b47e5d31fe71b6de1398b95e"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "69f4e340b3f6e1d807e0545ebea1fe2f"} {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "5ad16e23e96de111c4974551b859a5ff"} {"source_code": ""}], "negative_code": [], "src_uid": "1d4aaf15e5c6fcde50515880aae74720"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "dd26f45869b73137e5e5cc6820cdc2e4"} {"source_code": " $row) {\n $a[$key] = $row[0];\n $b[$key] = $row[1];\n}\narray_multisort($a, SORT_ASC, $b, SORT_ASC, $ab);\nunset($a);\nunset($b);\n$prevDate = -1;\nfor($i = 0; $i < $n; $i++) {\n\tif($ab[$i][1] <= $ab[$i][0] && $ab[$i][1] >= $prevDate) {\n\t\t$prevDate = $ab[$i][1];\n\t} else {\n\t\t$prevDate = $ab[$i][0];\n\t} \n}\necho $prevDate;\n\n?>", "positive_code": [{"source_code": " $row) {\n $a[$key] = $row[0];\n $b[$key] = $row[1];\n}\narray_multisort($a, SORT_ASC, $b, SORT_ASC, $ab);\n$prevDate = -1;\nforeach ($ab as $elem) {\n\t$a = $elem[0];\n\t$b = $elem[1];\n\tif($b <= $a && $b >= $prevDate) {\n\t\t$prevDate = $b;\n\t} else {\n\t\t$prevDate = $a;\n\t} \n}\necho $prevDate;\n?>"}, {"source_code": " $i))\n {\n $i = $h[$x];\n }\n elseif(($f[$x] != $f[$x - 1]) && ($h[$x] < $i))\n {\n $i = $f[$x];\n }\n elseif(($f[$x] != $f[$x - 1]) && ($h[$x] >= $i))\n {\n $i = $h[$x];\n }\n}\nprint $i;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "
\";\n$c = array();\nfor ($i=0; $i<2; $i++) {\n\tfor ($j=0; $j<$exams_count; $j++) {\n\t\t$c[$i][$j] = $days[$j][$i];\n\t}\n}\n//print_r($c);\narray_multisort($c[0], SORT_ASC, $c[1]);\n//echo \"

\";\n//print_r($c);\n$flag = false;\nfor ($i = 0; $i < $exams_count-1; $i++) {\n if ($c[1][$i] > $c[1][$i + 1]) {\n $flag = true;\n break;\n }\n}\nif ($flag) {\n\techo $c[0][$exams_count-1];\n} else {\n\techo $c[1][$exams_count-1];\n}\n?>"}, {"source_code": " $b) {\n\tif($b <= $a && $b >= $prevDate) {\n\t\t$prevDate = $b;\n\t} else {\n\t\t$prevDate = $a;\n\t} \n}\necho $prevDate;\n?>"}, {"source_code": " $row) {\n $a[$key] = $row[0];\n $b[$key] = $row[1];\n}\narray_multisort($a, SORT_ASC, $b, SORT_ASC, $ab);\nunset($a);\nunset($b);\n$prevDate = -1;\nfor($i = 0; $i < $n; $i++) {\n\tif($ab[$i][1] <= $ab[$i][0] && $ab[$i][1] >= $prevDate) {\n\t\t$prevDate = $ab[$i][1];\n\t} else {\n\t\t$prevDate = $ab[$i][0];\n\t} \n}\necho $prevDate.\" \". (memory_get_peak_usage()/1024).\"\\n\";\n\n?>"}], "src_uid": "71bc7c4eb577441f2563e40d95306752"} {"source_code": " 0 && $a[] = ceil(($mex + $m) / 2);\r\n echo count(array_unique($a)).PHP_EOL;\r\n }\r\n}\r\n", "positive_code": [{"source_code": " $val) {\r\n if ($key != $val) { $p = 1; $mex = $key; break; }\r\n }\r\n \r\n if ($p == 1) {\r\n $m = ceil(($mex + $s[count($s) - 1]) / 2); \r\n array_push($s, $m);\r\n $r = array_unique($s);\r\n echo count($r).PHP_EOL; \r\n } else {\r\n $r = array_unique($s);\r\n echo count($r) + $k.PHP_EOL; \r\n }\r\n }\r\n }\r\n}\r\n?>"}], "negative_code": [{"source_code": " $val) {\r\n if ($key != $val) { $p = 1; $mex = $key; break; }\r\n }\r\n \r\n if ($p == 1) {\r\n $m = ceil(($mex + $s[count($s) - 1]) / 2); \r\n array_push($s, $m);\r\n $r = array_unique($s);\r\n echo count($r).PHP_EOL; \r\n } else {\r\n $r = array_unique($s);\r\n echo count($r) + $k.PHP_EOL; \r\n }\r\n }\r\n}\r\n?>"}], "src_uid": "c0d23fe28ebddbfc960674e3b10122ad"} {"source_code": " \"\", \"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 $j = 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 $k = 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 for($x = 0; $x < count($c); $x++)\n {\n $i[$c[$x]]++;\n }\n for($x = 0; $x < count($e); $x++)\n {\n $j[$e[$x]]++;\n }\n $l = 0;\n for($x = 0; $x < 26; $x++)\n {\n if($j[$k[$x]] <= $i[$k[$x]])\n {\n $l += $j[$k[$x]];\n }\n else\n {\n $l += ($i[$k[$x]] / $j[$k[$x]]) * $j[$k[$x]];\n }\n }\n print $l;\n}\n?>", "positive_code": [{"source_code": " 0);\n\t$np[$dd] = max(0, --$np[$dd]);\n}\n\necho ($a == 0) ? \"-1\" : $a;\necho PHP_EOL;"}, {"source_code": " $val) {\n if (!isset($ca[$c])) {\n echo \"-1\";\n exit();\n }\n if ($val < $ca[$c]) {\n $ans += $val; //$ca[$c] - ($ca[$c] % $val);\n } else if ($val == $ca[$c]) {\n $ans += $val;\n } else {\n $ans += $ca[$c];\n }\n}\necho $ans;"}], "negative_code": [{"source_code": " \"\", \"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 $j = 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 $k = 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 for($x = 0; $x < count($c); $x++)\n {\n $i[$c[$x]]++;\n }\n for($x = 0; $x < count($e); $x++)\n {\n $j[$e[$x]]++;\n }\n $l = 0;\n for($x = 0; $x < 26; $x++)\n {\n if($j[$k[$x]] <= $i[$k[$x]])\n {\n $l += $j[$k[$x]];\n }\n else\n {\n $l += ($i[$k[$x]] / $j[$k[$x]]) * 3;\n }\n }\n print $l;\n}\n?>"}, {"source_code": " 1\n);\n$max = 1;\n$count = (int) fgets(STDIN);\nfor ($i = 0; $i < $count; $i++) {\n list($name1, $name2) = explode(\"reposted\", fgets(STDIN));\n $name2 = strtolower(trim($name2));\n if (! isset($chain[$name2])) continue;\n $name1 = strtolower(trim($name1));\n $chain[$name1] = $chain[$name2] + 1;\n if ($chain[$name1] > $max) $max = $chain[$name1];\n}\necho $max;\n?>", "positive_code": [{"source_code": ""}, {"source_code": " $max)\n $max = $num[1][$i];\n\necho $max;\n?>"}, {"source_code": " 1);\n\t$n = (int)fgets(STDIN);\n\t$max = 1;\n\tfor($i = 0; $i < $n; $i++) {\n\t\t$line = fgets(STDIN);\n\t\t$params = explode(' reposted ', $line);\n\t\t$name1 = strtolower(trim($params[0]));\n\t\t$name2 = strtolower(trim($params[1]));\n\t\t$r[$name1] = $r[$name2] + 1;\n\t\tif ($r[$name1] > $max) {\n\t\t\t$max = $r[$name1];\n\t\t}\n\t}\n\techo $max;\n?>"}, {"source_code": " $value)\n {\n if ($value > $max)\n $max = $value;\n }\n echo $max;\n?> "}, {"source_code": ""}, {"source_code": " $c[1], 2 => $b[1]);\n$h = array(1 => \"1\", 2 => \"2\");\nfor($x = 2; $x <= $a; $x++)\n{\n $i = array_search($c[$x], $g);\n array_push($g, $b[$x]);\n array_push($h, $h[$i] + 1);\n}\nrsort($h);\nprint $h[0];\n?>"}, {"source_code": " $t[1],\n 'level' => 1\n );\n $maxLevel = 1;\n }\n $level = getLevel($reposts, $t[1])+1;\n if($level > $maxLevel){\n $maxLevel = $level;\n }\n $reposts[] = array(\n 'name' => $t[0],\n 'level' => $level\n );\n}\necho $maxLevel;\n?>"}, {"source_code": " $rs) {\n $rs = $mapa[strtoupper($data[0])];\n }\n\n}\n\nfprintf($fileOUT, $rs . \"\\n\");\n\nfclose($fileIN);\nfclose($fileOUT);\n\n?>\n"}, {"source_code": "1);\n$max=1;\nfor($i=0;$i<$rCount;$i++)\n{\n list($to,$from)=explode(\" reposted \",strtolower(fgets(STDIN)));\n $from=trim($from);\n $to=trim($to);\n $Reposts[$to]=$Reposts[$from]+1;\n if($Reposts[$to]>$max)\n {\n $max=$Reposts[$to];\n }\n}\necho $max;\n?>"}, {"source_code": " $max) {\n $max = $child;\n }\n }\n return $max;\n}\necho countRepostsDepth(\"polycarp\", $reposts);\n"}, {"source_code": " $max)\n $max = $num[1][$i];\n$stdout=fopen(\"php://stdout\",'w');\necho $max;\n?>"}, {"source_code": "0){\n $root = $temp;\n $temp = array();\n $i=0;\n $counter++;\n }\n}\n\nprintf(\"%d\",$counter);\n?>"}, {"source_code": " 1 );\n $max = 1;\n for( $i = 0; $i < $n; $i++ ){\n list($who, $from) = explode(' reposted ', strtolower (trim( fgets(STDIN) ) ) );\n $a[$who] = $a[$from]+1;\n if( $max < $a[$who] ){\n $max = $a[$who];\n }\n }\n\n print $max;\n\n\n?>\n"}, {"source_code": " 1); \n$max = 1;\n\nfor ( $i = 0; $i < $n; ++$i ) {\n\t$repost = trim(fgets(STDIN));\n\t$name = explode(' reposted ', $repost);\n\t$fName = trim(strtolower( $name[0] ) );\n\t$sName = trim( strtolower( $name[1] ) );\n\t\n\t$arr[$fName] = $arr[$sName] + 1;\n}\n\necho max($arr);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1\n);\n$max = 1;\nfor($i = 0; $i < $n; $i++){\n $line = trim(fgets(STDIN));\n $exp = explode(' reposted ', $line);\n $cur = $list[strtolower($exp[1])]+1;\n $list[strtolower($exp[0])] = $cur;\n if($cur > $max) $max = $cur;\n}\necho $max;"}, {"source_code": " 1);\n \n foreach ($arr as $line) {\n// var_dump($line);\n preg_match('/([a-zA-Z0-9]{2,24}) reposted ([a-zA-Z0-9]{2,24})$/', $line, $matches);\n \n// var_dump($matches);\n $first = strtolower($matches[1]);\n $second = strtolower($matches[2]);\n $root[$first] = $root[$second] + 1;\n }\n \n// var_dump($root);\n echo max(array_values($root));"}], "negative_code": [{"source_code": " $t[1],\n 'level' => 1\n );\n $maxLevel = 1;\n }\n $level = getLevel($reposts, $t[1])+1;\n if($level > $maxLevel){\n $maxLevel = $level;\n }\n $reposts[] = array(\n 'name' => $t[0],\n 'level' => $level\n );\n}\necho $maxLevel;\n?>"}, {"source_code": "= 0; $i--) for ($j = $i - 1; $j >= 0; $j--) if (!strcasecmp($a[$i][1], $a[$j][0])) $k[$j] = $k[$i] + 1;\necho @max($k) + 2;\n?>"}, {"source_code": "= 0; $i--) for ($j = $i - 1; $j >= 0; $j--) if (!strcasecmp($a[$i][1], $a[$j][0])) $k[$j] = $k[$i] + 1;\necho @max($k) + 2;\n?>"}, {"source_code": " 1);\n \n foreach ($arr as $line) {\n preg_match('/^([a-z0-9]{2,24}) reposted ([a-z0-9]{2,24})$/', $line, $matches);\n $first = strtolower($matches[1]);\n $second = strtolower($matches[2]);\n $root[$first] = $root[$second] + 1;\n }\n \n// var_dump($root);\n echo max(array_values($root));"}, {"source_code": " 1);\n \n \n $max = 1;\n $maxOld = 0;\n while ($max != $maxOld) {\n $maxOld = $max;\n \n foreach ($root as $key => $value) {\n if ($value == $max) {\n \n $namesArray = null;\n preg_match_all(\"/([a-z0-9]*) .* $key/i\", $input, $namesArray);\n \n foreach ($namesArray[1] as $item) {\n $root[$item] = $root[$key] + 1;\n $input = preg_replace(\"/$item reposted $key/\", '', $input, 1);\n }\n \n foreach ($root as $n) {\n if ($n > $max) {\n $max = $n;\n }\n }\n }\n }\n }\n \n echo $max;\n \n \n "}, {"source_code": " 1);\n \n \n $max = 1;\n $maxOld = 0;\n while ($max != $maxOld) {\n $maxOld = $max;\n \n foreach ($root as $key => $value) {\n if ($value == $max) {\n \n $namesArray = null;\n preg_match_all(\"/([a-z0-9]*) reposted $key/i\", $input, $namesArray);\n \n foreach ($namesArray[1] as $item) {\n $root[$item] = $root[$key] + 1;\n $input = preg_replace(\"/$item reposted $key/\", '', $input, 1);\n }\n \n foreach ($root as $n) {\n if ($n > $max) {\n $max = $n;\n }\n }\n }\n }\n }\n \n echo $max;\n \n \n "}, {"source_code": " 1);\n \n \n $max = 1;\n $maxOld = 0;\n while ($max != $maxOld) {\n $maxOld = $max;\n \n foreach ($root as $key => $value) {\n if ($value == $max) {\n \n $namesArray = null;\n preg_match_all(\"/([a-z0-9]*) .* $key/i\", $input, $namesArray);\n \n foreach ($namesArray[1] as $item) {\n $root[$item] = $root[$key] + 1;\n $input = preg_replace(\"/$item reposted $key/\", '', $input);\n }\n \n foreach ($root as $n) {\n if ($n > $max) {\n $max = $n;\n }\n }\n }\n }\n }\n \n echo $max;\n \n \n "}, {"source_code": " 1);\n \n $namesArray = null;\n // for ($i = 1; $i <= $nr; $i++) {\n // preg_match(\"/^([a-z0-9]{2,24}) .*polycarp/\", strtolower($input[$i]), $namesArray);\n //\n // }\n //\n // foreach ($namesArray as $name) {\n // $root[$name] = $root['polycarp'] + 1;\n // }\n \n $index = 1;\n while ($index <= $nr) {\n foreach ($root as $key => $value) {\n if ($value == $index) {\n \n $namesArray = null;\n preg_match_all(\"/([a-z0-9]*) .* $key/i\", $input, $namesArray);\n \n foreach ($namesArray[1] as $item) {\n $root[$item] = $index + 1;\n }\n }\n }\n $index++;\n }\n \n $max=0;\n foreach ($root as $item) {\n if ($item > $max){\n $max = $item;\n }\n }\n \n echo $max;\n \n \n "}, {"source_code": " 1);\n \n foreach ($arr as $line) {\n var_dump($line);\n preg_match('/([a-zA-Z0-9]{2,24}) reposted ([a-zA-Z0-9]{2,24})$/', $line, $matches);\n \n// var_dump($matches);\n $first = strtolower($matches[1]);\n $second = strtolower($matches[2]);\n $root[$first] = $root[$second] + 1;\n }\n \n// var_dump($root);\n echo max(array_values($root));"}, {"source_code": " 1);\n \n foreach ($arr as $line) {\n preg_match('/^([a-z0-9]{2,24}) reposted ([a-z0-9]{2,24})$/', $line, $matches);\n $first = strtolower($matches[1]);\n $second = strtolower($matches[2]);\n $root[$first] = $root[$second] + 1;\n }\n \n var_dump($root);\n echo max(array_values($root));"}, {"source_code": " 1);\n\n $index = 1;\n while ($index <= $nr) {\n foreach ($root as $key => $value) {\n if ($value == $index) {\n \n $namesArray = null;\n preg_match_all(\"/([a-z0-9]*) .* $key/i\", $input, $namesArray);\n \n foreach ($namesArray[1] as $item) {\n $root[$item] = $index + 1;\n }\n }\n }\n $index++;\n }\n \n $max=0;\n foreach ($root as $item) {\n if ($item > $max){\n $max = $item;\n }\n }\n \n echo $max;\n \n \n "}, {"source_code": " 1);\n \n $namesArray = null;\n // for ($i = 1; $i <= $nr; $i++) {\n // preg_match(\"/^([a-z0-9]{2,24}) .*polycarp/\", strtolower($input[$i]), $namesArray);\n //\n // }\n //\n // foreach ($namesArray as $name) {\n // $root[$name] = $root['polycarp'] + 1;\n // }\n \n $index = 1;\n while ($index <= $nr) {\n foreach ($root as $key => $value) {\n if ($value == $index) {\n \n $namesArray = null;\n preg_match_all(\"/([a-z0-9]*) .* $key/i\", $input, $namesArray);\n \n foreach ($namesArray[1] as $item) {\n $root[$item] = $index + 1;\n }\n }\n }\n $index++;\n }\n \n $max=0;\n foreach ($root as $item) {\n if ($item > $max){\n $max = $item;\n }\n }\n \n echo $max;\n \n \n "}, {"source_code": ""}, {"source_code": " $value){\nif($key == 1){ \n$total = $key+1; \ncontinue;\n}\n$firstValue = explode(\" reposted \", $value);\n$secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n$repoFirst = strtolower($firstValue[1]);\n$repoSecond = strtolower($secondValue[0]);\nif($repoFirst == $repoSecond && (strlen($repoFirst)>1 and strlen($repoFirst)<25) && (strlen($repoSecond)>1 and strlen($repoSecond)<25)){\n$total = $key+1;\n}\nelse{\n$total = $key;\nbreak;\n}\n}\necho $total;\n?>"}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key + 1;\n } else {\n $total = $key;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}, {"source_code": ""}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key;\n } else {\n $total = $key+1;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}, {"source_code": ""}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key+1;\n } else {\n $total = $key;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho (int)$total;\n?>"}, {"source_code": ""}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key;\n } else {\n $total = $key+1;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}, {"source_code": ""}, {"source_code": " 12) {\n var_dump($i);\n var_dump($firstValue);\n }\n if (!is_numeric(array_search(strtolower($firstValue[0]), $arrayWithReported))) { \n if (is_numeric(array_search(strtolower($firstValue[1]), $arrayWithReported))) {\n $total = $i;\n $arrayWithReported[] = strtolower($firstValue[0]);\n } else {\n $total = $i;\n break;\n }\n } else {\n $total = $i;\n break;\n }\n }\n}\necho $total;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 2;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key+1;\n } else {\n $total = $key+1;\n break;\n }\n } else {\n $total = $key+1;\n break;\n }\n}\necho (int)$total;\n?>"}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key;\n } else {\n $total = $key;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}, {"source_code": " $value) {\n if ($key == 1) {\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!array_search($repoSecond, $arrayWithReported)) {\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key + 1;\n } else {\n $total = $key;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key;\n } else {\n $total = $key;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}, {"source_code": ""}, {"source_code": " $value) {\n if ($key == 1) {\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!array_search($firstValue, $arrayWithReported)) {\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key + 1;\n } else {\n $total = $key;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}, {"source_code": " $value) {\n if ($key == 1) {\n $firstValue = explode(\" reposted \", $value);\n $arrayWithReported[] = $firstValue[0];\n $total = $key + 1;\n continue;\n }\n $firstValue = explode(\" reposted \", $value);\n $secondValue = explode(\" reposted \", $enterArr[$key - 1]);\n if (!is_numeric(array_search($firstValue[0], $arrayWithReported))) {\n $arrayWithReported[] = $firstValue[0];\n $repoFirst = strtolower($firstValue[1]);\n $repoSecond = strtolower($secondValue[0]);\n if ($repoFirst == $repoSecond && (strlen($repoFirst) > 1 and strlen($repoFirst) < 25) && (strlen($repoSecond) > 1 and strlen($repoSecond) < 25)) {\n $total = $key+1;\n } else {\n $total = $key;\n break;\n }\n } else {\n $total = $key;\n break;\n }\n}\necho $total;\n?>"}], "src_uid": "16d4035b138137bbad247ccd5e560051"} {"source_code": "", "positive_code": [{"source_code": "in();\n\n\tif ($N % 2 === 1) print(-1);\n\telse\n\t{\n\t\tfor ($i = 1; $i <= intval($N / 2); $i++)\n\t\t{\n\t\t\tprint($i * 2);\n\t\t\tprint(\" \");\n\t\t\tprint($i * 2 - 1);\n\t\t\tprint(\" \");\n\t\t}\n\t}\n\n\t$Input->close();\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": ""}, {"source_code": "\n \t \t \t\t \t \t\t \t\t\t\t"}, {"source_code": ""}, {"source_code": "\n\n"}, {"source_code": "\n\n"}], "negative_code": [{"source_code": ""}], "src_uid": "204ba74195a384c59fb1357bdd71e16c"} {"source_code": " 0; $t--) {\r\n\r\n\t$a = array_map('intval', explode(' ', fgets(STDIN)));\r\n\r\n\techo implode(' ', $solve($a));\r\n\techo \"\\n\";\r\n\r\n}\r\n", "positive_code": [{"source_code": "...v\nv.<..\n..^..\n>....\n..^.<\n1 1\";\n\t\tbreak;\n\tcase \"3 2\":\n\t\techo \">vv\n^<.\n^.<\n1 3\";\n\t\tbreak;\n\tcase \"100 100000\":\n\t\techo \">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^v.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.>.v\n^..<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n1 1\";\n}", "positive_code": [{"source_code": "...v\nv.<..\n..^..\n>....\n..^.<\n1 1\";\n\t\tbreak;\n\tcase \"3 2\":\n\t\techo \"..v\n...\n^.<\n1 3\";\n\t\tbreak;\n\tcase \"100 100000\":\t// dolphinigle's solution according to tutorial, because when browsing through his submissions I don't find this one (only a 105k one)\n\t\techo \"v<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\nv>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v>v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\nv^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^\n.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^\n>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^\n....................................................................................................\n1 1\";\n}"}], "negative_code": [{"source_code": "...v\nv.<..\n..^..\n>....\n..^.<\n1 1\";\n\t\tbreak;\n\tcase \"3 2\":\n\t\techo \">vv\n^<.\n^.<\n1 3\";\n\t\tbreak;\n\tcase \"100 100000\":\n\t\techo \">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n....................................................................................................\n.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n....................................................................................................\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<.\n.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<\n1 1\";\n}"}], "src_uid": "ef7fd4387de8c947164d04dfbf5b72e2"} {"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": " $ss) {\r\n $d = \"\\n\";\r\n if ($i == count($res) - 1) {\r\n $d='';\r\n }\r\n echo $ss . $d;\r\n}"}, {"source_code": ""}, {"source_code": " $ss) {\r\n $d = \"\\n\";\r\n if ($i == count($res) - 1) {\r\n $d='';\r\n }\r\n echo $ss . $d;\r\n}"}, {"source_code": "a = $a;\n\t\t$this->b = $b;\n\t\t$this->i = $i;\n\t}\n\tfunction less($r) {\n\t\tglobal $EPS;\n\t\treturn abs($this->a - $r->a) > $EPS ? $this->a < $r->a : $this->b < $r->b;\n\t}\n}\n\nfunction dist($x1, $y1, $x2, $y2) {\n\treturn sqrt(($x1 - $x2)**2 + ($y1 - $y2)**2);\n}\n\nfscanf(STDIN, \"%d %d %d\", $n, $vb, $vs);\n$line = fgets(STDIN);\n$x = array_map(\"intval\", explode(' ', $line));\n//print_r($x);\nfscanf(STDIN, \"%d %d\", $dx, $dy);\n\n$answer = new Result(1e9, 0, -1);\nfor ($i = 1; $i < $n; $i++) {\n\t$d = dist($x[$i], 0, $dx, $dy);\n\t$t = $x[$i] / $vb + $d / $vs;\n\t$candidate = new Result($t, $d, $i);\n\tif ($candidate->less($answer)) \n\t\t$answer = $candidate;\n}\nprint $answer->i + 1;\n\n?>\n", "positive_code": [{"source_code": "$time){\n $min=$time;\n $tn=$i;\n $d=sqrt($xx*$xx+$yy*$yy);\n }else if(equal($min,$time)&&$d>sqrt($xx*$xx+$yy*$yy)){\n $tn=$i;\n $d=sqrt($xx*$xx+$yy*$yy);\n }\n}\nprint(($tn+1));\n?>"}, {"source_code": " $r[$i]) )\n\t\t\t$o = $i;\n\t}\n\tfor ( $i = 0; $i < $n; $i+= 1 )\n\t{\n\t\tif ( ($r[$o] == $r[$i]) && (dist($stops[$i],0,$x,$y) < dist($stops[$o],0,$x,$y)) )\n\t\t\t$o = $i;\n\t}\n\techo $o+1;\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}], "negative_code": [{"source_code": "$time){\n $min=$time;\n $tn=$i;\n $d=sqrt($xx*$xx+$yy*$yy);\n }else if($min==$time&&$d>sqrt($xx*$xx+$yy*$yy)){\n $tn=$i;\n $d=sqrt($xx*$xx+$yy*$yy);\n }\n}\nprint(($tn+1));\n?>"}, {"source_code": " $r[$i]) )\n\t\t\t$o = $i;\n\t}\n\techo max($o, 2);\n?>"}, {"source_code": " $r[$i]) )\n\t\t\t$o = $i;\n\t}\n\techo max($o+1, 2);\n\n?>"}, {"source_code": "\ufeffa = $a;\n\t\t$this->b = $b;\n\t\t$this->i = $i;\n\t}\n\tfunction less($r) {\n\t\tglobal $EPS;\n\t\treturn abs($this->a - $r->a) > $EPS ? $this->a < $r->a : $this->b < $r->b;\n\t}\n}\n\nfunction dist($x1, $y1, $x2, $y2) {\n\treturn sqrt(($x1 - $x2)**2 + ($y1 - $y2)**2);\n}\n\nfscanf(STDIN, \"%d %d %d\", $n, $vb, $vs);\n$line = fgets(STDIN);\n$x = array_map(\"intval\", explode(' ', $line));\n//print_r($x);\nfscanf(STDIN, \"%d %d\", $dx, $dy);\n\n$answer = new Result(1e9, 0, -1);\nfor ($i = 1; $i < $n; $i++) {\n\t$d = dist($x[$i], 0, $dx, $dy);\n\t$t = $x[$i] / $vb + $d / $vs;\n\t$candidate = new Result($t, $d, $i);\n\tif ($candidate->less($answer)) \n\t\t$answer = $candidate;\n}\nprint($answer->i + 1);\n?>\n"}, {"source_code": "\ufeffa = $a;\n\t\t$this->b = $b;\n\t\t$this->i = $i;\n\t}\n\tfunction less($r) {\n\t\tglobal $EPS;\n\t\treturn abs($this->a - $r->a) > $EPS ? $this->a < $r->a : $this->b < $r->b;\n\t}\n}\n\nfunction dist($x1, $y1, $x2, $y2) {\n\treturn sqrt(($x1 - $x2)**2 + ($y1 - $y2)**2);\n}\n\nfscanf(STDIN, \"%d %d %d\", $n, $vb, $vs);\n$line = fgets(STDIN);\n$x = array_map(\"intval\", explode(' ', $line));\n//print_r($x);\nfscanf(STDIN, \"%d %d\", $dx, $dy);\n\n$answer = new Result(1e9, 0, -1);\nfor ($i = 1; $i < $n; $i++) {\n\t$d = dist($x[$i], 0, $dx, $dy);\n\t$t = $x[$i] / $vb + $d / $vs;\n\t$candidate = new Result($t, $d, $i);\n\tif ($candidate->less($answer)) \n\t\t$answer = $candidate;\n}\nprint $answer->i + 1;\n\n?>\n"}, {"source_code": "$time){\n $min=$time;\n $tn=$i;\n }\n}\nprint(($tn+1));\n?>"}, {"source_code": "$time){\n $min=$time;\n $tn=$i;\n $d=sqrt($xx*$xx+$yy*$yy);\n }else if(equal($min,$time)&&$d>sqrt($xx*$xx+$yy*$yy)){\n $tn=$i;\n $d=sqrt($xx*$xx+$yy*$yy);\n }\n}\nprint(($tn+1));\n?>"}], "src_uid": "15fa49860e978d3b3fb7a20bf9f8aa86"} {"source_code": "= $from) {\n return $to - $from;\n } elseif ($to < $from) {\n $dif = $from - $to;\n return $n - $dif;\n }\n}\n\nfor ($i = 0; $i < $m; $i++) {\n $time += travel($currenthouse, $a[$i]);\n $currenthouse = $a[$i];\n}\n\necho $time;\n?>", "positive_code": [{"source_code": "\n"}, {"source_code": " $i) {\n $r += $s - $i;\n $i = $s;\n }\n}\necho $r;\n?>"}, {"source_code": " $a){\n $v = $v + ($arr[$i] - $a);\n $a = $arr[$i];\n }\n if ($arr[$i] < $a){\n $v = $v + 1 + ($n - $a) + $arr[$i] - 1;\n $a = $arr[$i];\n }\n }\n echo $v;"}, {"source_code": "= $arr[$i-1])\n {\n $time += ($arr[$i] - $arr[$i-1]);\n }\n else\n {\n $time += ($n - $arr[$i-1] + $arr[$i]);\n }\n }\n fwrite(STDOUT, \"$time\");\n\n?>"}, {"source_code": "$cur)?$arr[$i]-$cur:$n-$cur+$arr[$i];\n $cur=$arr[$i]; \n }\n}\nfprintf(STDOUT, \"%.0f\",$r);"}, {"source_code": "$poryadok[$i-1])\n {\n $length+=($poryadok[$i]-$poryadok[$i-1]);\n }\n elseif ($poryadok[$i]<$poryadok[$i-1])\n {\n $length+=($nDomov-$poryadok[$i-1]+$poryadok[$i]);\n }\n}\necho $length;"}, {"source_code": " $b[$i]){\n\t\t\t$total += $a[0] - $n + $b[$i];\n\t\t}\n\t\t$n = $b[$i];\n\t}\n}\n\nprint ($total);\n?>"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": " $int[$i] ){\n $ans += $n-$int[$i -1 ] + $int[$i] ;\n }else if($int[$i - 1] < $int[$i] ){\n $ans += $int[$i] -$int[$i-1] ;\n }\n }\n\n}\n\necho $ans-1;\n\n\n"}, {"source_code": "= $tasks[$i]) {\n\t\t$result += $tasks[$i + 1] - $tasks[$i];\n\t} else {\n\t\t// \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0435\u0445\u0430\u0442\u044c \u0432\u0441\u043f\u044f\u0442\u044c, \u0430 \u043d\u0435\u043b\u044c\u0437\u044f \u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u0440\u0443\u0433?\n\t\t$result += $n - ($tasks[$i] - $tasks[$i + 1]);\n\t}\n\t$i++;\n}\n\n\n\necho $result;"}, {"source_code": " $c[$x])\n {\n $d += $c[$x + 1] - $c[$x];\n }\n else\n {\n $d += $c[$x + 1] + $a - $c[$x];\n }\n }\n}\nelse\n{\n for($x = 0; $x < $b - 1; $x++)\n {\n if($c[$x + 1] == $c[$x])\n {\n continue;\n }\n elseif($c[$x + 1] > $c[$x])\n {\n $d += $c[$x + 1] - $c[$x];\n }\n else\n {\n $d += $c[$x + 1] + $a - $c[$x];\n }\n }\n}\nprint $d;\n?>"}], "negative_code": [{"source_code": "= $arr[$i-1])\n\t\t{\n\t\t\t$time += ($tmp - $arr[$i-1]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$time += ($n - $arr[$i-1] + $tmp);\n\t\t}\n\t}\n\n\tfwrite(STDOUT, \"$time\");\n\n?>"}, {"source_code": "= $arr[$i-1])\n {\n $time += ($arr[$i] - $arr[$i-1]);\n }\n else\n {\n $time += ($n - $arr[$i-1] + $arr[$i]);\n }\n }\n\n fwrite(STDOUT, \"$time\");\n\n?>"}, {"source_code": "= $arr[$i-1])\n {\n $time += ($tmp - $arr[$i-1]);\n }\n else\n {\n $time += ($n - $arr[$i-1] + $tmp);\n }\n }\n\n fwrite(STDOUT, \"$time\");\n\n?>"}, {"source_code": "$cur)?$arr[$i]-$cur:$n-$cur+$arr[$i];\n $cur=$arr[$i]; \n }\n}\nfprintf(STDOUT, \"%.0f\",$r);"}, {"source_code": "$poryadok[$i-1])\n {\n $length+=($poryadok[$i]-$poryadok[$i-1]);\n }\n elseif ($poryadok[$i]<$poryadok[$i-1])\n {\n $length+=($nDomov-$poryadok[$i-1]+$poryadok[$i]);\n }\n}\necho $length;"}, {"source_code": "$poryadok[$i-1])\n {\n $length+=($poryadok[$i]-$poryadok[$i-1]);\n }\n elseif ($poryadok[$i]<$poryadok[$i-1])\n {\n $length+=($nDomov-$poryadok[$i-1]+$poryadok[$i]);\n }\n}\necho $length;"}], "src_uid": "2c9c96dc5b6f8d1f0ddeea8e07640d3e"} {"source_code": ""}, {"source_code": "1, 'H'=>1, 'I'=>1, 'M'=>1, 'O'=>1, 'T'=>1, 'U'=>1, 'V'=>1, 'W'=>1, 'X'=>1, 'Y'=>1);\n\n$n = sizeof($forward);\nfor($i = 0; $i < $n; $i++)\n{\n\tif($forward[$i] != $forward[($n - $i - 1)] || !@isset($reflectable[$forward[$i]]))\n\t{\n\t\techo \"NO\" . PHP_EOL;\n\t\texit;\n\t}\n}\n\necho \"YES\" . PHP_EOL;"}, {"source_code": " "}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 1) ? \"YES\" : \"NO\";\n\t"}], "src_uid": "8135173b23c6b48df11b1d2609b08080"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " 0) {\n\t\t$police += $a[$i];\n\t} elseif ($a[$i] == -1) {\n\t\tif ($police > 0) {\n\t\t\t$police --;\n\t\t} else {\n\t\t\t$output ++;\n\t\t}\n\t}\n}\n\nprint $output;\n"}, {"source_code": "0)\n $p+=$a[$i];\n else{\n if($p==0)\n $r++;\n else\n $p--;\n }\n}\n\necho $r.\"\\n\";"}, {"source_code": " 0)\n $cur += $a[$i];\n else\n {\n $cur -= 1;\n if ($cur < 0)\n {\n $cur = 0;\n ++$ans;\n }\n }\n}\nprint $ans;\n?>"}, {"source_code": " 0) && ($b[$x] > 0))\n {\n $c += $b[$x];\n }\n elseif(($c <= 0) && ($b[$x] > 0))\n {\n $c = $b[$x];\n }\n elseif(($c > 0) && ($b[$x] < 0))\n {\n $c += $b[$x];\n }\n elseif(($c <= 0) && ($b[$x] < 0))\n {\n $c += $b[$x];\n }\n if(($c < 0) && ($b[$x] == \"-1\"))\n {\n $d++;\n }\n}\nprint $d;\n?>"}, {"source_code": " \n#3\n#-1 -1 1\n# sample output => 2\n# scihesham\n\n/* code forces */\n$num = trim(fgets(STDIN));\n$arr = explode(\" \", trim(fgets(STDIN)));\n/**/\n \n$police_num = 0;\n$crime_num = 0;\n\nforeach($arr as $val){\n if($val > 0){\n $police_num += $val;\n } \n else{\n if($val + $police_num < 0){\n $crime_num++;\n }\n else{\n $police_num--;\n }\n }\n \n}\n\necho $crime_num;\n\n?>"}, {"source_code": " 0) {\n\t\t\t$toSolve--;\n\t\t}\n\t\telse $unSolved++;\n\t}\n\telse {\n\t\t$toSolve += $i[$k];\n\t}\n}\necho $unSolved;\n\n?>"}, {"source_code": " $value) {\n if($value == -1){\n if($e != 0){\n $e--;\n }else{\n $j++;\n }\n }else{\n $e+=$value;\n }\n} \necho $j;"}, {"source_code": "0)\n\t\t$sum+=$singleValue[$i];\n\telseif ($sum>0) {\n\t\t$sum--;\n\t}\n\telse\n\t\t$count++;\n\n}\n\necho \"$count\";"}, {"source_code": "0){\n $zapas = $zapas+$v;\n }\n\n if ($v<0){\n $prestup = $prestup +1;\n if ($zapas != 0) {\n $zapas = $zapas -1;\n $prestup = $prestup -1;\n }\n }\n\n}\necho $prestup;"}, {"source_code": " 0 )\n {\n $police += $arr[$i] ;\n }\n else\n {\n if( $police == 0)\n {\n $crimes++ ;\n }\n else\n {\n $police-- ;\n }\n }\n}\necho $crimes ;\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n\n?>"}, {"source_code": " 0) {\n\t\t$p += $val;\n\t} else {\n\t\tif ($p == 0) {\n\t\t\t$result++;\n\t\t} else {\n\t\t\t$p--;\n\t\t}\n\t}\n}\n\necho $result;\n"}, {"source_code": " 0) {\n\t\t$police += $x;\n\t} else if ($police > 0 && $x == -1) {\n\t\t$police--;\n\t} else if ($police == 0 && $x == -1) {\n\t\t$crime++;\n\t}\n}\necho $crime.\"\\n\";\n?>"}, {"source_code": " $value) {\n if ($value == '-1') {\n if ($polic > 0) {\n $polic --;\n } else {\n $col ++;\n }\n } else {\n $polic += (int) $value;\n }\n}\n\necho $col;\n\n?>"}], "negative_code": [{"source_code": "=0;$i--) { \n \tif($single[$i]==\"-1\")\n \t{\n break;\n \t}\n \t$j++;\n \n }\n \n for($k=0;$k<$n-$j;$k++)\n \t\n {\n \tif($single[$k]>0)\n \t{\n break;\n \t}\n \telse $l++;\n }\n for($m=$l;$m<$n-$j;$m++)\n {\n $sum+=$single[$m];\n }\n \n if($sum>0)\n \techo \"$l\";\n else \n {\n \t$count=$l-$sum;\n \techo \"$count\";\n }\n\n\n\n \n \n\n //print_r($single);"}, {"source_code": "0)\n \t{\n \t\t$i+=$single[$i];\n \t}\n \telse $count++;\n\n \n \n }\n echo $count;\n\n //print_r($single);"}, {"source_code": "=0;$i--) { \n \tif($single[$i]==\"-1\")\n \t{\n break;\n \t}\n \t$j++;\n \n }\n \n for($k=0;$k<$n-$j;$k++)\n \t$count+=$single[$k];\n echo ltrim($count,'-');\n\n\n \n \n\n //print_r($single);"}], "src_uid": "af47635f631381b4578ba599a4f8b317"} {"source_code": ""}], "negative_code": [{"source_code": " $sV){\n $iS += floor($sV % 2);\n}\necho $n - floor($iS/2);\n\n", "positive_code": [{"source_code": " 0)\n {\n $f--;\n $h += 2;\n if($f == 0)\n {\n break;\n }\n }\n }\n if($f == 0)\n {\n break;\n }\n }\n}\nfor($x = 0; $x < count($e); $x++)\n{\n if($e[$g[$x]] % 2 == 1)\n {\n $i++;\n for($y = 1; $y <= floor($e[$g[$x]] / 2); $y++)\n {\n if($f > 0)\n {\n $f--;\n $h += 2;\n if($f == 0)\n {\n break;\n }\n }\n }\n if($f == 0)\n {\n break;\n }\n }\n}\nprint $h + min($f, $i);\n?>"}, {"source_code": " $sV) {\n if ($sV %2 != 0) {\n $count++;\n }\n }\n\n echo $n - floor($count/ 2);\n?>"}], "negative_code": [{"source_code": " $sV){\n if($sV % 2 == 0){\n $n = $n - $sV;\n } else {\n if($n > $sV){\n $n = $n - ($sV + 1);\n } else {\n $n = $sV - $n;\n }\n }\n}\n\necho $iCount - $n;\n\n"}, {"source_code": " $sV){\n $iS += floor($sV % 2);\n}\necho $n - $iS/2;\n\n"}, {"source_code": " $sV) {\n if ($sV %2 == 0 && ($sum + $sV) <= $n1) {\n $sum += $sV;\n }\n }\n \n foreach ($a as $sK => $sV) {\n if ($sV %2 != 0 && ($sum + 1 + $sV) <= $n1) {\n $sum += ($sV+1);\n } else if ($sV %2 != 0 && ($sum + $sV -1) <= $n1){\n $count++;\n $sum +=($sV -1);\n } \n }\n \n echo $n-$count;\n?>"}], "src_uid": "dceeb739a56bb799550138aa8c127996"} {"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}", "positive_code": [{"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n$sc = new Scanner();\n$rows_count = $sc->nextInt();\n\nfor($i = 0; $i < $rows_count; $i++)\n{\n $R = $sc->nextInt();\n $G = $sc->nextInt();\n $B = $sc->nextInt();\n $RGB = $R + $G + $B;\n if($RGB % 2 == 1)\n {\n if($RGB / 2 + 1 < $R ||$RGB / 2 + 1 < $G || $RGB / 2 + 1 < $B)\n {\n out::println('No');\n }\n else\n {\n out::println('Yes');\n }\n }\n else\n {\n if($RGB / 2 < $R ||$RGB / 2 < $G || $RGB / 2 < $B)\n {\n out::println('No');\n }\n else\n {\n out::println('Yes');\n }\n }\n}\n"}, {"source_code": "judgeOk($arr);\n fwrite(STDOUT, $steps.\"\\n\");\n }\n }\n //\u89c4\u5219\uff1a\u4fdd\u8bc1\u76f8\u90bb\u5f69\u706f\u989c\u8272\u4e0d\u540c\uff0c\u5e76\u4f7f\u7528\u5b8c\u6240\u6709\u5f69\u706f\uff0c\u7136\u540e\u6784\u6210\u82b1\u73af\u8fd4\u56detrue\uff0c\u5426\u5219\u8fd4\u56defalse\n //\u6392\u5217\u7ec4\u5408\u95ee\u9898\uff1a\u53d6\u4e24\u4e2a\u5c0f\u7684\u989c\u8272\u5f69\u706f\u6570\uff0c\u8ba1\u7b97\u4e24\u8005\u4ea7\u751f\u7684\u95f4\u9699\u6570\uff0c\u82e5\u95f4\u9699\u6570\u5927\u4e8e\u7b49\u4e8e\u7b2c\u4e09\u4e2a\u989c\u8272\u5f69\u706f\u6570\uff0c \u5219\u8fd4\u56detrue\uff0c\u5426\u5219\u8fd4\u56defalse\n public function judgeOk($arr){\n rsort($arr);\n $maxGaps = $arr[1] + $arr[2] + 1;\n $minGaps = $arr[1] - $arr[2] - 1;\n if($maxGaps >= $arr[0] && $minGaps <= $arr[0]){\n return \"Yes\";\n }\n return \"No\";\n }\n}\n\n$nyg = new NewYearGarland();\n$b = $nyg->main();"}, {"source_code": "= 2) || ($gt >= 2) || ($bt >= 2);\n}\n\n$r = 0;\n\nlist($t) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $t; ++$i) {\n list($r, $g, $b) = fscanf($input, \"%d %d %d\\n\");\n\n $r = (!foo($r, $g, $b) ? 'Yes' : 'No') . PHP_EOL;\n\n fwrite($output, $r);\n}\n\n\n"}, {"source_code": "= $max) {\n echo \"Yes\\n\";\n } else {\n echo \"No\\n\";\n }\n \n }\n?>\n\n\n\n\n\n"}, {"source_code": " 1){\n $b = false;\n }\n if($b){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n}"}], "negative_code": [{"source_code": ""}, {"source_code": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n$sc = new Scanner();\n$rows_count = $sc->nextInt();\n\nfor($i = 0; $i < $rows_count; $i++)\n{\n $R = $sc->nextInt();\n $G = $sc->nextInt();\n $B = $sc->nextInt();\n out::println($R);\n out::println($G);\n out::println($B);\n $RGB = $R + $G + $B;\n if($RGB % 2 == 1)\n {\n if($RGB / 2 < $R ||$RGB / 2 < $G || $RGB / 2 < $B)\n {\n out::println('No');\n }\n else\n {\n out::println('Yes');\n }\n }\n else\n {\n if($RGB / 2 < $R ||$RGB / 2 < $G || $RGB / 2 < $B)\n {\n out::println('No');\n }\n else\n {\n out::println('Yes');\n }\n }\n}\n"}, {"source_code": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n$sc = new Scanner();\n$rows_count = $sc->nextInt();\n\nfor($i = 0; $i < $rows_count; $i++)\n{\n $R = $sc->nextInt();\n $G = $sc->nextInt();\n $B = $sc->nextInt();\n out::println($R);\n out::println($G);\n out::println($B);\n $RGB = $R + $G + $B;\n if($RGB % 2 == 1)\n {\n if($RGB / 2 + 1 < $R ||$RGB / 2 + 1 < $G || $RGB / 2 + 1 < $B)\n {\n out::println('No');\n }\n else\n {\n out::println('Yes');\n }\n }\n else\n {\n if($RGB / 2 < $R ||$RGB / 2 < $G || $RGB / 2 < $B)\n {\n out::println('No');\n }\n else\n {\n out::println('Yes');\n }\n }\n}\n"}, {"source_code": "judgeOk($arr);\n fwrite(STDOUT, $steps.\"\\n\");\n }\n }\n //\u89c4\u5219\uff1a\u4fdd\u8bc1\u76f8\u90bb\u5f69\u706f\u989c\u8272\u4e0d\u540c\uff0c\u5e76\u4f7f\u7528\u5b8c\u6240\u6709\u5f69\u706f\uff0c\u7136\u540e\u6784\u6210\u82b1\u73af\u8fd4\u56detrue\uff0c\u5426\u5219\u8fd4\u56defalse\n //\u6392\u5217\u7ec4\u5408\u95ee\u9898\uff1a\u53d6\u4e24\u4e2a\u5c0f\u7684\u989c\u8272\u5f69\u706f\u6570\uff0c\u8ba1\u7b97\u4e24\u8005\u4ea7\u751f\u7684\u95f4\u9699\u6570\uff0c\u82e5\u95f4\u9699\u6570\u5927\u4e8e\u7b49\u4e8e\u7b2c\u4e09\u4e2a\u989c\u8272\u5f69\u706f\u6570\uff0c \u5219\u8fd4\u56detrue\uff0c\u5426\u5219\u8fd4\u56defalse\n public function judgeOk($arr){\n rsort($arr);\n var_dump($arr);\n $maxGaps = $arr[1] + $arr[2] + 1;\n $minGaps = $arr[1] - $arr[2] - 1;\n if($maxGaps >= $arr[0] && $minGaps <= $arr[0]){\n return \"Yes\";\n }\n return \"No\";\n }\n}\n\n$nyg = new NewYearGarland();\n$b = $nyg->main();"}, {"source_code": " 2){\n $b = false;\n }\n if(($u[1] - $u[0]) > 2){\n $b = false;\n }\n if($b){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n}"}], "src_uid": "34aa41871ee50f06e8acbd5eee94b493"} {"source_code": " 1) && ($b == 0))\n{\n print \"No solution\";\n}\nelseif($b < 10)\n{\n $c = $b;\n for($x = 1; $x < $a; $x++)\n {\n $c .= \"0\";\n }\n print $c;\n}\nelseif($b >= 10)\n{\n $d = $b % 9;\n $e = floor($b / 9);\n if(($d > 0) && ($a < (1 + $e)))\n {\n print \"No solution\";\n }\n elseif(($d == 0) && ($a < $e))\n {\n print \"No solution\";\n }\n else\n {\n $f = \"\";\n for($x = 1; $x <= $e; $x++)\n {\n $f .= \"9\";\n } \n if($d > 0)\n {\n $f .= $d;\n for($x = 1; $x <= $a - strlen($f) + 1; $x++)\n {\n $f .= \"0\";\n }\n print $f;\n }\n else\n {\n for($x = 1; $x <= $a - strlen($f); $x++)\n {\n $f .= \"0\";\n }\n print $f;\n }\n }\n}\n?>", "positive_code": [{"source_code": "1) {\n print \"No solution\";\n} else {\nif ($k>3) {\n\n if ($k%2 == 0) {\n for ($i = 0; $i <= $k-2; $i++) {\n $n = 9-$n;\n print $n;\n }\n if ($d == 9) {\n print \"1\";\n } else {\n print 1+$d;\n }\n } else {\n for ($i = 0; $i <= $k-2; $i++) {\n $n = 9-$n;\n print $n;\n }\n print $d;\n }\n\n} else {\n switch ($k) {\n case 1:\n print $d;\n break;\n case 2:\n if ($d ==9) {\n print \"81\";\n } else {\n print \"8\".$d+1;\n }\n break;\n case 3:\n print \"81\".$d;\n }\n}\n}"}, {"source_code": " 1 && $d == 0) {\n echo 'No solution';\n} else {\n echo $d;\n for ($i = 0; $i < $k-1; $i++) {\n echo 0;\n }\n}"}], "negative_code": [{"source_code": " 1 && $d == 0) {\n echo 'No solution';\n} else {\n echo $d . str_repeat(0, $k - 1);\n}"}, {"source_code": " 1 && $d == 0) {\n echo 'No solution';\n} else {\n echo $d;\n for ($i=0; $i < $k-1; $i++) {\n echo 0;\n }\n}"}, {"source_code": " 1 && $d == 0) {\n echo 'No solution';\n} else {\n echo $k . str_repeat(0, $d - 1);\n}"}, {"source_code": "3) {\n\n if ($k%2 == 0) {\n for ($i = 0; $i <= $k-2; $i++) {\n $n = 9-$n;\n print $n;\n }\n if ($d == 9) {\n print \"1\";\n } else {\n print 1+$d;\n }\n } else {\n for ($i = 0; $i <= $k-2; $i++) {\n $n = 9-$n;\n print $n;\n }\n print $d;\n }\n\n}"}, {"source_code": "3) {\n\n if ($k%2 == 0) {\n for ($i = 0; $i <= $k-2; $i++) {\n $n = 9-$n;\n print $n;\n }\n if ($d == 9) {\n print \"1\";\n } else {\n print 1+$d;\n }\n } else {\n for ($i = 0; $i <= $k-2; $i++) {\n $n = 9-$n;\n print $n;\n }\n print $d;\n }\n\n} else {\n switch ($k) {\n case 1:\n print $d;\n break;\n case 2:\n if ($d ==9) {\n print \"81\";\n } else {\n print \"8\".$d+1;\n }\n break;\n case 3:\n print \"81\".$d;\n }\n}"}], "src_uid": "5dd0d518f315d81204b25e48fea0793a"} {"source_code": " $r[1]) {\n $m++;\n } elseif ($r[1] > $r[0]) {\n $c++;\n }\n}\nif ($m > $c) {\n print \"Mishka\";\n} elseif ($c > $m) {\n print \"Chris\";\n} else {\n print \"Friendship is magic!^^\";\n}\n?>\n\n\n", "positive_code": [{"source_code": " $second) {\n $mishkaPoint++;\n } elseif ($first < $second) {\n $chrisPoint++;\n }\n}\n\nif ($mishkaPoint > $chrisPoint) {\n echo 'Mishka';\n} elseif ($mishkaPoint < $chrisPoint) {\n echo 'Chris';\n} else {\n echo 'Friendship is magic!^^';\n}\n\necho PHP_EOL;\n"}, {"source_code": " $b;\n\t\t$c += $b > $a;\n\t}\n\tif($m > $c) echo \"Mishka\";\n\telse if($m < $c) echo \"Chris\";\n\telse echo \"Friendship is magic!^^\";\n?>"}, {"source_code": " $e)\n {\n $b++;\n }\n elseif($d < $e)\n {\n $c++;\n }\n}\nif($b < $c)\n{\n print \"Chris\";\n}\nelseif($b == $c)\n{\n print \"Friendship is magic!^^\";\n}\nelseif($b > $c)\n{\n print \"Mishka\";\n}\n?>"}, {"source_code": " $p[1]) {\n\t\t$a++;\n\t}\n\telseif ($p[0] < $p[1]) {\n\t\t$b++;\n\t}\n}\nif ($a > $b) {\n\techo 'Mishka';\n}\nelseif ($a < $b) {\n\techo 'Chris';\n}\nelse echo 'Friendship is magic!^^';"}, {"source_code": "$n[1]);\necho $o == 0 ? 'Friendship is magic!^^' : ($o < 0 ? 'Mishka' : 'Chris');"}, {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$n = readNum($f);\n\t$counter = array(\n\t\t'm' => 0, 'c' => 0,\n\t);\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tlist($m, $c) = readStringExplodeNum($f, ' ', true);\n\t\tif ($m > $c) {\n\t\t\t$counter['m'] ++;\n\t\t} elseif ($m < $c) {\n\t\t\t$counter['c'] ++;\n\t\t}\n\t}\n\tif ($counter['m'] > $counter['c']) {\n\t\techo 'Mishka';\n\t} elseif ($counter['m'] < $counter['c']) {\n\t\techo 'Chris';\n\t} else {\n\t\techo 'Friendship is magic!^^';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": "$c[$i])\n\t{\n\t\t$mas++;\n\t}\n\telseif ($m[$i]<$c[$i]) {\n\t\t$cha++;\n\t\t# code...\n\t}\n\telse{\n\t\t$mas++;\n\t $cha++;\n\t}\n\n}\n\tif($mas>$cha)\n\t\techo \"Mishka\";\n\telseif ($mas<$cha) {\n\t\techo \"Chris\";\n\t}\n\telse\n\t\techo \"Friendship is magic!^^\";"}, {"source_code": " $y)\n $a++;\n else if ($x < $y)\n $b++;\n}\nif ($a > $b)\n echo \"Mishka\";\nelse if ($a < $b)\n echo \"Chris\";\nelse\n echo \"Friendship is magic!^^\";\n?>"}], "negative_code": [{"source_code": "//703a\n $p[1]) {\n\t\t$a++;\n\t}\n\telseif ($p[0] < $p[1]) {\n\t\t$b++;\n\t}\n}\nif ($a > $b) {\n\techo 'Mishka';\n}\nelseif ($a < $b) {\n\techo 'Chris';\n}\nelse echo 'Friendship is magic!^^';"}, {"source_code": " $c) {\n print \"Mishka\";\n} elseif ($c > $m) {\n print \"Chris\";\n} else {\n print \"Friendship is magic!^^\";\n}\n?>\n\n\n"}, {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$n = readNum($f);\n\t$counter = array(\n\t\t'm' => 0, 'c' => 0,\n\t);\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tlist($m, $c) = readStringExplodeNum($f, ' ', true);\n\t\tif ($m > $c) {\n\t\t\t$counter['m'] ++;\n\t\t} else {\n\t\t\t$counter['c'] ++;\n\t\t}\n\t}\n\tif ($counter['m'] > $counter['c']) {\n\t\techo 'Mishka';\n\t} elseif ($counter['m'] < $counter['c']) {\n\t\techo 'Chris';\n\t} else {\n\t\techo 'Friendship is magic!^^';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": " $y)\n $a++;\n else if ($x < $y)\n $b++;\n}\nif ($a > $b)\n echo \"Mishka\";\nelse if ($a < $b)\n echo \"Chris\";\nelse\n echo \"Friendship is magic!^^\";\n?>"}, {"source_code": " $y)\n $a++;\n else if ($x < $y)\n $b++;\n}\nif ($a > $b)\n echo \"Mishka\";\nelse if ($a < $b)\n echo \"Chris\";\nelse\n echo \"Friendship is magic!^^\";\n?>"}], "src_uid": "76ecde4a445bbafec3cda1fc421e6d42"} {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}], "negative_code": [{"source_code": ""}], "src_uid": "53a3313f5d6ce19413d72473717054fc"} {"source_code": " 0)\n{\n for($x = 0; $x < $a; $x++)\n {\n if($g[$x] == NULL)\n {\n if($f == 0)\n {\n print $c[$x] . \"\\n\";\n }\n else\n {\n print ($c[$x] - 1) . \"\\n\";\n $f--;\n }\n }\n else\n {\n print $c[$x] . \"\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " 0; $i++) {\n if ($ceil[$i] === false) {\n $arr[$i]--;\n $sum--;\n }\n}\necho implode(PHP_EOL, $arr);\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 0)\n{\n for($x = 0; $x < $a; $x++)\n {\n if($f == 0)\n {\n print $c[$x] . \"\\n\";\n }\n else\n {\n print ($c[$x] - 1) . \"\\n\";\n $f--;\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": " 0)\n{\n for($x = 0; $x < $a; $x++)\n {\n if($g[$x] == NULL)\n {\n if($f == 0)\n {\n print $c[$x] . \"\\n\";\n }\n else\n {\n print ($c[$x] - 1) . \"\\n\";\n $f--;\n }\n }\n else\n {\n print \"0\\n\";\n }\n }\n}\n?>"}, {"source_code": " 0; $i++, $sum--) {\n $arr[$i]--;\n}\necho implode(PHP_EOL, $arr);\n"}, {"source_code": " 0) {\n $arr[] = (int)ceil($value);\n } else {\n $arr[] = (int)floor($value);\n\n }\n}\n$sum = array_sum($arr);\nfor ($i = 0; $i < $n && $sum > 0; $i++, $sum--) {\n if ($arr[$i] > 0) {\n $arr[$i]--;\n } else {\n $arr[$i]++;\n }\n}\necho implode(PHP_EOL, $arr);\n"}], "src_uid": "6059cfa13594d47b3e145d7c26f1b0b3"} {"source_code": "", "positive_code": [{"source_code": " ord($s[0])) {\r\n $t1 = ord($s[1]) - ord($s[0]) ;\r\n } else {\r\n $t1 = ord($s[1]) - ord($s[0]) + 1;\r\n }\r\n } else {\r\n $t1 = ord($s[1]) - ord($s[0]); \r\n }\r\n \r\n $ans = $t0 + $t1 ;\r\n \r\n \r\n echo $ans, $inter;\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 } "}, {"source_code": ""}], "negative_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 } "}], "src_uid": "2e3006d663a3c7ad3781aba1e37be3ca"} {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\tlist($n, $a) = readStringExplodeNum($f, ' ', true);\n\t$points = readStringExplodeNum($f, ' ', true);\n\tsort($points);\n\n\tif ($n < 2) {\n\t\techo 0;\n\t\treturn;\n\t}\n\t$points1 = $points2 = $points3 = $points4 = $points;\n\n\tarray_pop($points1);\n\tarray_unshift($points1, $a);\n\n\tarray_shift($points2);\n\tarray_unshift($points2, $a);\n\n\tarray_shift($points3);\n\tarray_push($points3, $a);\n\n\tarray_pop($points4);\n\tarray_push($points4, $a);\n\n\t$paths = array();\n\t$len = count($points);\n\tfor ($i = 1; $i < $len; $i++) {\n\t\t$paths[0]+=abs($points1[$i] - $points1[$i - 1]);\n\t\t$paths[1]+=abs($points2[$i] - $points2[$i - 1]);\n\t\t$paths[2]+=abs($points3[$i] - $points3[$i - 1]);\n\t\t$paths[3]+=abs($points4[$i] - $points4[$i - 1]);\n\t}\n\techo min($paths);\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": "solve(array_reverse($l), array_reverse($r));\n echo $result . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->run();\n\n"}, {"source_code": " $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b), ($g - $b) * 2 + ($b - $e));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f), ($b - $f) * 2 + ($h - $b));\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f), ($b - $f) * 2 + ($h - $b), ($g - $b) * 2 + ($b - $e));\n }\n}\n?>"}], "negative_code": [{"source_code": " $e)\n {\n print $b - $e;\n }\n}\nelseif($a == 2)\n{\n if($b < $e)\n {\n print $e - $b;\n }\n elseif($b == $e)\n {\n print $b;\n }\n elseif($b == $f)\n {\n print $b;\n }\n elseif($b > $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f));\n }\n}\n?>"}, {"source_code": " $f))\n {\n $f = $c[$x];\n $h = $c[$x];\n }\n if(($c[$x] > $d) && ($c[$x] < $g))\n {\n $g = $c[$x];\n $i = $c[$x];\n }\n}\nif(count(array_unique($c)) == 1)\n{\n print abs($b - $c[0]);\n}\nelseif($b <= $d)\n{\n print abs($f - $b);\n}\nelseif($b >= $e)\n{\n print abs($b - $e);\n}\nelse\n{\n if($a == 2)\n {\n $j = abs($e - $b);\n $k = abs($b - $d);\n print min($j, $k);\n }\n else\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r);\n }\n}\n?>"}, {"source_code": " $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f), ($b - $f) * 2 + ($h - $b));\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f), ($b - $f) * 2 + ($h - $b), ($g - $b) * 2 + ($b - $e));\n }\n}\n?>"}, {"source_code": " $f))\n {\n $f = $c[$x];\n $h = $c[$x];\n }\n if(($c[$x] > $d) && ($c[$x] < $g))\n {\n $g = $c[$x];\n $i = $c[$x];\n }\n}\nif(count(array_unique($c)) == 1)\n{\n print abs($b - $c[0]);\n}\nelseif($b <= $d)\n{\n print abs($f - $b);\n}\nelseif($b >= $e)\n{\n print abs($b - $g);\n}\nelse\n{\n if($a == 2)\n {\n $j = abs($e - $b);\n $k = abs($b - $d);\n print min($j, $k);\n }\n else\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r);\n }\n}\n?>"}, {"source_code": " $f))\n {\n $f = $c[$x];\n $h = $c[$x];\n }\n if(($c[$x] > $d) && ($c[$x] < $g))\n {\n $g = $c[$x];\n $i = $c[$x];\n }\n}\nif(count(array_unique($c)) == 1)\n{\n print abs($b - $c[0]);\n}\nelseif($b <= $d)\n{\n print abs($f - $b);\n}\nelseif($b >= $e)\n{\n print abs($b - $g);\n}\nelse\n{\n if($a == 2)\n {\n $j = abs($e - $b);\n $k = abs($b - $d);\n print min($j, $k);\n }\n else\n {\n if($b < $i)\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r, abs($e - $b));\n }\n elseif($b > $h)\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r, abs($b - $d));\n }\n else\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r);\n }\n }\n}\n?>"}, {"source_code": " $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f), ($b - $f) * 2 + ($h - $b), ($g - $b) * 2 + ($b - $e));\n }\n}\n?>"}, {"source_code": " $e)\n {\n print $b - $e;\n }\n}\nelseif($a == 2)\n{\n if($b < $e)\n {\n print $e - $b;\n }\n elseif($b == $e)\n {\n print $b;\n }\n elseif($b == $f)\n {\n print $b;\n }\n elseif($b > $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f), ($b - $f) * 2 + ($h - $b), ($g - $b) * 2 + ($b - $e));\n }\n}\n?>"}, {"source_code": " $f))\n {\n $f = $c[$x];\n $h = $c[$x];\n }\n if(($c[$x] > $d) && ($c[$x] < $g))\n {\n $g = $c[$x];\n $i = $c[$x];\n }\n}\nif(count(array_unique($c)) == 1)\n{\n print abs($b - $c[0]);\n}\nelseif($b <= $i)\n{\n print abs($e - $b);\n}\nelseif($b >= $h)\n{\n print abs($b - $h);\n}\nelseif($b <= $d)\n{\n print abs($f - $b);\n}\nelseif($b >= $e)\n{\n print abs($b - $g);\n}\nelse\n{\n if($a == 2)\n {\n $j = abs($e - $b);\n $k = abs($b - $d);\n print min($j, $k);\n }\n else\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r);\n }\n}\n?>"}, {"source_code": " $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f), ($b - $f) * 2 + ($h - $b), ($g - $b) * 2 + ($b - $e));\n }\n}\n?>"}, {"source_code": " $e)\n {\n print $b - $e;\n }\n}\nelseif($a == 2)\n{\n if($b < $e)\n {\n print $e - $b;\n }\n elseif($b == $e)\n {\n print $b;\n }\n elseif($b == $f)\n {\n print $b;\n }\n elseif($b > $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n if($a == 353)\n {\n print \"1\\n\";\n }\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n if($a == 353)\n {\n print \"2\\n\";\n }\n }\n elseif($b >= $h)\n {\n print $b - $f;\n if($a == 353)\n {\n print \"3\\n\";\n }\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n if($a == 353)\n {\n print \"4\\n\";\n }\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f));\n }\n}\n?>"}, {"source_code": " $e)\n {\n print $b - $e;\n }\n}\nelseif($a == 2)\n{\n if($b < $e)\n {\n print $e - $b;\n }\n elseif($b == $e)\n {\n print $b;\n }\n elseif($b == $f)\n {\n print $b;\n }\n elseif($b > $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b == $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n }\n elseif($b == $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f));\n }\n}\n?>"}, {"source_code": " $e)\n {\n print $b - $e;\n }\n}\nelseif($a == 2)\n{\n if($b < $e)\n {\n print $e - $b;\n }\n elseif($b == $e)\n {\n print $b;\n }\n elseif($b == $f)\n {\n print $b;\n }\n elseif($b > $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n }\n elseif($b >= $h)\n {\n print $b - $f;\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f));\n }\n}\n?>"}, {"source_code": " $e)\n {\n print $b - $e;\n }\n}\nelseif($a == 2)\n{\n if($b < $e)\n {\n print $e - $b;\n }\n elseif($b == $e)\n {\n print $b;\n }\n elseif($b == $f)\n {\n print $b;\n }\n elseif($b > $f)\n {\n print $b - $f;\n }\n else\n {\n print min($b - $e, $f - $b);\n }\n}\nelse\n{\n if($b <= $e)\n {\n print $g - $b;\n if($a == 353)\n {\n print \"1\\n\";\n }\n }\n elseif($b <= $f)\n {\n print min($h - $b, ($b - $e) * 2 + ($g - $b));\n if($a == 353)\n {\n print \"2\\n\";\n }\n }\n elseif($b >= $h)\n {\n print $b - $f;\n if($a == 353)\n {\n print \"3\\n\";\n }\n }\n elseif($b >= $g)\n {\n print min($b - $e, ($h - $b) * 2 + ($b - $f));\n if($a == 353)\n {\n print \"4\\n\";\n }\n }\n else\n {\n print min(($b - $e) * 2 + ($g - $b), ($h - $b) * 2 + ($b - $f));\n if($a == 353)\n {\n print \"5\\n\";\n }\n }\n}\n?>"}, {"source_code": " $f))\n {\n $f = $c[$x];\n $h = $c[$x];\n }\n if(($c[$x] > $d) && ($c[$x] < $g))\n {\n $g = $c[$x];\n $i = $c[$x];\n }\n}\nif($b <= $d)\n{\n print abs(abs($f) - abs($b));\n}\nelseif($b >= $e)\n{\n print abs(abs($b) - abs($e));\n}\nelse\n{\n if($a == 2)\n {\n $j = abs(abs($e) - abs($b));\n $k = abs(abs($b) - abs($d));\n print min($j, $k);\n }\n else\n {\n $j = abs(abs($e) - abs($b));\n $k = abs(abs($b) - abs($i));\n $l = abs(abs($b) - abs($d));\n $m = abs(abs($h) - abs($b));\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n print min($n, $o);\n }\n}\n?>"}, {"source_code": " $f))\n {\n $f = $c[$x];\n $h = $c[$x];\n }\n if(($c[$x] > $d) && ($c[$x] < $g))\n {\n $g = $c[$x];\n $i = $c[$x];\n }\n}\nif(count(array_unique($c)) == 1)\n{\n print abs($b - $c[0]);\n}\nelseif($b <= $d)\n{\n print abs($f - $b);\n}\nelseif($b >= $e)\n{\n print abs($b - $g);\n}\nelse\n{\n if($a == 2)\n {\n $j = abs($e - $b);\n $k = abs($b - $d);\n print min($j, $k);\n }\n else\n {\n if($b <= $i)\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r, abs($e - $b));\n }\n elseif($b >= $h)\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r, abs($b - $d));\n }\n else\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n $p = $j + $k + $k;\n $r = $l + $m + $m;\n print min($n, $o, $p, $r);\n }\n }\n}\n?>"}, {"source_code": " $f))\n {\n $f = $c[$x];\n $h = $c[$x];\n }\n if(($c[$x] > $d) && ($c[$x] < $g))\n {\n $g = $c[$x];\n $i = $c[$x];\n }\n}\nif(count(array_unique($c)) == 1)\n{\n print abs($b - $c[0]);\n}\nelseif($b <= $d)\n{\n print abs($f - $b);\n}\nelseif($b >= $e)\n{\n print abs($b - $e);\n}\nelse\n{\n if($a == 2)\n {\n $j = abs($e - $b);\n $k = abs($b - $d);\n print min($j, $k);\n }\n else\n {\n $j = abs($e - $b);\n $k = abs($b - $i);\n $l = abs($b - $d);\n $m = abs($h - $b);\n $n = $j + $j + $k;\n $o = $l + $l + $m;\n print min($n, $o);\n }\n}\n?>"}, {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\tlist($n, $a) = readStringExplodeNum($f, ' ', true);\n\t$points = readStringExplodeNum($f, ' ', true);\n\tsort($points);\n\t$toFirst = abs($points[0] - $a);\n\t$toEnd = abs($points[count($points) - 1] - $a);\n\t$path = 0;\n\tif ($toFirst <= $toEnd) {\n\t\tarray_pop($points);\n\t\t$path = $toFirst;\n\t} else {\n\t\tarray_shift($points);\n\t\t$path = $toEnd;\n\t}\n\n\t$len = count($points);\n\tfor ($i = 1; $i < $len; $i++) {\n\t\t$path += $points[$i] - $points[$i - 1];\n\t}\n\techo $path;\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": "calc(array_slice($l, 0, -1), $r), $this->calc(array_slice($r, 0, -1), $l));\n }\n\n public function run()\n {\n fscanf(STDIN, '%d %d', $n, $a);\n $arr = explode(' ', trim(fgets(STDIN)));\n\n echo $this->solve($arr, $n, $a) . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->run();\n\n"}], "src_uid": "7807c484035e0327870b6cac23c8d60a"} {"source_code": "", "positive_code": [{"source_code": "= $b[1] + $b[2])\n {\n print ($b[1] + $b[2]) . \"\\n\";\n }\n else\n {\n print floor(($b[0] + $b[1] + $b[2]) / 2) . \"\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": " $d) && ($b2[1] > $e))\n {\n $c++;\n }\n elseif(($b2[0] > $e) && ($b2[1] > $d))\n {\n $c++;\n }\n }\n }\n elseif(($b[0] == 0) && ($b[1] != 0) && ($b[2] == 0))\n {\n $d = floor($b[1] / 2);\n $e = ceil($b[1] / 2);\n if(($d != 0) && ($e != 0))\n {\n if(($b2[0] > $d) && ($b2[2] > $e))\n {\n $c++;\n }\n elseif(($b2[0] > $e) && ($b2[2] > $d))\n {\n $c++;\n }\n }\n }\n elseif(($b[0] != 0) && ($b[1] == 0) && ($b[2] == 0))\n {\n $d = floor($b[0] / 2);\n $e = ceil($b[0] / 2);\n if(($d != 0) && ($e != 0))\n {\n if(($b2[1] > $d) && ($b2[2] > $e))\n {\n $c++;\n }\n elseif(($b2[1] > $e) && ($b2[2] > $d))\n {\n $c++;\n }\n }\n }\n print $c . \"\\n\";\n}\n?>"}], "src_uid": "1f29461c42665523d0a4d56b13f7e480"} {"source_code": "= ($n - 1 - $r)) $sum = 1;\r\n elseif ($k >= $l) $sum = 10;\r\n } else {\r\n if (is_numeric($r) && ($n - 1 - $r) > 0 && $k >= ($n - 1 - $r)) {\r\n $k -= $n - 1 - $r;\r\n $sum -= 10;\r\n }\r\n if ($l > 0 && $k >= $l) {\r\n $sum -= 1;\r\n }\r\n }\r\n echo $sum, \"\\n\";\r\n}", "positive_code": [{"source_code": " 0) {\r\n $ans = 11 * $count;\r\n $l=0;\r\n $r = $n-1;\r\n while ($s[$l] == '0') {\r\n $l += 1;\r\n }\r\n while ($s[$r] == '0') {\r\n $r -= 1;\r\n }\r\n $r = $n-1-$r;\r\n if($count == 1) {\r\n if($r<=$k) {\r\n $ans -= 10;\r\n } else {\r\n if($l <= $k) {\r\n $ans -= 1;\r\n }\r\n } \r\n } else {\r\n if ($l + $r <= $k) {\r\n $ans -= 11;\r\n } else {\r\n if ($r <= $k) {\r\n $ans -= 10;\r\n } else {\r\n if ($l <= $k) {\r\n $ans -= 1;\r\n }\r\n }\r\n }\r\n }\r\n \r\n }\r\n // var_dump($a);\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 = ($n - 1 - $r)) $sum = 1;\r\n elseif ($k >= $l) $sum = 10;\r\n } else {\r\n if (is_numeric($r) && ($n - 1 - $r) > 0 && $k >= ($n - 1 - $r)) {\r\n $k -= $n - 1 - $r;\r\n $sum -= 10;\r\n }\r\n if ($l > 0 && $k >= $l) {\r\n $sum -= 1;\r\n }\r\n }\r\n echo $sum, \"\\n\";\r\n}"}, {"source_code": " 0 && $k >= ($n - 1 - $r)) {\r\n $k -= $n - 1 - $r;\r\n $sum -= 10;\r\n if (0 == $l && $l === $r) $sum += 1;\r\n }\r\n if ($l > 0 && $l < $r && $k >= $l) {\r\n $sum -= 1;\r\n }\r\n echo $sum, \"\\n\";\r\n}"}, {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $item) {\n if ($item === $abc) {\n unset($values[$i]);\n } else {\n $values[$i] = $abc - $item;\n }\n}\necho implode(' ', $values);\n"}, {"source_code": " $value) {\n $array[$key] = (int) $value;\n if ($value > $max) {\n $maxKey = $key;\n $max = $value;\n }\n}\n\n$result = [];\nforeach ($array as $key => $value) {\n if ($key != $maxKey) {\n $result[] = $max - $value;\n }\n}\necho implode(' ', $result);"}, {"source_code": " "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "3) echo \" \";\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $v) {\n if ($k == 0) {\n $max = $v;\n } else {\n $r[] = $max - $v;\n }\n }\n echo implode(\" \", $r);\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "a18edcadb31f76e69968b0a3e1cb7e3e"} {"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\n$n = $ir->readInt();\n$a = $ir->readArrayOfInt($n);\n\nsort($a);\n\necho ($a[$n-1]- $a[0] - max([$a[$n-1] - $a[$n-2], $a[1] - $a[0]]));\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n{\n\t$result = min($one_num, $two_num);\n\t$one_num -= $result;\n}\n\n$result += floor($one_num / 3);\n\necho $result;\n", "positive_code": [{"source_code": " $d)\n{\n $e = $c - $d;\n $f = floor($e / 3);\n print $f + $d;\n}\n?>"}], "negative_code": [], "src_uid": "6c9cbe714f8f594654ebc59b6059b30a"} {"source_code": "\")\n {\n $d++;\n $e = 1;\n }\n elseif($b[$x] == \"<\")\n {\n $d = 0;\n }\n}\nprint $c + $d;\n?>", "positive_code": [{"source_code": "\");\n $intSR = strpos($S, \"<\");\n $intEL = strrpos($S, \"<\");\n $intER = strrpos($S, \">\");\n\n // var_dump($intSL);\n // var_dump($intSR);\n // var_dump($intEL);\n // var_dump($intER);\n\n $ans = 0;\n if ($intSL === false || $intSR === false || $intEL === false || $intER === false) {\n $ans = $N;\n } else {\n if ($intSR < $intSL) {\n $ans += $intSL;\n }\n\n if ($intER > $intEL) {\n $ans += $N - $intEL - 1;\n }\n }\n\n echo $ans;\n\n"}], "negative_code": [{"source_code": "');\n\n\techo abs($l - $r);\n"}, {"source_code": "\");\n $intSR = strpos($S, \"<\");\n $intEL = strrpos($S, \"<\");\n $intER = strrpos($S, \">\");\n\n // var_dump($intSL);\n // var_dump($intSR);\n // var_dump($intEL);\n // var_dump($intER);\n\n $ans = 0;\n if ($intSL === false || $intSR === false || $intEL === false || $intER === false) {\n $ans = $N;\n } else {\n if ($intSR < $intSL) {\n $ans += $intSL;\n }\n\n if ($intER > $intEL) {\n $ans += $intER;\n }\n }\n\n echo $ans;\n\n"}], "src_uid": "6b4242ae9a52d36548dda79d93fe0aef"} {"source_code": " 1)\n\t\t{\n\t\t\t$m = $l + floor(($r - $l) / 2);\n\t\t\tif($skill[$m] < $skill[$i])\n\t\t\t{\n\t\t\t\t$l = $m;\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r = $m;\n\t\t\t}\n\t\t}\t\t\n\t\n\t\t$r = $skill[$l] < $skill[$i] ? $r : $l;\n\n\t$count = $r;\t\n\t\n\t$progId = $prog[$i];\n\t\n\tif(isset($arg[$progId]))\n\t{\n\t\tfor($j = 0; $j < count($arg[$progId]); $j++)\n\t\t{\n\t\t\tif($skill[$backProg[$arg[$progId][$j]]] < $skill[$i])\n\t\t\t{\n\t\t\t\t$count--;\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\t$pos[$progId] = $count;\n}\n\necho implode(' ', $pos);\n", "positive_code": [{"source_code": " $c[$j - 1])\n {\n $h[$i - 1]--;\n }\n }\n}\nprint implode(\" \", $h);\n?>"}], "negative_code": [{"source_code": " 1)\n\t{\n\t\twhile($r - $l > 1)\n\t\t{\n\t\t\t$m = $l + floor(($r - $l) / 2);\n\t\t\tif($skill[$m] < $skill[$i])\n\t\t\t{\n\t\t\t\t$l = $m;\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r = $m;\n\t\t\t}\n\t\t}\t\t\n\t}\n\telse\n\t{\n\t\t$r = $skill[$l] < $skill[$i] ? $r : $l;\n\t}\n\n\t$count = $r;\t\n\t\n\t$progId = $prog[$i];\n\t\n\tif(isset($arg[$progId]))\n\t{\n\t\tfor($j = 0; $j < count($arg[$progId]); $j++)\n\t\t{\n\t\t\tif($skill[$backProg[$arg[$progId][$j]]] < $skill[$i])\n\t\t\t{\n\t\t\t\t$count--;\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\t$pos[$progId] = $count;\n}\n\necho implode(' ', $pos);\n"}], "src_uid": "4687176445ed1087864b081a181e1840"} {"source_code": " $value)\r\n\tprint($value.\"\\r\\n\");\r\n$end = readline();\r\n?>", "positive_code": [{"source_code": " $value)\r\n\tprint($value.\"\\r\\n\");\r\n$end = readline();\r\n?>"}], "negative_code": [{"source_code": " $value)\r\n print($value);\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"}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n"}, {"source_code": "');\r\n// unset($arr_split[$i + 1]);\r\n\r\n// $z++;\r\n// } else {\r\n// $m--;\r\n// $o++;\r\n// $t = $arr_split[$i + 1];\r\n// }\r\n// }\r\n\r\n\r\n// $r = implode($arr_split);\r\n// for ($d = 0; $d < strlen($r); $d++) {\r\n// $x = substr_count($r, $r[$d]);\r\n// if ($x % 2 != 0) {\r\n// if (!in_array($r[$d], $arr2)) {\r\n// array_push($arr2, $r[$d]);\r\n// $z++;\r\n// }\r\n// }\r\n// }\r\n\r\n// echo $z . '
';\r\n// }\r\n// Get_an_Even_String(\"bmefbmuyw\");\r\n\r\n// --------------------------------------------------------------\r\n\r\nfunction Deletions_of_Two_Adjacent_Letters($str, $char)\r\n{\r\n $x = strlen($str) / 2;\r\n // echo $x;\r\n if ($str[intval($x)] == $char) {\r\n echo \"YES\";\r\n } else {\r\n echo \"NO\";\r\n }\r\n}\r\nDeletions_of_Two_Adjacent_Letters(\"contest\", 't');\r\n"}, {"source_code": "$s = file_get_contents('php://9');"}], "src_uid": "c569b47cf80dfa98a7105e246c3c1e01"} {"source_code": "", "positive_code": [{"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": " $sV){\n if($sV == '.'){\n $iNullPointer++;\n }\n }\n}\nif($iNullPointer % 5 !== 0){\n echo \"NO\";\n exit;\n}\n$bFlag = false;\nfor($i = 0; $i< $n - 2; $i++){\n for($j = 1; $j< $n - 1; $j++){\n if($aDesc[$i][$j] == '.' && $aDesc[$i+1][$j-1] == '.' &&\n $aDesc[$i+1][$j] == '.' && $aDesc[$i+1][$j+1] == '.'\n && $aDesc[$i+2][$j] == '.'){\n $aDesc[$i][$j] = '#';\n $aDesc[$i+1][$j-1] = '#';\n $aDesc[$i+1][$j] = '#';\n $aDesc[$i+1][$j+1] = '#';\n $aDesc[$i+2][$j] = '#';\n }\n }\n}\n\n$iNullPointer2 = 0;\nforeach ($aDesc as $aArr){\n foreach ($aArr as $sK => $sV){\n if($sV == '.'){\n $iNullPointer2++;\n }\n }\n}\nif (!$iNullPointer2){\n echo \"YES\";\n} else {\n echo \"NO\";\n}\n\n"}], "negative_code": [{"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": " 2)\n {\n $j = 2;\n }\n array_push($k, $j);\n }\n}\n$l = array_sum($k);\nprint $l + 2;\n?>", "positive_code": [{"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 '';\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 *****************************************************/\nlist($n, $t) = explode(' ', g());\n\n$lines = array();\nfor ($i = 0; $i < $n; $i++) {\n list($k, $v) = explode(' ', g());\n $lines[$k] = $v;\n}\n\nksort($lines);\n\n$sum = 2;\n\n$x0 = null;\n$a0 = null;\nforeach ($lines as $x => $a) {\n if (!is_null($x0)) {\n $distance = $x - $x0 - ($a + $a0) / 2 - $t;\n\n if($distance == 0) {\n $sum++;\n } else if($distance > 0) {\n $sum += 2;\n }\n }\n\n $x0 = $x;\n $a0 = $a;\n}\n\necho $sum;\n\n?>"}], "negative_code": [{"source_code": " 2)\n {\n $j = 2;\n }\n array_push($k, $j);\n }\n}\n$l = array_sum($k);\nprint $l + 2;\n?>"}, {"source_code": ""}], "src_uid": "c31fed523230af1f904218b2fe0d663d"} {"source_code": "= 0; --$j) {\r\n --$max;\r\n $max < $a[$j] && $max = $a[$j];\r\n $max > 0 && $b[$j] = 1;\r\n }\r\n echo implode(' ', $b).PHP_EOL;\r\n}\r\n", "positive_code": [{"source_code": "= 0; $i--) {\n\t\t\tif ($i - $a[$i] < $low) {\n\t\t\t\t$low = $i - $a[$i];\n\t\t\t}\n\t\t\tif ($i > $low) {\n\t\t\t\t$k[$i] = 1;\n\t\t\t} else {\n\t\t\t\t$k[$i] = 0;\n\t\t\t}\n\t\t}\n\t\tfor ($i = 0; $i < $n; $i++) {\n\t\t\tprint $k[$i].($i == $n-1 ? \"\\n\" : \" \");\n\t\t}\n\t}\n?>"}, {"source_code": " 0 && $c < $n) { \r\n $h = 1;\r\n $k++;\r\n $m--; \r\n $c++;\r\n $m = max($m, $a[$k]); \r\n $str .= ' 1'; \r\n if ($m == 0) { $j = $k - 1; break; }\r\n }\r\n \r\n if ($h == 0 && $c < $n) { $str .= ' 0'; $c++; }\r\n }\r\n \r\n echo strrev($str).PHP_EOL;\r\n}\r\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": "= 0; $j--) {\r\n if (isset($b[$j])) { echo $b[$j].' '; }\r\n else { echo '0 '; }\r\n }\r\n echo PHP_EOL;\r\n}\r\n?>"}, {"source_code": "= 0; $j--) {\r\n if (isset($b[$j])) { echo $b[$j].' '; }\r\n else { echo '0 '; }\r\n }\r\n echo PHP_EOL;\r\n}\r\n?>"}, {"source_code": "= 0; --$j) {\r\n --$amax;\r\n if ($a[$j] > 0 && $amax < $a[$j]) {\r\n $amax = $a[$j];\r\n if ($j > $a[$j]) {\r\n $m = $j - $a[$j] + 1;\r\n for ($k = $j; $k >= $m; --$k) {\r\n $ans[$k] = 1;\r\n }\r\n }\r\n }\r\n }\r\n echo implode(' ', $ans).PHP_EOL;\r\n}\r\n"}], "src_uid": "807c5ec37b0ea83ef40550698f1ff498"} {"source_code": "1)\n\t{\n\t\t$str1=str_replace('*','',$s);\n //print_r($str2);\n $count1=0;\n for ($i=0; $i 1)\n {\n $str1=str_replace('*','',$s);\n \n $count2=0;\n $j=strlen($t)-1;\n\n for ($i=0; $i =0; $i--)\n\t\t{ \n\t\t\tif($second[$i]==$t[$j])\n\t\t\t{\n\t\t\t\t$j--;\n\t\t\t\t$count2++;\n\t\t\t}\n\n\t\t}\n\t if($count1==strlen($first)&&$count2==strlen($second))\n\t\t $decision=true;\n\n\t}\n\n}\necho $decision?\"YES\":\"NO\";", "positive_code": [{"source_code": " $m) {\n\techo \"NO\";\n} else {\n\t$s1 = substr($s, 0, $pos);\n\t$s2 = substr($s, $pos + 1);\n\tif (DEBUG) {\n\t\techo \"s1: \" . $s1 . PHP_EOL;\n\t}\n\n\tif (DEBUG) {\n\t\techo \"s2: \" . $s2 . PHP_EOL;\n\t}\n\n\t$t1 = substr($t, 0, strlen($s1));\n\tif (strlen($s2) === 0) {\n\t\t$t2 = \"\";\n\t} else {\n\t\t$t2 = substr($t, -strlen($s2));\n\t}\n\tif (DEBUG) {\n\t\techo \"t1: \" . $t1 . PHP_EOL;\n\t}\n\n\tif (DEBUG) {\n\t\techo \"t2: \" . $t2 . PHP_EOL;\n\t}\n\n\tif ($s1 === $t1 && $s2 === $t2) {\n\t\techo \"YES\";\n\t} else {\n\t\techo \"NO\";\n\t}\n}\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $m) {\n\techo \"NO\";\n} else {\n\t$s1 = substr($s, 0, $pos);\n\t$s2 = substr($s, $pos + 1);\n\tif (DEBUG) {\n\t\techo $s1 . PHP_EOL;\n\t}\n\n\tif (DEBUG) {\n\t\techo $s2 . PHP_EOL;\n\t}\n\n\t$t1 = substr($t, 0, strlen($s1));\n\t$t2 = substr($t, -strlen($s2));\n\tif (DEBUG) {\n\t\techo $t1 . PHP_EOL;\n\t}\n\n\tif (DEBUG) {\n\t\techo $t2 . PHP_EOL;\n\t}\n\n\tif ($s1 === $t1 && $s2 === $t2) {\n\t\techo \"YES\";\n\t} else {\n\t\techo \"NO\";\n\t}\n}\n"}, {"source_code": "=0; $i--)\n\t\t{ \n\t\t\tif($second[$i]==$t[$j])\n\t\t\t{\n\t\t\t\t$j--;\n\t\t\t\t$count2++;\n\t\t\t}\n\n\t\t}\n\t if($count1==strlen($first)&&$count2==strlen($second))\n\t\t $decision=true;\n\n\t}\n\n}\necho $decision?\"YES\":\"NO\";"}, {"source_code": "1))\n\t{\n\t\t$str1=str_replace('*','',$s);\n\t\tif($str1==$t)\n\t\t $decision=true;\n\n\t}\n\n\telseif($s=='*')\n\t\t\t$decision=true;\n\t\n\telseif(substr_count($s,'*')!=1)\n\t{\n\t\tif($s==$t)\n\t\t\t$decision=true;\n\t}\n\n\telse\n\t{\n\t\t$str2=explode('*',$s);\n\t\t$first=$str2[0];\n\t\t$second=$str2[1];\n\n\t\t//print_r($str2);\n\t\t$count1=0;\n\t\tfor ($i=0; $i =0; $i--)\n\t\t{ \n\t\t\tif($second[$i]==$t[$j])\n\t\t\t{\n\t\t\t\t$j--;\n\t\t\t\t$count2++;\n\t\t\t}\n\n\t\t}\n\t if($count1==strlen($first)&&$count2==strlen($second))\n\t\t $decision=true;\n\n\t}\n\n}\necho $decision?\"YES\":\"NO\";"}, {"source_code": "=0; $i--)\n\t\t{ \n\t\t\tif($second[$i]==$t[$j])\n\t\t\t{\n\t\t\t\t$j--;\n\t\t\t\t$count2++;\n\t\t\t}\n\n\t\t}\n\t if($count1==strlen($first)&&$count2==strlen($second))\n\t\t $decision=true;\n\n\t}\n\n}\necho $decision?\"YES\":\"NO\";"}, {"source_code": "1)\n\t{\n\t\t$str1=str_replace('*','',$s);\n //print_r($str2);\n $count1=0;\n for ($i=0; $i 1)\n {\n $str1=str_replace('*','',$s);\n \n $count2=0;\n $j=strlen($t)-1;\n\n for ($i=0; $i =0; $i--)\n\t\t{ \n\t\t\tif($second[$i]==$t[$j])\n\t\t\t{\n\t\t\t\t$j--;\n\t\t\t\t$count2++;\n\t\t\t}\n\n\t\t}\n\t if($count1==strlen($first)&&$count2==strlen($second))\n\t\t $decision=true;\n\n\t}\n\n}\necho $decision?\"YES\":\"NO\";"}, {"source_code": "=0; $i--)\n\t\t{ \n\t\t\tif($second[$i]==$t[$j])\n\t\t\t{\n\t\t\t\t$j--;\n\t\t\t\t$count2++;\n\t\t\t}\n\n\t\t}\n\t if($count1==strlen($first)&&$count2==strlen($second))\n\t\t $decision=true;\n\n\t}\n\n}\necho $decision?\"YES\":\"NO\";"}], "src_uid": "d629d09782a7af0acc359173ac4b4f0a"} {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "99e5c907b623c310d6f1599f485ca21d"} {"source_code": " $h) $w++;\n\necho $w;", "positive_code": [{"source_code": "$height)\n $r+=2;\n else\n $r+=1;\n}\necho $r;"}, {"source_code": ""}, {"source_code": " $height ? 2 : 1;\n}\n\necho $result;\n"}, {"source_code": " $pieces[1]){\n $output = $output+2;\n }else{\n $output += 1;\n }\n }\n\n echo \"\\n\". $output;\n?>\n"}, {"source_code": " $h) {\n $w += 2;\n } else {\n $w += 1;\n }\n}\n\necho $w;\n\n?>"}, {"source_code": " (int)$h ){\n $width += 2;\n }else{\n $width+=1;\n }\n}\necho $width;"}, {"source_code": " (int)$h ){\n $width += 2;\n }else{\n $width += 1;\n }\n}\necho $width;"}, {"source_code": "fence[1];\n\nforeach ($input->heights as $key => $height) {\n $width += ($height > $fence) ? 2 : 1;\n}\n\necho $width . \"\\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]] = explode(' ', trim(fgets(STDIN)));\n }\n }\n\n public function __get($name)\n {\n return $this->inputs[$name];\n }\n}\n"}, {"source_code": " $h){\n $k = $k+2;\n }\n else $k = $k+1;\n }\n echo $k;"}, {"source_code": " $h) {\n $w += 2;\n } else {\n $w += 1;\n }\n}\nprint $w;\n?>\n\n"}, {"source_code": " $s) {\n $w += 2;\n }\n else {\n $w += 1;\n }\n }\n\n echo $w;\n\n if (++$COUNT > 1) {\n break;\n }\n}\n"}, {"source_code": " $h ? 2 : 1;\n\t$total += $s;\n}\necho $total;\n\n?>"}, {"source_code": " n, 1 => h]\n$ans = 0;\n\narray_map(function($item) {\n global $ans, $row;\n $ans += intval($item) > intval($row[1]) ? 2 : 1;\n}, explode(' ', fgets($in)));\n\necho $ans;\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $h) {\n $ans += 2;\n } else {\n $ans++;\n }\n }\n fprintf(STDOUT, \"%d\\n\", $ans);\n?>\n "}, {"source_code": "$h){\n\t\t$w+=1;\n\t}\n}\necho $w;\n\n\n\n?>"}, {"source_code": " $fenceHeight) {\n $answer += 2;\n } else {\n $answer += 1;\n }\n}\n\necho $answer . PHP_EOL;\n"}, {"source_code": " $fenceHeight){\n\t\t$roadWidth += 2;\n\t} else {\n\t\t$roadWidth++;\t\n\t}\n}\n\nprint_r($roadWidth);"}, {"source_code": " $h ? 2: 1;\necho $ans;\n?>"}, {"source_code": " $h ? 2: 1;\nprint $ans;"}, {"source_code": " $zabor[1]) {\n $counter += 2;\n } else $counter++;\n}\necho $counter;"}, {"source_code": ""}], "negative_code": [{"source_code": " $pieces[1]){\n $output = $output+2;\n }else{\n $output += 1;\n }\n }\n\n echo \"\\n\". $output;\n?>\n"}, {"source_code": " $h ){\n $width = $width + 2;\n }else{\n $width ++;\n }\n}\necho $width;"}, {"source_code": " $h ){\n $width = $width + 2;\n }else{\n $width ++;\n }\n}\necho $width;\n\n\n\n"}, {"source_code": " (int)$h ){\n $width += 2;\n }else{\n $width+=1;\n }\n}\n\necho $width;\n"}, {"source_code": "php\n$n = readline();\n$height_friends = readline();\n//$n = '3 7';\n$quantity = $n[0];\n$height_fence = $n[-1];\n//$height_friends = '4 5 14';\n$height_friends = explode(' ', $height_friends);\n$sum = 0;\nforeach ($height_friends as $v){\n if ($v <= $height_fence ){\n $sum++;\n } else {\n $sum = $sum + 2;\n }\n}\necho $sum;"}, {"source_code": ""}], "src_uid": "e7ed5a733e51b6d5069769c3b1d8d22f"} {"source_code": "", "positive_code": [{"source_code": "$n)\n\t{\n\t\t$tmp=$array2;\n\t\t$array2=$array1;\n\t\t$array1=$tmp;\n\t}\n\t$flag=0;\n for ($i=0; $i \n"}], "negative_code": [{"source_code": " $pi) {\n $fnd = 0;\n\n for ($i = 0; $i < $n[$k]; $i++) {\n $prev = ($i == 0) ? $pi[$n[$k] - 1] : $pi[$i - 1];\n $next = ($i == $n[$k] - 1) ? $pi[0] : $pi[$i + 1];\n\n if (abs($pi[$i] - $prev) != 1 || abs($next - $pi[$i]) != 1) {\n $fnd++;\n\n if ($fnd > 2) {\n break;\n }\n }\n }\n\n if ($fnd > 2) {\n echo \"NO\" . PHP_EOL;\n } else {\n echo \"YES\" . PHP_EOL;\n }\n}", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "b27436086ead93397be748d8ebdbf19a"} {"source_code": " 0) {\r\n $str = trim(fgets(STDIN));\r\n $target = (int) trim(fgets(STDIN));\r\n\r\n $ar = array(); $id = array();\r\n $val = 0;\r\n $ln = strlen($str);\r\n\r\n for ($i = 0; $i < $ln; $i++) {\r\n $ar[] = $str[$i];\r\n $id[] = $i;\r\n $val += ord($str[$i]) - ord(\"a\") + 1;\r\n }\r\n\r\n array_multisort(\r\n $ar, SORT_DESC,\r\n $id\r\n );\r\n\r\n // var_dump($ar);\r\n // var_dump($id);\r\n // var_dump($val);\r\n\r\n $del = array();\r\n $it = 0;\r\n while ($val > $target) {\r\n $val -= ord($ar[$it]) - ord(\"a\") + 1;\r\n $del[] = $id[$it];\r\n ++$it;\r\n }\r\n\r\n // var_dump($val);\r\n // var_dump($del);\r\n\r\n sort($del);\r\n \r\n $itt = 0;\r\n for ($i = 0; $i < $ln; $i++) {\r\n if ($itt < $it) {\r\n if ($del[$itt] == $i) $itt++;\r\n else echo($str[$i]);\r\n }\r\n else echo($str[$i]);\r\n }\r\n echo \"\\n\";\r\n}", "positive_code": [{"source_code": "$v) {\r\n if($cur+$v <= $n) {\r\n $cur += $v ;\r\n $ans[$k] = chr(96+$v);\r\n }\r\n else {\r\n break ;\r\n }\r\n }\r\n ksort($ans);\r\n return implode('',$ans);\r\n}\r\n\r\n$t = (int) fgets(STDIN);\r\n$ans = [] ;\r\nwhile($t--) {\r\n $st = trim(fgets(STDIN));\r\n $n = (int) fgets(STDIN);\r\n $ans[] = solve($n,$st);\r\n}\r\nprint_r(implode(\"\\n\",$ans)) ;"}, {"source_code": " $price){\r\n\t\t\t\tbreak 2;\r\n\t\t\t}else{\r\n\t\t\t\t$price -= $now_price;\r\n\t\t\t\t$delete_array[$v] = $j;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tksort($delete_array);\r\n\t\r\n\t$now_result = implode(\"\", $delete_array);\r\n\t\r\n\t$result .= $now_result.\"\\n\";\r\n}\r\n\r\necho $result;"}], "negative_code": [], "src_uid": "cb645c794ee3916b180fc3d789cb7c27"} {"source_code": "=0){\n if ($all[$i][1]==$all[$j][0] && $all[$i][0]==$all[$j][1] && intval($all[$i][2])-intval($all[$j][2])<=$d && intval($all[$i][2])-intval($all[$j][2])>0){\n $flag=0; $z=0;\n while($z", "positive_code": [{"source_code": " $recipients) {\n foreach ($recipients as $recipient) {\n $sendTime = $recipient[1];\n $reciever = $recipient[0];\n if (isset($a[$reciever])) {\n foreach ($a[$reciever] as $hisRecievers) {\n if ($hisRecievers[0] === $sender) {\n if ((($hisRecievers[1] - $sendTime) > 0) && (($hisRecievers[1] - $sendTime) <= $d)) {\n if (!isset($r[$reciever . ' ' . $sender]) && !isset($r[$sender . ' ' . $reciever])) {\n $r[$sender . ' ' . $reciever] = 0;\n }\n }\n }\n }\n }\n }\n}\necho count($r) . \"\\n\";\nforeach ($r as $k => $v) {\n echo $k . \"\\n\";\n}"}, {"source_code": " 0) and\n ($Mes[$j]['time'] - $Mes[$i]['time'] <= $d) and\n (CheckU($Mes[$i]['sender'], $Mes[$i]['to'], $Frends))){\n\n $Frends[$FrendsCount]['a'] = $Mes[$i]['sender'];\n $Frends[$FrendsCount]['b'] = $Mes[$i]['to'];\n\n $FrendsCount++;\n\n break;\n }\n }\n}\n \necho $FrendsCount . \"\\r\\n\";\nfor($i = 0; $i < $FrendsCount; $i++){\n echo $Frends[$i]['a'] . ' ' . $Frends[$i]['b'] . \"\\r\\n\"; \n}\n?>"}, {"source_code": " 0)\n {\n foreach($arr as $user)\n {\n $diff = $t - $user[2];\n if($B == $user[0] && $A == $user[1] && $diff <= $d && $diff > 0)\n {\n $result[] = $A.' '.$B;\n }\n }\n }\n \n $arr[] = array($A, $B, $t);\n}\n\n$count = count($result);\n\n$txt = '';\n$pair = array();\n$cnt = 0;\n\nfor($i = 0; $i < $count; $i++)\n{\n $exp = explode(' ', $result[$i]);\n if(!in_array($exp[0].' '.$exp[1], $pair) && !in_array($exp[1].' '.$exp[0], $pair))\n {\n $txt.= \"\\n\".$result[$i];\n $pair[] = $result[$i];\n $cnt++;\n }\n}\n\necho $cnt;\nif($cnt > 0)\n echo $txt;\n?>"}, {"source_code": " $i)$diffTime = $messages[$j][2] - $time;\n if($i > $j)$diffTime = $time - $messages[$j][2];\n if($diffTime <= $d && $diffTime != 0) {\n $cnt++;\n $results[] = $messages[$j][0].\" \".$messages[$j][1];\n }\n }\n\n }\n}\n\n\necho $cnt . PHP_EOL;\nforeach($results as $r) {\n echo $r . PHP_EOL;\n}\n\n\n\n/*\n16 10000\nxxx petya 1\nvasya petya 2\nanya petya 5\nvasya ivan 8\nivan vasya 9\nivan anya 11\npetya vasya 13\npetya vasya 14\nanya ivan 15\nivan anya 18\nxxx anya 20\nxxx anya 21\nanya xxx 24\nanya petya 25\nanya petya 26\npetya anya 28\n\n\n2 1\na b 1\nb a 3\n\n\n2 1\na b 0\nb a 0\n */\n\n?>\n\n"}, {"source_code": " $friend[0], \"second\" => $friend[1], \"time\" => $friend[2]);\n for($j = 0 ; $j < $i ; $j++)\n {\n if($list[$j][\"first\"] == $list[$i-1][\"second\"] && $list[$j][\"second\"] == $list[$i-1][\"first\"] && ($list[$i-1][\"time\"] - $list[$j][\"time\"]) <= $d && ($list[$i-1][\"time\"] - $list[$j][\"time\"]) > 0 )\n {\n $flag = false;\n for($k = 0 ; $k < count($result) ; $k++)\n {\n if($result[$k][\"first\"] == $list[$i-1][\"first\"] && $result[$k][\"second\"] == $list[$i-1][\"second\"])\n {\n $flag = true;\n break;\n }\n else if($result[$k][\"second\"] == $list[$i-1][\"first\"] && $result[$k][\"first\"] == $list[$i-1][\"second\"])\n {\n $flag = true;\n break;\n }\n }\n if(!$flag)\n {\n $result[] = array(\"first\" => $list[$i-1][\"first\"], \"second\" => $list[$i-1][\"second\"]);\n }\n }\n }\n}\necho count($result).\"\\n\";\nfor($i = 0 ; $i < count($result) ; $i++)\n{\n echo $result[$i][\"first\"].' '.$result[$i][\"second\"];\n if($i != (count($result)-1)) echo \"\\n\";\n}\n?>"}, {"source_code": " $m[$b][$a][0] && $t - $m[$b][$a][0] <= $d || $m[$b][$a][1]!==false && $t > $m[$b][$a][1] && $t - $m[$b][$a][1] <= $d))\n {\n if (!isset($f[$a])) $f[$a] = array();\n $f[$a][$b] = true;\n if (!isset($f[$b])) $f[$b] = array();\n $f[$b][$a] = true;\n $k++;\n $r .= $a . \" \" . $b . \"\\n\";\n }\n}\nfprintf(STDOUT, \"%d\\n%s\", $k, $r);"}, {"source_code": " $f){\n echo $f[0] . ' ' . $f[1];\n if ( $k != $cnt - 1 ){\n echo \"\\n\";\n }\n}"}, {"source_code": " $m[$b][$a][0] && $t - $m[$b][$a][0] <= $d || $m[$b][$a][1]!==false && $t > $m[$b][$a][1] && $t - $m[$b][$a][1] <= $d))\n {\n if (!isset($f[$a])) $f[$a] = array();\n $f[$a][$b] = true;\n if (!isset($f[$b])) $f[$b] = array();\n $f[$b][$a] = true;\n $k++;\n $r .= $a . \" \" . $b . \"\\n\";\n }\n}\nfprintf(STDOUT, \"%d\\n%s\", $k, $r);"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 1000 || $d < 1 || $d > 1000)\n\t\t\texit(1);\n\t} else {\n\t\t$line = trim($line);\n\t\t$base[] = explode(' ', $line);\n\t\t$end = end($base);\n\t\tif(iconv_strlen($end[0]) > 20 || iconv_strlen($end[1]) > 20)\n\t\t\texit(1);\n\t}\n\n\tif($i == $n)\n\t\tbreak;\n}\n\n//var_dump($base);\n$friends = array();\n$there_is = false;\n\nfor($i = 0; $i < count($base); $i++)\n\tfor($j = $i + 1; $j < count($base); $j++)\n\t\tif($base[$i][0] == $base[$j][1] && $base[$i][1] == $base[$j][0]\n\t\t&& ($base[$j][2] - $base[$i][2]) >= 1 && ($base[$j][2] - $base[$i][2]) <= $d\n\t\t&& $base[$j][2] >= 0 && $base[$j][2] <= 10000\n\t\t&& ($base[$i][0] != $base[$i][1]))\n\t\t{\n\t\t\tfor($g = 0; $g < count($friends); $g++)\n\t\t\t\tif(($friends[$g][0] == $base[$i][0] && $friends[$g][1] == $base[$i][1]) || ($friends[$g][0] == $base[$i][1] && $friends[$g][1] == $base[$i][0]))\n\t\t\t\t{\n\t\t\t\t\t$there_is = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else\n\t\t\t\t\t$there_is = false;\n\t\t\tif($there_is != true)\n\t\t\t\t$friends[] = array($base[$i][1], $base[$i][0]);\n\t\t}\n\necho count($friends) . \"\\n\";\nforeach($friends as $string)\n\techo implode(' ', $string) . \"\\n\";\n?>\n"}], "negative_code": [{"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($k <= $b))\n {\n $m++;\n array_push($l, $j);\n }\n }\n }\n }\n}\nif($l == TRUE)\n{\n print $m . \"\\n\";\n}\nelse\n{\n print $m;\n}\nfor($x = 0; $x < count($l); $x++)\n{\n if($x == count($l) - 1)\n {\n print $l[$x];\n }\n else\n {\n print $l[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($k <= $b))\n {\n $m++;\n array_push($l, $j);\n }\n }\n }\n }\n}\nfor($x = 0; $x < count($l); $x++)\n{\n for($y = 0; $y < count($l); $y++)\n {\n if($x == $y)\n {\n continue;\n }\n else\n {\n list($n, $o) = explode(\" \", $l[$y]);\n if(($l[$x] == $n . \" \" . $o) || ($l[$x] == $o . \" \" . $n))\n {\n $m--;\n }\n }\n }\n}\nif($l == TRUE)\n{\n print $m . \"\\n\";\n}\nelse\n{\n print $m;\n}\nfor($x = 0; $x < count($l); $x++)\n{\n if($x == count($l) - 1)\n {\n print $l[$x];\n }\n else\n {\n print $l[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0) && ($k <= $b))\n {\n $m++;\n array_push($l, $j);\n }\n }\n }\n }\n}\nfor($x = 0; $x < count($l); $x++)\n{\n for($y = 0; $y < count($l); $y++)\n {\n if($x == $y)\n {\n continue;\n }\n else\n {\n list($n, $o) = explode(\" \", $l[$y]);\n if($l[$x] == $n . \" \" . $o)\n {\n $l[$y] = $n . \" \" . $o;\n }\n if($l[$x] == $o . \" \" . $n)\n {\n $l[$y] = $o . \" \" . $n;\n }\n }\n }\n}\n$l = array_unique($l);\n$m = count($l);\nif($l == TRUE)\n{\n print $m . \"\\n\";\n}\nelse\n{\n print $m;\n}\nfor($x = 0; $x < count($l); $x++)\n{\n if($x == count($l) - 1)\n {\n print $l[$x];\n }\n else\n {\n print $l[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0) && ($k <= $b))\n {\n $m++;\n array_push($l, $j);\n $c[$x] = $n;\n list($o, $p) = explode(\" \", $n);\n $o++;\n $p++;\n $n = $o . \" \" . $p;\n }\n }\n }\n }\n}\nif($l == TRUE)\n{\n print $m . \"\\n\";\n}\nelse\n{\n print $m;\n}\nfor($x = 0; $x < count($l); $x++)\n{\n if($x == count($l) - 1)\n {\n print $l[$x];\n }\n else\n {\n print $l[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0) && ($m <= $b))\n {\n if($c[$x] < $d[$x])\n {\n array_push($f, $c[$x] . \" \" . $d[$x]);\n }\n else\n {\n array_push($f, $d[$x] . \" \" . $c[$x]);\n }\n }\n }\n array_unshift($j, $c[$x] . \" \" . $d[$x]);\n array_unshift($j, \" \");\n unset($j[0]);\n}\nif(count($f) == 0)\n{\n print \"0\";\n}\nelse\n{\n $f = array_unique($f);\n sort($f);\n print count($f) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \"\\n\";\n }\n print $f[$x];\n}\n?>"}, {"source_code": " 0)\n\t{\n\t\tforeach($arr as $user)\n\t\t{\n\t\t\tif($B == $user[0] && $user[1] == $A)\n\t\t\t{\n\t\t\t\tif($t - $user[2] <= $d)\n\t\t\t\t{\n\t\t\t\t\t$result[] = $A.' '.$B;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$arr[] = array($A, $B, $t);\n}\n\n$count = count($result);\n\n$txt = '';\n$pair = array();\n$cnt = 0;\n\nfor($i = 0; $i < $count; $i++)\n{\n\tif(!in_array($result[$i], $pair))\n\t{\n\t\t$txt.= \"\\n\".$result[$i];\n\t\t$pair[] = $result[$i];\n\t\t$cnt++;\n\t}\n}\n\necho $cnt;\nif($cnt > 0)\n\techo $txt;\n?>"}, {"source_code": " 0)\n\t{\n\t\tforeach($arr as $user)\n\t\t{\n\t\t\tif($B == $user[0] && $user[1] == $A)\n\t\t\t{\n\t\t\t\tif($t - $user[2] <= $d)\n\t\t\t\t{\n\t\t\t\t\t$result[] = $A.' '.$B;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$arr[] = array($A, $B, $t);\n}\n\n$count = count($result);\necho $count;\n\nif($count > 0)\n{\n\t$pair = array();\n\tfor($i = 0; $i < $count; $i++)\n\t{\n\t\tif(!in_array($result[$i], $pair))\n\t\t{\n\t\t\techo \"\\n\".$result[$i];\n\t\t\t$pair[] = $result[$i];\n\t\t}\n\t}\n}\n?>"}, {"source_code": " 0)\n\t{\n\t\tforeach($arr as $user)\n\t\t{\n\t\t\tif($B == $user[0] && $user[1] == $A)\n\t\t\t{\n\t\t\t\tif($t - $user[2] <= $d)\n\t\t\t\t{\n\t\t\t\t\t$result[] = $A.' '.$B;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$arr[] = array($A, $B, $t);\n}\n\n$count = count($result);\n\n$txt = '';\n$pair = array();\n$cnt = 0;\n\nfor($i = 0; $i < $count; $i++)\n{\n\t$exp = explode(' ', $result[$i]);\n\tif(!in_array($exp[0].' '.$exp[1], $pair) && !in_array($exp[1].' '.$exp[0], $pair))\n\t{\n\t\t$txt.= \"\\n\".$result[$i];\n\t\t$pair[] = $result[$i];\n\t\t$cnt++;\n\t}\n}\n\necho $cnt;\nif($cnt > 0)\n\techo $txt;\n?>"}, {"source_code": " 0 and $razn <= $param[1])\n {\n $itogfr[] = $friends[$i][1] . \" \" . $friends[$j][1];\n $num++;\n unset($friends[$j]); \n break; \n }\n }\n }\n\n}\necho $num;\nfor ($i = 0; $i < count($itogfr); $i++)\n{\n echo \"\\n\" . $itogfr[$i];\n}\n\n\n\n?>"}, {"source_code": " 0 and $razn <= $param[1])\n {\n $itogfr[] = $friends[$i][1] . \" \" . $friends[$j][1];\n $num++;\n unset($friends[$j]); \n break; \n }\n }\n }\n\n}\necho $num;\nfor ($i = 0; $i < count($itogfr); $i++)\n{\n echo \"\\n\" . $itogfr[$i];\n}\n\n\n?>"}, {"source_code": " 0 and $razn <= $param[1])\n {\n $itogfr[] = $friends[$i][1] . \" \" . $friends[$j][1];\n $num++;\n unset($friends[$j]); \n break; \n }\n }\n }\n\n}\necho $num;\nfor ($i = 0; $i < count($itogfr); $i++)\n{\n echo \"\\n\" . $itogfr[$i];\n}\n\n\n?>"}, {"source_code": " 0 and $razn <= $param[1])\n {\n $itogfr[] = $friends[$i][1] . \" \" . $friends[$i + 1][1];\n $num++; \n break; \n }\n }\n }\n\n}\necho $num;\nfor ($i = 0; $i < count($itogfr); $i++)\n{\n echo \"\\n\" . $itogfr[$i];\n}\n\n\n?>"}, {"source_code": " 0 and $razn <= $param[1])\n {\n $itogfr[] = $friends[$i][1] . \" \" . $friends[$i + 1][1];\n $num++;\n unset($friends[$j]); \n break; \n }\n }\n }\n\n}\necho $num;\nfor ($i = 0; $i < count($itogfr); $i++)\n{\n echo \"\\n\" . $itogfr[$i];\n}\n\n\n?>"}, {"source_code": " 0 and $razn <= $param[1])\n {\n $itogfr[] = $friends[$i][1] . \" \" . $friends[$i + 1][1];\n $num++; \n }\n }\n\n}\necho $num;\nfor ($i = 0; $i < count($itogfr); $i++)\n{\n echo \"\\n\" . $itogfr[$i];\n}\n\n\n?>"}, {"source_code": " $m[$b][$a] && $t - $m[$b][$a] <= $d)\n {\n if (!isset($f[$a])) $f[$a] = array();\n $f[$a][$b] = true;\n if (!isset($f[$b])) $f[$b] = array();\n $f[$b][$a] = true;\n $k++;\n $r .= $a . \" \" . $b . \"\\n\";\n }\n}\nfprintf(STDOUT, \"%d\\n%s\", $k, $r);\n"}, {"source_code": " 0))\n\t\t{\n\t\t\tforeach($friends as $pair)\n\t\t\t\tif(($pair[0] == $base[$i][0] && $pair[1] == $base[$i][1]) || ($pair[0] == $base[$i][1] && $pair[1] == $base[$i][0]))\n\t\t\t\t\t$there_is = true;\n\t\t\tif($there_is != true)\n\t\t\t\t$friends[] = array($base[$i][1], $base[$i][0]);\n\t\t}\n\necho count($friends) . \"\\n\";\nforeach($friends as $string)\n\techo implode(' ', $string) . \"\\n\";\n?>\n"}, {"source_code": " 1000 || $d < 1 || $d > 1000)\n\t\t\texit(1);\n\t} else {\n\t\t$line = trim($line);\n\t\t$base[] = explode(' ', $line);\n\t\t$end = end($base);\n\t\tif(iconv_strlen($end[0]) > 20 || iconv_strlen($end[1]) > 20)\n\t\t\texit(1);\n\t}\n\n\tif($i == $n)\n\t\tbreak;\n}\n\n//var_dump($base);\n$friends = array();\n$there_is = false;\n\nfor($i = 0; $i < count($base); $i++)\n\tfor($j = 0; $j < count($base); $j++)\n\t\tif($base[$i][0] == $base[$j][1] && $base[$i][1] == $base[$j][0] && ((($base[$j][2] - $base[$i][2]) <= $d) && ($base[$j][2] - $base[$i][2]) > 0) && ($base[$i][0] != $base[$i][1]) && $base[$j][2] <= $n)\n\t\t{\n\t\t\tforeach($friends as $pair)\n\t\t\t\tif(($pair[0] == $base[$i][0] && $pair[1] == $base[$i][1]) || ($pair[0] == $base[$i][1] && $pair[1] == $base[$i][0]))\n\t\t\t\t\t$there_is = true;\n\t\t\tif($there_is != true)\n\t\t\t\t$friends[] = array($base[$i][1], $base[$i][0]);\n\t\t}\n\necho count($friends) . \"\\n\";\nforeach($friends as $string)\n\techo implode(' ', $string) . \"\\n\";\n\n?>\n"}, {"source_code": " 0))\n\t\t\t$friends[] = $base[$i][1] . ' ' . $base[$i][0] . \"\\n\";\n\necho count($friends) . \"\\n\";\nforeach($friends as $string)\n\techo $string;\n?>\n"}, {"source_code": "\n\n"}, {"source_code": "=0){\n if ($all[$i][1]==$all[$j][0] && $all[$i][0]==$all[$j][1] && $all[$i][2]-$all[$j][2]<=$d){\n $flag=0; $z=0;\n while($z"}], "src_uid": "3cb4c89b174bf5ea51e797b78103e089"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= 0) { // bigger than or equal first wire\n $birds_on_wires[$wire - 1] += $bird - 1;\n }\n\n if ($wire + 1 <= $n_wires - 1) { // smaller than or equal last wire\n $birds_on_wires[$wire + 1] += $birds_on_wires[$wire] - $bird;\n }\n\n $birds_on_wires[$wire] = 0;\n}\n\nforeach ($birds_on_wires as $birds) {\n echo \"$birds\\n\";\n}\n"}, {"source_code": "= 0) { // bigger than or equal first wire\n $birds_on_wires[$wire - 1] += $bird - 1;\n }\n\n if ($wire + 1 <= $n_wires - 1) { // smaller than or equal last wire\n $birds_on_wires[$wire + 1] += $birds_on_wires[$wire] - $bird;\n }\n\n $birds_on_wires[$wire] = 0;\n}\n\nforeach ($birds_on_wires as $birds) {\n echo \"$birds\\n\";\n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "nextInt();\n$a = array();\n\nfor ($i = 0; $i < $n; $i ++) {\n $a[] = $scanner->nextInt();\n}\n\n$m = $scanner->nextInt();\n\nfor ($i = 0; $i < $m; $i ++) {\n $x = $scanner->nextInt();\n $y = $scanner->nextInt();\n $x --;\n if ($x - 1 >= 0) {\n $a[$x-1] += $y - 1;\n }\n if ($x + 1 < $n) {\n $a[$x+1] += $a[$x] - $y;\n }\n $a[$x] = 0;\n}\n\nfor ($i = 0; $i < $n; $i ++) {\n print $a[$i] . PHP_EOL;\n}\n\nclass Scanner {\n private $_buffer;\n private $_buffer_size;\n private $_i;\n\n function __construct() {\n $this->initBuffer();\n }\n\n function initBuffer() {\n $line = trim(fgets(STDIN));\n $this->_buffer = explode(' ', $line);\n $this->_buffer_size = count($this->_buffer);\n $this->_i = 0;\n }\n\n function nextInt() {\n if ($this->_buffer_size == 0 || $this->_i >= $this->_buffer_size) {\n $this->initBuffer();\n }\n return (int)$this->_buffer[$this->_i ++];\n }\n}\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "859d66fc2c204a8c002012b1fb206645"} {"source_code": " $wealth) {\n if ($first === false) {\n $happiness = $friends[$wealth];\n $first = $key;\n continue;\n }\n\n if (abs($friendsWealth[$first] - $wealth) < $d) {\n $happiness += $friends[$wealth];\n } else {\n if ($max < $happiness) {\n $max = $happiness;\n }\n while (abs($friendsWealth[$first] - $wealth) >= $d) {\n $happiness -= $friends[$friendsWealth[$first]];\n $first++;\n }\n $happiness += $friends[$wealth];\n }\n}\n\nif ($max < $happiness) {\n $max = $happiness;\n}\n\necho $max;\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $wealth) {\n if ($first === false) {\n $happiness = $friends[$wealth];\n $first = $key;\n continue;\n }\n\n if (abs($friendsWealth[$first] - $wealth) <= $d) {\n $happiness += $friends[$wealth];\n } else {\n if ($max < $happiness) {\n $max = $happiness;\n }\n while (abs($friendsWealth[$first] - $wealth) > $d) {\n $happiness -= $friends[$friendsWealth[$first]];\n $first++;\n }\n $happiness += $friends[$wealth];\n }\n}\n\nif ($max < $happiness) {\n $max = $happiness;\n}\n\necho $max;\n"}, {"source_code": " $wealth) {\n if ($first === false) {\n $happiness = $friends[$wealth];\n $first = $key;\n continue;\n }\n\n if (abs($friendsWealth[$first] - $wealth) < $d) {\n $happiness += $friends[$wealth];\n } else {\n if ($max < $happiness) {\n $max = $happiness;\n }\n while (abs($friendsWealth[$first] - $wealth) >= $d) {\n $happiness -= $friends[$friendsWealth[$first]];\n $first++;\n }\n $happiness += $friends[$wealth];\n }\n}\n\nif ($max < $happiness) {\n $max = $happiness;\n}\n\necho $max;\n"}], "src_uid": "38fe0e19974a7bc60153793b9060369a"} {"source_code": "", "positive_code": [{"source_code": "\n"}], "negative_code": [], "src_uid": "42840fc873369e0d0d6a4ad24a43f5a6"} {"source_code": "\n\n\n\n", "positive_code": [{"source_code": " $c[$x])\n {\n $h++;\n $i = $h % $b;\n if($i == 0)\n {\n $h2 += 5;\n }\n }\n elseif($e == $c[$x])\n {\n $h++;\n $h3--;\n if($h3 == 0)\n {\n break;\n }\n $i = $h % $b;\n if($i == 0)\n {\n $h2 += 5;\n }\n }\n elseif($e < $c[$x])\n {\n break;\n }\n}\nprint ($f + $f2) . \" \" . ($h + $h2);\n?>"}, {"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 pass_compare($p1, $p2) {\n\t$l1 = strlen($p1);\n\t$l2 = strlen($p2);\n\tif ($l1 > $l2) {\n\t\treturn 1;\n\t} elseif ($l1 < $l2) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\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\tlist($n, $k) = readStringExplodeNum($stream, ' ', true);\n\t$passList = array();\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$passList[] = readString($stream);\n\t}\n\n\t$validPass = readString($stream);\n\tusort($passList, 'pass_compare');\n\t$passPos = range(1, $n);\n\t$passPos = array_combine($passList, $passPos);\n\t$posPass = array_combine($passPos, $passList);\n\n\t$validPassLength = strlen($validPass);\n\n\t$validPassPos = $passPos[$validPass];\n\n\t$minPassPos = $maxPassPos = $validPassPos;\n\twhile ($minPassPos > 0 && strlen($posPass[$minPassPos - 1]) == $validPassLength) {\n\t\t$minPassPos--;\n\t}\n\n\twhile ($maxPassPos < $n && strlen($posPass[$maxPassPos + 1]) == $validPassLength) {\n\t\t$maxPassPos++;\n\t}\n\n\t$minfailWaitCount = floor(($minPassPos - 1) / $k);\n\t$maxfailWaitCount = floor(($maxPassPos - 1) / $k);\n\n\t$minWaitTime = $minPassPos + $minfailWaitCount * 5;\n\t$maxWaitTime = $maxPassPos + $maxfailWaitCount * 5;\n\techo \"{$minWaitTime} {$maxWaitTime}\";\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "negative_code": [{"source_code": " $c[$x])\n {\n $h++;\n $i = $h % $b;\n if($i == 0)\n {\n $h2 += 5;\n }\n }\n elseif($e == $c[$x])\n {\n $h++;\n $i = $h % $b;\n if($i == 0)\n {\n $h2 += 5;\n }\n }\n elseif($e < $c[$x])\n {\n break;\n }\n}\nprint ($f + $f2) . \" \" . ($h + $h2);\n?>"}, {"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 pass_compare($p1, $p2) {\n\t$l1 = strlen($p1);\n\t$l2 = strlen($p2);\n\tif ($l1 > $l2) {\n\t\treturn 1;\n\t} elseif ($l1 < $l2) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\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\tlist($n, $k) = readStringExplodeNum($stream, ' ', true);\n\t$passList = array();\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$passList[] = readString($stream);\n\t}\n\n\t$validPass = readString($stream);\n\tusort($passList, 'pass_compare');\n\t$passPos = range(1, $n);\n\t$passPos = array_combine($passList, $passPos);\n\t$posPass = array_combine($passPos, $passList);\n\n\t$validPassLength = strlen($validPass);\n\n\t$validPassPos = $passPos[$validPass];\n\n\t$minPassPos = $maxPassPos = $validPassPos;\n\twhile ($minPassPos > 0 && strlen($posPass[$minPassPos - 1]) == $validPassLength) {\n\t\t$minPassPos--;\n\t}\n\n\twhile ($maxPassPos < $n && strlen($posPass[$maxPassPos + 1]) == $validPassLength) {\n\t\t$maxPassPos++;\n\t}\n\n\t$minfailWaitCount = floor($minPassPos / $k);\n\t$maxfailWaitCount = floor($maxPassPos / $k);\n\n\t$minWaitTime = $minPassPos + $minfailWaitCount * 5;\n\t$maxWaitTime = $maxPassPos + $maxfailWaitCount * 5;\n\techo \"{$minWaitTime} {$maxWaitTime}\";\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": "\n\n\n\n"}, {"source_code": "\n\n\n\n"}], "src_uid": "06898c5e25de2664895f512f6b766915"} {"source_code": " $counter) {\n\t\t$counter = $value;\n\t} else {\n\t\t$no = TRUE;\n\t\tbreak;\n\t}\n}\nif ($no == TRUE) {\n\techo \"Happy Alex\";\n} else {\n\techo \"Poor Alex\";\n}\n?>", "positive_code": [{"source_code": ""}, {"source_code": "$v) $flag=true;\n\t$prev=$v;\n}\n\n\nif($flag) echo \"Happy Alex\\n\";\nelse echo \"Poor Alex\\n\";\n\n\n\n\n?>"}, {"source_code": " $b[$ord[$i]]){\n $can = true;\n }\n $maxi = max($maxi,$b[$ord[$i]]);\n }\n if ($can == true){\n echo(\"Happy Alex\");\n }else{\n echo(\"Poor Alex\");\n }\n \n?>"}, {"source_code": " $g[$x + 1]))\n {\n $h = 1;\n break;\n }\n}\nif(($a == 1) || ($h == 0))\n{\n print \"Poor Alex\";\n}\nelse\n{\n print \"Happy Alex\";\n}\n?>"}], "negative_code": [{"source_code": " $g[$x]))\n {\n $h = 1;\n break;\n }\n}\nif(($h == 0) || ($a == 1))\n{\n print \"Poor Alex\";\n}\nelse\n{\n print \"Happy Alex\";\n}\n?>"}, {"source_code": "$ara[$i+1][1]) $flag=true;\n}\n\n\nif($flag) echo \"Happy Alex\\n\";\nelse echo \"Poor Alex\\n\";\n\n\n\n\n?>"}, {"source_code": " $b[$ord[$i]]){\n $can = true;\n }\n $maxi = max($maxi,$b[$ord[$i]]);\n }\n if (can){\n echo(\"Happy Alex\");\n }else{\n echo(\"Poor Alex\");\n }\n \n?>"}, {"source_code": " $b[$ord[$i]]){\n $can = true;\n }\n $maxi = max(maxi,$b[$ord[$i]]);\n }\n if (can){\n echo(\"Happy Alex\");\n }else{\n echo(\"Poor Alex\");\n }\n \n?>"}, {"source_code": " $b[$ord[$i]]){\n $can = true;\n }\n $maxi = max(maxi,$b[$ord[$i]]);\n }\n if (can){\n echo(\"Happy Alex\");\n }else{\n echo(\"Poor Alex\");\n }\n \n?>"}, {"source_code": " $b[$ord[$i]]){\n $can = true;\n }\n $maxi = max($maxi,$b[$ord[$i]]);\n }\n if (can){\n echo(\"Happy Alex\");\n }else{\n echo(\"Poor Alex\");\n }\n \n?>"}, {"source_code": " $b[$ord[$i]]){\n $can = true;\n }\n $maxi = max(maxi,$b[$ord[$i]]);\n }\n if (can){\n echo(\"Happy Alex\");\n }else{\n echo(\"Poor Alex\");\n }\n \n?>"}], "src_uid": "c21a84c4523f7ef6cfa232cba8b6ee2e"} {"source_code": "$val) {\n\n if (!isset($map[$val])) {\n\n $map[$val] = array(\n \"last\" => $pos,\n \"ok\" => 1,\n \"delay\" => 0\n );\n\n } else {\n\n if ($map[$val][\"ok\"] == 0) continue;\n if ($map[$val][\"delay\"]==0) {\n $map[$val][\"delay\"] = $pos - $map[$val][\"last\"];\n }\n else {\n if($pos - $map[$val][\"last\"] != $map[$val][\"delay\"]) $map[$val][\"ok\"] = 0;\n else $map[$val][\"last\"] = $pos;\n }\n\n if ($map[$val][\"ok\"]) $map[$val][\"last\"] = $pos;\n\n }\n //print_r($map);\n\n}\n\n//print_r($map);\n\nksort($map);\n\n$str = \"\";\n$k = 0;\n\nforeach($map as $key=>$val) {\n if ($val[\"ok\"]) {\n $k++;\n $str.=\"$key $val[delay]\\n\";\n }\n}\n\necho \"$k\\n$str\";\n\n?>", "positive_code": [{"source_code": " -1))\n {\n if($d[$x] != -1)\n {\n print $x . \" \" . $d[$x] . \"\\n\";\n }\n $h--;\n }\n elseif(($h == 1) && ($d[$x] > -1))\n {\n if($d[$x] != -1)\n {\n print $x . \" \" . $d[$x];\n }\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " \"0\") && ($d[$e] == \"0\"))\n {\n $d[$e] = $x - $f[$e];\n $f[$e] = $x;\n }\n elseif(($e > \"0\") && ($d[$e] > \"0\") && (($x - $f[$e]) == $d[$e]) && ($d[$e] != \"-1\"))\n {\n $f[$e] = $x;\n }\n elseif(($e > \"0\") && ($d[$e] > \"0\") && (($x - $f[$e]) != $d[$e]) && ($d[$e] != \"-1\"))\n {\n $d[$e] = \"-1\";\n }\n}\nasort($c);\n$g = array_keys($c);\narray_unshift($g, \" \");\nunset($g[0]);\nsort($c);\narray_unshift($c, \" \");\nunset($c[0]);\nprint count($c) . \"\\n\";\nfor($x = 1; $x < count($c); $x++)\n{\n if($d[$x] != \"-1\")\n {\n print $c[$x] . \" \" . $d[$g[$x]] . \"\\n\";\n }\n}\nif($d[$x] != \"-1\")\n{\n print $c[$x] . \" \" . $d[$g[$x]];\n}\n?>"}, {"source_code": " \"0\") && ($d[$e] == \"0\"))\n {\n $d[$e] = $x - $f[$e];\n $f[$e] = $x;\n }\n elseif(($e > \"0\") && ($d[$e] > \"0\") && (($x - $f[$e]) == $d[$e]) && ($d[$e] != \"-1\"))\n {\n $f[$e] = $x;\n }\n elseif(($e > \"0\") && ($d[$e] > \"0\") && (($x - $f[$e]) != $d[$e]) && ($d[$e] != \"-1\"))\n {\n $d[$e] = \"-1\";\n }\n}\nasort($c);\n$g = array_keys($c);\narray_unshift($g, \" \");\nunset($g[0]);\nsort($c);\narray_unshift($c, \" \");\nunset($c[0]);\n$k = array_unique($d);\nsort($k);\nif((count($k) == \"1\") && ($k[0] == \"-1\"))\n{\n print \"0\";\n}\nelse\n{\n print count($c) . \"\\n\";\n for($x = 1; $x < count($c); $x++)\n {\n if($d[$x] != \"-1\")\n {\n print $c[$x] . \" \" . $d[$g[$x]] . \"\\n\";\n }\n }\n if($d[$x] != \"-1\")\n {\n print $c[$x] . \" \" . $d[$g[$x]];\n }\n}\n?>"}, {"source_code": " -1))\n {\n if($d[$x] != -1)\n {\n print $x . \" \" . $d[$x] . \"\\n\";\n }\n $h--;\n }\n elseif(($h == 1) && ($d[$x] > -1))\n {\n if($d[$x] != -1)\n {\n print $x . \" \" . $d[$x];\n }\n }\n }\n}\n?>"}, {"source_code": "$val) {\n\n if ($res[$val]) continue;\n if (isset($map[$val])) {\n\n $res[$val] = $pos - $map[$val];\n unset($map[$val]);\n\n\n } else {\n $map[$val] = $pos;\n }\n}\n\nforeach($map as &$val) $val = 0;\n\n\n$res = $res + $map;\nksort($res);\necho count($res).\"\\n\";\n//print_r($res);\nforeach($res as $k=>$v) {\n echo \"$k $v\\n\";\n}\n\n\n?>"}, {"source_code": "$val) {\n\n if ($res[$val]) continue;\n if ($map[$val]) {\n\n $res[$val] = $pos - $map[$val];\n unset($map[$val]);\n\n\n } else {\n $map[$val] = $pos;\n }\n}\n\nforeach($map as &$val) $val = 0;\n\n\n$res = $res + $map;\nksort($res);\necho count($res).\"\\n\";\nforeach($res as $k=>$v) echo \"$k $v\\n\";\n\n\n?>"}], "src_uid": "097e35b5e9c96259c54887158ebff544"} {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "0fbac68f497fe189ee088c13d0488cce"} {"source_code": "? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100\n? 128 256 384 512 640 768 896 1024 1152 1280 1408 1536 1664 1792 1920 2048 2176 2304 2432 2560 2688 2816 2944 3072 3200 3328 3456 3584 3712 3840 3968 4096 4224 4352 4480 4608 4736 4864 4992 5120 5248 5376 5504 5632 5760 5888 6016 6144 6272 6400 6528 6656 6784 6912 7040 7168 7296 7424 7552 7680 7808 7936 8064 8192 8320 8448 8576 8704 8832 8960 9088 9216 9344 9472 9600 9728 9856 9984 10112 10240 10368 10496 10624 10752 10880 11008 11136 11264 11392 11520 11648 11776 11904 12032 12160 12288 12416 12544 12672 12800\n! ", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c7f31e0c57cf15f71c401d826c3ee0ef"} {"source_code": "= 0; $x--)\n{\n $f = $c[$x];\n for($y = $b - 1; $y >= 0; $y--)\n {\n if($f[$y] == \"B\")\n {\n $e = 1;\n $h = $x;\n break;\n }\n }\n if($f[$y] == \"B\")\n {\n break;\n }\n}\n$i = $b;\nfor($x = 0; $x < $a; $x++)\n{\n $f = $c[$x];\n for($y = 0; $y < $b; $y++)\n {\n if($f[$y] == \"B\")\n {\n $e = 1;\n $i = min($i, $y);\n break;\n }\n }\n}\n$j = 0;\nfor($x = $a - 1; $x >= 0; $x--)\n{\n $f = $c[$x];\n for($y = $b - 1; $y >= 0; $y--)\n {\n if($f[$y] == \"B\")\n {\n $e = 1;\n $j = max($j, $y);\n break;\n }\n }\n}\nif($e == 0)\n{\n print \"1\";\n}\nelse\n{\n $k = $h - $g + 1;\n $l = $j - $i + 1;\n $m = max($k, $l);\n if(($m > $a) || ($m > $b))\n {\n print \"-1\";\n }\n else\n {\n $n = 0;\n for($x = 0; $x < $a; $x++)\n {\n for($y = 0; $y < $b; $y++)\n {\n if($c[$x][$y] == \"B\")\n {\n $n++;\n }\n }\n }\n $o = pow($m, 2);\n $p = $o - $n;\n print $p;\n }\n}\n?>", "positive_code": [{"source_code": "=$n || $j+$len>=$m) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\t\n\t\t\t$sum = 0;\n\t\t\t$sum+=$cnt[$i+$len][$j+$len];\n\t\t\tif($i!=0) $sum-=$cnt[$i-1][$j+$len];\n\t\t\tif($j!=0) $sum-=$cnt[$i+$len][$j-1];\n\t\t\tif($i!=0&&$j!=0) $sum+=$cnt[$i-1][$j-1];\n\t\t\t\n\t\t\tif($sum==$cnt[$n-1][$m-1]) {\n\t\t\t\t$cost = ($len+1)*($len+1)-$sum;\n\t\t\t\tif($ans>$cost) {\n\t\t\t\t\t$ans=$cost;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nif($ans==1000000000) {\n\t$ans = -1;\n}\n\nfprintf(STDOUT, \"%d\\n\", $ans);\n?>\n"}, {"source_code": "$n){\n if($a[1]<$m){\n print -1;\n }\n else{\n print $m*$m-count($b);\n }\n}\nelseif ($m<$n){\n if($a[0]<$n){\n print -1;\n }\n else{\n print $n*$n-count($b);\n }\n}\nelse{\n print $n*$n-count($b);\n}\n?>"}], "negative_code": [{"source_code": "= 0; $x--)\n{\n $f = $c[$x];\n for($y = $b - 1; $y >= 0; $y--)\n {\n if($f[$y] == \"B\")\n {\n $e = 1;\n $h = $x;\n break;\n }\n }\n if($f[$y] == \"B\")\n {\n break;\n }\n}\n$i = $b;\nfor($x = 0; $x < $a; $x++)\n{\n $f = $c[$x];\n for($y = 0; $y < $b; $y++)\n {\n if($f[$y] == \"B\")\n {\n $e = 1;\n $i = min($i, $y);\n break;\n }\n }\n}\n$j = $b;\nfor($x = $a - 1; $x >= 0; $x--)\n{\n $f = $c[$x];\n for($y = $b - 1; $y >= 0; $y--)\n {\n if($f[$y] == \"B\")\n {\n $e = 1;\n $j = min($j, $y);\n break;\n }\n }\n}\nif($e == 0)\n{\n print \"1\";\n}\nelse\n{\n $k = $h - $g + 1;\n $l = $j - $i + 1;\n $m = max($k, $l);\n if(($m > $a) || ($m > $b))\n {\n print \"-1\";\n }\n else\n {\n $n = 0;\n for($x = 0; $x < $a; $x++)\n {\n for($y = 0; $y < $b; $y++)\n {\n if($c[$x][$y] == \"B\")\n {\n $n++;\n }\n }\n }\n $o = pow($m, 2);\n $p = $o - $n;\n print $p;\n }\n}\n?>"}], "src_uid": "cd6bc23ea61c43b38c537f9e04ad11a6"} {"source_code": "= $r) && ($i[$x] == TRUE))\n {\n $o += $e[$x];\n $p = 1;\n unset($i[$x]);\n break;\n }\n }\n if($p == 1)\n {\n array_push($l, $n);\n array_push($m, $j[$x]);\n }\n $k -= $o;\n $k += $c;\n $n++;\n if($k <= 0)\n {\n $s = 1;\n break;\n }\n elseif(($k >= $b) && ($p == 0))\n {\n $s = 2;\n break;\n }\n if($k >= $b)\n {\n $k = $b;\n }\n}\nif($s == 1)\n{\n print \"YES\\n\";\n print $n . \" \" . count($m) . \"\\n\";\n for($x = 0; $x < count($l) - 1; $x++)\n {\n print $l[$x] . \" \" . $m[$x] . \"\\n\";\n }\n print $l[$x] . \" \" . $m[$x];\n}\nelseif($s == 2)\n{\n print \"NO\";\n}\n?>", "positive_code": [{"source_code": "= (double)((100 * $cur / $max))\n && $spell[$i][1] > $mmax\n && !isset($spell[$i][2])) {\n $mmax = $spell[$i][1];\n $mpos = $i;\n $mpow = $spell[$i][0];\n }\n }\n\n if ($mpow == 0 && $sum <= $reg) {\n echo 'NO';\n return;\n } else if ($mpow != 0) {\n $result[$spells][0] = $sec;\n $result[$spells][1] = $mpos + 1;\n $spells++;\n $spell[$mpos][2] = $sec;\n $sum += $mmax;\n }\n $sec++;\n }\n\n echo \"YES\\n\";\n echo \"$sec $spells\\n\";\n for ($i = 0; $i < count($result); $i++) {\n echo \"{$result[$i][0]} {$result[$i][1]}\\n\";\n }"}], "negative_code": [{"source_code": "= $cur / $max && $spell[$i][1] > $mmax\n && !isset($spell[$i][2])) {\n $mmax = $spell[$i][1];\n $mpos = $i;\n $mpow = $spell[$i][0];\n }\n }\n\n if ($mpow == 0 && $sum <= $reg) {\n echo 'NO';\n return;\n } else if ($mpow != 0) {\n $spells++;\n $spell[$mpos][2]= $sec;\n $sum += $spell[$mpos][1];\n }\n $sec++;\n }\n\n echo \"YES\\n\";\n echo \"$sec $spells\\n\";\n for ($i = 0; $i < $n; $i++) {\n if (isset($spell[$i][2])) {\n $pos = $i + 1;\n echo \"{$spell[$i][2]} {$pos}\\n\";\n }\n }"}, {"source_code": "= (int)((100 * $cur / $max))\n && $spell[$i][1] > $mmax\n && !isset($spell[$i][2])) {\n $mmax = $spell[$i][1];\n $mpos = $i;\n $mpow = $spell[$i][0];\n }\n }\n\n if ($mpow == 0 && $sum <= $reg) {\n echo 'NO';\n return;\n } else if ($mpow != 0) {\n $spells++;\n $spell[$mpos][2]= $sec;\n $sum += $mmax;\n }\n $sec++;\n }\n\n echo \"YES\\n\";\n echo \"$sec $spells\\n\";\n for ($i = 0; $i < $n; $i++) {\n if (isset($spell[$i][2])) {\n $pos = $i + 1;\n echo \"{$spell[$i][2]} {$pos}\\n\";\n }\n }"}, {"source_code": "= (double)(100 * $cur / $max)\n && $spell[$i][1] > $mmax\n && !isset($spell[$i][2])) {\n $mmax = $spell[$i][1];\n $mpos = $i;\n $mpow = $spell[$i][0];\n }\n }\n\n if ($mpow == 0 && $sum <= $reg) {\n echo 'NO';\n return;\n } else if ($mpow != 0) {\n $spells++;\n $spell[$mpos][2]= $sec;\n $sum += $mmax;\n }\n $sec++;\n }\n\n echo \"YES\\n\";\n echo \"$sec $spells\\n\";\n for ($i = 0; $i < $n; $i++) {\n if (isset($spell[$i][2])) {\n $pos = $i + 1;\n echo \"{$spell[$i][2]} {$pos}\\n\";\n }\n }"}], "src_uid": "e9c486e2d942700e0644dff29b6e3be6"} {"source_code": "toArray();\n\nusort($items, function($a, $b) {\n $cmp = $a[0] <=> $b[0];\n return ($cmp) == 0 ?\n ($b[1] <=> $a[1]) : $cmp;\n});\n\nfor ($i = 0; $i < count($items) - 1; $i++) {\n $a = $items[$i];\n $b = $items[$i + 1];\n\n if ($a[0] <= $b[0] && $a[1] >= $b[1]) {\n echo $b[2] . ' ' . $a[2];\n exit;\n }\n}\n\necho '-1 -1';", "positive_code": [{"source_code": " $g[$i]) && ($b[$x] == $b[$i]))\n {\n $h = 2;\n break;\n }\n else\n {\n $i = $x;\n }\n}\nif($h == 0)\n{\n print \"-1 -1\";\n}\nelseif($h == 1)\n{\n print ($f[$x] + 1) . \" \" . ($f[$i] + 1);\n}\nelseif($h == 2)\n{\n print ($f[$i] + 1) . \" \" . ($f[$x] + 1);\n}\n?>"}, {"source_code": " $b[0];\n return $cmp == 0 ?\n ($b[1] <=> $a[1]) : $cmp;\n});\n\nfor ($i = 0; $i < count($items) - 1; $i++) {\n $a = $items[$i];\n $b = $items[$i + 1];\n\n if ($a[0] <= $b[0] && $a[1] >= $b[1]) {\n echo $b[2] . ' ' . $a[2];\n exit;\n }\n}\n\necho '-1 -1';\n\n"}], "negative_code": [{"source_code": ""}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $f[$h[$x]];\n }\n }\n if($l == 0)\n {\n print \"-1 -1\";\n }\n else\n {\n print ($x + 1) . \" \" . ($o + 1);\n }\n}\n?>"}, {"source_code": "= 0; $x--)\n{\n $m = $h[$x];\n $n = $i[$x];\n if(($m >= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n}\nif($l == 0)\n{\n print \"-1 -1\";\n}\nelse\n{\n print ($g[$x] + 1) . \" \" . ($o + 1);\n}\n?>"}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n }\n if($l == 0)\n {\n print \"-1 -1\";\n }\n else\n {\n print ($g[$x] + 1) . \" \" . ($o + 1);\n }\n}\n?>"}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n }\n if($l == 0)\n {\n print \"-1 -1\";\n }\n else\n {\n print ($g[$x] + 1) . \" \" . ($o + 1);\n }\n}\n?>"}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n}\nif($l == 0)\n{\n print \"-1 -1\";\n}\nelse\n{\n print ($g[$x] + 1) . \" \" . ($o + 1);\n}\n?>"}, {"source_code": ""}, {"source_code": "= 0; $y--)\n {\n if($f[$y] == 0)\n {\n $p++;\n }\n else\n {\n break;\n }\n }\n $d[$x] = $e . \".\" . (strlen($f) - $p) . $f;\n}\nif($b[0] == 211907912)\n{\n print \"33187 8165\";\n}\nelseif($b[0] == \"95024040\")\n{\n print \"163180 200717\";\n}\nelseif($b[0] == \"568074760\")\n{\n print \"29081 236255\";\n}\nelse\n{\n asort($d);\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < $a; $x++)\n {\n $h[$x] = $b[$g[$x]];\n $i[$x] = $c[$g[$x]];\n }\n $j = $h[0];\n $k = $i[0];\n $l = 0;\n $o = $g[0];\n for($x = 1; $x < $a; $x++)\n {\n $m = $h[$x];\n $n = $i[$x];\n if(($m >= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n }\n if($l == 0)\n {\n print \"-1 -1\";\n }\n else\n {\n print ($g[$x] + 1) . \" \" . ($o + 1);\n }\n}\n?>"}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n}\nif($l == 0)\n{\n print \"-1 -1\";\n}\nelse\n{\n print ($g[$x] + 1) . \" \" . ($o + 1);\n}\n?>"}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $f[$h[$x]];\n }\n }\n if($l == 0)\n {\n print \"-1 -1\";\n }\n else\n {\n print ($f[$h[$x]] + 1) . \" \" . ($o + 1);\n }\n}\n?>"}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n }\n if($l == 0)\n {\n print \"-1 -1\";\n }\n else\n {\n print ($g[$x] + 1) . \" \" . ($o + 1);\n }\n}\n?>"}, {"source_code": "= $j) && ($n <= $k))\n {\n $l = 1;\n break;\n }\n elseif($n > $k)\n {\n $j = $m;\n $k = $n;\n $o = $g[$x];\n }\n }\n if($l == 0)\n {\n print \"-1 -1\";\n }\n else\n {\n print ($g[$x] + 1) . \" \" . ($o + 1);\n }\n}\n?>"}, {"source_code": " $b[0]) \n\t\treturn 1;\n\tif ($a[0] == $b[0]) \n\t\treturn 0;\n\tif ($a[0] < $b[0]) \n\t\treturn -1;\n}\n\nforeach ($c as $key => $vvalue) {\n\t$value = $vvalue[0];\n\n\tfor ($k=$key; $k < $number; $k++) {\n\t\t$_value = $c[$k][0]; \n\n\t\tif ($value >= $_value && $b[$key] <= $c[$k][1] && $key != $k) {\n\t\t\techo ($vvalue[2]) . \" \" . ($c[$k][2]);\n\t\t\tdie();\n\t\t}\n\t}\n}\n\necho '-1 -1';\n\n?>"}, {"source_code": " $b[0]) \n\t\treturn 1;\n\tif ($a[0] == $b[0]) \n\t\treturn 0;\n\tif ($a[0] < $b[0]) \n\t\treturn -1;\n}\n\nforeach ($c as $key => $vvalue) {\n\t$value = $vvalue[0];\n\n\tfor ($k=$key; $k < $number; $k++) {\n\t\t$_value = $c[$k][0]; \n\n\t\tif ($value >= $_value && $b[$key] <= $c[$k][1] && $key != $k) {\n\t\t\techo ($vvalue[2]) . \" \" . ($c[$k][2]);\n\t\t\tdie();\n\t\t}\n\t}\n}\n\nforeach ($c as $key => $vvalue) {\n\t$value = $vvalue[0];\n\n\tfor ($k=$key; $k < $number; $k++) {\n\t\t$_value = $c[$k][0]; \n\n\t\tif ($value <= $_value && $b[$key] >= $c[$k][1] && $key != $k) {\n\t\t\techo ($vvalue[2]) . \" \" . ($c[$k][2]);\n\t\t\tdie();\n\t\t}\n\t}\n}\n\necho '-1 -1';\n\n?>"}, {"source_code": " $b[0]) \n\t\treturn 1;\n\tif ($a[0] == $b[0]) \n\t\treturn 0;\n\tif ($a[0] < $b[0]) \n\t\treturn -1;\n}\n\nforeach ($c as $key => $vvalue) {\n\t$value = $vvalue[0];\n\n\tfor ($k=$key; $k < $number; $k++) {\n\t\t$_value = $c[$k][0]; \n\n\t\tif ($value >= $_value && $b[$key] <= $c[$k][1] && $key != $k) {\n\t\t\techo ($vvalue[2]) . \" \" . ($c[$k][2]);\n\t\t\tdie();\n\t\t}\n\t}\n}\n\nforeach ($c as $key => $vvalue) {\n\t$value = $vvalue[0];\n\n\tfor ($k=$key; $k < $number; $k++) {\n\t\t$_value = $c[$k][0]; \n\n\t\tif ($value <= $_value && $b[$key] >= $c[$k][1] && $key != $k) {\n\t\t\techo ($c[$k][2]) . \" \" . ($vvalue[2]);\n\t\t\tdie();\n\t\t}\n\t}\n}\n\necho '-1 -1';\n\n?>"}, {"source_code": " $i && $big[0] <= $small[0] && $big[1] >= $small[1]) {\n echo $small[2] . ' ' . $big[2];\n exit;\n }\n}\n\necho '-1 -1';\n\n"}, {"source_code": " $b[0]) == 0 ?\n ($a[1] <=> $b[1]) : $a[0] <=> $b[0];\n});\n\nfor ($i = 0; $i < count($items); $i++) {\n $a = $items[$i];\n for ($k = $i+1; $k < count($items); $k++) {\n $b = $items[$k];\n\n if ($b[0] <= $a[0] && $b[1] >= $a[1]) {\n echo $a[2] . ' ' . $b[2];\n exit;\n }\n }\n}\n\necho '-1 -1';\n\n"}, {"source_code": " $small[1]) {\n echo $small[2] . ' ' . $big[2];\n exit;\n }\n}\n\necho '-1 -1';\n\n"}, {"source_code": "= $small[1]) {\n echo $small[2] . ' ' . $big[2];\n exit;\n }\n}\n\necho '-1 -1';\n\n"}], "src_uid": "0148aed9b07c4f65b2507fcb8b837360"} {"source_code": "", "positive_code": [{"source_code": " 1)\n {\n if($n%3)\n {\n echo \"-1\\n\" ;\n $f = false ;\n break ;\n }\n \n if($n%6)\n {\n $n *= 2 ;\n $n /= 6 ;\n $ans += 2 ;\n }\n else\n {\n $n /= 6 ;\n $ans ++ ;\n }\n }\n if($f) echo $ans . \"\\n\" ;\n }\n?>"}, {"source_code": " 1) {\n if ($item % 6 == 0) {\n $item = intdiv($item, 6);\n $step++;\n } else if ($item % 2 == 0) {\n echo -1 . PHP_EOL;\n continue 2;\n } else {\n $item *= 2;\n $step++;\n }\n }\n\n echo $step . PHP_EOL;\n\n}"}], "negative_code": [], "src_uid": "3ae468c425c7b156983414372fd35ab8"} {"source_code": "", "positive_code": [{"source_code": " $v){\n if($v != 'R'){\n $c++;\n if($c > $m){\n $m = $c;\n }\n } else {\n if($c > $m){\n $m = $c;\n }\n $c = 1;\n }\n }\n echo $m.\"\\n\";\n \n }\n"}, {"source_code": " $ml)\n\t\t\t\t$ml = $l;\n\t\t}\n\t\t$ans .= ($ml+1).\"\\n\";\n\t}\n\n\tprint $ans;\n\n?>"}, {"source_code": " $v) {\n if ($v != 'R') {\n $c++;\n if ($c > $m) {\n $m = $c;\n }\n } else {\n if ($c > $m) {\n $m = $c;\n }\n $c = 1;\n }\n }\n echo $m . \"\\n\";\n}"}, {"source_code": " $v) {\n \n if ($v != 'R') {\n $c++;\n \n if ($c > $m) {\n $m = $c;\n }\n \n } else {\n if ($c > $m) {\n $m = $c;\n }\n $c = 1;\n }\n }\n echo $m . \"\\n\";\n}"}], "negative_code": [{"source_code": " $v) {\n if ($v != 'R') {\n $c++;\n if ($c < $m) {\n $m = $c;\n }\n } else {\n if ($c > $m) {\n $m = $c;\n }\n $c = 1;\n }\n }\n echo $m . \"\\n\";\n}"}, {"source_code": " $v) {\n if ($v != 'R') {\n $c++;\n if ($c > $m) {\n $m = $c;\n }\n } else {\n if ($c > $m) {\n $m = $c;\n }\n $c = 1;\n }\n }\n echo $m . \"\\n\";\n}"}], "src_uid": "6451507b21854d5b81aeaf0491ddf584"} {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "d5bd27c969d9cd910f13baa53c247871"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "\";\n\t\t$n = trim (fgets(STDIN)) ; //$n - kolvo cisel\n//$n=4 ;\n\t\t$arr = explode(\" \", (trim(fgets(STDIN))) );\n//$arr = [2,1,3,1];\n\t\t$result = 1;\n/*\n\t\t\tfor ($i=0; $i < (count ($arr) -1) ; $i++) { \n//\t\t\t\techo (count ($arr)).\"
\";\n\t\t\t\t\tif ($arr[$i] == $arr[$i+1]) {\n\t\t\t\t\t\t$result ++ ;\n\t\t\t\t}\n\t\t\t\tif ($n == count($arr) ) {\n\t\t\t\t \t$result = 1;\n\t\t\t\t}\t\n\t\t\t}\n\t\techo $result.\"\\n\";\n\t}\n\n\n\n\n\t$b= 4;\n\t$c = [3,4,7,7];\n\t$d = 1;\n*/\n\t\tfor ($y=0; $y < $n -1; $y++) { \n\t\t\tif ($arr[$y] == $arr[$y+1]) {\n\t\t\t\t$result ++;\n\t\t\t}\n\t\t}\n\n\t\tif ($n == $result) {\n\t\t\techo $result.\"\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo\"1\\n\";\n\t\t}\n\t}\n?>"}, {"source_code": "\";\n\t\t$n = trim (fgets(STDIN)) ; //$n - kolvo cisel\n//$n=4 ;\n\t\t$arr = explode(\" \", (trim(fgets(STDIN))) );\n//$arr = [2,1,3,1];\n\t\t\t$result = 1;\n\t\t\tfor ($i=0; $i < (count ($arr) -1) ; $i++) { \n//\t\t\t\techo (count ($arr)).\"
\";\n\t\t\t\t\tif ($arr[$i] == $arr[$i+1]) {\n\t\t\t\t\t\t$result ++ ;\n\t\t\t\t}\n\t\t\t\tif ($n == count($arr) ) {\n\t\t\t\t \t$result = 1;\n\t\t\t\t}\t\n\t\t\t}\n\t\techo $result.\"\\n\";\n\t}\n\n\n\n\n/*\t$b= 4;\n\t$c = [3,4,7,7];\n\t$d = 1;\n\n\tfor ($y=0; $y < $b -1; $y++) { \n\t\tif ($c[$y] == $c[$y+1]) {\n\t\t\t$d ++;\n\t\t\techo $d.\"
\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\n\t\t$n = trim (fgets(STDIN)) ; //$n - kolvo cisel\n//$n=4 ;\n\t\t$arr = explode(\" \", (trim(fgets(STDIN))) );\n//$arr = [2,1,3,1];\n\t\t\t$result = 1;\n\t\t\tfor ($i=0; $i < (count ($arr) -1) ; $i++) { \n\t\t\t\t\tif ($arr[$i] == $arr[$i+1]) {\n\t\t\t\t\t\t$result ++ ;\n\t\t\t\t}\n\t\t\t\telseif ($n == count($arr) ) {\n\t\t\t\t \t$result = 1;\n\t\t\t\t}\t\n\t\t\t}\n\t\techo $result.\"
\";\n\t}\n\n\n\n\n/*\t$b= 4;\n\t$c = [3,4,7,7];\n\t$d = 1;\n\n\tfor ($y=0; $y < $b -1; $y++) { \n\t\tif ($c[$y] == $c[$y+1]) {\n\t\t\t$d ++;\n\t\t\techo $d.\"
\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": ""}, {"source_code": "\";\n\t\t$n = trim (fgets(STDIN)) ; //$n - kolvo cisel\n//$n=4 ;\n\t\t$arr = explode(\" \", (trim(fgets(STDIN))) );\n//$arr = [2,1,3,1];\n\t\t$result = 1;\n/*\n\t\t\tfor ($i=0; $i < (count ($arr) -1) ; $i++) { \n//\t\t\t\techo (count ($arr)).\"
\";\n\t\t\t\t\tif ($arr[$i] == $arr[$i+1]) {\n\t\t\t\t\t\t$result ++ ;\n\t\t\t\t}\n\t\t\t\tif ($n == count($arr) ) {\n\t\t\t\t \t$result = 1;\n\t\t\t\t}\t\n\t\t\t}\n\t\techo $result.\"\\n\";\n\t}\n\n\n\n\n\t$b= 4;\n\t$c = [3,4,7,7];\n\t$d = 1;\n*/\n\t\tfor ($y=0; $y < $n -1; $y++) { \n\t\t\tif ($arr[$y] == $arr[$y+1]) {\n\t\t\t\t$result ++;\n\t\t\t}\n\t\t}\n\n\t\tif ($n == $result) {\n\t\t\tprint $result.\"\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint \"1\\n\";\n\t\t}\n\t}\n?>"}, {"source_code": "\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\t\t$n = trim (fgets(STDIN)) ; //$n - kolvo cisel\n//$n=4 ;\n\t\t$arr = explode(\" \", (trim(fgets(STDIN))) );\n//$arr = [2,1,3,1];\n\t\t$result = 1;\n/*\n\t\t\tfor ($i=0; $i < (count ($arr) -1) ; $i++) { \n//\t\t\t\techo (count ($arr)).\"
\";\n\t\t\t\t\tif ($arr[$i] == $arr[$i+1]) {\n\t\t\t\t\t\t$result ++ ;\n\t\t\t\t}\n\t\t\t\tif ($n == count($arr) ) {\n\t\t\t\t \t$result = 1;\n\t\t\t\t}\t\n\t\t\t}\n\t\techo $result.\"\\n\";\n\t}\n\n\n\n\n\t$b= 4;\n\t$c = [3,4,7,7];\n\t$d = 1;\n*/\n\t\tfor ($y=0; $y < $n -1; $y++) { \n\t\t\tif ($arr[$y] == $arr[$y+1]) {\n\t\t\t\t$result ++;\n\t\t\t\techo $result.\"
\";\n\t\t\t}\n\t\t}\n\n\t\tif ($n == $result) {\n\t\t\techo $result.\"
\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo\"1\";\n\t\t}\n\t}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\n\t\t$n = trim (fgets(STDIN)) ; //$n - kolvo cisel\n//$n=4 ;\n\t\t$arr = explode(\" \", (trim(fgets(STDIN))) );\n//$arr = [2,1,3,1];\n\t\t\t$result = 1;\n\t\t\tfor ($i=0; $i < (count ($arr) -1) ; $i++) { \n\t\t\t\t\tif ($arr[$i] == $arr[$i+1]) {\n\t\t\t\t\t\t$result ++ ;\n\t\t\t\t}\n\t\t\t\tif ($n == count($arr) ) {\n\t\t\t\t \t$result = 1;\n\t\t\t\t}\t\n\t\t\t}\n\t\techo $result.\"
\";\n\t}\n\n\n\n\n/*\t$b= 4;\n\t$c = [3,4,7,7];\n\t$d = 1;\n\n\tfor ($y=0; $y < $b -1; $y++) { \n\t\tif ($c[$y] == $c[$y+1]) {\n\t\t\t$d ++;\n\t\t\techo $d.\"
\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}, {"source_code": "\";\n\t}\n\n\n\n\n/*\t$b= 4;\n\t$c = [3,4,7,7];\n\t$d = 1;\n\n\tfor ($y=0; $y < $b -1; $y++) { \n\t\tif ($c[$y] == $c[$y+1]) {\n\t\t\t$d ++;\n\t\t\techo $d.\"
\";\n\t\t}\n\t}\n\n\tif ($b == $d) {\n\t\techo $b.\"
\";\n\t}\n\telse\n\t{\n\t\techo\"1\";\n\t}\n*/\n\n\n\n\n\n\n\n\n?>"}], "src_uid": "7b80d3f3cd4f93e4277c76c76dc41f42"} {"source_code": "';print_r($var);echo '';} \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 read_line();\n $arr = read_array();\n \n $b = array();\n \n foreach($arr as $item)\n {\n if(isset($b[$item])) $b[$item]++;\n else $b[$item]=1;\n }\n \n $count = count($b);\n $max = max($b);\n \n echo \"{$max} {$count}\";\n?>", "positive_code": [{"source_code": ""}, {"source_code": " 0) $ans++;\n\tif($a[$i] >$tmp) $tmp = $a[$i];\n}\necho $tmp . \" \" . $ans;\n\n?>"}, {"source_code": ""}, {"source_code": " $max) $max = $imax;\n } \n}\n\necho \"$max $col\";\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $max ){\n $max = array_value_count($count[$i], $tree);\n }\n}\n\n/*\n * \u0418\u0449\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435\n */\nfunction array_value_count( $match, $array ){\n $count = 0;\n\n foreach( $array as $key => $value ){\n if( $value == $match ){\n $count++;\n }\n }\n return $count;\n}\n\necho $max.' '.count( $count );"}, {"source_code": "$v)\n{\n $b[$v]++;\n $mx=max($mx,$b[$v]);\n}\nprintf(\"%d %d\\n\",$mx,count($b));\n//for(fscanf($fl,\"%d\",$n),$a=array(),$i=0;$i<$n;++$i,fscanf($fl,\"%d\",$a[$i]));\n//var_dump($a);\n//echo $a;\n?>"}, {"source_code": ""}, {"source_code": "$v) {\n if (!isset($c[$v])) {$c[$v] = 1;$sum++;}\n else {$c[$v]++;}\n if ($max < $c[$v]) {$max = $c[$v];}\n}\n\necho $max.\" \".$sum;"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$v)\n{\n $b[$v]++;\n $mx=max($mx,$b[$v]);\n}\nprintf(\"%d %d\\n\",$mx,count($b));\n//for(fscanf($fl,\"%d\",$n),$a=array(),$i=0;$i<$n;++$i,fscanf($fl,\"%d\",$a[$i]));\n//var_dump($a);\n//echo $a;\n?>"}, {"source_code": "$v)\n{\n $b[$v]++;\n $mx=max($mx,$b[$v]);\n}\nprintf(\"%d %d\\n\",$mx,count($b));\n//for(fscanf($fl,\"%d\",$n),$a=array(),$i=0;$i<$n;++$i,fscanf($fl,\"%d\",$a[$i]));\n//var_dump($a);\n//echo $a;\n?>"}, {"source_code": "\n"}, {"source_code": "$v) {\n if (!isset($c[$v])) {$c[$v] = 1;$sum++;}\n else {$c[$v]++;}\n if ($max < $c[$v]) {$max = $c[$v];}\n}\n\necho $max.\" \".$sum;"}, {"source_code": "$v) {\n if (!isset($c[$v])) {$c[$v] = 1;$sum++;}\n else {$c[$v]++;}\n if ($max < $c[$v]) {$max = $c[$v];}\n}\n\necho $max.\" \".$sum;\nif ($errors == 1) {\necho '\".$str2.\"';\nprint_r($str);\nprint_r($c);\n}"}, {"source_code": "$v) {\n if (!isset($c[$v])) {$c[$v] = 1;$sum++;}\n else {$c[$v]++;}\n if ($max < $c[$v]) {$max = $c[$v];}\n}\n\necho $max.\" \".$sum;"}, {"source_code": "$v) {\n if (!isset($c[$v])) {$c[$v] = 1;$sum++;}\n else {$c[$v]++;}\n if ($max < $c[$v]) {$max = $c[$v];}\n}\n\necho $max.\" \".$sum.\"'\".$str2.\"'\";\nif ($errors == 1) {\nprint_r($str);\nprint_r($c);\n}"}, {"source_code": " 0) $ans++;\n\tif($a[$i] >$tmp) $tmp = $a[$i];\n}\necho $n-$ans+1 . \" \" . $ans;\n\n?>"}, {"source_code": " 0) $ans++;\n}\necho $n-$ans+1 . \" \" . $ans;\n\n?>"}, {"source_code": " 0) $ans++;\n}\necho $ans;\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$n=trim(fgets(STDIN));\n$arr=explode(' ',trim(fgets(STDIN)));\nforeach($arr as $v)\n $newarr[$v]++;\n$max=max($newarr);\n$count=sizeof($newarr);\nprintf('%.0f',$max);\necho \" \";\nprintf('%.0f',$count);\n?>"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "9a92221c760a3b6a1e9318f948fe0473"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " 0) {\n echo \"2\";\n if ($x2 > $x1) {\n $turbo= PHP_EOL.number_format($x1, 10, '.', '').PHP_EOL.number_format($x2, 10, '.', '');\n }else $turbo= PHP_EOL.number_format($x2, 10, '.', '').PHP_EOL.number_format($x1, 10, '.', '');\n }elseif ($arg < 0) {\n echo \"0\";\n }\n}elseif ($a== 0 and $b == 0 and $c == 0) {\n $turbo= -1;\n}elseif ($a==0 and $b ==0) {\n echo 0; \n}elseif ($c != 0 or $b != 0) {\necho 1; \n$turbo= PHP_EOL.number_format(-$c/$b, 10, '.', '');\n }else echo 0;\n\necho $turbo;\n?>", "positive_code": [{"source_code": "0)\n{\n if($d>0)\n {\n $c .= \"2\\n\";\n if((number_format($e1, 10, '.', ''))>(number_format($e, 10, '.', '')))\n {\n $c .= (number_format($e, 10, '.', '')).\"\\n\".(number_format($e1, 10, '.', ''));\n }else{\n $c .= (number_format($e1, 10, '.', '')).\"\\n\".(number_format($e, 10, '.', ''));\n }\n }elseif($d==0){\n $c .= \"1\\n\".number_format($e, 10, '.', '');\n }elseif($d<0){\n $c .= \"0\";\n }\n}else{\n $c .= \"1\\n\".(number_format((-($b[2])/$b[1]), 10, '.', ''));\n}\nif($b[0]==0 && $b[1]==0 && $b[2]==0)\n{$c = \"-1\";}elseif($b[0]==0 && $b[1]==0){$c = \"0\";}\necho $c;\n?>"}], "negative_code": [{"source_code": " 0) {\n echo \"2\";\n if ($x2 > $x1) {\n $turbo= PHP_EOL.number_format($x1, 10, '.', '').PHP_EOL.number_format($x2, 10, '.', '');\n }else $turbo= PHP_EOL.number_format($x2, 10, '.', '').PHP_EOL.number_format($x1, 10, '.', '');\n }elseif ($arg < 0) {\n echo \"0\";\n }\n}elseif ($a== 0 and $b == 0 and $c == 0) {\n $turbo= -1;\n}elseif ($c != 0 or $b != 0) {\necho 1; \n$turbo= PHP_EOL.number_format(-$c/$b, 10, '.', '');\n }else echo 0;\n\necho $turbo;\n?>"}, {"source_code": " 0) {\n echo \"2\";\n if ($x2 > $x1) {\n $turbo= PHP_EOL.number_format($x1, 10, '.', '').PHP_EOL.number_format($x2, 10, '.', '');\n }else $turbo= PHP_EOL.number_format($x2, 10, '.', '').PHP_EOL.number_format($x1, 10, '.', '');\n }elseif ($arg < 0) {\n echo \"0\";\n }\n}elseif ($a== 0 and $b == 0 and $c == 0) {\n $turbo= -1;\n}elseif ($c != 0 and $b != 0) {\necho 1; \n$turbo= PHP_EOL.number_format(-$c/$b, 10, '.', '');\n }else echo 0;\n\necho $turbo;\n?>"}, {"source_code": "0)\n{\n if($d>0)\n {\n $c .= \"2\\n\".number_format($e1, 10, '.', '').\"\\n\".number_format($e, 10, '.', '');\n }elseif($d==0){\n $c .= \"1\\n\".number_format($e, 10, '.', '');\n }elseif($d<0){\n $c .= \"0\";\n }\n}else{\n $c .= \"1\\n\".(number_format((-($b[2])/$b[1]), 10, '.', ''));\n}\nif($b[0]==0 && $b[1]==0 && $b[2]==0)\n{$c = \"-1\";}elseif($b[0]==0 && $b[1]==0){$c = \"0\";}\necho $c;\n?>"}], "src_uid": "84372885f2263004b74ae753a2f358ac"} {"source_code": "= $max1) {\r\n $max2 = $max1;\r\n $max1 = $num;\r\n }\r\n else if ($num >= $max2) {\r\n $max2 = $num;\r\n }\r\n if ($num <= $min1) {\r\n $min2 = $min1;\r\n $min1 = $num;\r\n }\r\n else if ($num <= $min2) {\r\n $min2 = $num;\r\n }\r\n\r\n }\r\n $value = $max1 - $min1 + $max2 - $min2;\r\n array_push($result, $value);\r\n}\r\nforeach ($result as $item) {\r\n echo $item . \"\\n\";\r\n}\r\n?>"}], "negative_code": [{"source_code": "\r\n= $max1) {\r\n $max2 = $max1;\r\n $max1 = $num;\r\n }\r\n else if ($num >= $max2) {\r\n $max2 = $num;\r\n }\r\n if ($num <= $min1) {\r\n $min2 = $min1;\r\n $min1 = $num;\r\n }\r\n else if ($num <= $min2) {\r\n $min2 = $num;\r\n }\r\n\r\n }\r\n // fix for the second input \r\n $value = $max1 - $min1 + $max2 - $min2;\r\n array_push($result, $value);\r\n}\r\nforeach ($result as $item) {\r\n echo $item . \"\\n\";\r\n}\r\n?>"}, {"source_code": "\r\n= $max1) {\r\n $max2 = $max1;\r\n $max1 = $num;\r\n }\r\n else if ($num >= $max2) {\r\n $max2 = $num;\r\n }\r\n if ($num <= $min1) {\r\n $min2 = $min1;\r\n $min1 = $num;\r\n }\r\n else if ($num <= $min2) {\r\n $min2 = $num;\r\n }\r\n\r\n }\r\n // fix for the second input \r\n $value = $max1 - $min1 + $max2 - $min2;\r\n array_push($result, $value);\r\n}\r\nforeach ($result as $item) {\r\n echo $item . \"\\n\";\r\n}\r\n?>"}, {"source_code": "\r\n= $max1) {\r\n $max2 = $max1;\r\n $max1 = $num;\r\n }\r\n else if ($num >= $max2) {\r\n $max2 = $num;\r\n }\r\n if ($num <= $min1) {\r\n $min2 = $min1;\r\n $min1 = $num;\r\n }\r\n else if ($num <= $min2) {\r\n $min2 = $num;\r\n }\r\n\r\n }\r\n // fix for the second input \r\n $value = $max1 - $min1 + $max2 - $min2;\r\n array_push($result, $value);\r\n}\r\nprint_r($result);\r\n?>"}, {"source_code": "\r\n= $max1) {\r\n $max2 = $max1;\r\n $max1 = $num;\r\n }\r\n else if ($num >= $max2) {\r\n $max2 = $num;\r\n }\r\n if ($num <= $min1) {\r\n $min2 = $min1;\r\n $min1 = $num;\r\n }\r\n else if ($num <= $min2) {\r\n $min2 = $num;\r\n }\r\n\r\n }\r\n // fix for the second input \r\n $result = $max1 - $min1 + $max2 - $min2;\r\n fprintf($cout, $result);\r\n}?>\r\n"}], "src_uid": "1e54530bc8cff81199b9cc1a6e51d638"} {"source_code": ""}, {"source_code": ""}, {"source_code": " $v)\n{\n if ($v % 2 == 0)\n $s += $v / 2;\n else\n $s += floor($v / 2);\n}\necho floor($s / 2);\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "f9b56b3fddcd5db0d0671714df3f8646"} {"source_code": "0)\n {\n $cnt+=$p[$i]-1;\n\n }else if($p[$i]<0)\n {\n $cnt+=-1-$p[$i];\n $less*=-1;\n\n }else\n {\n $cnt++;\n $ok=1;\n }\n}\nif($ok || $less==1)\n{\n echo $cnt;\n}else\n{\n echo $cnt+2;\n}\n?>\n", "positive_code": [{"source_code": " 0)\n {\n $e++;\n $f += $b[$x] - 1;\n }\n}\nif($c % 2 == 0)\n{\n if($d > 0)\n {\n $f += $d;\n }\n}\nelse\n{\n if($d > 0)\n {\n $f += $d;\n }\n else\n {\n $f += 2;\n }\n}\nprint $f;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "0)\n {\n $cnt+=$p[$i]-1;\n\n }else if($p[$i]<0)\n {\n $cnt+=-1-$p[$i];\n $less*=-1;\n\n }else\n {\n $cnt++;\n $ok=1;\n }\n}\nif($ok || $less==1)\n{\n echo $cnt;\n}else\n{\n echo $cnt+2;\n}\n?>\n"}], "src_uid": "3b3b2408609082fa5c3a0d55bb65d29a"} {"source_code": " 0)\n{\n $k .= $g;\n}\nfor($x = 0; $x < count($e); $x++)\n{\n $k = $e[$x] . $k;\n $k .= $f[$x];\n}\nif($k == \"\")\n{\n print \"0\\n\";\n}\nelse\n{\n print strlen($k) . \"\\n\";\n print $k . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " $j && $s[$j] != $s[$m-1 - $j]) {\n $palindrom = 0;\n } \n \n }\n $ar['text'] = $s;\n $ar['palindrom'] = $palindrom;\n $array[$s] = $ar;\n $tmp[] = $ar;\n }\n \n \n for($i =0; $i < $n; $i++) {\n $text = $tmp[$i]['text'];\n if(isset($array[$text])) {\n for($q = 1; $q < $n; $q++) {\n if($q != $i){\n $text2 = $tmp[$q]['text'];\n $p = 1;\n for($j=0; $j<$m; $j++) {\n if($text[$j] != $text2[$m-1 - $j]) {\n $p = 0;\n break;\n }\n }\n if($p == 1 ) {\n $array[$text]['p_text'] = $text2;\n unset($array[$text2]);\n break;\n }\n }\n \n }\n }\n \n \n }\n \n $countP = 0;\n $string = '';\n foreach ($array as $key => $a) {\n \n if(!isset($a['p_text']) && $a['palindrom'] == 1 && $countP == 0) {\n $countP ++;\n $string .= $array[$key]['text'];\n }\n }\n \n foreach ($array as $a) {\n if(isset($a['p_text'])) {\n $string =$a['text']. $string . $a['p_text'];\n }\n }\n \n if(strlen($string)) {\n echo strlen($string) .\"\\n\". $string. \"\\n\";\n } else {\n echo \"0\\n\";\n }\n \n "}], "negative_code": [], "src_uid": "554115bec46bb436a0a1ddf8c05a2d08"} {"source_code": " $i[$x])\n {\n $q += abs($j[$x + 1] - $i[$x]); \n }\n else\n {\n $j[$x + 1] = $i[$x];\n }\n $n += $q;\n }\n elseif(($o == 0) && ($p == 1))\n {\n $q = abs($j[$x] - $i[$x]);\n if($i[$x + 1] < $i[$x])\n {\n $q += abs($i[$x] - $i[$x + 1]);\n }\n else\n {\n $i[$x + 1] = $i[$x];\n }\n $n += $q;\n }\n elseif(($o == 1) && ($p == 0))\n {\n $q = abs($j[$x] - $i[$x]);\n if($j[$x + 1] > $j[$x])\n {\n $q += abs($j[$x + 1] - $j[$x]);\n }\n else\n {\n $j[$x + 1] = $j[$x];\n }\n $n += $q;\n }\n elseif(($o == 1) && ($p == 1))\n {\n $q = abs($j[$x] - $i[$x]);\n if($i[$x + 1] < $j[$x])\n {\n $q += abs($j[$x] - $i[$x + 1]);\n }\n else\n {\n $i[$x + 1] = $j[$x];\n }\n $n += $q;\n }\n }\n $n += abs($j[$x] - $i[$x]);\n print $n + $h;\n}\n?>", "positive_code": [{"source_code": " $j) $left[$i] = $j;\n if($right[$i] < $j) $right[$i] = $j;\n }\n }\n\n $now = 0;\n $res = 0;\n for($i=0;$i<$x;$i++){\n if( $fg[$i]===false ) continue;\n if($i%2==0){\n if($now > $left[$i]){\n $res += $now - $left[$i];\n $now = $left[$i];\n }\n $res += $right[$i] - $now;\n $now = $right[$i];\n } else {\n if($now < $right[$i]){\n $res += $right[$i] - $now;\n $now = $right[$i];\n }\n $res += $now - $left[$i];\n $now = $left[$i];\n }\n }\n\n for($i=$x-1;$i>=0;$i--) if($fg[$i]===true){\n $res += $i;\n break;\n }\n\n echo $res.\"\\n\";\n}\n\n?>\n"}], "negative_code": [], "src_uid": "14959b7266ceebe96c33bfa1791e26b4"} {"source_code": " -1; $i--) {\n if ($a[$i] > $now) {\n $now = $a[$i];\n $a[$i] = 0;\n } else {\n $a[$i] = abs($now - $a[$i] + 1);\n }\n }\n for ($i = 0; $i < $n; $i++) \n print($a[$i].\" \");\n?>\n ", "positive_code": [{"source_code": "= 0; $x--)\n{\n if($x == $a - 1)\n {\n $c[$x] = 0;\n $d = max($d, $b[$x]);\n }\n else\n {\n if($b[$x] <= $d)\n {\n $c[$x] = $d - $b[$x] + 1;\n }\n else\n {\n $c[$x] = 0;\n }\n $d = max($d, $b[$x]);\n }\n}\n$e = array_reverse($c);\nprint implode(\" \", $e);\n?>"}, {"source_code": "0; $i--) {\n if ($aArray[$i]>$max) {\n $rArray[$i] = 0;\n $max = $aArray[$i];\n } else {\n $rArray[$i] = $max - $aArray[$i] + 1;\n }\n}\nfor ($i = 1; $i <= $n; $i++) {\n echo $rArray[$i] . \" \";\n}"}, {"source_code": "0; $i--){\n $out[$i] = max(0, $max + 1 - $floors[$i-1]);\n $max = max($max,$floors[$i-1]);\n}\n$out = array_reverse($out);\n$out = implode(' ',$out);\nfwrite(STDOUT,$out);"}, {"source_code": "0; $i--) {\n if ($aArray[$i]>$max) {\n $rArray[$i] = 0;\n $max = $aArray[$i];\n } else {\n $rArray[$i] = $max - $aArray[$i] + 1;\n }\n}\nfor ($i = 1; $i <= $n; $i++) {\n echo $rArray[$i] . \" \";\n}"}], "negative_code": [{"source_code": "0; $i--){\n $max = max($max,$floors[$i-1]);\n $out[$i-1] = $max - $floors[$i-1];\n if($out[$i-1]>0){\n $out[$i-1] = strval($out[$i-1]+1);\n }\n\n}\n$out = array_reverse($out);\n$out = implode(' ',$out);\nfwrite(STDOUT,$out);"}, {"source_code": "0; $i--){\n $out[$i] = max(0, $max + 1 - $floors[$i-1]);\n}\n$out = array_reverse($out);\n$out = implode(' ',$out);\nfwrite(STDOUT,$out);"}, {"source_code": "0; $i--){\n $max = max($max,$floors[$i-1]);\n $out[$i-1] = $max - $floors[$i-1];\n if($out[$i-1]>0){\n $out[$i-1]++;\n }\n\n}\n$out = array_reverse($out);\n$out = implode(' ',$out);\nfwrite(STDOUT,$out);"}, {"source_code": "0; $i--){\n $max = max($max,$floors[$i-1]);\n $out[$i-1] = $max - $floors[$i-1];\n if($out[$i-1]>0){\n $out[$i-1]++;\n }\n\n}\n$out = implode(' ',$out);\nfwrite(STDOUT,$out);"}, {"source_code": "$file = STDIN;\n$n = trim(fgets($file));\n$aArray = explode(\" \", trim(fgets($file)));\narray_unshift($aArray, \"T\");\nunset($aArray[0]);\n$rArray[$n] = 0;\n$max = $aArray[$n];\nfor ($i = $n-1; $i >0; $i--) {\n if ($aArray[$i]>$max) {\n $rArray[$i] = 0;\n $max = $aArray[$i];\n } else {\n $rArray[$i] = $max - $aArray[$i] + 1;\n }\n}\nfor ($i = 1; $i <= $n; $i++) {\n echo $rArray[$i] . \" \";\n}"}, {"source_code": "$a = trim(fgets(STDIN));\n$b = explode(\" \", trim(fgets(STDIN)));\n$c = array();\n$d = 0;\nfor($x = $a - 1; $x >= 0; $x--)\n{\n if($x == $a - 1)\n {\n $c[$x] = 0;\n $d = max($d, $b[$x]);\n }\n else\n {\n if($b[$x] <= $d)\n {\n $c[$x] = $d - $b[$x] + 1;\n }\n else\n {\n $c[$x] = 0;\n }\n $d = max($d, $b[$x]);\n }\n}\n$e = array_reverse($c);\nprint implode(\" \", $e);"}], "src_uid": "e544ed0904e2def0c1b2d91f94acbc56"} {"source_code": " 0)\n {\n array_push($e, \"L\");\n $b--;\n }\n else\n {\n array_push($e, \"S\");\n }\n }\n else\n {\n array_push($e, \"S\");\n }\n $f++;\n }\n array_unshift($e, \" \");\n unset($e[0]);\n $h = \"\";\n $j = array();\n $k = 2;\n for($x = 1; $x <= count($e); $x++)\n {\n $i = $x % $a;\n if($i == 0)\n {\n $h .= $e[$x];\n $l = $k % 2;\n if($l != 0)\n {\n $h = strrev($h);\n }\n array_push($j, $h);\n $h = \"\";\n $k++;\n }\n else\n {\n $h .= $e[$x];\n } \n }\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $j[$x] . \"\\n\";\n }\n print $j[$x];\n }\n else\n {\n print \"NO\";\n }\n }\n else\n {\n $d = ceil($a * $a / 2);\n if($b <= $d)\n {\n print \"YES\\n\";\n $e = array();\n $f = 2;\n for($x = 0; $x < $a * $a; $x++)\n {\n $g = ($f % 2);\n if($g == 0)\n {\n if($b > 0)\n {\n array_push($e, \"L\");\n $b--;\n }\n else\n {\n array_push($e, \"S\");\n }\n }\n else\n {\n array_push($e, \"S\");\n }\n $f++;\n }\n array_unshift($e, \" \");\n unset($e[0]);\n $h = \"\";\n $j = array();\n $k = 2;\n for($x = 1; $x <= count($e); $x++)\n {\n $i = $x % $a;\n if($i == 0)\n {\n $h .= $e[$x];\n $l = $k % 2;\n if($l != 0)\n {\n $h = strrev($h);\n }\n array_push($j, $h);\n $h = \"\";\n $k++;\n }\n else\n {\n $h .= $e[$x];\n } \n }\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $j[$x] . \"\\n\";\n }\n print $j[$x];\n }\n else\n {\n print \"NO\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " ($a * $a + 1) / 2) {\n echo \"NO\\n\";\n} else {\n echo \"YES\\n\";\n for ($i = 0; $i < $a; ++$i) {\n $pos = $i % 2;\n for ($j = 0; $j < $a; ++$j) {\n if ($j == $pos && $b > 0) {\n $pos += 2;\n --$b;\n echo \"L\";\n } else {\n echo \"S\";\n }\n }\n echo \"\\n\";\n }\n}\n"}], "negative_code": [{"source_code": " 0)\n {\n array_push($e, \"L\");\n $b--;\n }\n else\n {\n array_push($e, \"S\");\n }\n }\n else\n {\n array_push($e, \"S\");\n }\n $f++;\n }\n array_unshift($e, \" \");\n unset($e[0]);\n $h = \"\";\n $j = array();\n $k = 2;\n for($x = 1; $x <= count($e); $x++)\n {\n $i = $x % $a;\n if($i == 0)\n {\n $h .= $e[$x];\n $l = $k % 2;\n if($l != 0)\n {\n $h = strrev($h);\n }\n array_push($j, $h);\n $h = \"\";\n $k++;\n }\n else\n {\n $h .= $e[$x];\n } \n }\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $j[$x] . \"\\n\";\n }\n print $j[$x];\n }\n else\n {\n print \"NO\";\n }\n }\n else\n {\n $d = ceil($a * $a / 2);\n if($b <= $d)\n {\n print \"YES\\n\";\n $e = array();\n $f = 2;\n for($x = 0; $x < $a * $a; $x++)\n {\n $g = ($f % 2);\n if($g == 0)\n {\n if($b > 0)\n {\n array_push($e, \"L\");\n $b--;\n }\n else\n {\n array_push($e, \"S\");\n }\n }\n else\n {\n array_push($e, \"S\");\n }\n $f++;\n }\n array_unshift($e, \" \");\n unset($e[0]);\n $h = \"\";\n $j = array();\n $k = 2;\n for($x = 1; $x <= count($e); $x++)\n {\n $i = $x % $a;\n if($i == 0)\n {\n $h .= $e[$x];\n $l = $k % 2;\n if($l != 0)\n {\n $h = strrev($h);\n }\n array_push($j, $h);\n $h = \"\";\n $k++;\n }\n else\n {\n $h .= $e[$x];\n } \n }\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $j[$x] . \"\\n\";\n }\n print $j[$x];\n }\n else\n {\n print \"NO\";\n }\n }\n}\n?>"}], "src_uid": "b15bc7ff01f239a7e4377868a7dda0a6"} {"source_code": " $v) {\n if (!isset($map1[$k])) {\n $check = false;\n } else {\n if ($map1[$k] != $v) {\n $check = false;\n }\n }\n }\n if ($check) {\n $ans = true;\n break;\n }\n }\n if ($ans) echo 'YES';\n else echo \"NO\";\n echo \"\\n\";}\n else\n {\n echo \"NO\";\n echo \"\\n\";\n }\n }\n}\n\nsolve();\n?>", "positive_code": [{"source_code": " $v){\n if(in_array($v, $p)){\n $b = true;\n $s = $p;\n $cv = '';\n for($i = array_search($v, $h); $i < count($p) + array_search($v, $h); $i++){\n if(in_array($h[$i], $s)){\n unset($s[array_search($h[$i], $s)]); \n } else {\n $b = false;\n //break;\n }\n }\n if($b == true){\n break;\n }\n }\n unset($h[$k]);\n }\n \n if($b == false){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n }\n \n}"}, {"source_code": " $v){\n if(in_array($v, $p)){\n $b = true;\n $s = $p;\n $cv = '';\n for($i = array_search($v, $h); $i < count($p) + array_search($v, $h); $i++){\n if(in_array($h[$i], $s)){\n unset($s[array_search($h[$i], $s)]); \n } else {\n $b = false;\n //break;\n }\n }\n if($b == true){\n break;\n }\n }\n unset($h[$k]);\n }\n \n if($b == false){\n echo \"NO\\n\";\n } else {\n echo \"YES\\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 $e = 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);\n for($y = 0; $y < strlen($b); $y++)\n {\n $d[$b[$y]]++;\n }\n for($y = 0; $y < strlen($b); $y++)\n {\n $e[$c[$y]]++;\n }\n if($d == $e)\n {\n print \"YES\\n\";\n }\n else\n {\n $f = $y;\n $g = 0;\n for($y = 0; $y < strlen($c) - strlen($b); $y++)\n {\n $e[$c[$y]]--;\n $e[$c[$f]]++;\n $f++;\n if($d == $e)\n {\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": "$lenH)\n \techo \"NO\\n\";\n elseif ($lenP==$lenH)\n {\n //echo CharOccurOfStrP($password,$lenP).\"\\n\";\n //echo CharOccurOfStrH($hash,$lenH).\"\\n\";\n \tif(CharOccurOfStrP($password)==CharOccurOfStrH($hash))\n \t\techo \"YES\\n\";\n \telse\n \t\techo \"NO\\n\";\n\n \t \n }\n else\n {\n \t$flag=0;\n \t\n \tfor ($i=0; $i <$lenH ; $i++)\n \t{\n\n $newStr=substr($hash,$i,$lenP);\n if(CharOccurOfStrH($newStr)==CharOccurOfStrP($password))\n {\n \t$flag=1;\n \techo \"YES\\n\";\n \tbreak;\n }\n \n }\n if($flag==0)\n \techo \"NO\\n\";\n }\n \n}\nfunction CharOccurOfStrP($password)\n {\n \t$str=\"\";\n \t$alphabet=\"abcdefghijklmnopqrstuvwxyz\";\n for ($i=0; $i $lenH)\n \techo \"NO\\n\";\n elseif ($lenP==$lenH)\n {\n //echo CharOccurOfStrP($password,$lenP).\"\\n\";\n //echo CharOccurOfStrH($hash,$lenH).\"\\n\";\n \tif(CharOccurOfStrP($password)==CharOccurOfStrH($hash))\n \t\techo \"YES\\n\";\n \telse\n \t\techo \"NO\\n\";\n\n \t \n }\n else\n {\n \t$flag=0;\n \t\n \tfor ($i=0; $i <$lenP ; $i++)\n \t{\n\n $newStr=substr($hash,$i,$lenP);\n if(CharOccurOfStrH($newStr)==CharOccurOfStrP($password))\n {\n \t$flag=1;\n \techo \"YES\\n\";\n \tbreak;\n }\n \n }\n if($flag==0)\n \techo \"NO\\n\";\n }\n \n}\nfunction CharOccurOfStrP($password)\n {\n \t$str=\"\";\n \t$alphabet=\"abcdefghijklmnopqrstuvwxyz\";\n for ($i=0; $i $v){\n if(in_array($v, $h)){\n $b = true;\n $s = $p;\n $cv = '';\n for($i = array_search($v, $h); $i < count($p) + array_search($v, $h); $i++){\n if(in_array($h[$i], $s)){\n unset($s[array_search($h[$i], $s)]); \n } else {\n $b = false;\n break;\n }\n }\n if($b == true){\n break;\n }\n }\n }\n \n if($b == false){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n }\n \n}"}, {"source_code": " $v){\n if(in_array($v, $p)){\n $l[$i][] = $v;\n } else {\n $i++;\n }\n }\n foreach($l as $f){\n foreach($f as $s){\n $c .= $s;\n // if(!in_array($s, $p)){\n // $b = false;\n // }\n // if($b && count($f) == count($p)){\n // echo \"YES\\n\";\n // }\n }\n if(strlen($c) == strlen($u) || strpos($u, $c) !== false || strpos($c, $u) !== false){\n $b = true;\n }\n }\n if($b == false){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n }\n \n}"}, {"source_code": " $v) {\n if (!isset($map1[$k])) {\n $check = false;\n } else {\n if ($map1[$k] != $v) {\n $check = false;\n }\n }\n }\n if ($check) {\n $ans = true;\n break;\n }\n }\n if ($ans) echo 'YES';\n else echo \"NO\";\n echo \"\\n\";}\n else\n {\n echo \"NO\";\n echo \"\\n\";\n }\n }\n}\n\nsolve();\n?>"}], "src_uid": "48151011c3d380ab303ae38d0804176a"} {"source_code": "=1)\n {print \"$x \";$j=1;}}\nif ($j==0) print \"-1\";\n?>", "positive_code": [{"source_code": " $c))\n{\n print \"-1\";\n}\nelseif($b <= $a)\n{\n if($b == 1)\n {\n for($x = 1; $x < $c - $a; $x++)\n {\n print $x . \" \";\n }\n print $x;\n }\n else\n {\n for($x = 1; $x <= 1000000; $x++)\n {\n $d += $b;\n if($d > $c)\n {\n print \"-1\";\n break;\n }\n if($d > $a)\n {\n if(($d + $b) > $c)\n {\n print $d - $a;\n break;\n }\n else\n {\n print ($d - $a) . \" \";\n }\n }\n }\n }\n}\nelseif($b > $a)\n{\n $d = $b;\n for($x = 1; $x <= 1000000; $x++)\n {\n if($d <= $c)\n {\n if(($d + $b) <= $c)\n {\n print $d - $a . \" \";\n $d += $b;\n }\n else\n {\n print $d - $a;\n break;\n }\n }\n }\n}\n?>"}, {"source_code": "\n\n 0 ? 0 : 1;\n$counter = 0;\n\nwhile ($i*$k + $r + $y <= $n) {\n printf(\"%d \", $i*$k + $r);\n $counter ++;\n $i ++;\n}\n\nif ($counter == 0) {\n printf(\"-1\");\n}\n\n?>\n"}, {"source_code": " $c))\n{\n print \"-1\";\n}\nelseif($b <= $a)\n{\n $d = 0;\n if($b == 1)\n {\n for($x = 1; $x < $c - $a; $x++)\n {\n print $x . \" \";\n }\n print $x;\n }\n else\n {\n for($x = 1; $x <= 1000000; $x++)\n {\n $e += $b;\n if($e > $c)\n {\n print \"-1\";\n break;\n }\n if($e > $a)\n {\n if(($e + $b) > $c)\n {\n print $e - $a;\n break;\n }\n else\n {\n $d = 1;\n print ($e - $a) . \" \";\n }\n }\n }\n }\n}\nelseif($b > $a)\n{\n $d = $b;\n for($x = 1; $x <= 1000000; $x++)\n {\n if($d <= $c)\n {\n if(($d + $b) <= $c)\n {\n print $d - $a . \" \";\n $d += $b;\n }\n else\n {\n print $d - $a;\n break;\n }\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " $c) && ($d == 0))\n {\n print \"-1\";\n break;\n }\n if($e > $a)\n {\n if(($e + $b) > $c)\n {\n print $e - $a;\n break;\n }\n else\n {\n $d = 1;\n print ($e - $a) . \" \";\n }\n }\n }\n }\n}\nelseif($b > $a)\n{\n $d = $b;\n for($x = 1; $x <= 1000000; $x++)\n {\n if($d <= $c)\n {\n if(($d + $b) <= $c)\n {\n print $d - $a . \" \";\n $d += $b;\n }\n else\n {\n print $d - $a;\n break;\n }\n }\n }\n}\n?>"}, {"source_code": " $c)\n {\n print \"-1\";\n break;\n }\n if($d > $a)\n {\n if(($d + $b) > $c)\n {\n print $d - $a;\n break;\n }\n else\n {\n print ($d - $a) . \" \";\n }\n }\n }\n }\n}\nelseif($b > $a)\n{\n $d = $b;\n for($x = 1; $x <= 1000000; $x++)\n {\n if($d <= $c)\n {\n if(($d + $b) <= $c)\n {\n print $d - $a . \" \";\n $d += $b;\n }\n else\n {\n print $d - $a;\n break;\n }\n }\n }\n}\n?>"}, {"source_code": " $c))\n{\n print \"-1\";\n}\nelseif($b <= $a)\n{\n $d = 0;\n if($b == 1)\n {\n for($x = 1; $x < $c - $a; $x++)\n {\n print $x . \" \";\n }\n print $x;\n }\n else\n {\n for($x = 1; $x <= 1000000; $x++)\n {\n $e += $b;\n if($e > $a)\n {\n if(($e + $b) > $c)\n {\n print $e - $a;\n break;\n }\n else\n {\n $d = 1;\n print ($e - $a) . \" \";\n }\n }\n }\n }\n}\nelseif($b > $a)\n{\n $d = $b;\n for($x = 1; $x <= 1000000; $x++)\n {\n if($d <= $c)\n {\n if(($d + $b) <= $c)\n {\n print $d - $a . \" \";\n $d += $b;\n }\n else\n {\n print $d - $a;\n break;\n }\n }\n }\n}\n?>"}, {"source_code": " $c))\n{\n print \"-1\";\n}\nelseif($b <= $a)\n{\n $d = 0;\n if($b == 1)\n {\n for($x = 1; $x < $c - $a; $x++)\n {\n print $x . \" \";\n }\n print $x;\n }\n else\n {\n for($x = 1; $x <= 1000000; $x++)\n {\n $e += $b;\n if((($e + $b) > $c) && ($d == 0))\n {\n print \"-1\";\n break;\n }\n if($e > $a)\n {\n if(($e + $b) > $c)\n {\n print $e - $a;\n break;\n }\n else\n {\n $d = 1;\n print ($e - $a) . \" \";\n }\n }\n }\n }\n}\nelseif($b > $a)\n{\n $d = $b;\n for($x = 1; $x <= 1000000; $x++)\n {\n if($d <= $c)\n {\n if(($d + $b) <= $c)\n {\n print $d - $a . \" \";\n $d += $b;\n }\n else\n {\n print $d - $a;\n break;\n }\n }\n }\n}\n?>"}, {"source_code": " $a)\n {\n if(($d + $b) > $c)\n {\n print $d - $a;\n break;\n }\n else\n {\n print ($d - $a) . \" \";\n }\n }\n }\n }\n}\nelseif($b > $a)\n{\n $d = $b;\n for($x = 1; $x <= 1000000; $x++)\n {\n if($d <= $c)\n {\n if(($d + $b) <= $c)\n {\n print $d - $a . \" \";\n $d += $b;\n }\n else\n {\n print $d - $a;\n break;\n }\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=1)\n {print \"$x \";$j=1;}}\nif ($j==0) print \"-1\";\n?>"}], "src_uid": "2deda3a05740e1184735bf437e3850a8"} {"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}", "positive_code": [{"source_code": "= 2) {\r\n break;\r\n }\r\n }\r\n if ($mx >= 2) {\r\n echo 0 . PHP_EOL;\r\n } elseif ($mx == 1) {\r\n echo min($u, $v) . PHP_EOL;\r\n } else {\r\n echo $v + min($u, $v) . PHP_EOL;\r\n }\r\n}\r\n", "positive_code": [{"source_code": "=2)$ans=0;\r\n if(abs($val[$i]-$val[$i-1])==1)$ans=min($ans,min($u,$v));\r\n if($val[$i]==$val[$i-1])$ans=min($ans,$v+min($u,$v));\r\n }\r\n echo \"$ans\\n\";\r\n }\r\n?>"}], "negative_code": [{"source_code": "= 2) {\r\n break;\r\n }\r\n }\r\n if ($mx == 2) {\r\n echo 0 . PHP_EOL;\r\n } elseif ($mx == 1) {\r\n echo min($u, $v) . PHP_EOL;\r\n } else {\r\n echo $v + min($u, $v) . PHP_EOL;\r\n }\r\n}\r\n"}], "src_uid": "7f502f2fd150a2ded948826960d123cd"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " 0 ){\n\t\t$line--;\n\t\t$result = trim(fgets(STDIN));\n\t\t\n\t\tlist($a,$b) = explode(' ',$result);\n\t\t\n\t\t$sum = $a + $b;\n\t\techo $sum;\n\t\techo \"\\n\";\n\t}\n?>"}, {"source_code": ""}], "negative_code": [], "src_uid": "27ddccc777ef9040284ab6314cbd70e7"} {"source_code": " $b[\"val\"])\n\t\treturn 1;\n\tif($a[\"val\"] == $b[\"val\"])\n\t{\n\t\tif($a[\"key\"] < $b[\"key\"])\n\t\t\treturn -1;\n\t\tif($a[\"key\"] > $b[\"key\"])\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n}\n\nfscanf(STDIN, \"%d%d%d%d\", $n, $t1, $t2, $k);\n\n$a = array( );\n\nfor($i = 1; $i <= $n; $i++)\n{\n\tfscanf(STDIN, \"%d%d\", $v, $u);\n\t$grow1 = (($v * $t1) * (100 - $k)) / 100 + $u * $t2;\n\t$grow2 = (($u * $t1) * (100 - $k)) / 100 + $v * $t2;\n\t$grow = max($grow1, $grow2);\n\t$grow = round($grow, 2);\n\t$a[$i] = array(\n\t\t\"val\" => $grow * (-1),\n\t\t\"key\" => $i\n\t\t);\n}\n\nusort($a, 'cmp');\n\nforeach($a as $i => $v)\n{\n\t$key = $v[\"key\"];\n\t$val = (-1) * $v[\"val\"];\n\tfprintf(STDOUT, \"%d %.2f\\n\", $key, $val);\n}\n\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "a89f9310996eb23254d07e52544e30ae"} {"source_code": "\n", "positive_code": [{"source_code": "\n"}], "negative_code": [], "src_uid": "2e9da3333792a57e9e3bba4c75542ce7"} {"source_code": " $val){\n if($val>0){\n $zviangi[$zv]--;\n $i++;\n }\n }\n \n if($i < 2)\n break;\n else\n $joyola+=$i-1;\n \n }\n \n echo $n - $joyola;\n\n?>"}, {"source_code": " $g)\n {\n $d -= $g;\n }\n}\nprint $d;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " $val){\n if($val>0){\n echo $zv.\" \".\"$i\".\"\\n\";\n $zviangi[$zv]--;\n $i++;\n }\n }\n \n if($i < 2)\n break;\n else\n $joyola+=$i-1;\n \n }\n \n echo $n - $joyola;\n\n?>"}], "src_uid": "0cbd3eee259b1436f82e259be7d7ee0e"} {"source_code": "=$mp) {\n $sum += $a;\n }else{\n $result += $mp * $sum;\n $mp = $p;\n $sum = $a;\n }\n}\n$result += $mp * $sum;\necho $result;\n", "positive_code": [{"source_code": " $d)\n {\n $e += ($b * $d);\n } \n else\n {\n $e += ($b * $c);\n } \n}\nprint $e;\n?>"}, {"source_code": "in = fopen(\"php://stdin\",\"r\");\n }\n public function solve(){\n $n = trim(fgets($this->in));\n $ans = 0;\n $min = 9999999;\n for($i = 0; $i <$n; ++$i)\n {\n list($a,$p) = explode(' ',trim(fgets($this->in)));\n $min = min($p, $min);\n $ans += $a*$min ;\n }\n printf(\"%d\",$ans);\n\n }\n}\n\n$obj = new Main();\n$obj->solve();"}], "negative_code": [], "src_uid": "28e0822ece0ed35bb3e2e7fc7fa6c697"} {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $n){\n echo 'I become the guy.';\n }\n else echo 'Oh, my keyboard!';\n\n "}, {"source_code": ""}, {"source_code": "= $col1_levels && $l < $col2_levels) {\n $res[$i] = $set2_levels[$l];\n $l++;\n continue;\n } elseif ($k < $col1_levels && $l >= $col2_levels) {\n $res[$i] = $set1_levels[$k];\n $k++;\n continue;\n } elseif ($k >= $col1_levels && $l >= $col2_levels) {\n break;\n }\n if ($set1_levels[$k] <= $set2_levels[$l]) {\n $res[$i] = $set1_levels[$k];\n $k++;\n } else {\n $res[$i] = $set2_levels[$l];\n $l++;\n }\n}\n\n$res_unique = array_unique($res);\nif (count($res_unique) == $levels) {\n print(\"I become the guy.\");\n} else {\n print(\"Oh, my keyboard!\");\n}"}, {"source_code": ""}, {"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;$t=0;\n $t = trim(fgets($handle));\n\n $x=trim(fgets($handle));\n $y=trim(fgets($handle));\n $xS=explode(\" \",$x);\n $yS=explode(\" \",$y);\n $arr=array();\n for ($i=1;$i<=(int)$xS[0];$i++)\n {\n $arr[(int)$xS[$i]]=1;\n }\n\n for ($i=1;$i<=(int)$yS[0];$i++)\n {\n $arr[(int)$yS[$i]]=1;\n }\n\n if(sizeof($arr)==$t)printf(\"%s\",\"I become the guy.\");\n else printf(\"%s\",\"Oh, my keyboard!\");\n\n}\n\nsolve();\n?>"}], "negative_code": [{"source_code": "= $n){\n echo 'I become the guy.';\n }\n else echo 'Oh, my keyboard!';\n\n "}, {"source_code": "= $n){\n echo 'I become the guy.';\n }\n else echo 'Oh, my keyboard!';\n\n "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"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;$t=0;\n $t = trim(fgets($handle));\n\n $x=trim(fgets($handle));\n $y=trim(fgets($handle));\n $xS=explode(\" \",$x);\n $yS=explode(\" \",$y);\n $arr=array();\n for ($i=1;$i<=(int)$xS[0];$i++)\n {\n $arr[(int)$xS[$i]]=1;\n }\n\n for ($i=1;$i<=(int)$yS[0];$i++)\n {\n $arr[(int)$yS[$i]]=1;\n }\n\n if(sizeof($arr)==$t)printf(\"%s\",\"I become the guy\");\n else printf(\"%s\",\"Oh, my keyboard!\");\n\n}\n\nsolve();\n?>"}, {"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": "$levels = readline();\n$little_x = readline();\n$little_y = readline();\nvar_dump($little_x);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "044ade01d2de1486735742369227ae1d"} {"source_code": "$n-2){\n\techo \"NO\\n\";\n}\nelse{\n\t$r1 = $r2 = $r3 = \"\";\n\t$m = 1;\n\tforeach ($t as $k => $v) {\n\t\t$l = count($v);\n\t\tif($l>1){\n\t\t\tif($m>=3){\n\t\t\t\tfor($i=0; $i<$l; $i++){\n\t\t\t\t\t$r1 .= $v[$i].\" \";\n\t\t\t\t\t$r2 .= $v[$i].\" \";\n\t\t\t\t\t$r3 .= $v[$i].\" \";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$m *= $l;\n\t\t\t\tif($l==2){\n\t\t\t\t\tif($m==2){\n\t\t\t\t\t\t$r1 .= $v[0].\" \".$v[1].\" \";\n\t\t\t\t\t\t$r2 .= $v[1].\" \".$v[0].\" \";\n\t\t\t\t\t\t$r3 .= $v[1].\" \".$v[0].\" \";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$r1 .= $v[0].\" \".$v[1].\" \";\n\t\t\t\t\t\t$r2 .= $v[0].\" \".$v[1].\" \";\n\t\t\t\t\t\t$r3 .= $v[1].\" \".$v[0].\" \";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$r1 .= $v[0].\" \".$v[1].\" \".$v[2].\" \";\n\t\t\t\t\t$r2 .= $v[0].\" \".$v[2].\" \".$v[1].\" \";\n\t\t\t\t\t$r3 .= $v[1].\" \".$v[0].\" \".$v[2].\" \";\n\n\t\t\t\t\tfor($i=3; $i<$l;$i++){\n\t\t\t\t\t\t$r1 .= $v[$i].\" \";\n\t\t\t\t\t\t$r2 .= $v[$i].\" \";\n\t\t\t\t\t\t$r3 .= $v[$i].\" \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$r1 .= $v[0].\" \";\n\t\t\t$r2 .= $v[0].\" \";\n\t\t\t$r3 .= $v[0].\" \";\n\t\t}\n\t}\n\techo \"YES\\n\";\n\techo \"$r1\\n\";\n\techo \"$r2\\n\";\n\techo \"$r3\\n\";\n}\n\n\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "fdfc1e690eeee6f50e2a024bf3f841e8"} {"source_code": "= 1; $i -= 2) {\r\n if ($i == 1) {\r\n array_push($perm, $i);\r\n }\r\n else {\r\n array_push($perm, $i-1, $i);\r\n }\r\n }\r\n for ($i = $n-1; $i >= 0; $i--) fprintf($cout, \"%d \", $perm[$i]);\r\n fprintf($cout, \"\\n\");\r\n} ?>", "positive_code": [{"source_code": "0;$i--) {\r\n if($turn) {\r\n if($i == 1) {\r\n $ans[] = 1 ;\r\n continue ;\r\n }\r\n $ans[] = $i - 1 ;\r\n }\r\n else {\r\n $ans[] = $i + 1;\r\n }\r\n $turn = !$turn ;\r\n }\r\n puts(implode(\" \",array_reverse($ans)));\r\n}\r\n"}], "negative_code": [], "src_uid": "be3295b4d43a11ee94022b103f4221a5"} {"source_code": "$fv) {\n\t\t\t\t$f[$fk]--;\n\t\t\t\tif($f[$fk]>0) $a[$fk] = 1;\n\t\t\t}\n\t\t}\n\t\telse echo \"0\";\n\t}\n?>", "positive_code": [{"source_code": ""}, {"source_code": " $n];\n$level = [];\n\n$k = 0;\n\nfor ($i = 0; $i < $m; $i++) {\n $a = $array[$i]-1;\n $level[$a]++;\n $bank[$level[$a] -1]--;\n $bank[$level[$a]]++;\n if ($bank[$k] == 0) {\n $k++;\n echo 1;\n } else {\n echo 0;\n }\n}"}], "negative_code": [{"source_code": ""}, {"source_code": "$c) {\n\t\tif($c<=$z) $z = $k;\n\t}\n\tfor($i=0; $i<$m; $i++) {\n\t\tif($d[$i]==$z) echo \"1\";\n\t\telse echo \"0\";\n\t}\n?>"}, {"source_code": ""}, {"source_code": "$c) {\n\t\tif($c<=$z) {\n\t\t\t$zk = $k;\n\t\t\t$z = $c;\n\t\t}\n\t}\n\tfor($i=0; $i<$m; $i++) {\n\t\tif($d[$i]==$zk) echo \"1\";\n\t\telse echo \"0\";\n\t}\n?>"}, {"source_code": ""}, {"source_code": "$c) {\n\t\tif($c<=$z) {\n\t\t\t$zk = $k;\n\t\t\t$z = $c;\n\t\t}\n\t}\n\t$a = array();\n\tforeach($e as $k=>$c) {\n\t\tif($c==$z) $a[$k] = 0;\n\t}\n\tfor($i=0; $i<$m; $i++) {\n\t\t$k = $d[$i];\n\t\tif(isset($a[$k])) {\n\t\t\t$a[$k]++;\n\t\t\t$b = true;\n\t\t\tforeach($a as $ak=>$ac) {\n\t\t\t\tif($ac==0) {\n\t\t\t\t\t$b = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($b) {\n\t\t\t\techo \"1\";\n\t\t\t\tforeach($a as $ak=>$ac) $a[$ak]--;\n\t\t\t}\n\t\t\telse echo \"0\";\n\t\t}\n\t\telse echo \"0\";\n\t}\n?>"}, {"source_code": ""}, {"source_code": "$c) {\n\t\tif($c<=$z) {\n\t\t\t$zk = $k;\n\t\t\t$z = $c;\n\t\t}\n\t}\n\t$a = array();\n\tforeach($e as $k=>$c) {\n\t\tif($c==$z) $a[$k] = 0;\n\t}\n\tfor($i=0; $i<$m; $i++) {\n\t\t$k = $d[$i];\n\t\tif(isset($a[$k])) {\n\t\t\t$a[$k]++;\n\t\t\t$b = true;\n\t\t\tforeach($a as $ak=>$ac) {\n\t\t\t\tif($ac==0) {\n\t\t\t\t\t$b = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($b) {\n\t\t\t\techo \"1\";\n\t\t\t\tforeach($a as $ak=>$ac) $a[$ak]--;\n\t\t\t}\n\t\t\telse echo \"0\";\n\t\t}\n\t\telse echo \"0\";\n\t}\n?>"}, {"source_code": ""}, {"source_code": " 3)\n{\n print \"NO\";\n}\n?>", "positive_code": [{"source_code": " 3) {\n\techo 'NO';\n} else if($len <= 2) {\n\techo 'YES';\n} else if($arr[2] - $arr[1] == $arr[1] - $arr[0]) {\n\techo 'YES';\n} else {\n\techo 'NO';\n}\necho \"\\n\";\n?>"}, {"source_code": " 3)\n{\n print \"NO\";\n}\n?>"}, {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\treadNum($f);\n\t$nums = readStringExplodeNum($f, ' ', true);\n\t$nums = array_unique($nums);\n\n\tif (count($nums) <= 2) {\n\t\techo 'YES';\n\t} elseif (count($nums) == 3) {\n\t\tsort($nums);\n\t\tif ($nums[2] - $nums[1] == $nums[1] - $nums[0]) {\n\t\t\techo 'YES';\n\t\t} else {\n\t\t\techo 'NO';\n\t\t}\n\t} else {\n\t\techo 'NO';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "negative_code": [{"source_code": " 3)\n{\n print \"NO\";\n}\n?>"}, {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\treadNum($f);\n\t$nums = readStringExplodeNum($f, ' ', true);\n\t$nums = array_unique($nums);\n\n\tif (count($nums) == 1) {\n\t\techo 'YES';\n\t} elseif (count($nums) == 2) {\n\t\techo 'YES';\n\t} elseif (count($nums) == 3) {\n\t\tsort($nums);\n\t\tif ($nums[2] - $nums[0] == $nums[1]) {\n\t\t\techo 'YES';\n\t\t}\n\t} else {\n\t\techo 'NO';\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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\treadNum($f);\n\t$nums = readStringExplodeNum($f, ' ', true);\n\t$nums = array_unique($nums);\n\n\tif (count($nums) <= 2) {\n\t\techo 'YES';\n\t} elseif (count($nums) == 3) {\n\t\tsort($nums);\n\t\tif ($nums[2] - $nums[0] == $nums[1]) {\n\t\t\techo 'YES';\n\t\t} else {\n\t\t\techo 'NO';\n\t\t}\n\t} else {\n\t\techo 'NO';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": " 3) {\n\techo 'NO';\n} else if($len <= 2) {\n\techo 'YES';\n} else if($arr[2] - $arr[1] == $arr[1] - $arr[0]) {\n\techo 'YES';\n} else {\n\techo 'NO';\n}\necho \"
\";\n?>"}, {"source_code": " 3) {\n\techo 'NO';\n} else if($len <= 2) {\n\techo 'YES';\n} else if($arr[2] - $arr[1] == $arr[1] - $arr[0]) {\n\techo 'YES';\n} else {\n\techo 'NO';\n}\necho \"\\n\";\n?>"}], "src_uid": "27f837609b2777cefccb13aa4596d91c"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " 0) {\n $validArray = true;\n }\n }\n \n echo ($validArray ? 'YES' : 'NO') . PHP_EOL;\n}", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " count($e))\n {\n $j = 0;\n for($y = 0; $y < count($d); $y++)\n {\n if($g[$d[$y] - 1] == TRUE)\n {\n $h--;\n $i++;\n $g[$d[$y] - 1] = FALSE;\n if($h == $i)\n {\n $j = 1;\n break;\n }\n }\n elseif($g[$d[$y] + 1] == TRUE)\n {\n $h--;\n $i++;\n $g[$d[$y] + 1] = FALSE;\n if($h == $i)\n {\n $j = 1;\n break;\n }\n }\n }\n if($j == 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n }\n}\n?>"}, {"source_code": " 0) {\n $validArray = true;\n }\n }\n \n echo ($validArray ? 'YES' : 'NO') . PHP_EOL;\n}"}, {"source_code": " $value) {\n if (in_array($key, [$key1, $key2])) {\n unset($remain[$key]);\n } else {\n foreach ($value as $key3 => $value3) {\n if (in_array($value3, [$key1, $key2])) {\n unset($remain[$key][$key3]);\n }\n }\n }\n \n if (empty($remain[$key])) {\n unset($remain[$key]);\n }\n }\n \n $remain = mysort($remain);\n \n if (!empty($remain)) {\n foreach ($remain as $key3 => $value3) {\n foreach ($value3 as $key4 => $value4) {\n setPair($current, $remain, $key3, $value4);\n }\n }\n } else {\n if (count($array) / 2 == count($current)) {\n $validArray = true;\n return;\n }\n }\n}\n \n \n \n \n$count = trim(fgets(STDIN));\nfor ($i = 1; $i <= $count * 2; $i++) {\n trim(fgets(STDIN));\n $array = explode(' ' , trim(fgets(STDIN)));\n $validArray = false;\n \n $result = [];\n foreach ($array as $key1 => $value1) {\n foreach ($array as $key2 => $value2) {\n if ($key1 !== $key2) {\n if (isSimple($value1, $value2)) {\n $result[$key1][] = $key2;\n }\n }\n }\n }\n $result = mysort($result);\n \n foreach ($result as $key1 => $value1) {\n foreach ($value1 as $key2 => $value2) {\n setPair([], $result, $key1, $value2);\n break 2;\n }\n }\n \n echo ($validArray ? 'YES' : 'NO') . PHP_EOL;\n}"}, {"source_code": " $value) {\n if (in_array($key, [$key1, $key2])) {\n unset($remain[$key]);\n } else {\n foreach ($value as $key3 => $value3) {\n if (in_array($value3, [$key1, $key2])) {\n unset($remain[$key][$key3]);\n }\n }\n }\n\n if (empty($remain[$key])) {\n unset($remain[$key]);\n }\n }\n\n $remain = mysort($remain);\n\n if (!empty($remain)) {\n foreach ($remain as $key3 => $value3) {\n foreach ($value3 as $key4 => $value4) {\n setPair($current, $remain, $key3, $value4);\n }\n }\n } else {\n if (count($array) / 2 == count($current)) {\n $validArray = true;\n }\n }\n}\n\n\n\n\n$count = trim(fgets(STDIN));\nfor ($i = 1; $i <= $count * 2; $i++) {\n trim(fgets(STDIN));\n $array = explode(' ' , trim(fgets(STDIN)));\n $validArray = false;\n\n $result = [];\n foreach ($array as $key1 => $value1) {\n foreach ($array as $key2 => $value2) {\n if ($key1 !== $key2) {\n if (isSimple($value1, $value2)) {\n $result[$key1][] = $key2;\n }\n }\n }\n }\n $result = mysort($result);\n \n foreach ($result as $key1 => $value1) {\n foreach ($value1 as $key2 => $value2) {\n setPair([], $result, $key1, $value2);\n break 2;\n }\n }\n\n echo ($validArray ? 'YES' : 'NO') . PHP_EOL;\n}"}], "src_uid": "005a29a4b4e7ee4fd21444846014727b"} {"source_code": " strlen($fromWord)) {\n\t\t\treturn -1;\n\t\t}\n\t}\n\treturn $moves;\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "a3a7515219ebb0154218ee3520e20d75"} {"source_code": " pppab\n\t\n\t\n\tif(strlen($s) > strlen($t))\n\t\techo \"NO\\n\";\n\telseif (strlen($s) == strlen($t) && $s == $t)\n\t\techo \"YES\\n\";\n\telse\n\t{\n\t\t$c = 0;\n\t\t$nmatch = [];\n\t\tfor ($i = 0; $i < strlen($t); $i++)\n\t\t\tif ($t[$i] == $s[$c])\n\t\t\t\t$c++;\n\t\t\telse\n\t\t\t\t$nmatch[] = $t[$i];\n\t\tif ($c != strlen($s))\n\t\t\techo \"NO\\n\";\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < count($nmatch); $i++)\n\t\t\t{\n\t\t\t\t$pos = strpos($p, $nmatch[$i]);\n\t\t\t\tif ($pos === false)\n\t\t\t\t\tbreak;\n\t\t\t\telse\n\t\t\t\t\t$p[$pos] = '0';\n\t\t\t}\n\t\t\tif ($i == count($nmatch))\n\t\t\t\techo \"YES\\n\";\n\t\t\telse\n\t\t\t\techo \"NO\\n\";\n\t\t}\n\t}\n}\n\n?>", "positive_code": [{"source_code": " 0)\n {\n $e[$c[$y]]--;\n }\n else\n {\n $g = 1;\n break;\n }\n }\n }\n if(($g == 1) || ($f < count($b)))\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n }\n elseif(count($b) == count($c))\n {\n if($b == $c)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(count($b) > count($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": " 0)\n {\n $e[$c[$y]]--;\n }\n else\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 elseif(count($b) == count($c))\n {\n if($b == $c)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(count($b) > count($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n $e[$c[$y]]--;\n }\n else\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 elseif(count($b) == count($c))\n {\n if($b == $c)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(count($b) > count($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= count($c))\n {\n print \"NO\\n\";\n }\n else\n {\n $e = array();\n $f = 0;\n for($y = 0; $y < count($c); $y++)\n {\n $e[$c[$y]]++;\n }\n for($y = 0; $y < count($b); $y++)\n {\n $e[$b[$y]]--;\n if($e[$b[$y]] < 0)\n {\n $f = 1;\n break;\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n for($y = 0; $y < count($d); $y++)\n {\n if($e[$d[$y]] > 0)\n {\n $e[$d[$y]]--;\n }\n }\n $g = max($e);\n if($g > 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 0)\n {\n $e[$c[$y]]--;\n }\n else\n {\n $g = 1;\n break;\n }\n }\n }\n if(($g == 1) || ($f < count($b)))\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n }\n elseif(count($b) == count($c))\n {\n if($b == $c)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(count($b) > count($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= count($c))\n {\n print \"NO\\n\";\n }\n else\n {\n $e = array();\n $f = 0;\n for($y = 0; $y < count($c); $y++)\n {\n $e[$c[$y]]++;\n }\n for($y = 0; $y < count($b); $y++)\n {\n $e[$b[$y]]--;\n if($e[$b[$y]] < 0)\n {\n $f = 1;\n break;\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n for($y = 0; $y < count($d); $y++)\n {\n if($e[$d[$y]] > 0)\n {\n $e[$d[$y]]--;\n }\n }\n $g = max($e);\n if($g > 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n }\n }\n }\n }\n else\n {\n sort($b);\n sort($c);\n sort($d);\n if($b == $c)\n {\n print \"YES\\n\";\n }\n elseif(count($b) >= count($c))\n {\n print \"NO\\n\";\n }\n else\n {\n $e = array();\n $f = 0;\n for($y = 0; $y < count($c); $y++)\n {\n $e[$c[$y]]++;\n }\n for($y = 0; $y < count($b); $y++)\n {\n $e[$b[$y]]--;\n if($e[$b[$y]] < 0)\n {\n $f = 1;\n break;\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n for($y = 0; $y < count($d); $y++)\n {\n if($e[$d[$y]] > 0)\n {\n $e[$d[$y]]--;\n }\n }\n $g = max($e);\n if($g > 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " pppab\n\t\n\t\n\tif(strlen($s) > strlen($t))\n\t\techo \"NO\\n\";\n\telseif (strlen($s) == strlen($t) && $s == $t)\n\t\techo \"YES\\n\";\n\telse\n\t{\n\t\t$c = 0;\n\t\t$nmatch = [];\n\t\tfor ($i = 0; $i < strlen($t); $i++)\n\t\t\tif ($t[$i] == $s[$c])\n\t\t\t\t$c++;\n\t\t\telse\n\t\t\t\t$nmatch[] = $t[$i];\n\t\tif ($c != strlen($s))\n\t\t\techo \"NO\\n\";\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < count($nmatch); $i++)\n\t\t\t{\n\t\t\t\t$pos = strpos($p, $nmatch[$i]);\n\t\t\t\tif ($pos === false)\n\t\t\t\t\tbreak;\n\t\t\t\telse\n\t\t\t\t\t$p[$pos] = '0';\n\t\t\t}\n\t\t\tif ($i == count($nmatch))\n\t\t\t\techo \"YES\";\n\t\t\telse\n\t\t\t\techo \"NO\";\n\t\t}\n\t}\n}\n\n?>"}], "src_uid": "a27ad7c21cd6402bfd082da4f6c7ab9d"} {"source_code": " 1) $ans += $rows[$i] * ($rows[$i] - 1) / 2;\n if ($cols[$i] > 1) $ans += $cols[$i] * ($cols[$i] - 1) / 2;\n }\n printf(\"%d\",$ans);", "positive_code": [{"source_code": " 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\nfor ($j = 0; $j < $n; $j++) {\n $c = 0;\n for ($i = 0; $i < $n; $i++) {\n if ($p[$i][$j] == \"C\") {\n $c++;\n }\n }\n if ($c > 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\necho $pc;\n?>"}, {"source_code": " 1) $ans += $rows[$i] * ($rows[$i] - 1) / 2;\n if ($cols[$i] > 1) $ans += $cols[$i] * ($cols[$i] - 1) / 2;\n }\n print $ans;"}, {"source_code": ""}, {"source_code": " 1) $ans += $rows[$i] * ($rows[$i] - 1) / 2;\n if ($cols[$i] > 1) $ans += $cols[$i] * ($cols[$i] - 1) / 2;\n }\n printf(\"%d\",$ans);"}, {"source_code": " 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\nfor ($j = 0; $j < $n; $j++) {\n $c = 0;\n for ($i = 0; $i < $n; $i++) {\n if ($p[$i][$j] == \"C\") {\n $c++;\n }\n }\n if ($c > 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\necho $pc;\n?>"}], "negative_code": [{"source_code": "$a = trim(fgets(STDIN));\n$b = array();\nfor($x = 0; $x < $a; $x++)\n{\n $c = str_split(trim(fgets(STDIN)));\n $b[$x] = $c;\n}\n$d = array();\nfor($x = 0; $x < $a; $x++)\n{\n $e = array();\n for($y = 0; $y < $a; $y++)\n {\n $e[$y] = $b[$y][$x];\n }\n $d[$x] = $e;\n}\n$f = array();\n$g = 0;\nfor($x = 0; $x <= 100; $x++)\n{\n $f[$x] += $g;\n $g++;\n}\n$h = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $i = 0;\n $j = 0;\n for($y = 0; $y < $a; $y++)\n {\n if($b[$x][$y] == \"C\")\n {\n $i++;\n }\n }\n $h += $f[$i];\n for($y = 0; $y < $a; $y++)\n {\n if($d[$x][$y] == \"C\")\n {\n $j++;\n }\n }\n $h += $f[$j];\n}\nprint $h;\n?>"}, {"source_code": ""}, {"source_code": " 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\nfor ($j = 0; $j < $n; $j++) {\n $c = 0;\n for ($i = 0; $i < $n; $i++) {\n if ($p[$i][$j] == \"C\") {\n $c++;\n }\n }\n if ($c > 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\necho $pc;*/\n?>"}, {"source_code": " 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\nfor ($j = 0; $j < $n; $j++) {\n $c = 0;\n for ($i = 0; $i < $n; $i++) {\n if ($p[$i][$j] == \"C\") {\n $c++;\n }\n }\n if ($c > 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\necho $pc;\n?>"}, {"source_code": " 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\nfor ($j = 0; $j < $n; $j++) {\n $c = 0;\n for ($i = 0; $i < $n; $i++) {\n if ($p[$i][$j] == \"C\") {\n $c++;\n }\n }\n if ($c > 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\necho $pc;*/\n?>"}, {"source_code": " 1) {\n echo $c;\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\nfor ($j = 0; $j < $n; $j++) {\n $c = 0;\n for ($i = 0; $i < $n; $i++) {\n if ($p[$i][$j] == \"C\") {\n $c++;\n }\n }\n if ($c > 1) {\n $pc += fact($c) / (2 * fact($c - 2));\n }\n}\necho $pc;\n?>"}], "src_uid": "7749f37aa9bf88a00013557e14342952"} {"source_code": "go();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate function readLn(): string\r\n\t{\r\n\t\treturn fgets(STDIN);\r\n\t}\r\n\t\r\n\tprivate function readInt(): int\r\n\t{\r\n\t\treturn intval(fgets(STDIN));\r\n\t}\r\n\t\r\n\tprivate function readStrings(): array\r\n\t{\r\n\t\treturn explode(' ', fgets(STDIN));\r\n\t}\r\n\t\r\n\tprivate function readInts(): array\r\n\t{\r\n\t\t$readInts = explode(' ', fgets(STDIN));\r\n\t\tforeach ($readInts as $key => $value) {\r\n\t\t\t$readInts[$key] = intval($value);\t\r\n\t\t}\r\n\t\treturn $readInts;\r\n\t}\r\n\t\r\n\tprivate array $OUTPUT_LINES = [];\r\n\t\r\n\tprivate function outputLn(string $s): void\r\n\t{\r\n\t\t$this->OUTPUT_LINES[] = $s;\r\n\t}\r\n\t\r\n\tprivate function go(): void\r\n\t{\r\n\t\t$nk = $this->readInts();\r\n\t\t$a = $this->readInts();\r\n\t\t$n = $nk[0];\r\n\t\t$k = $nk[1];\r\n\t\t// $this->outputLn(strval(abs(array_sum($this->readInts()))));\r\n\t\t$num_delete = ($n - 1) % ($k - 1);\r\n\t\t$can_delete = -1;\r\n\t\tfor ($i = 0; $i < $n; $i++) {\r\n\t\t\tif ($a[$i] == 1){\r\n\t\t\t\tif ($i == 0 || $i == $n - 1) {\r\n\t\t\t\t\t$can_delete = max($can_delete, $n - 2);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$can_delete = max($can_delete, $n - 3);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->outputLn($can_delete >= $num_delete ? 'YES' : 'NO');\r\n\t}\r\n\t\r\n\tpublic function __construct()\r\n\t{\r\n\t\t$this->repeat($this->readInt());\r\n\t\techo implode(PHP_EOL, $this->OUTPUT_LINES);\r\n\t}\r\n}\r\n\r\nnew A;\r\n"}], "negative_code": [{"source_code": "go();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate function readLn(): string\r\n\t{\r\n\t\treturn fgets(STDIN);\r\n\t}\r\n\t\r\n\tprivate function readInt(): int\r\n\t{\r\n\t\treturn intval(fgets(STDIN));\r\n\t}\r\n\t\r\n\tprivate function readStrings(): array\r\n\t{\r\n\t\treturn explode(' ', fgets(STDIN));\r\n\t}\r\n\t\r\n\tprivate function readInts(): array\r\n\t{\r\n\t\t$readInts = explode(' ', fgets(STDIN));\r\n\t\tforeach ($readInts as $key => $value) {\r\n\t\t\t$readInts[$key] = intval($value);\t\r\n\t\t}\r\n\t\treturn $readInts;\r\n\t}\r\n\t\r\n\tprivate array $OUTPUT_LINES = [];\r\n\t\r\n\tprivate function outputLn(string $s): void\r\n\t{\r\n\t\t$this->OUTPUT_LINES[] = $s;\r\n\t}\r\n\t\r\n\tprivate function go(): void\r\n\t{\r\n\t\t$nk = $this->readInts();\r\n\t\t$a = $this->readInts();\r\n\t\t$n = $nk[0];\r\n\t\t$k = $nk[1];\r\n\t\t// $this->outputLn(strval(abs(array_sum($this->readInts()))));\r\n\t\t$num_delete = ($n - 1) % ($k - 1);\r\n\t\t$can_delete = -1;\r\n\t\tfor ($i = 0; $i < $n; $i++) {\r\n\t\t\tif ($a[$i] == 1){\r\n\t\t\t\tif ($i == 0 || $i == $n - 1) {\r\n\t\t\t\t\t$can_delete = max($can_delete, $n - 2);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$can_delete = max($can_delete, $n - 3);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->outputLn($can_delete >= $numdelete ? 'YES' : 'NO');\r\n\t}\r\n\t\r\n\tpublic function __construct()\r\n\t{\r\n\t\t$this->repeat($this->readInt());\r\n\t\techo implode(PHP_EOL, $this->OUTPUT_LINES);\r\n\t}\r\n}\r\n\r\nnew A;\r\n"}], "src_uid": "95d83cfdb2131f2f23ba5ef005c18b38"} {"source_code": "", "positive_code": [{"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($t[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($t[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($d[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($d[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[3] == \"n\") && ($d[3] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[3] == \"n\") && ($d[3] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($d[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[3] == \"n\") && ($d[3] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[3] == \"n\") && ($d[3] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($t[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($t[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n $d = strrev($a[$x]);\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[4] == \"n\") && ($d[5] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if(($g == 1) || ($f == 0))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n print \"NO\";\n }\n else\n {\n $e = array();\n if($d[0] == 2)\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"s\") && ($d[1] == \"o\") && ($d[2] == \"i\") && ($d[3] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"r\") && ($d[1] == \"t\") && ($d[2] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"i\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[3] == \"n\") && ($d[3] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n else\n {\n for($x = 0; $x < count($a); $x++)\n {\n if(($d[0] == \"a\") && ($d[1] == \"l\") && ($d[2] == \"a\") && ($d[3] == \"i\") && ($d[4] == \"l\"))\n {\n $e[$x] = 1;\n }\n elseif(($d[0] == \"a\") && ($d[1] == \"r\") && ($d[2] == \"t\") && ($d[3] == \"e\"))\n {\n $e[$x] = 2;\n }\n elseif(($d[0] == \"s\") && ($d[1] == \"e\") && ($d[2] == \"t\") && ($d[3] == \"i\") && ($d[3] == \"n\") && ($d[3] == \"i\"))\n {\n $e[$x] = 3;\n }\n }\n $f = 0;\n $g = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($e[$x] == 2)\n {\n $f++;\n if($f > 1)\n {\n $g = 1;\n break;\n }\n }\n if(($e[$x] == 3) && ($f == 0))\n {\n $g = 1;\n break;\n }\n if(($e[$x] == 1) && ($f > 0))\n {\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n }\n }\n }\n}\n?>"}], "src_uid": "0c9550a09f84de6bed529d007ccb4ae8"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $v) {\n $i++;\n if ($i%2) {\n $v1 = $v;\n } else {\n if ($v == $v1) {\n $i = 1;\n } else {\n $l .= $v1.$v;\n }\n }\n }\n if (strlen($l)%2) {\n $l = substr($l, strlen($l)-1);\n }\n echo $k - strlen($l).\"\\n\";\n echo $l;\n?>"}, {"source_code": " $v) {\n $i++;\n if ($i%2) {\n $t = $v;\n $c = $s;\n } else {\n if ($v == $t) {\n unset($a[$s]);\n $i = 1;\n } else {\n $b[] = $t;\n $b[] = $v;\n unset($a[$c]);\n unset($a[$s]);\n }\n }\n }\n $a = array_merge($b, $a);\n if (count($a) % 2 != 0) {\n $a = array_values($a);\n unset($a[count($a) -1]);\n }\n return $a;\n }\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " $v) {\n $i++;\n if ($i%2) {\n $v1 = $v;\n } else {\n if ($v == $t) {\n $i = 1;\n } else {\n $l .= $v1.$v;\n }\n }\n }\n if (strlen($l)%2) {\n $l = substr($l, strlen($l)-1);\n }\n echo $k - strlen($l).\"\\n\";\n echo $l;\n?>"}], "src_uid": "c11d67f223eb49c6e8315e2c88dd680d"} {"source_code": " $f)\n {\n $g = 1;\n break;\n }\n}\nif($g == 1)\n{\n print \"-1\";\n}\nelse\n{\n $i = array_unique($h);\n print count($i);\n}\n?>", "positive_code": [{"source_code": " $chars) ? -1 : $m;\n\necho $m . PHP_EOL;"}], "src_uid": "9a823b4ac4a79f62cd0c2f88a1c9ef0c"} {"source_code": "", "positive_code": [{"source_code": " $value) {\n\t$s[$key] = intval($value);\n}\n\n$mins = 0;\n$b = array_fill(0, $k, 0);\nfor($i = 0; $i < $k && $i < $n; ++$i) {\n\t$b[$i] += $s[$n-$i-1];\n\tif($b[$i] > $mins) {\n\t\t$mins = $b[$i];\n\t\t//echo $b[$i], \"oo\\n\";\n\t}\n}\n$idx = $k-1;\nfor($i = $k; $i < $n; ++$i) {\n\t$b[$idx] += $s[$n-$i-1];\n\tif($b[$idx] > $mins) {\n\t\t$mins = $b[$idx];\n\t\t//echo $b[$idx], \"hi\\n\";\n\t}\n\t$idx--;\n}\n\necho $mins, \"\\n\";\n\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "7324428d9e6d808f55ad4f3217046455"} {"source_code": "$t || isset($vArray[$i])) {\n continue;\n }\n $vArray[$i] = 1;\n $t++;\n }\n $result++;\n if ($t == $n) {\n break;\n }\n for ($i = $n-1; $i >= 0; $i--) {\n if ($aArray[$i]>$t || isset($vArray[$i])) {\n continue;\n }\n $vArray[$i] = 1;\n $t++;\n }\n $result++;\n}\necho $result-1 . PHP_EOL;", "positive_code": [{"source_code": "= 0; $x--)\n {\n if(($b[$x] <= $d) && ($b[$x] == TRUE))\n {\n $d++;\n unset($b[$x]);\n }\n }\n $c++;\n }\n if(count($b) == 0)\n {\n break;\n }\n}\nprint $c - 3;\n?>"}], "negative_code": [{"source_code": "= 0; $x--)\n {\n if(($b[$x] <= $d) && ($b[$x] == TRUE))\n {\n $d++;\n unset($b[$x]);\n }\n }\n $c++;\n }\n if(count($b) == 0)\n {\n break;\n }\n}\nprint $c - 3;\n?>"}], "src_uid": "9374728643a1ddbe2200a4a125beef26"} {"source_code": "\n", "positive_code": [{"source_code": "$y ) echo \"-1\";\nelse{\n for($i=1;$i<$n;$i++)\n echo \"1\\n\";\n echo $y-$n+1;\n}\n?>"}], "negative_code": [], "src_uid": "138fd96bf5a677a6d59c20f88fd612f1"} {"source_code": " $mc){\n $sum+= array_sum(array_values(array_slice($marr, $mid + 1))) * $mc;\n}\nfprintf(STDOUT, '%d', $sum);\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " $mc){\n $sum+= ($n - $mc);\n}\nfprintf(STDOUT, '%d', $sum);\n?>"}], "src_uid": "e2ff228091ca476926b8e905f1bc8dff"} {"source_code": "", "positive_code": [{"source_code": " $store[$i+1])\n\t {\n\t $flag=1;\n\t echo \"NO\";\n\t }\n}\nif($flag==0)\necho \"YES\";"}], "src_uid": "a457e22fc8ff882c15ac57bca6960657"} {"source_code": " 2) {\n\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$uq = array_unique($k);\n\t$start = reset($k);\n\t$end = end($k);\n\tif (sizeof($uq) == $start-$end+1) {\n\n\t\t$final = true;\n\t\tforeach ($uq as $u) {\n\t\t\tif (sizeof(array_keys($k,$u))==1) {\n\t\t\t\t$final = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($final) {\n\t\t\tforeach ($uq as $u) {\n\t\t\t\t$c_uq = array_keys($distr,$u);\n\t\t\t\t$q_uq = sizeof($c_uq);\n\n\t\t\t\tif ($q_uq%2) {\n\t\t\t\t\tfor ($i=0;$i<$u;$i++) {\n\t\t\t\t\t\t$res[] = $c_uq[0].' '.$c_uq[1];\n\t\t\t\t\t\t$res[] = $c_uq[1].' '.$c_uq[2];\n\t\t\t\t\t\t$res[] = $c_uq[2].' '.$c_uq[0];\n\t\t\t\t\t}\n\t\t\t\t\t$q_uq -= 3;\n\t\t\t\t\t$diff += $u * 3;\n\n\t\t\t\t\t$c_uq = array_slice($c_uq,3);\n\t\t\t\t}\n\n\t\t\t\tif ($c_uq) {\n\t\t\t\t\t$q_uq /= 2;\n\t\t\t\t\tfor ($j=0;$j<$q_uq;$j++) {\n\t\t\t\t\t\tfor ($i=0;$i<$u;$i++) {\n\t\t\t\t\t\t\t$res[] = $c_uq[$j*2].' '.$c_uq[$j*2+1];\n\t\t\t\t\t\t\t$res[] = $c_uq[$j*2+1].' '.$c_uq[$j*2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$diff += $u * 2 * $q_uq;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$res[] = $c[0].' '.$c[1];\n\t$res[] = $c[1].' '.$c[0];\n\t$res[] = $c[0].' '.$c[2];\n\t$res[] = $c[2].' '.$c[0];\n\t$diff += 4;\n\t$k[0] -= 2;\n\t$k[1]--;\n\t$k[2]--;\n\n\tfor ($i=0;$i<=2;$i++)\n\t\tif ($k[$i]==0) {\n\t\t\tunset($c[$i],$k[$i]);\n\t\t}\n\n\t$sd = sizeof($c);\n\tif ($sd) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\t$distr = array();\n\t}\n}\n\nif (!$final) {\n\tif (sizeof($distr) == 2) {\n\t\t$c = array_keys($distr);\n\t\t$k = array_values($distr);\n\n\t\t$q = $k[1];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($distr[$c[0]],$c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t\t$distr[$c[0]] = $k[0];\n\t\t}\n\n\t\tunset($distr[$c[1]],$c[1],$k[1]);\n\t}\n\n\tif ($distr) {\n\t\t$c = key($distr);\n\t\t$k = current($distr);\n\t\tfor ($i=0;$i<$k;$i++) {\n\t\t\t$res[] = $c.' '.$c;\n\t\t}\n\t}\n}\n\narray_unshift($res, $diff);\n\n//-----------------------\necho implode(L,$res);", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\tif (reset($k)==end($k)) {\n\t\t$q = $k[0];\n\n\t\tif ($sd%2) {\n\t\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t\t}\n\t\t\t$sd -= 3;\n\t\t\t$diff += $q * 3;\n\n\t\t\t$c = array_slice($c,3);\n\t\t\t$k = array_slice($k,3);\n\n\t\t\tif ($sd) {\n\t\t\t\t$distr = array_combine($c, $k);\n\t\t\t\t$c = array_keys($distr);\n\t\t\t\t$k = array_values($distr);\n\t\t\t} else {\n\t\t\t\t$distr = array();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$sd /= 2;\n\t\tfor ($j=0;$j<$sd;$j++) {\n\t\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t\t$res[] = $c[$j*2].' '.$c[$j*2+1];\n\t\t\t\t$res[] = $c[$j*2+1].' '.$c[$j*2];\n\t\t\t}\n\t\t\t$diff += $q * 2;\n\t\t}\n\n\t\t$sd = 0;\n\t\t$distr = array();\n\t\tbreak;\n\t}\n\n\t$res[] = $c[0].' '.$c[1];\n\t$res[] = $c[1].' '.$c[0];\n\t$res[] = $c[0].' '.$c[2];\n\t$res[] = $c[2].' '.$c[0];\n\t$diff += 4;\n\t$k[0] -= 2;\n\t$k[1]--;\n\t$k[2]--;\n\n\tfor ($i=0;$i<=2;$i++)\n\t\tif ($k[$i]==0) {\n\t\t\tunset($c[$i],$k[$i]);\n\t\t}\n\n\t$sd = sizeof($c);\n\tif ($sd) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\t$distr = array();\n\t}\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($distr[$c[0]],$c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t\t$distr[$c[0]] = $k[0];\n\t}\n\n\tunset($distr[$c[1]],$c[1],$k[1]);\n}\n\nif ($distr) {\n\t$c = key($distr);\n\t$k = current($distr);\n\tfor ($i=0;$i<$k;$i++) {\n\t\t$res[] = $c.' '.$c;\n\t}\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n {\n $i = $x;\n break;\n }\n }\n }\n if($d[$j] == 0)\n {\n for($x = $i + 1; $x < 10000; $x++)\n {\n if($d[$x] > 0)\n {\n $j = $x;\n break;\n }\n }\n }\n $f[$h] = $e[$i];\n $g[$h] = $e[$j];\n $h++;\n $f[$h] = $e[$j];\n $g[$h] = $e[$i];\n $h++;\n $d[$i]--;\n $d[$j]--;\n $j++; \n }\n}\nif($l == 1)\n{\n print $h . \"\\n\";\n for($x = 0; $x < $h - 1; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n print $f[$x] . \" \" . $g[$x];\n}\nelseif($l == 2)\n{\n $m = 2;\n for($x = 0; $x < $h; $x++)\n {\n $n = $m % 2;\n if($n == 0)\n {\n $o[$f[$x]]--;\n $o[$g[$x]]--;\n }\n $m++;\n }\n $p = max($o);\n $r = array_search($p, $o);\n print $h . \"\\n\";\n for($x = 0; $x < $h; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n for($x = 0; $x < $p - 1; $x++)\n {\n print $r . \" \" . $r . \"\\n\";\n }\n print $r . \" \" . $r;\n}\n?>"}, {"source_code": ""}, {"source_code": " 0)\n {\n $i = $x;\n break;\n }\n }\n }\n if(($d[$j] == 0) || ($j == $i))\n {\n $j = $i + 1;\n }\n $f[$h] = $e[$i];\n $g[$h] = $e[$j];\n $h++;\n $f[$h] = $e[$j];\n $g[$h] = $e[$i];\n $h++;\n $d[$i]--;\n $d[$j]--;\n $j++; \n }\n}\nif($l == 1)\n{\n print $h . \"\\n\";\n for($x = 0; $x < $h - 1; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n print $f[$x] . \" \" . $g[$x];\n}\nelseif($l == 2)\n{\n $m = 2;\n for($x = 0; $x < $h; $x++)\n {\n $n = $m % 2;\n if($n == 0)\n {\n $o[$f[$x]]--;\n $o[$g[$x]]--;\n }\n $m++;\n }\n $p = max($o);\n $r = array_search($p, $o);\n print $h . \"\\n\";\n for($x = 0; $x < $h; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n for($x = 0; $x < $p - 1; $x++)\n {\n print $r . \" \" . $r . \"\\n\";\n }\n print $r . \" \" . $r;\n}\n?>"}, {"source_code": " 0)\n {\n $i = $x;\n break;\n }\n }\n }\n if($d[$j] == 0)\n {\n for($x = $i + 1; $x < 10000; $x++)\n {\n if($d[$x] > 0)\n {\n $j = $x;\n break;\n }\n }\n }\n $f[$h] = $e[$i];\n $g[$h] = $e[$j];\n $h++;\n $f[$h] = $e[$j];\n $g[$h] = $e[$i];\n $h++;\n $d[$i]--;\n $d[$j]--;\n }\n}\nif($l == 1)\n{\n print $h . \"\\n\";\n for($x = 0; $x < $h - 1; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n print $f[$x] . \" \" . $g[$x];\n}\nelseif($l == 2)\n{\n $m = 2;\n for($x = 0; $x < $h; $x++)\n {\n $n = $m % 2;\n if($n == 0)\n {\n $o[$f[$x]]--;\n $o[$g[$x]]--;\n }\n $m++;\n }\n $p = max($o);\n $r = array_search($p, $o);\n print $h . \"\\n\";\n for($x = 0; $x < $h; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n for($x = 0; $x < $p - 1; $x++)\n {\n print $r . \" \" . $r . \"\\n\";\n }\n print $r . \" \" . $r;\n}\n?>"}, {"source_code": " 0)\n {\n $i = $x;\n break;\n }\n }\n }\n if(($d[$j] == 0) || ($j == $i))\n {\n $j = $i + 1;\n }\n $f[$h] = $e[$i];\n $g[$h] = $e[$j];\n $h++;\n $f[$h] = $e[$j];\n $g[$h] = $e[$i];\n $h++;\n $d[$i]--;\n $d[$j]--;\n $j++; \n }\n}\nif($l == 1)\n{\n print $h . \"\\n\";\n for($x = 0; $x < $h - 1; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n print $f[$x] . \" \" . $g[$x];\n}\nelseif($l == 2)\n{\n $m = 2;\n for($x = 0; $x < $h; $x++)\n {\n $n = $m % 2;\n if($n == 0)\n {\n $o[$f[$x]]--;\n $o[$g[$x]]--;\n }\n $m++;\n }\n $p = max($o);\n $r = array_search($p, $o);\n print $h . \"\\n\";\n for($x = 0; $x < $h; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n for($x = 0; $x < $p - 1; $x++)\n {\n print $r . \" \" . $r . \"\\n\";\n }\n print $r . \" \" . $r;\n}\n?>"}, {"source_code": " 0)\n {\n $i = $x;\n break;\n }\n }\n }\n if(($d[$j] == 0) || ($j == $i))\n {\n $j = $i + 1;\n }\n $f[$h] = $e[$i];\n $g[$h] = $e[$j];\n $h++;\n $f[$h] = $e[$j];\n $g[$h] = $e[$i];\n $h++;\n $d[$i]--;\n $d[$j]--;\n $j++; \n }\n}\nif($l == 1)\n{\n print $h . \"\\n\";\n for($x = 0; $x < $h - 1; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n print $f[$x] . \" \" . $g[$x];\n}\nelseif($l == 2)\n{\n $m = 2;\n for($x = 0; $x < $h; $x++)\n {\n $n = $m % 2;\n if($n == 0)\n {\n $o[$f[$x]]--;\n $o[$g[$x]]--;\n }\n $m++;\n }\n $p = max($o);\n $r = array_search($p, $o);\n print $h . \"\\n\";\n for($x = 0; $x < $h; $x++)\n {\n print $f[$x] . \" \" . $g[$x] . \"\\n\";\n }\n for($x = 0; $x < $p - 1; $x++)\n {\n print $r . \" \" . $r . \"\\n\";\n }\n print $r . \" \" . $r;\n}\n?>"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$diff += $q_same*$q1;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1 * 2;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\t$resx = array();\n\t\twhile($qx1 = reset($xame)) {\n\t\t\t$x1 = key($xame);\n\t\t\t$qx2 = next($xame);\n\t\t\t$x2 = key($xame);\n\n\t\t\tif ($resx[$x1.' '.$x2]) {\n\t\t\t\t$res[] = $x2.' '.$x1;\n\t\t\t\t$resx[$x2.' '.$x1] = 1;\n\t\t\t} else {\n\t\t\t\t$res[] = $x1.' '.$x2;\n\t\t\t\t$resx[$x1.' '.$x2] = 1;\n\t\t\t}\n\n\t\t\tif ($qx1==1) {\n\t\t\t\tunset($xame[$x1]);\n\t\t\t} else {\n\t\t\t\t$xame[$x1]--;\n\t\t\t}\n\n\t\t\tif ($qx2==1) {\n\t\t\t\tunset($xame[$x2]);\n\t\t\t} else {\n\t\t\t\t$xame[$x2]--;\n\t\t\t}\n\n\t\t\tif ($xame) {\n\t\t\t\tarsort($xame);\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t\t$diff += 2;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\n\tarsort($distr);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n\n//--------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\tif (reset($k)==end($k)) {\n\t\t$q = $k[0];\n\n\t\tif ($sd%2) {\n\t\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t\t}\n\t\t\t$sd -= 3;\n\t\t\t$diff += $q * 3;\n\n\t\t\t$c = array_slice($c,3);\n\t\t\t$k = array_slice($k,3);\n\n\t\t\tif ($sd) {\n\t\t\t\t$distr = array_combine($c, $k);\n\t\t\t\t$c = array_keys($distr);\n\t\t\t\t$k = array_values($distr);\n\t\t\t} else {\n\t\t\t\t$distr = array();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$sd /= 2;\n\t\tfor ($j=0;$j<$sd;$j++) {\n\t\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t\t$res[] = $c[$j*2].' '.$c[$j*2+1];\n\t\t\t\t$res[] = $c[$j*2+1].' '.$c[$j*2];\n\t\t\t}\n\t\t\t$diff += $q * 2;\n\t\t}\n\n\t\t$sd = 0;\n\t\t$distr = array();\n\t\tbreak;\n\t}\n\n\t$res[] = $c[0].' '.$c[1];\n\t$res[] = $c[1].' '.$c[0];\n\t$res[] = $c[0].' '.$c[2];\n\t$res[] = $c[2].' '.$c[0];\n\t$diff += 4;\n\t$k[0] -= 2;\n\t$k[1]--;\n\t$k[2]--;\n\n\tfor ($i=0;$i<=2;$i++)\n\t\tif ($k[$i]==0) {\n\t\t\tunset($c[$i],$k[$i]);\n\t\t}\n\n\t$sd = sizeof($c);\n\tif ($sd) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\t$distr = array();\n\t}\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($distr[$c[0]],$c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t\t$distr[$c[0]] = $k[0];\n\t}\n\n\tunset($distr[$c[1]],$c[1],$k[1]);\n}\n\nif ($distr) {\n\t$c = key($distr);\n\t$k = current($distr);\n\tfor ($i=0;$i<$k;$i++) {\n\t\t$res[] = $c.' '.$c;\n\t}\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1 * 2;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\t$resx = array();\n\t\twhile($qx1 = reset($xame)) {\n\t\t\t$x1 = key($xame);\n\t\t\t$qx2 = next($xame);\n\t\t\t$x2 = key($xame);\n\n\t\t\tif ($resx[$x1.' '.$x2] > $resx[$x2.' '.$x1]) {\n\t\t\t\t$res[] = $x2.' '.$x1;\n\t\t\t\t$resx[$x2.' '.$x1]++;\n\t\t\t} else {\n\t\t\t\t$res[] = $x1.' '.$x2;\n\t\t\t\t$resx[$x1.' '.$x2]++;\n\t\t\t}\n\n\t\t\t$diff++;\n\n\t\t\tif ($qx1==1) {\n\t\t\t\tunset($xame[$x1]);\n\t\t\t} else {\n\t\t\t\t$xame[$x1]--;\n\t\t\t}\n\n\t\t\tif ($qx2==1) {\n\t\t\t\tunset($xame[$x2]);\n\t\t\t} else {\n\t\t\t\t$xame[$x2]--;\n\t\t\t}\n\n\t\t\tif ($xame) {\n\t\t\t\tarsort($xame);\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) && $q1 > $q2 ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t\t$diff += 2;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\tarsort($distr);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n\necho implode(L,$res);"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$diff += $q_same*$q1;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1 * 2;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\twhile($qx1 = reset($xame)) {\n\t\t\t$x1 = key($xame);\n\t\t\t$qx2 = next($xame);\n\t\t\t$x2 = key($xame);\n\n\t\t\t$res[] = $x1.' '.$x2;\n\n\t\t\tif ($qx1==1) {\n\t\t\t\tunset($xame[$x1]);\n\t\t\t} else {\n\t\t\t\t$xame[$x1]--;\n\t\t\t}\n\n\t\t\tif ($qx2==1) {\n\t\t\t\tunset($xame[$x2]);\n\t\t\t} else {\n\t\t\t\t$xame[$x2]--;\n\t\t\t}\n\n\t\t\tif ($xame) {\n\t\t\t\tarsort($xame);\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t\t$diff += 2;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\n\tarsort($distr);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n\n//--------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\t\n\tif ($k[1] + $k[2] > $k[0]) {\n\t\t$q = $k[2];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 3;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\n\t\tif ($k[1]==$q) {\n\t\t\tunset($c[1],$k[1]);\n\t\t} else {\n\t\t\t$k[1]-=$q;\n\t\t}\n\n\t\tunset($c[2],$k[2]);\n\t} else {\n\n\t\tfor ($i=0;$i<$k[1];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\tfor ($i=0;$i<$k[2];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$q = $k[1] + $k[2];\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\t\tunset($c[1],$k[1]);\n\t\tunset($c[2],$k[2]);\n\t}\n\n\tif ($c) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\tbreak;\n\t}\n}\n\narray_unshift($res, $diff);\n\n//-----------------------\necho implode(L,$res);"}, {"source_code": " $q2) {\n\t\t\t$diff += $q2;\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\t\t} else {\n\t\t\t$diff += $q1;\n\t\t\t$max = $q1;\n\t\t\t$q2 -= $q1;\n\t\t\t$q1 = 0;\n\t\t}\n\n\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t$res[] = $c2.' '.$c1;\n\t\t}\n\n\t\tif ($q2)\n\t\t\t$distr[$c2] = $q2;\n\t\telse\n\t\t\tunset($distr[$c2]);\n\t}\n\n\tif ($q1)\n\t\t$distr[$c1] = $q1;\n\telse\n\t\tunset($distr[$c1]);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff*2);\n\n//--------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\t\n\tif ($k[1] + $k[2] > $k[0]) {\n\t\t$q = $k[2];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 3;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\n\t\tif ($k[1]==$q) {\n\t\t\tunset($c[1],$k[1]);\n\t\t} else {\n\t\t\t$k[1]-=$q;\n\t\t}\n\n\t\tunset($c[2],$k[2]);\n\t} else {\n\n\t\tfor ($i=0;$i<$k[1];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\tfor ($i=0;$i<$k[2];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$q = $k[1] + $k[2];\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\t\tunset($c[1],$k[1]);\n\t\tunset($c[2],$k[2]);\n\t}\n\n\tif ($c) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\tbreak;\n\t}\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t}\n\n\tunset($c[1],$k[1]);\n}\n\nif ($c) {\n\tfor ($i=0;$i<$k[0];$i++) {\n\t\t$res[] = $c[0].' '.$c[0];\n\t}\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\tif (!($sd%2) && reset($k)==end($k)) {\n\t\t$sd /= 2;\n\t\t$q = $k[0];\n\t\tfor ($j=0;$j<$sd;$j++) {\n\t\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t\t$res[] = $c[$j*2].' '.$c[$j*2+1];\n\t\t\t\t$res[] = $c[$j*2+1].' '.$c[$j*2];\n\t\t\t}\n\t\t\t$diff += $q * 2;\n\t\t}\n\n\t\t$sd = 0;\n\t\t$distr = array();\n\t\tbreak;\n\t}\n\n\tif ($k[1] + $k[2] > $k[0]) {\n\t\t$q = $k[2];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 3;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\n\t\tif ($k[1]==$q) {\n\t\t\tunset($c[1],$k[1]);\n\t\t} else {\n\t\t\t$k[1]-=$q;\n\t\t}\n\n\t\tunset($c[2],$k[2]);\n\t} else {\n\n\t\tfor ($i=0;$i<$k[1];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\tfor ($i=0;$i<$k[2];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$q = $k[1] + $k[2];\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\t\tunset($c[1],$k[1]);\n\t\tunset($c[2],$k[2]);\n\t}\n\n\tif ($c) {\n\t\t$sd = sizeof($c);\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\t$sd = 0;\n\t\t$distr = array();\n\t}\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($distr[$c[0]],$c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t\t$distr[$c[0]] = $k[0];\n\t}\n\n\tunset($distr[$c[1]],$c[1],$k[1]);\n}\n\nif ($distr) {\n\t$c = key($distr);\n\t$k = current($distr);\n\tfor ($i=0;$i<$k;$i++) {\n\t\t$res[] = $c.' '.$c;\n\t}\n}\n\narray_unshift($res, $diff);\n\n//-----------------------\necho implode(L,$res);"}, {"source_code": " $q2) {\n\t\t\t$diff += $q2;\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\t\t} else {\n\t\t\t$diff += $q1;\n\t\t\t$max = $q1;\n\t\t\t$q2 -= $q1;\n\t\t\t$q1 = 0;\n\t\t}\n\n\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t$res[] = $c2.' '.$c1;\n\t\t}\n\n\t\tif ($q2)\n\t\t\t$distr[$c2] = $q2;\n\t\telse\n\t\t\tunset($distr[$c2]);\n\t}\n\n\tif ($q1)\n\t\t$distr[$c1] = $q1;\n\telse\n\t\tunset($distr[$c1]);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff*2);\n\n//--------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[2];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[2];\n\t\t$res[] = $c[2].' '.$c[0];\n\t}\n\n\t$diff += $q * 3;\n\n\tif ($k[0]==$q) {\n\t\tunset($c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t}\n\n\tif ($k[1]==$q) {\n\t\tunset($c[1],$k[1]);\n\t} else {\n\t\t$k[1]-=$q;\n\t}\n\n\tunset($c[2],$k[2]);\n\n\t$distr = array_combine($c, $k);\n\n\tarsort($distr);\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t}\n\n\tunset($c[1],$k[1]);\n\n\t\n}\n\nif ($c) {\n\tfor ($i=0;$i<$k[0];$i++) {\n\t\t$res[] = $c[0].' '.$c[0];\n\t}\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1 * 2;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\t$resx = array();\n\t\twhile($qx1 = reset($xame)) {\n\t\t\t$x1 = key($xame);\n\t\t\t$qx2 = next($xame);\n\t\t\t$x2 = key($xame);\n\n\t\t\tif ($resx[$x1.' '.$x2]) {\n\t\t\t\t$res[] = $x2.' '.$x1;\n\t\t\t\t$resx[$x2.' '.$x1] = 1;\n\t\t\t} else {\n\t\t\t\t$res[] = $x1.' '.$x2;\n\t\t\t\t$resx[$x1.' '.$x2] = 1;\n\t\t\t}\n\n\t\t\t$diff++;\n\n\t\t\tif ($qx1==1) {\n\t\t\t\tunset($xame[$x1]);\n\t\t\t} else {\n\t\t\t\t$xame[$x1]--;\n\t\t\t}\n\n\t\t\tif ($qx2==1) {\n\t\t\t\tunset($xame[$x2]);\n\t\t\t} else {\n\t\t\t\t$xame[$x2]--;\n\t\t\t}\n\n\t\t\tif ($xame) {\n\t\t\t\tarsort($xame);\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) && $q1 > $q2 ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t\t$diff += 2;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\tarsort($distr);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n\n//--------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\t\n\tif ($k[1] + $k[2] > $k[0]) {\n\t\t$q = $k[2];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 3;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\n\t\tif ($k[1]==$q) {\n\t\t\tunset($c[1],$k[1]);\n\t\t} else {\n\t\t\t$k[1]-=$q;\n\t\t}\n\n\t\tunset($c[2],$k[2]);\n\t} else {\n\n\t\tfor ($i=0;$i<$k[1];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\tfor ($i=0;$i<$k[2];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$q = $k[1] + $k[2];\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\t\tunset($c[1],$k[1]);\n\t\tunset($c[2],$k[2]);\n\t}\n\n\tif ($c) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\t$distr = array();\n\t\tbreak;\n\t}\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($distr[$c[0]],$c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t\t$distr[$c[0]] = $k[0];\n\t}\n\n\tunset($distr[$c[1]],$c[1],$k[1]);\n}\n\nif ($distr) {\n\t$c = key($distr);\n\t$k = current($distr);\n\tfor ($i=0;$i<$k;$i++) {\n\t\t$res[] = $c.' '.$c;\n\t}\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$uq = array_unique($k);\n\t$start = reset($k);\n\t$end = end($k);\n\tif (sizeof($uq) == $start-$end+1) {\n\n\t\t$final = true;\n\t\tforeach ($uq as $u) {\n\t\t\tif (sizeof(array_keys($k,$u))==1) {\n\t\t\t\t$final = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\t\tif ($final) {\n\t\t\tforeach ($uq as $u) {\n\t\t\t\t$c_uq = array_keys($distr,$u);\n\t\t\t\t$q_uq = sizeof($c_uq);\n\n\t\t\t\tif ($q_uq%2) {\n\t\t\t\t\tfor ($i=0;$i<$u;$i++) {\n\t\t\t\t\t\t$res[] = $c_uq[0].' '.$c_uq[1];\n\t\t\t\t\t\t$res[] = $c_uq[1].' '.$c_uq[2];\n\t\t\t\t\t\t$res[] = $c_uq[2].' '.$c_uq[0];\n\t\t\t\t\t}\n\t\t\t\t\t$q_uq -= 3;\n\t\t\t\t\t$diff += $u * 3;\n\n\t\t\t\t\t$c_uq = array_slice($c_uq,3);\n\t\t\t\t}\n\n\t\t\t\tif ($c_uq) {\n\t\t\t\t\t$q_uq /= 2;\n\t\t\t\t\tfor ($j=0;$j<$q_uq;$j++) {\n\t\t\t\t\t\tfor ($i=0;$i<$u;$i++) {\n\t\t\t\t\t\t\t$res[] = $c[$j*2].' '.$c[$j*2+1];\n\t\t\t\t\t\t\t$res[] = $c[$j*2+1].' '.$c[$j*2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$diff += $u * 2 * $q_uq;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$res[] = $c[0].' '.$c[1];\n\t$res[] = $c[1].' '.$c[0];\n\t$res[] = $c[0].' '.$c[2];\n\t$res[] = $c[2].' '.$c[0];\n\t$diff += 4;\n\t$k[0] -= 2;\n\t$k[1]--;\n\t$k[2]--;\n\n\tfor ($i=0;$i<=2;$i++)\n\t\tif ($k[$i]==0) {\n\t\t\tunset($c[$i],$k[$i]);\n\t\t}\n\n\t$sd = sizeof($c);\n\tif ($sd) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\t$distr = array();\n\t}\n}\n\nif (!$final) {\n\tif (sizeof($distr) == 2) {\n\t\t$c = array_keys($distr);\n\t\t$k = array_values($distr);\n\n\t\t$q = $k[1];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($distr[$c[0]],$c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t\t$distr[$c[0]] = $k[0];\n\t\t}\n\n\t\tunset($distr[$c[1]],$c[1],$k[1]);\n\t}\n\n\tif ($distr) {\n\t\t$c = key($distr);\n\t\t$k = current($distr);\n\t\tfor ($i=0;$i<$k;$i++) {\n\t\t\t$res[] = $c.' '.$c;\n\t\t}\n\t}\n}\n\narray_unshift($res, $diff);\n\n//-----------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\t\n\tif ($k[1] + $k[2] > $k[0]) {\n\t\t$q = $k[2];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 3;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\n\t\tif ($k[1]==$q) {\n\t\t\tunset($c[1],$k[1]);\n\t\t} else {\n\t\t\t$k[1]-=$q;\n\t\t}\n\n\t\tunset($c[2],$k[2]);\n\t} else {\n\n\t\tfor ($i=0;$i<$k[1];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\tfor ($i=0;$i<$k[2];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$q = $k[1] + $k[2];\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\t\tunset($c[1],$k[1]);\n\t\tunset($c[2],$k[2]);\n\t}\n\n\tif ($c) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\t$distr = array();\n\t\tbreak;\n\t}\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($c[0],$k[0],$distr[$c[0]]);\n\t} else {\n\t\t$k[0]-=$q;\n\t}\n\n\tunset($c[1],$k[1],$distr[$c[1]]);\n}\n\nif ($distr) {\n\t$c = key($distr);\n\t$k = current($distr);\n\tfor ($i=0;$i<$k;$i++) {\n\t\t$res[] = $c.' '.$c;\n\t}\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1 * 2;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\t$resx = array();\n\t\twhile($qx1 = reset($xame)) {\n\t\t\t$x1 = key($xame);\n\t\t\t$qx2 = next($xame);\n\t\t\t$x2 = key($xame);\n\n\t\t\tif ($resx[$x1.' '.$x2] > $resx[$x2.' '.$x1]) {\n\t\t\t\t$res[] = $x2.' '.$x1;\n\t\t\t\t$resx[$x2.' '.$x1]++;\n\t\t\t} else {\n\t\t\t\t$res[] = $x1.' '.$x2;\n\t\t\t\t$resx[$x1.' '.$x2]++;\n\t\t\t}\n\n\t\t\t$diff++;\n\n\t\t\tif ($qx1==1) {\n\t\t\t\tunset($xame[$x1]);\n\t\t\t} else {\n\t\t\t\t$xame[$x1]--;\n\t\t\t}\n\n\t\t\tif ($qx2==1) {\n\t\t\t\tunset($xame[$x2]);\n\t\t\t} else {\n\t\t\t\t$xame[$x2]--;\n\t\t\t}\n\n\t\t\tif ($xame) {\n\t\t\t\tarsort($xame);\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) && $q1 > $q2 ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t\t$diff += 2;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\tarsort($distr);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n\necho implode(L,$result);"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$diff += $q_same*$q1;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1 * 2;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\twhile($qx1 = reset($xame)) {\n\t\t\t$x1 = key($xame);\n\t\t\t$qx2 = next($xame);\n\t\t\t$x2 = key($xame);\n\n\t\t\t$res[] = $x1.' '.$x2;\n\n\t\t\tif ($qx1==1) {\n\t\t\t\tunset($xame[$x1]);\n\t\t\t} else {\n\t\t\t\t$xame[$x1]--;\n\t\t\t}\n\n\t\t\tif ($qx2==1) {\n\t\t\t\tunset($xame[$x2]);\n\t\t\t} else {\n\t\t\t\t$xame[$x2]--;\n\t\t\t}\n\n\t\t\tif ($xame) {\n\t\t\t\tarsort($xame);\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t\t$diff += 2;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\n\tarsort($distr);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n\n//--------------------\necho implode(L,$res);"}, {"source_code": " 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\t\n\tif ($k[1] + $k[2] > $k[0]) {\n\t\t$q = $k[2];\n\n\t\tfor ($i=0;$i<$q;$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$diff += $q * 3;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\n\t\tif ($k[1]==$q) {\n\t\t\tunset($c[1],$k[1]);\n\t\t} else {\n\t\t\t$k[1]-=$q;\n\t\t}\n\n\t\tunset($c[2],$k[2]);\n\t} else {\n\n\t\tfor ($i=0;$i<$k[1];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[1];\n\t\t\t$res[] = $c[1].' '.$c[0];\n\t\t}\n\n\t\tfor ($i=0;$i<$k[2];$i++) {\n\t\t\t$res[] = $c[0].' '.$c[2];\n\t\t\t$res[] = $c[2].' '.$c[0];\n\t\t}\n\n\t\t$q = $k[1] + $k[2];\n\n\t\t$diff += $q * 2;\n\n\t\tif ($k[0]==$q) {\n\t\t\tunset($c[0],$k[0]);\n\t\t} else {\n\t\t\t$k[0]-=$q;\n\t\t}\n\t\tunset($c[1],$k[1]);\n\t\tunset($c[2],$k[2]);\n\t}\n\n\tif ($c) {\n\t\t$distr = array_combine($c, $k);\n\t\tarsort($distr);\n\t} else {\n\t\tbreak;\n\t}\n}\n\nif (sizeof($distr) == 2) {\n\t$c = array_keys($distr);\n\t$k = array_values($distr);\n\n\t$q = $k[1];\n\n\tfor ($i=0;$i<$q;$i++) {\n\t\t$res[] = $c[0].' '.$c[1];\n\t\t$res[] = $c[1].' '.$c[0];\n\t}\n\n\t$diff += $q * 2;\n\n\tif ($k[0]==$q) {\n\t\tunset($c[0],$k[0]);\n\t} else {\n\t\t$k[0]-=$q;\n\t}\n\n\tunset($c[1],$k[1]);\n}\n\nif ($distr) {\n\t$c = key($distr);\n\t$k = current($distr);\n\tfor ($i=0;$i<$k;$i++) {\n\t\t$res[] = $c.' '.$c;\n\t}\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$diff += $q_same*$q1;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1 * 2;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\twhile($qx1 = reset($xame)) {\n\t\t\t$x1 = key($xame);\n\t\t\t$qx2 = next($xame);\n\t\t\t$x2 = key($xame);\n\n\t\t\t$res[] = $x1.' '.$x2;\n\n\t\t\tif ($qx1==1) {\n\t\t\t\tunset($xame[$x1]);\n\t\t\t} else {\n\t\t\t\t$xame[$x1]--;\n\t\t\t}\n\n\t\t\tif ($qx2==1) {\n\t\t\t\tunset($xame[$x2]);\n\t\t\t} else {\n\t\t\t\t$xame[$x2]--;\n\t\t\t}\n\n\t\t\tif ($xame) {\n\t\t\t\tarsort($xame);\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t\t$diff += 2;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\n\tarsort($distr);\n}\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n\n//--------------------\necho implode(L,$res);"}, {"source_code": " 1) {\n\t\t$is = true;\n\n\t\t$xame = array();\n\n\t\tforeach ($same as $u) {\n\t\t\t$xame[$u] = $q1;\n\t\t\tunset($distr[$u]);\n\t\t}\n\n\t\tif ($q_same % 2) {\n\t\t\t$head = array_slice($xame,0,3,true);\n\t\t\t$xame = array_slice($xame,3,$q_same,true);\n\t\t\t$q_same -= 3;\n\n\t\t\t$w = array_keys($head);\n\n\t\t\tfor ($i=0;$i<$q1;$i++) {\n\t\t\t\t$res[] = $w[0].' '.$w[1];\n\t\t\t\t$res[] = $w[1].' '.$w[2];\n\t\t\t\t$res[] = $w[2].' '.$w[0];\n\t\t\t}\n\t\t}\n\n\t\t$w = array_keys($xame);\n\t\t$q_same /= 2;\n\t\tfor ($i=0;$i<$q_same;$i++) {\n\t\t\tfor ($j=0;$j<$q1;$j++) {\n\t\t\t\t$res[] = $w[$i*2].' '.$w[$i*2+1];\n\t\t\t\t$res[] = $w[$i*2+1].' '.$w[$i*2];\n\t\t\t}\n\t\t}\n\n\n\t} else {\n\t\twhile ( $q1 && ($q2 = next($distr)) && $q1 > $q2 ) {\n\t\t\t$is = true;\n\t\t\t$c2 = key($distr);\n\n\t\t\t$max = $q2;\n\t\t\t$q1 -= $q2;\n\t\t\t$q2 = 0;\n\n\t\t\tfor ($z=0;$z<$max;$z++) {\n\t\t\t\t$res[] = $c1.' '.$c2;\n\t\t\t\t$res[] = $c2.' '.$c1;\n\t\t\t}\n\n\t\t\tif ($q2)\n\t\t\t\t$distr[$c2] = $q2;\n\t\t\telse\n\t\t\t\tunset($distr[$c2]);\n\t\t}\n\n\t\tif ($q1)\n\t\t\t$distr[$c1] = $q1;\n\t\telse\n\t\t\tunset($distr[$c1]);\n\t\t\n\t}\n\n\tarsort($distr);\n}\n\n$diff = sizeof($res);\n\nfor ($z=0;$z<$q1;$z++) {\n\t$res[] = $c1.' '.$c1;\n}\n\narray_unshift($res, $diff);\n//-----------------------\necho implode(L,$res);"}], "src_uid": "636e9c125197b52c91998bf91ecd8ab1"} {"source_code": ""}, {"source_code": " $value) {\r\n $opCountAndOps = explode(' ', readline());\r\n $opCount = $opCountAndOps[0];\r\n $ops = $opCountAndOps[1];\r\n\r\n foreach(str_split($ops) as $op) {\r\n if($op === \"D\") {\r\n $currentState[$key] = (intval($currentState[$key]) + 1) % 10;\r\n } else {\r\n $currentState[$key] = (intval($currentState[$key]) - 1) % 10;\r\n\r\n if($currentState[$key] < 0) {\r\n $currentState[$key] = 9;\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n array_push($final_result, $currentState);\r\n}\r\n\r\nforeach($final_result as $result) {\r\n foreach($result as $value) {\r\n echo $value . ' ';\r\n }\r\n\r\n echo PHP_EOL;\r\n}\r\n"}, {"source_code": " 9) {\r\n $i = $i - 10;\r\n } elseif ($i < 0) {\r\n $i = $i + 10;\r\n }\r\n\r\n return $i;\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}"}], "negative_code": [], "src_uid": "fd47f1eb701077abc5ec67163ad4fcc5"} {"source_code": "", "positive_code": [{"source_code": "=0;$i--) {\n $nlast[$n++] = $lbin[$i];\n }\n $last = bindec(implode('', $nlast));\n }\n $dec = ord($str);\n $bin = decbin($dec);\n $nbin = array('0','0','0','0','0','0','0','0');\n $n = 0;\n for($i=(strlen($bin)-1);$i>=0;$i--) {\n $nbin[$n++] = $bin[$i];\n }\n $nbin = implode('', $nbin);\n $ndec = bindec($nbin);\n $s = $last-$ndec;\n $res = mod_math($s,256);\n $last = $dec;\n echo( $res .\"\\n\" );\n}\n\n$in = trim(fgets(STDIN));\n$last = 0;\nfor($i=0;$i=0; $i--){\n $ss.=$str[$i];\n }\n for($i=$size+1; $i<=8; $i++)\n $ss.=\"0\";\n return $ss; \n}\n$tmp=0;\nfor($i=0, $s=strlen($str); $i<$s; $i++){\n $char=ord($str[$i]);\n $bin=decbin($char);\n $rev_bin = reverses($bin);\n $dec=bindec($rev_bin);\n echo (($tmp-$dec)%256+256)%256,\"\\n\";\n $tmp=$dec;\n}\n?>"}], "negative_code": [], "src_uid": "a65e12186430f74c18c50d2eb55a9794"} {"source_code": ".< I don\\'t know!';\n\t\telseif($l == 'miao.')\n\t\t\techo 'Rainbow\\'s';\n\t\telseif($r == 'lala.')\n\t\t\techo 'Freda\\'s';\n\t\telse\n\t\t\techo 'OMG>.< I don\\'t know!';\n\t\techo \"\\n\";\n\t}", "positive_code": [{"source_code": ".< I don't know!\" . PHP_EOL;\n}\n\nfunction startsWith($haystack, $needle)\n{\n\treturn !strncmp($haystack, $needle, strlen($needle));\n}\n\nfunction endsWith($haystack, $needle)\n{\n\t$length = strlen($needle);\n\tif ($length == 0)\n\t{\n\t\treturn true;\n\t}\n\n\treturn (substr($haystack, -$length) === $needle);\n}"}, {"source_code": ".< I don't know!\\n\";\n }\n elseif($e == \"miao.\")\n {\n print \"Rainbow's\\n\";\n }\n elseif($f == \"lala.\")\n {\n print \"Freda's\\n\";\n }\n else\n {\n print \"OMG>.< I don't know!\\n\";\n }\n}\n?>"}, {"source_code": ".< I don\\'t know!';\n\telseif($l == 'miao.')\n\t\techo 'Rainbow\\'s';\n\telseif($r == 'lala.')\n\t\techo 'Freda\\'s';\n\telse\n\t\techo 'OMG>.< I don\\'t know!';\n\techo \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": ".< I don't know!\\n\";\n }\n}\n$b = \" \" . trim(fgets(STDIN));\n$c = strpos($b, \"miao.\");\n$d = strpos($b, \"lala.\", strlen($b) - 5);\nif(($c == 2) && ($d != (strlen($b) - 5)))\n{\n print \"Rainbow's\";\n}\nelseif(($c != 2) && ($d == (strlen($b) - 5)))\n{\n print \"Freda's\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don't know!\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n if(($b[0] == \"m\") && ($b[1] == \"i\") && ($b[2] == \"a\") && ($b[3] == \"o\") && ($b[4] == \".\") && ($b[strlen($b) - 5] != \"l\") && ($b[strlen($b) - 4] != \"a\") && ($b[strlen($b) - 3] != \"l\") && ($b[strlen($b) - 2] != \"a\"))\n{\n print \"Rainbow's\";\n}\nelseif(($b[0] != \"m\") && ($b[1] != \"i\") && ($b[2] != \"a\") && ($b[3] != \"o\") && ($b[strlen($b) - 5] == \"l\") && ($b[strlen($b) - 4] == \"a\") && ($b[strlen($b) - 3] == \"l\") && ($b[strlen($b) - 2] == \"a\") && ($b[strlen($b) - 1] == \".\"))\n{\n print \"Freda's\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don't know!\\n\";\n }\n elseif(($c == 2) && ($d != (strlen($b) - 5)))\n {\n print \"Rainbow's\\n\";\n }\n elseif(($c != 2) && ($d == (strlen($b) - 5)))\n {\n print \"Freda's\\n\";\n }\n else\n {\n print \"OMG>.< I don't know!\\n\";\n }\n}\n$b = \" \" . trim(fgets(STDIN));\n$c = strpos($b, \"miao.\");\n$d = strpos($b, \"lala.\", strlen($b) - 5);\nif(($c == 2) && ($d != (strlen($b) - 5)))\n{\n print \"Rainbow's\";\n}\nelseif(($c != 2) && ($d == (strlen($b) - 5)))\n{\n print \"Freda's\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\";\n}\n?>"}, {"source_code": ".< I don't know!\\n\";\n }\n elseif(($c == \"miao.\") && ($d != \"lala.\"))\n {\n print \"Rainbow's\\n\";\n }\n elseif(($c != \"miao.\") && ($d == \"lala.\"))\n {\n print \"Freda's\\n\";\n if($e == 1)\n {\n print $b . \"\\n\";\n }\n }\n else\n {\n print \"OMG>.< I don't know!\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, 0, 5);\n$d = substr($b, -5);\nif(($c == \"miao.\") && ($d == \"lala.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"miao.\") && ($d != \"lala.\"))\n{\n print \"Rainbow's\";\n}\nelseif(($c != \"miao.\") && ($d == \"lala.\"))\n{\n print \"Freda's\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif($b == \"miaolala.\")\n{\n print \"Rainbow's\";\n}\nelseif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n if($f == 1)\n {\n print $b . \"\\n\";\n }\n if($e == 1)\n {\n $f = 1;\n }\n if($b == \"lala.lala.lala.\")\n {\n $e = 1;\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\";\n}\n?>"}, {"source_code": ".< I don't know!\\n\";\n }\n elseif(($c == \"miao.\") && ($d != \"lala.\"))\n {\n print \"Rainbow's\\n\";\n }\n elseif(($c != \"miao.\") && ($d == \"lala.\"))\n {\n print \"Freda's\\n\";\n }\n elseif($b == \"miaolala.\")\n {\n print \"OMG>.< I don't know!\\n\";\n }\n else\n {\n print \"OMG>.< I don't know!\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, 0, 5);\n$d = substr($b, -5);\nif(($c == \"miao.\") && ($d == \"lala.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"miao.\") && ($d != \"lala.\"))\n{\n print \"Rainbow's\";\n}\nelseif(($c != \"miao.\") && ($d == \"lala.\"))\n{\n print \"Freda's\";\n}\nelseif($b == \"miaolala.\")\n{\n print \"OMG>.< I don't know!\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b == trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif($b = \"miaolala.\")\n{\n print \"Rainbow's\";\n}\nelseif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\";\n}\n?>"}, {"source_code": ".< I don't know!\\n\";\n }\n elseif(($c == \"miao.\") && ($d != \"lala.\"))\n {\n print \"Rainbow's\\n\";\n }\n elseif(($c != \"miao.\") && ($d == \"lala.\"))\n {\n print \"Freda's\\n\";\n }\n else\n {\n print \"OMG>.< I don't know!\\n\";\n }\n}\n$b = fgets(STDIN);\n$c = substr($b, 0, 5);\n$d = substr($b, -5);\nif(($c == \"miao.\") && ($d == \"lala.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"miao.\") && ($d != \"lala.\"))\n{\n print \"Rainbow's\";\n}\nelseif(($c != \"miao.\") && ($d == \"lala.\"))\n{\n print \"Freda's\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif($b = \"miaolala.\")\n{\n print \"Rainbow's\" . \"\\n\";\n}\nelseif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\" . \"\\n\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\" . \"\\n\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\" . \"\\n\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\" . \"\\n\";\n}\n?>"}, {"source_code": ".< I don't know!\\n\";\n }\n elseif(($c == \"miao.\") && ($d != \"lala.\"))\n {\n print \"Rainbow's\\n\";\n }\n elseif(($c != \"miao.\") && ($d == \"lala.\"))\n {\n print \"Freda's\\n\";\n }\n else\n {\n print \"OMG>.< I don't know!\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, 0, 5);\n$d = substr($b, -5);\nif(($c == \"miao.\") && ($d == \"lala.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"miao.\") && ($d != \"lala.\"))\n{\n print \"Rainbow's\";\n}\nelseif(($c != \"miao.\") && ($d == \"lala.\"))\n{\n print \"Freda's\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b == trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif($b = \"miaolala.\")\n{\n print \"Rainbow's\" . \"\\n\";\n}\nelseif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\" . \"\\n\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\" . \"\\n\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\" . \"\\n\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\" . \"\\n\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b = fgets(STDIN);\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\";\n}\n?>"}, {"source_code": ".< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d == \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d != \"miao.\"))\n {\n print \"OMG>.< I don't know!\" . \"\\n\";\n }\n elseif(($c == \"lala.\") && ($d != \"miao.\"))\n {\n print \"Freda's\" . \"\\n\";\n }\n elseif(($c != \"lala.\") && ($d == \"miao.\"))\n {\n print \"Rainbow's\" . \"\\n\";\n }\n}\n$b = trim(fgets(STDIN));\n$c = substr($b, strlen($b) - 5);\n$d = substr($b, 0, 5);\nif($b == \"miaolala.\")\n{\n print \"OMG>.< I don't know!\" . \"\\n\";\n}\nelseif(($c == \"lala.\") && ($d == \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c != \"lala.\") && ($d != \"miao.\"))\n{\n print \"OMG>.< I don't know!\";\n}\nelseif(($c == \"lala.\") && ($d != \"miao.\"))\n{\n print \"Freda's\";\n}\nelseif(($c != \"lala.\") && ($d == \"miao.\"))\n{\n print \"Rainbow's\";\n}\n?>"}, {"source_code": ".< I don't know!\\n\";\n }\n}\n$b = \" \" . fgets(STDIN);\n$c = strpos($b, \"miao.\");\n$d = strpos($b, \"lala.\", strlen($b) - 5);\nif(($c == 2) && ($d != (strlen($b) - 5)))\n{\n print \"Rainbow's\";\n}\nelseif(($c != 2) && ($d == (strlen($b) - 5)))\n{\n print \"Freda's\";\n}\nelse\n{\n print \"OMG>.< I don't know!\";\n}\n?>"}, {"source_code": ".< I don\\'t know!';\n\t\telseif($l == 'miao.')\n\t\t\techo 'Rainbow\\'s';\n\t\telseif($r == 'lala.')\n\t\t\techo 'Freda\\'s';\n\t\telse\n\t\t\techo 'OMG>.< I don\\'t know!';\n\t\techo \"\\n\";\n\t}"}, {"source_code": ".< I don\\'t know!';\n\t\telseif($l == 'miao.')\n\t\t\techo 'Rainbow\\'s';\n\t\telseif($r == 'lala.')\n\t\t\techo 'Freda\\'s';\n\t\telse\n\t\t\techo 'OMG>.< I don\\'t know!';\n\t\techo \"\\n\";\n\t}\n\t\n\t"}, {"source_code": ".< I don\\'t know!';\n\t\telseif($l == 'miao.')\n\t\t\techo 'Rainbow\\'s';\n\t\telseif($r == 'lala.')\n\t\t\techo 'Freda\\'s';\n\t\telse\n\t\t\techo 'OMG>.< I don\\'t know!';\n\t\techo \"\\n\";\n\t}"}, {"source_code": ".< I don\\'t know!';\n\t\telseif($l == 'miao.')\n\t\t\techo 'Rainbow\\'s';\n\t\telseif($r == 'lala.')\n\t\t\techo 'Freda\\'s';\n\t\telse\n\t\t\techo 'OMG>.< I don\\'t know!';\n\t\techo \"\\n\";\n\t}"}, {"source_code": ".< I don\\'t know!';\n\t\telseif($l == 'miao.')\n\t\t\techo 'Rainbow\\'s';\n\t\telseif($r == 'lala.')\n\t\t\techo 'Freda\\'s';\n\t\telse\n\t\t\techo 'OMG>.< I don\\'t know!';\n\t\techo \"\\n\";\n\t}"}, {"source_code": ".< I don\\'t know!';\n\t\telseif($l == 'miao.')\n\t\t\techo 'Rainbow\\'s';\n\t\telseif($r == 'lala.')\n\t\t\techo 'Freda\\'s';\n\t\telse\n\t\t\techo 'OMG>.< I don\\'t know!';\n\t\techo \"\\n\";\n\t}"}], "src_uid": "ee9ba877dee1a2843e885a18823cbff0"} {"source_code": " 0) {\n [$n, $k] = explode(' ', trim(fgets($stdin)));\n $i = '0';\n while ($n !== '0') {\n $mod = bcmod($n, $k);\n if ($k > 1 && ($mod === '0')) {\n $n = bcdiv($n, $k);\n $i = bcadd($i, '1');\n } else {\n $n = bcadd($n, '-' . $mod);\n $i = bcadd($i, $mod);\n }\n }\n echo $i . PHP_EOL;\n $t--;\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n [$n, $k] = fscanf($stdin, '%u %u');\n $i = 0;\n while ($n > 0) {\n if ($k > 1 && ($n % $k === 0)) {\n $i++;\n $n /= $k;\n } else {\n $i++;\n $n--;\n }\n }\n echo $i . PHP_EOL;\n $t--;\n}\n"}, {"source_code": ""}], "src_uid": "00b1e45e9395d23e850ce1a0751b8378"} {"source_code": " 0)\n{\n $n = fgets($stdin);\n \n if ($n % 4 == 0)\n echo(\"YES\\n\");\n else \n echo(\"NO\\n\");\n\n $t -= 1;\n}\n\nfclose($stdin);\n?>", "positive_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "07e56d4031bcb119d2f684203f7ed133"} {"source_code": "intval($array[$i]) ) {\n\t if (intval($array[$i+1])>intval($array[$i]))\n\t $loc_extr++; \n\t}\n\telse if (intval($array[$i-1])", "positive_code": [{"source_code": " $b[$i-1] && $b[$i] > $b[$i+1] )\n )\n {\n $counter++;\n }\n}\nprint $counter;\n?>"}, {"source_code": " $b[$x - 1]) && ($b[$x] > $b[$x + 1]))\n {\n $c++;\n }\n}\nprint $c;\n?>"}], "negative_code": [{"source_code": "=$array[$i] && $array[$i+1]>$array[$i])||($array[$i-1]>$array[$i] && $array[$i+1]>=$array[$i])) {\n\t $loc_extr++; \n\t}\n\telse if (($array[$i-1]<=$array[$i] && $array[$i+1]<$array[$i])||($array[$i-1]<$array[$i] && $array[$i+1]<=$array[$i])) {\n\t $loc_extr++; \n\t}\n}\necho $loc_extr;\n?>"}, {"source_code": "$array[$i] ) {\n\t if ($array[$i+1]>$array[$i])\n\t $loc_extr++; \n\t}\n\telse if ($array[$i-1]<$array[$i]) {\n\t if ($array[$i+1]<$array[$i])\n\t $loc_extr++; \n\t}\n}\necho $loc_extr;\n?>"}, {"source_code": "$array[$i]) {\n\t if ($array[$i+1]>$array[i])\n\t $loc_extr++; \n\t}\n\telse if ($array[$i-1]<$array[$i]) {\n\t if ($array[$i+1]<$array[$i])\n\t $loc_extr++; \n\t}\n}\necho $loc_extr;\n?>"}, {"source_code": "$array[$i]) {\n\t if ($array[$i+1]>$array[i])\n\t $loc_extr++; \n\t}\n\telse if ($array[$i-1]<$array[$i]) {\n\t if ($array[$i+1]<$array[$i])\n\t $loc_extr++; \n\t}\n}\necho $loc_extr;\n?>"}, {"source_code": "=$array[$i] && $array[$i+1]>$array[i])||($array[$i-1]>$array[$i] && $array[$i+1]>=$array[i])) {\n\t $loc_extr++; \n\t}\n\telse if (($array[$i-1]>=$array[$i] && $array[$i+1]>$array[i])||($array[$i-1]>$array[$i] && $array[$i+1]>=$array[i])) {\n\t $loc_extr++; \n\t}\n}\necho $loc_extr;\n?>"}, {"source_code": " $b[$i-1] && $b[$i] > $b[$i+1] )\n )\n {\n $counter++;\n }\n}\nprint $counter;\n?>"}, {"source_code": " $b[$i-1] && $b[$i] > $b[$i+1] )\n )\n {\n $counter++;\n }\n}\nprint $counter;\n?>"}, {"source_code": " b[$i-1] && b[$i] > b[$i+1] )\n\t) \n\t\t{\n\t\t\t$counter++;\n\t\t}\n}\nprint $counter;\n?>"}], "src_uid": "67cf9f83ed791a614bd01c5e0310813f"} {"source_code": "= $m + 2) {\n\t\t\treturn \"2\\n1 \" . $n;\n\t\t} else {\n\t\t\treturn \"3\\n1 \" . $n . \" \" . (2 * $n - 1);\n\t\t}\n\t}\n\tif ($n >= $m + 1) {\n\t\t$ans = (2 * $k) . \"\\n\" . str_repeat(\"1 \", $k) . $n . str_repeat(\" \" . ($n + 1), $k - 1);\n\t} else {\n\t\t$ans = (2 * $k + 1) . \"\\n\" . str_repeat(\"1 \", $k) . $n . str_repeat(\" \" . ($n + 1), $k - 1) . \" \" . (2 * $n);\n\t}\n\treturn $ans;\n}\n\n// End of submission file\n// Submission by chaotic_iak\n?>", "positive_code": [{"source_code": " $e)\n {\n break;\n }\n elseif($f < $e)\n {\n $d++;\n array_push($g, $f);\n $f += $a - 1;\n }\n }\n print $d . \"\\n\";\n print implode(\" \", $g);\n}\nelse\n{\n while(TRUE)\n {\n if($f == $e)\n {\n $d++;\n array_push($g, $f);\n break;\n }\n elseif($f > $e)\n {\n break;\n }\n elseif($f < $e)\n {\n $d++;\n array_push($g, $f);\n $f++;\n $d += $c - 1;\n for($x = 1; $x <= $c - 1; $x++)\n {\n array_push($g, $f);\n }\n $f += $a - 1;\n }\n }\n print $d . \"\\n\";\n print implode(\" \", $g);\n}\n?>"}, {"source_code": "= $m + 2) {\n\t\t\treturn \"2\\n1 \" . $n;\n\t\t} else {\n\t\t\treturn \"3\\n1 \" . $n . \" \" . (2 * $n - 1);\n\t\t}\n\t}\n\tif ($n >= $m + 1) {\n\t\t$ans = (2 * $k) . \"\\n\" . str_repeat(\"1 \", $k) . $n . str_repeat(\" \" . ($n + 1), $k - 1);\n\t} else {\n\t\t$ans = (2 * $k + 1) . \"\\n\" . str_repeat(\"1 \", $k) . $n . str_repeat(\" \" . ($n + 1), $k - 1) . \" \" . (2 * $n);\n\t}\n\treturn $ans;\n}\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}], "src_uid": "113997707143a57f7e81fb14d9bbde96"} {"source_code": "", "positive_code": [{"source_code": "0){\n $m = $a[$i];\n\n if ($m<=$k){\n $sum = $sum + ($m*$m);\n $k = $k-$m;\n } else {\n $sum = $sum + ($k*$k);\n $k = 0;\n }\n $i++;\n}\n\necho ($sum);"}, {"source_code": " $value) {\n $check = 0;\n if($count>$k)\n break;\n $check = $count + $value;\n \n if($check <= $k){\n $count += $value;\n $total +=$value*$value;\n \n }\n else{\n $left = $k-$count;\n $count += $left;\n $total += $left*$left;\n }\n }\n \n echo $total;\n}\n \n\n\n$nk = trim(fgets(STDIN));\n$cards = trim(fgets(STDIN));\n$nk = explode(\" \", $nk);\n$n = $nk[0];\n$k = $nk[1];\nFindCards($n,$k,$cards);\n\n"}, {"source_code": "= 0, $k > 0; $i--){\n\t\t$u = min($k, $a[$i]);\n\t\t$ans = $ans + $u * $u;\n\t\t$k = $k - $u;\n\t\tif($i < 0){\n\t\t\tbreak;\n\t\t}\n\t}\n\tprint_r($ans.\"\\n\");\n\tfclose($cin);\n?>"}], "negative_code": [{"source_code": " $value) {\n $check = 0;\n if($count>$k)\n break;\n $check = $count + $value;\n \n if($check <= $k){\n $count += $value;\n $total +=$value*$value;\n \n }\n \n }\n if($count<$k){\n $total += $k-$count;\n }\n echo $total;\n}\n \n\n\n$nk = trim(fgets(STDIN));\n$cards = trim(fgets(STDIN));\n$nk = explode(\" \", $nk);\n$n = $nk[0];\n$k = $nk[1];\nFindCards($n,$k,$cards);\n\n"}, {"source_code": " $value) {\n $check = 0;\n if($count>$k)\n break;\n $check = $count + $value;\n \n if($check <= $k){\n $count += $value;\n $total +=$value*$value;\n \n }\n else{\n $left = $k-$count;\n $count += $left;\n $total += $left*$left;\n }\n }\n \n echo $total;\n}\n \n\n\n$nk = trim(fgets(STDIN));\n$cards = trim(fgets(STDIN));\n$nk = explode(\" \", $nk);\n$n = $nk[0];\n$k = $nk[1];\nFindCards($n,$k,$cards);\n\n"}], "src_uid": "480defc596ee5bc800ea569fd76dc584"} {"source_code": "", "positive_code": [{"source_code": " $n) {\r\n// $ans = -1; \r\n// } elseif($len < $n) {\r\n// $maxV = maxVal($x);\r\n// if($maxV == '1') {\r\n// $ans = -1; \r\n// } else {\r\n// $ind = [0, 1];\r\n \r\n// foreach(str_split($x) as $ch) {\r\n// IO::pr($ch);\r\n// }\r\n \r\n// }\r\n \r\n// }\r\n \r\n// IO::pr($ans);\r\n \r\n// function temp($x, $$aTemp, $ans) {\r\n// while($n > strlen($x)) {\r\n// IO::pr($ans . \" \" . strlen($x) . \" \" . $x . \" \" . $maxV);\r\n// if($maxV < 9 && in_array('3', str_split($x))) {\r\n// $maxV = 3;\r\n// }\r\n// $x = bcmul($x, $maxV);\r\n// $ans++;\r\n// $maxV = IO::getMaxValue(maxVal($x) , $maxV);\r\n// }\r\n// return $ans;\r\n// }\r\nfunction maxVal($x) {\r\n $max = $x[0];\r\n for($i=1; $i $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 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 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": ""}, {"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": ""}, {"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": ""}], "src_uid": "a16bb696858bc592c33dcf0fd99df197"} {"source_code": " $sv) {\n foreach($v as $sK1 => $sV1) {\n $qwe = $sv * $sV1;\n if($qwe == $x) {\n $q[0] = $sv;\n $q[1] = $sV1;\n }\n elseif ($qwe == $y) {\n $q[2] = $sv;\n $q[3] = $sV1;\n }\n }\n }\n \n if($q[0] == $q[2] || $q[0] == $q[3]) {\n $a[2] = $q[0];\n $a[3] = $q[1];\n if ($q[0] == $q[3]) {\n $a[4] = $q[2];\n } elseif ($q[0] == $q[2]) {\n $a[4] = $q[3];\n }\n }\n if($q[1] == $q[2] || $q[1] == $q[3]) {\n $a[2] = $q[1];\n $a[3] = $q[0];\n if ($q[1] == $q[3]) {\n $a[4] = $q[2];\n } elseif ($q[1] == $q[2]) {\n $a[4] = $q[3];\n }\n }\n \n unset($v[array_search($a[2], $v)]);\n unset($v[array_search($a[3], $v)]);\n unset($v[array_search($a[4], $v)]);\n \n echo \"! \";\n foreach($a as $k => $a2) {\n echo $a2.\" \";\n }\n foreach ($v as $z => $g) {\n echo $g.\" \";\n }\n \n \n \n ", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $sv) {\n foreach($v as $sK1 => $sV1) {\n $qwe = $sk * $sK1;\n if($qwe == $x) {\n $q[0] = $sv;\n $q[1] = $sV1;\n }\n if ($qwe == $y) {\n $q[2] = $sv;\n $q[3] = $sV1;\n }\n }\n }\n \n if($q[0] == $q[2] || $q[0] == $q[3]) {\n $a[2] = $q[0];\n $a[3] = $q[1];\n if ($q[0] == $q[3]) {\n $a[4] = $q[2];\n } elseif ($q[0] == $q[2]) {\n $a[4] = $q[3];\n }\n }\n if($q[1] == $q[2] || $q[1] == $q[3]) {\n $a[2] = $q[1];\n $a[3] = $q[0];\n if ($q[1] == $q[3]) {\n $a[4] = $q[2];\n } elseif ($q[1] == $q[2]) {\n $a[4] = $q[3];\n }\n }\n \n unset($v[array_search($a[2], $v)]);\n unset($v[array_search($a[3], $v)]);\n unset($v[array_search($a[4], $v)]);\n \n echo \"! \";\n foreach($a as $k => $a2) {\n echo $a2.\" \";\n }\n foreach ($v as $z => $g) {\n echo $g.\"\\n\";\n }\n \n \n \n "}, {"source_code": " $sv) {\n foreach($v as $sK1 => $sV1) {\n $qwe = $sk * $sK1;\n if($qwe == $x) {\n $q[0] = $sv;\n $q[1] = $sV1;\n }\n if ($qwe == $y) {\n $q[2] = $sv;\n $q[3] = $sV1;\n }\n }\n }\n \n if($q[0] == $q[2] || $q[0] == $q[3]) {\n $a[2] = $q[0];\n $a[3] = $q[1];\n if ($q[0] == $q[3]) {\n $a[4] = $q[2];\n } elseif ($q[0] == $q[2]) {\n $a[4] = $q[3];\n }\n }\n if($q[1] == $q[2] || $q[1] == $q[3]) {\n $a[2] = $q[1];\n $a[3] = $q[0];\n if ($q[1] == $q[3]) {\n $a[4] = $q[2];\n } elseif ($q[1] == $q[2]) {\n $a[4] = $q[3];\n }\n }\n \n unset($v[array_search($a[2], $v)]);\n unset($v[array_search($a[3], $v)]);\n unset($v[array_search($a[4], $v)]);\n \n echo \"! \";\n foreach($a as $k => $a) {\n echo $a.\" \";\n }\n foreach ($v as $z => $g) {\n echo $g.\"\\n\";\n }\n \n \n \n "}], "src_uid": "c0f79d7ebcecc4eb7d07c372ba9be802"} {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n{\n\t$s = input();\n\tif ($s == \"++X\" || $s == \"X++\") ++$risan;\n\telse --$risan;\n}\n\necho $risan;\necho \"\\n\";\n\n?>"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0){\n $str=stream_get_line(STDIN,10,\"\\n\");\n $h=substr($str,0,2);\n $t=substr($str,1,2);\n if($h==\"++\" or $t==\"++\")$ans++;\n else $ans--;\n }\n fprintf(STDOUT,\"%d\\n\",$ans);\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$N = $dxs->G();\n$X = 0;\nfor($i=0;$i<$N;$i++){\n $tL = $dxs->GL();\n if(strpos($tL,\"--\")!==false) {\n $X--;\n } else if(strpos($tL,\"++\")!==false) {\n $X++;\n }\n}\necho $X;\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "solve();\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1) $counter++;\n}\n\necho $counter;"}, {"source_code": ""}, {"source_code": " $value) {\n $stdIn[$key] = (int)$value;\n }\n }\n\n return $stdIn;\n}\n\nfunction stdOut($output)\n{\n fwrite(STDOUT, $output);\n}\n\nfunction solve(): void\n{\n [$n] = getStdIn(true);\n $x = 0;\n\n for ($i = 0; $i < $n; $i++) {\n [$operation] = getStdIn();\n if (strpos($operation, '++') !== false) {\n $x++;\n } elseif (strpos($operation, '--') !== false) {\n $x--;\n }\n }\n\n stdOut($x);\n}\n\nsolve();\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": ""}, {"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": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=0)\n $ret++;\n else\n $ret--;\n \n }\n echo $ret;\n?>\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=2)\n {\n $summSolution++;\n }\n}\necho $summSolution;\n?>"}, {"source_code": " $value) {\n $stdIn[$key] = (int)$value;\n }\n }\n\n return $stdIn;\n}\n\nfunction stdOut($output)\n{\n fwrite(STDOUT, $output);\n}\n\nfunction solve(): void\n{\n [$n] = getStdIn(true);\n $x = 0;\n\n for ($i = 0; $i < $n; $i++) {\n [$operation] = getStdIn();\n var_dump($operation);\n if (strpos($operation, '++') !== false) {\n $x++;\n } elseif (strpos($operation, '--') !== false) {\n $x--;\n }\n }\n\n stdOut($x);\n}\n\nsolve();\n"}, {"source_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*/ $dxs = new stdIn(true);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n$N = $dxs->G();\n$X = 0;\nfor($i=0;$i<$N;$i++){\n $tL = $dxs->GL();\n if(strpos(\"--\",$tL)!==false) {\n $X--;\n } else if(strpos(\"++\",$tL)!==false) {\n $X++;\n }\n}\necho $X;\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\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(true);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n$N = $dxs->G();\n$X = 0;\nfor($i=0;$i<$N;$i++){\n $tL = $dxs->GL();\n if(strpos($tL,\"--\")!==false) {\n $X--;\n } else if(strpos($tL,\"++\")!==false) {\n $X++;\n }\n}\necho $X;\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " "}, {"source_code": "\nint main(){\nint $i,$j,$m,$temp,$n[5][5];\n$m=0;\nfor($i=0;$i<5;$i++){\n for($j=0;$j<5;$j++){\n scanf(\"%d\",&$n[$i][$j]);\n }\n}\nfor($i=0;$i<5;$i++){\n if($n[2][2]==1)\n break;\n for($j=0;$j<5;$j++){\n if($n[2][2]==1)\n break;\n else if($n[2][2]!=1&&$n[$i][$j]==1){\n $temp = $n[$i][$j];\n $n[$i][$j]=$n[$i][$j+1];\n $n[$i][$j+1]=$temp;\n $m++;\n }\n else if($n[2][2]!=1&&$n[$i][$j]==1){\n $temp = $n[$i][$j];\n $n[$i][$j]=$n[$i+1][$j-4];\n $n[$i+1][$j-4]=$temp;\n $m++;\n }\n }\n}\n printf(\"%d\",$m);\nreturn 0;\n}\n"}, {"source_code": "= $l2 && $l1 <= $r2) {\r\n $ans = getMaxValue($l2, $l1);\r\n } else {\r\n $ans = $l1 + $l2;\r\n }\r\n \r\n pr($ans);\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": [], "src_uid": "c783eaf1bf7e4e7321406431030d5aab"} {"source_code": ">>>>>\".$max.\" \".$f.PHP_EOL;\r\n $s = 0;\r\n $cnt1 = 0;\r\n $ok = true;\r\n for($k=$j+1;$k<$m;$k++){\r\n $s += $a[$k];\r\n //echo \">>>>\".$s.PHP_EOL;\r\n $cnt1++;\r\n if($k==$m-1){\r\n if($f == $s){\r\n $max = max($max,$cnt1);\r\n }else{\r\n $ok=false;\r\n break;\r\n }\r\n }else{\r\n if($f < $s){\r\n $ok=false;\r\n break;\r\n }else if($f == $s){\r\n $max = max($max, $cnt1);\r\n //echo \">>\".$max.\" \".$cnt.PHP_EOL;\r\n $cnt1 = 0;\r\n $s = 0;\r\n } \r\n }\r\n }\r\n if($ok){\r\n $min = min($min, $max);\r\n }\r\n }\r\n }\r\n $ans[] = $min;\r\n}\r\necho implode(PHP_EOL,$ans);", "positive_code": [{"source_code": " ' . $rr . ' ' . $tols);\r\n $tols = $tols > $rr ? $tols : $rr;\r\n $t[$j][] = $tt; \r\n $temp = 0;\r\n $rr = 0;\r\n }\r\n }\r\n if(array_sum($t[$j]) == $cnt) {\r\n $e[$j] = $tols; \r\n } else {\r\n $e[$j] = $n;\r\n }\r\n \r\n }\r\n $min = $n;\r\n foreach($t as $key=>$value) {\r\n \r\n if(count($value) > 1 ) {\r\n $min = $min > count($value) ? count($value) : $min;\r\n $ans = $ans > $e[$key] ? $e[$key] : $ans; \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": " ' . $rr . ' ' . $tols);\r\n $tols = $tols > $rr ? $tols : $rr;\r\n $t[$j][] = $tt; \r\n $temp = 0;\r\n $rr = 0;\r\n }\r\n }\r\n $e[$j] = $tols;\r\n }\r\n $min = $n;\r\n foreach($t as $key=>$value) {\r\n \r\n if(count($value) > 1 ) {\r\n $min = $min > count($value) ? count($value) : $min;\r\n $ans = $ans > $e[$key] ? $e[$key] : $ans; \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}"}, {"source_code": "$value) {\r\n // IO::pr($key . ' ' . count($value));\r\n // IO::prArray($value);\r\n if(count($value) > 1 ) {\r\n $ans = $ans > count($value) ? count($value) : $ans; \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}"}, {"source_code": ">>>\".$s.PHP_EOL;\r\n $cnt++;\r\n if($k==$m-1){\r\n if($f == $s){\r\n $max = max($max,$cnt);\r\n }else{\r\n $ok=false;\r\n break;\r\n }\r\n }else{\r\n if($f < $s){\r\n $ok=false;\r\n break;\r\n }else if($f == $s){\r\n $max = max($max, $cnt);\r\n //echo \">>\".$max.\" \".$cnt.PHP_EOL;\r\n $cnt = 0;\r\n $s = 0;\r\n } \r\n }\r\n }\r\n if($ok){\r\n $min = min($min, $max);\r\n }\r\n }\r\n }\r\n $ans[] = $min;\r\n}\r\necho implode(PHP_EOL,$ans);"}], "src_uid": "1ca582e932ac93ae2e1555deb16e3c3c"} {"source_code": "\n\n\n", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "ff0843cbd7c3a07c7d7d0be46b03a700"} {"source_code": " $k,\n\t\t\t'time' => 0,\n\t\t\t'likes' => 0,\n\t\t];\n\t}\n\n\t$photos[$k]['time'] = $i;\n\t$photos[$k]['likes']++;\n}\n\nfunction compare($a, $b) {\n\tif ($a['likes'] > $b['likes']) {\n\t\treturn -1;\n\t} elseif ($a['likes'] < $b['likes']) {\n\t\treturn 1;\n\t} elseif ($a['time'] < $b['time']) {\n\t\treturn -1;\n\t} elseif ($a['time'] > $b['time']) {\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\n}\n\nusort($photos, \"compare\");\n\necho $photos[0]['id'];\n", "positive_code": [{"source_code": "#!/usr/bin/php\n $a) {\n\tif (isset($c[$a])) {\n\t\t$c[$a]++;\n\t} else {\n\t\t$c[$a] = 1;\n\t}\n\tif ($c[$a] > $wc) {\n\t\t$w = $a;\n\t\t$wc = $c[$a];\n\t}\n}\necho $w;\nexit();\n"}, {"source_code": " $max) {\n\t\t$max = $photos[$likes[$i]];\n\t\t$index = $likes[$i];\n\t}\n}\n\necho $index;\n"}, {"source_code": " $id) {\n if (!isset($likes[$id])) {\n $likes[$id] = [0, -1];\n }\n $likes[$id][0]++;\n $likes[$id][1] = $i;\n}\n\nuasort($likes, function ($a, $b) {\n if ($a[0] != $b[0]) {\n return $b[0] - $a[0];\n }\n return $a[1] - $b[1];\n});\n\nreset($likes);\necho key($likes), \"\\n\";\n"}, {"source_code": "count($input))\n$n=count($input);\nfor($i=0; $i<$n;$i++){\n\t$counters[$counter]=bestqualityfunctiononphp($n,$i,$input[$i],$input);\n\t$counter++;\n}\n\nif($n>0){\necho $input[array_search(max($counters),$counters, true)];\n}\nfunction bestqualityfunctiononphp($n,$k,$v,$input){\n\tfor($i=0; $i<$n;$i++){\n\t\tif($input[$i]==$v&&$i<=$k+1)\n\t\t\t$count++;\t\n\t}\n\treturn $count;\n}\n?>"}, {"source_code": "$value)\n{\n if ($value == $e)\n {\n //print_R('key='.$key.\"\\r\");\n $cur = array_keys($arr, $key);\n \n //print_R($cur[count($cur)-1]);\n if (($cur[count($cur)-1] < $last) || $last < 0)\n {\n $last = $cur[count($cur)-1];\n $asw = $key;\n }\n }\n else\n break;\n}\necho $asw;"}, {"source_code": " $max) {\n $max_id = $id;\n $max = $counts[$id];\n }\n}\n\necho $max_id;\n"}, {"source_code": ""}, {"source_code": " $count){\n if ($count >= $max && $last_likes[$id] < $last_like || $count > $max ){\n $max = $count;\n $max_id = $id;\n $last_like = $last_likes[$id];\n }\n}\n\necho $max_id.\"\\n\";\n"}, {"source_code": " $b['key'];\n }\n return $a['value'] < $b['value'];\n}\n\nuasort($totalArray, \"cmp\");\nreset($totalArray);\necho key($totalArray);\n?>"}, {"source_code": " $e) $f[$b] = sizeof($c[$b]);\n$e = max($f);\nforeach($f as $g => $h) if((int)$f[$g] < $e) unset($f[$g]);\n$e = null;\nforeach($f as $g => $h) $e[$g] = max(array_keys($a, $g)); \nprint trim(array_search(min($e), $e));"}, {"source_code": " $i,\n 'amount' => ++$counter[$photo],\n 'photo' => $photo\n );\n\n $sort['index'][$photo] = $i;\n $sort['amount'][$photo] = $counter[$photo];\n}\n\narray_multisort($sort['amount'], SORT_DESC, $sort['index'], SORT_ASC, $result);\n\n$result = reset($result);\n\necho $result['photo'];\n\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "0){\n print_r($counters);\necho $input[array_search(max($counters),$counters, true)];\n}\nfunction bestqualityfunctiononphp($n,$k,$v,$input){\n\tfor($i=0; $i<$n;$i++){\n\t\tif($input[$i]==$v&&$i<=$k)\n\t\t\t$count++;\t\n\t}\n\treturn $count;\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0){\necho $input[array_search(max($counters),$counters, true)];\n}\nfunction bestqualityfunctiononphp($n,$k,$v,$input){\n\tfor($i=0; $i<$n;$i++){\n\t\tif($input[$i]==$v&&$i<=$k)\n\t\t\t$count++;\t\n\t}\n\treturn $count;\n}\n?>"}, {"source_code": "0){\necho $input[array_search(max($counters),$counters, true)];\n}\nfunction bestqualityfunctiononphp($n,$k,$v,$input){\n\tfor($i=0; $i<$n;$i++){\n\t\tif($input[$i]==$v&&$i<=$k+1)\n\t\t\t$count++;\t\n\t}\n\treturn $count;\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $count){\n if ($count >= $max && $last_likes[$id] < $last_like){\n $max = $count;\n $max_id = $id;\n $last_like = $last_likes[$id];\n }\n}\n\necho $max_id.\"\\n\";\n"}, {"source_code": " $count){\n if ($count >= $max && $last_likes[$id] < $last_like){\n $max = $count;\n $max_id = $id;\n $last_like = $last_likes[$id];\n }\n}\n\necho $max_id.\"\\n\";\n"}, {"source_code": " $count){\n if ($count > $max){\n $max = $count;\n $max_id = $id;\n }\n}\n\necho $id;"}, {"source_code": " $count){\n if ($count > $max){\n $max = $count;\n $max_id = $id;\n }\n}\n\necho $max_id;"}, {"source_code": " $e) $f[$b] = sizeof($c[$b]);\n$e = max($f);\nforeach($f as $g => $h) if($f[$g] < $e) unset($f[$g]);\n$e = null;\nforeach($f as $g => $h) $e[$g] = max(array_keys($a, $g)); \nprint array_search(min($e), $e);"}], "src_uid": "e4a2354159fc4cab7088e016cf17ae6c"} {"source_code": "= 0)\n {\n $d[$y - $x]++;\n }\n }\n }\n $f++;\n}\nprint implode(\" \", $d);\n?>", "positive_code": [{"source_code": " $direction) {\n if ($direction == '.' || $direction == 'D') {\n continue;\n }\n \n switch ($direction)\n {\n case 'U':\n if ($row % 2 == 0) {\n $seen[$col]++;\n }\n break;\n case 'L':\n $k = $col - $row;\n if ($k >= 0) {\n $seen[$k]++;\n }\n break;\n case 'R':\n $k = $col + $row;\n if ($k < $cols) {\n $seen[$k]++;\n }\n break;\n default:\n break;\n }\n }\n}\n\necho join(' ', $seen);\n"}, {"source_code": ""}], "negative_code": [{"source_code": " 0))\n {\n $j++;\n }\n if(($e[$y + $h][$f] == \"U\") && (($y + $h) < 2000))\n {\n $j++;\n }\n if(($e[$y][$f + $i] == \"L\") && (($f + $i) < 2000))\n {\n $j++;\n }\n $g++;\n $h++;\n $i++;\n }\n $f++;\n $k[$x] = $j;\n}\nprint implode(\" \", $k);\n?>"}, {"source_code": "= 0) && ($y + $x < $b))\n {\n $d[$y + $x]++;\n }\n }\n elseif($e[$y] == \"L\")\n {\n if(($y - $x >= 0) && ($y - $x < $b))\n {\n $d[$y - $x]++;\n }\n }\n }\n}\nprint implode(\" \", $d);\n?>"}, {"source_code": " $direction) {\n if ($direction == '.') {\n continue;\n }\n \n switch ($direction)\n {\n case 'U':\n $spiders_U[$col][] = $row;\n break;\n case 'L':\n $spiders_L[$row][] = $col;\n break;\n case 'R':\n $spiders_R[$row][] = $col;\n break;\n }\n }\n}\n\n$seen = array_pad(array(), $cols, 0);\nfor ($row = 1; $row < $rows; $row++) {\n calculate_state($row, $seen);\n}\n\nforeach ($GLOBALS['spiders_U'] as $col => &$spiders) {\n foreach ($spiders as $row) {\n if ($row > 1) {\n $seen[$col]++;\n }\n }\n}\n \necho join(' ', $seen);\n\nfunction calculate_state($min_row, &$seen) {\n foreach ($GLOBALS['spiders_R'] as $row => &$spiders) {\n if ($row < $min_row) {\n unset($GLOBALS['spiders_R'][$row]);\n continue;\n }\n \n foreach ($spiders as $k => $spider) {\n $spiders[$k]++;\n \n if ($spiders[$k] >= count($seen)) {\n unset($spiders[$k]);\n continue;\n }\n \n if ($row == $min_row) {\n $seen[ $spiders[$k] ]++;\n }\n }\n }\n \n foreach ($GLOBALS['spiders_L'] as $row => &$spiders) {\n if ($row < $min_row) {\n unset($GLOBALS['spiders_L'][$row]);\n continue;\n }\n \n foreach ($spiders as $k => $spider) {\n $spiders[$k]--;\n \n if ($spiders[$k] < 0) {\n unset($spiders[$k]);\n continue;\n }\n \n if ($row == $min_row) {\n $seen[ $spiders[$k] ]++;\n }\n }\n }\n}\n\n"}, {"source_code": " $direction) {\n if ($direction == '.') {\n continue;\n }\n \n switch ($direction)\n {\n case 'U':\n $spiders_U[$col][] = $row;\n break;\n case 'L':\n $spiders_L[$row][] = $col;\n break;\n case 'R':\n $spiders_R[$row][] = $col;\n break;\n }\n }\n}\n\n$seen = array_pad(array(), $cols, 0);\nfor ($row = 1; $row < $rows; $row++) {\n calculate_state($row, $seen);\n}\n\nforeach ($GLOBALS['spiders_U'] as $col => &$spiders) {\n $seen[$col] += count($spiders);\n}\n \necho join(' ', $seen);\n\nfunction calculate_state($min_row, &$seen) {\n foreach ($GLOBALS['spiders_R'] as $row => &$spiders) {\n if ($row < $min_row) {\n unset($GLOBALS['spiders_R'][$row]);\n continue;\n }\n \n foreach ($spiders as $k => $spider) {\n $spiders[$k]++;\n \n if ($spiders[$k] >= count($seen)) {\n unset($spiders[$k]);\n continue;\n }\n \n if ($row == $min_row) {\n $seen[ $spiders[$k] ]++;\n }\n }\n }\n \n foreach ($GLOBALS['spiders_L'] as $row => &$spiders) {\n if ($row < $min_row) {\n unset($GLOBALS['spiders_L'][$row]);\n continue;\n }\n \n foreach ($spiders as $k => $spider) {\n $spiders[$k]--;\n \n if ($spiders[$k] < 0) {\n unset($spiders[$k]);\n continue;\n }\n \n if ($row == $min_row) {\n $seen[ $spiders[$k] ]++;\n }\n }\n }\n}\n\n"}, {"source_code": " $direction) {\n if ($direction == '.') {\n continue;\n }\n \n switch ($direction)\n {\n case 'U':\n $spiders_U[$col][] = $row;\n break;\n case 'D':\n $spiders_D[$col][] = $row;\n break;\n case 'L':\n $spiders_L[$row][] = $col;\n break;\n case 'R':\n $spiders_R[$row][] = $col;\n break;\n }\n }\n}\n\n$seen = array_pad(array(), $cols, 0);\nfor ($row = 1; $row < $rows; $row++) {\n $timer = 0;\n calculate_state($row, $seen);\n// for ($col = 0; $col < $cols; $col++) {\n// $seen[$col] += find_spiders($row, $col);\n// }\n \n $timer++;\n}\n\necho join(' ', $seen);\n\nfunction calculate_state($min_row, &$seen) {\n foreach ($GLOBALS['spiders_U'] as $col => &$spiders) {\n foreach ($spiders as $k => $spider) {\n $spiders[$k]--;\n \n if ($spiders[$k] < $min_row) {\n unset($spiders[$k]);\n } elseif ($spiders[$k] == $min_row) {\n $seen[$col]++;\n }\n }\n }\n \n foreach ($GLOBALS['spiders_D'] as $col => &$spiders) {\n foreach ($spiders as $k => $spider) {\n $spiders[$k]++;\n \n if ($spiders[$k] < $min_row) {\n unset($spiders[$k]);\n } elseif ($spiders[$k] == $min_row) {\n $seen[$col]++;\n }\n }\n }\n \n foreach ($GLOBALS['spiders_R'] as $row => &$spiders) {\n if ($row < $min_row) {\n unset($GLOBALS['spiders_R'][$row]);\n continue;\n }\n \n foreach ($spiders as $k => $spider) {\n $spiders[$k]++;\n \n if ($row == $min_row) {\n $seen[ $spiders[$k] ]++;\n }\n }\n }\n \n foreach ($GLOBALS['spiders_L'] as $row => &$spiders) {\n if ($row < $min_row) {\n unset($GLOBALS['spiders_L'][$row]);\n continue;\n }\n \n foreach ($spiders as $k => $spider) {\n $spiders[$k]--;\n \n if ($row == $min_row) {\n $seen[ $spiders[$k] ]++;\n }\n }\n }\n}\n\nfunction find_spiders($row, $col) {\n $spiders_U = $GLOBALS['spiders_U'];\n $spiders_D = $GLOBALS['spiders_D'];\n $spiders_R = $GLOBALS['spiders_R'];\n $spiders_L = $GLOBALS['spiders_L'];\n \n $num = 0;\n if (isset($spiders_U[$col])) {\n foreach ($spiders_U[$col] as $current_row) {\n if ($current_row == $row) {\n $num++;\n }\n }\n }\n \n if (isset($spiders_D[$col])) {\n foreach ($spiders_D[$col] as $current_row) {\n if ($current_row == $row) {\n $num++;\n }\n }\n }\n \n if (isset($spiders_R[$row])) {\n foreach ($spiders_R[$row] as $current_col) {\n if ($current_col == $col) {\n $num++;\n }\n }\n }\n \n if (isset($spiders_L[$row])) {\n foreach ($spiders_L[$row] as $current_col) {\n if ($current_col == $col) {\n $num++;\n }\n }\n }\n \n return $num;\n}"}], "src_uid": "d8c89bb83592a1ff1b639f7d53056d67"} {"source_code": "\n", "positive_code": [{"source_code": " $a2) {\n echo $a3 . \"\\n\";\n } else {\n $b = floor( $a2 / $a3 ) + 1;\n echo ($a3 * $b) . \"\\n\";\n }\n}"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $b) && ($d <= $c))\n {\n $e = (ceil($c / $d) * $d);\n if($e == $c)\n {\n $e += $d;\n }\n print $e . \"\\n\";\n }\n elseif($d > $c)\n {\n print $d . \"\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": " $a[$i][0] && $x > $a[$i][1])) && ($x%$a[$i][2] === 0)){\n $x = $a[$i][2];\n } else {\n $b = ($a[$i][1] + 1) % $a[$i][2];\n $x = $b;\n if((($x < $a[$i][0] && $x < $a[$i][1]) || ($x > $a[$i][0] && $x > $a[$i][1])) && ($x%$a[$i][2] === 0)){\n $x = $b;\n } else {\n $x = ($a[$i][1] + 1) - $b + $a[$i][2];\n\n }\n }\n \n\t echo $x;\n\t echo \"\\n\";\n\t \n\t}\n\t\n\t \n?>"}, {"source_code": " $a[$i][0] && $x > $a[$i][1])) && ($x%$a[$i][2] === 0)){\n $x = $a[$i][2];\n } else {\n $b = ($a[$i][1] + 1) % $a[$i][2];\n $x = ($a[$i][1] + 1) - $b + $a[$i][2];\n }\n \n\t echo $x;\n\t echo \"\\n\";\n\t \n\t}\n\t\n\t \n?>"}, {"source_code": " $a[$i][0] && $x > $a[$i][1])) && ($x%$a[$i][2] === 0)){\n $x = $a[$i][2];\n } else {\n \n if(($a[$i][1] + 1) % $a[$i][2] == 0){\n $x = $a[$i][1] + 1;\n } else {\n $x = ($a[$i][1] + 1) - $b + $a[$i][2];\n\n }\n }\n \n\t echo $x;\n\t echo \"\\n\";\n\t \n\t}\n\t\n\t \n?>"}, {"source_code": " $a2) {\n echo $a3;\n } else {\n $b = ceil( $a2 / $a3 );\n echo $a3 * $b;\n }\n}"}, {"source_code": " $a2) {\n echo $a3;\n } else {\n $b = round( $a2 / $a3 ) + 1;\n echo $a3 * $b;\n }\n}"}, {"source_code": " $a2) {\n echo $a3 . \"\\n\";\n } else {\n $b = round( $a2 / $a3 ) + 1;\n echo ($a3 * $b) . \"\\n\";\n }\n}"}, {"source_code": " $a2) {\n echo $a3;\n } else {\n $b = floor( $a2 / $a3 ) + 1;\n echo $a3 * $b;\n }\n}"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}], "src_uid": "091e91352973b18040e2d57c46f2bf8a"} {"source_code": "= 5)\n {\n $h = floor($f / 5);\n $f = $f % 5;\n }\n if($f >= 2)\n {\n $i = floor($f / 2);\n $f = $f % 2;\n }\n print $h + $i + $f . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " 2) ? (2) : ($rem ? 1 : 0)));\n print(\"\\n\");\n}\n"}, {"source_code": " $b) {\n $n = $a - $b;\n } else {\n $n = $b - $a;\n }\n echo process($n) . \"\\n\";\n }\n \n function process($n, $s = 0) {\n if ($n == 0) {\n return $s;\n }\n if ($n >= 5) {\n $s += floor($n/5);\n $k = $n%5;\n if ($k != 0) {\n return process($k, $s);\n } else {\n return $s;\n }\n } elseif($n >= 2) {\n $s += floor($n/2);\n $k = $n%2;\n if ($k != 0) {\n return process($k, $s);\n } else {\n return $s;\n }\n } else {\n return $s + 1;\n }\n }\n?>"}, {"source_code": "1){$result+=floor((abs($v[0]-$v[1])%5)/2);}\n if((abs($v[0]-$v[1])%5)%2==1)$result++;\n echo $result;\n }\n \n if($i!=$arr[0]-1) echo \"\\n\";\n}\n?>"}, {"source_code": " $necessary) $z = -1;\n $current = $current + 5 * $count * $z;\n while($current != $necessary)\n {\n $current = getCloser($current, $necessary);\n $count++;\n }\n echo $count.\"\\n\";\n\n $i++;\n}\n\nfunction getCloser($current, $necessary)\n{\n $availiable = array(-5, -2, -1, 1, 2, 5);\n $diff = $current - $necessary;\n if(array_search($diff, $availiable))\n return $necessary;\n\n $minDiff = abs($diff);\n $minDiffIndex = 0;\n foreach ($availiable as $key => $value) {\n if(abs($diff + $value) < $minDiff && $current + $value >= 0)\n {\n $minDiffIndex = $key;\n $minDiff = abs($diff + $value);\n }\n \n }\n return $current + $availiable[$minDiffIndex];\n}\nfunction toint($num)\n{\n return intval($num);\n}\n?>"}], "negative_code": [{"source_code": " 5)\n {\n $h = floor($f / 5);\n $f = $f % 5;\n }\n if($f > 2)\n {\n $i = floor($f / 2);\n $f = $f % 2;\n }\n print $h + $i + $f . \"\\n\";\n}\n?>"}, {"source_code": " 2) ? (2) : ($rem ? 1 : 0)));\n}\n"}], "src_uid": "ccfe798f5dc63c492ff54cf40bb40613"} {"source_code": "", "positive_code": [{"source_code": "0&&$str[$i]==')') \n\t \t \n\t \t \t$sum--;\n\t \t }\n\n }\n echo \"$sum\\n\";\n}"}, {"source_code": "0&&$str[$i]==')') \n\t \t $sum--;\n\t \t \n\n }\n echo \"$sum\\n\";\n}"}, {"source_code": ""}], "negative_code": [{"source_code": "0&&$str[$i]==')') \n\t \t \n\t \t \t$sum--;\n\t \t }\n\n }\n echo \"$sum\\n\";\n}"}, {"source_code": "0&&$str[$i]==')') \n\t \t {\n\t \t \t$sum--;\n\t \t }\n\n }\n echo \"$sum\\n\";\n}"}, {"source_code": "0&&$str[$i]==')') \n\t \t {\n\t \t \t$sum--;\n\t \t }\n\n }\n echo \"ans=$sum\\n\";\n}"}], "src_uid": "7a724f327c6202735661be25ef9328d2"} {"source_code": " =$i; ++$k[$q]['kol'],++$i) $k[$q]['team1'] .= \" \".($i+$dd);\t\n\tif($ss>1) {\t\t\n\t\tfnss($ss,$k,$q,$dd);\n\t\t$sd -= $ss; $dd += $ss;\n\t\tfnss($sd,$k,$q,$dd);\n\t}\n}\n$sd=fgets($in);\nfnss($sd,$k,0,0);\nfwrite ($out, count($k).\"\\n\");\nforeach ($k as $value) fwrite($out, $value['kol'].$value['team1'].\"\\n\");\nfclose($in); fclose($out);", "positive_code": [{"source_code": " =$i; ++$k[$q]['kol'],++$i) $k[$q]['team1'] .= \" \".($i+$dd);\t\n\tif($ss>1){\t\t\n\t\tfnss($ss,$k,$q,$dd);\n\t\t$sd -= $ss; $dd += $ss;\n\t\tfnss($sd,$k,$q,$dd);\n\t}\n\tif($k['all']<$q)$k['all']=$q;\n}\n\n$sd=fgets($in);\nfnss($sd,$k);\n\nfwrite ($out, trim($k['all']).\"\\n\");\nunset($k['all']);\nforeach ($k as $key => $value) {\t\n\t fwrite($out, $value['kol'].$value['team1'].\"\\n\");\n}\nfclose($in);fclose($out);"}], "negative_code": [{"source_code": "$dd-$sq+1;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\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": "=$dd-$sq+$p;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\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": "$dd-$sq;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\n for($e=1;$e<=$dn;$e++) echo $a[$e].\" \";\n $dd--;$i++;$z++;\n}\n"}, {"source_code": "$dd-$sq;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\n print $dn.\" \";for($e=1;$e<=$dn;$e++) echo $a[$e].\" \";\n $dd--;$i++;$z++;\n}\n"}, {"source_code": " =$i; ++$k[$q]['\ufffd\ufffd\ufffd'],++$i) $k[$q]['\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd1'] .= \" \".($i+$dd);\t\n\tif($ss>1){\t\t\n\t\tfnss($ss,$k,$q,$dd);\n\t\t$sd -= $ss; $dd += $ss;\n\t\tfnss($sd,$k,$q,$dd);\n\t}\n\tif($k['\ufffd\ufffd\ufffd\ufffd\ufffd']<$q)$k['all']=$q;\n}\n\n$sd=fgets($in);\nfnss($sd,$k);\n\nfwrite ($out, trim($k['all']).\"\\n\");\nunset($k['all']);\nforeach ($k as $key => $value) {\t\n\t fwrite($out, $value['\ufffd\ufffd\ufffd'].' '. $value['\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd1'].\"\\n\");\n}\nfclose($in);fclose($out);"}, {"source_code": "$dd-$sq+$p;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\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": "$dd-$sq;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\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": "$dd-$sq;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\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": "$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": "$dd-$sq;--$q)\n {\n if($a[$q]>$dn) $a[$q]=$dn-$zz;\n else $a[$q]=$n-$zz;\n $zz++; \n }\n echo $dn.\" \";for($e=1;$e<=$dn;$e++) echo $a[$e].\" \";\n $dd--;$i++;$z++;\n}\n"}, {"source_code": " =$i; ++$k[$q]['kol'],++$i) $k[$q]['team1'] .= \" \".($i+$dd);\t\n\tif($ss>1){\t\t\n\t\tfnss($ss,$k,$q,$dd);\n\t\t$sd -= $ss; $dd += $ss;\n\t\tfnss($sd,$k,$q,$dd);\n\t}\n\tif($k['\ufffd\ufffd\ufffd\ufffd\ufffd']<$q)$k['all']=$q;\n}\n\n$sd=fgets($in);\nfnss($sd,$k);\n\nfwrite ($out, trim($k['all']).\"\\n\");\nunset($k['all']);\nforeach ($k as $key => $value) {\t\n\t fwrite($out, $value['kol'].$value['team1'].\"\\n\");\n}\nfclose($in);fclose($out);"}], "src_uid": "31a64a84b5cc4e27737eea2c14f6dbd7"} {"source_code": " [],'b' => [],'c' => [],'d' => [],'e' => [],'f' => [],'g' => [],'h' => [],'i' => [],'j' => [],'k' => [],\n 'l' => [],'m' => [],'n' => [],'o' => [],'p' => [],'q' => [],'r' => [],'s' => [],'t' => [],'u' => [],'v' => [],\n 'w' => [],'x' => [],'y' => [],'z' => [], '?' => [],\n];\n$keys = array_keys($leftItems);\n\n$left = fgets(STDIN);\n$right = fgets(STDIN);\nfor ($i = 0, $j = 1; $i < $itemsCount; $i++, $j++) {\n $leftItems[$left[$i]][] = $j;\n $rightItems[$right[$i]][] = $j;\n}\nunset($left, $right);\nforeach ($keys as $key) {\n while ($leftItems[$key] !== [] && $rightItems[$key] !== []) {\n $result++;\n $pairs[] = [array_pop($leftItems[$key]) , array_pop($rightItems[$key])];\n }\n while ($leftItems[$key] !== [] && $rightItems['?'] !== []) {\n $result++;\n $pairs[] = [array_pop($leftItems[$key]) , array_pop($rightItems['?'])];\n }\n while ($leftItems['?'] !== [] && $rightItems[$key] !== []) {\n $result++;\n $pairs[] = [array_pop($leftItems['?']) , array_pop($rightItems[$key])];\n }\n}\necho $result . PHP_EOL;\nforeach($pairs as $pair) {\n echo $pair[0] . ' ' . $pair[1] . PHP_EOL;\n}\n", "positive_code": [{"source_code": " count($n))\n {\n for($y = 0; $y < count($n); $y++)\n {\n $k[count($k)] = $m[$y] + 1;\n $l[count($l)] = $n[$y] + 1;\n }\n for($z = $y; $z < count($m); $z++)\n {\n if($g[$j] !== NULL)\n {\n $k[count($k)] = $m[$z] + 1;\n $l[count($l)] = $g[$j] + 1;\n $j++;\n }\n }\n }\n}\nwhile(TRUE)\n{\n if(($e[$i] !== NULL) && ($g[$j] !== NULL))\n {\n $k[count($k)] = $e[$i] + 1;\n $l[count($l)] = $g[$j] + 1;\n $i++;\n $j++;\n }\n else\n {\n break;\n }\n}\nprint count($k) . \"\\n\";\nfor($x = 0; $x < count($k); $x++)\n{\n print $k[$x] . \" \" . $l[$x] . \"\\n\";\n}\n?>"}, {"source_code": "$char){\n $aa1[$char][]=$key;\n}\nforeach($arr2 as $key=>$char){\n $aa2[$char][]=$key;\n}\n$ans=[];\nforeach($aa1 as $key=>$value){\n \n if($key!='?'){\n while(sizeof($aa1[$key])>0 && isset($aa2[$key]) and sizeof($aa2[$key])>0){\n $ans[array_pop($aa1[$key])+1]=array_pop($aa2[$key]) + 1;\n }\n }\n}\nforeach($aa1 as $key=>$value){\n \n if($key!='?'){\n while(sizeof($aa1[$key])>0 && isset($aa2['?']) and sizeof($aa2['?'])>0){\n $ans[array_pop($aa1[$key])+1]=array_pop($aa2['?']) + 1;\n }\n }\n}\nforeach($aa2 as $key=>$value){\n \n if($key!='?'){\n while(sizeof($aa2[$key])>0 && isset($aa1['?']) and sizeof($aa1['?'])>0){\n $ans[array_pop($aa1['?']) + 1]=array_pop($aa2[$key])+1; \n }\n }\n}\nforeach($aa1 as $key=>$value){\n \n if($key=='?'){\n while(sizeof($aa1[$key])>0 && isset($aa2[$key]) and sizeof($aa2[$key])>0){\n $ans[array_pop($aa1[$key])+1]=array_pop($aa2[$key]) + 1;\n }\n }\n}\necho sizeof($ans); echo (\"\\n\");\nforeach($ans as $key=>$value){\n echo ($key);echo (\" \");\n echo ($value);echo (\"\\n\");\n}\n?>"}, {"source_code": " [],'b' => [],'c' => [],'d' => [],'e' => [],'f' => [],'g' => [],'h' => [],'i' => [],'j' => [],'k' => [],\n 'l' => [],'m' => [],'n' => [],'o' => [],'p' => [],'q' => [],'r' => [],'s' => [],'t' => [],'u' => [],'v' => [],\n 'w' => [],'x' => [],'y' => [],'z' => [], '?' => [],\n];\n$keys = array_keys($leftItems);\n\n$left = fgets(STDIN);\n$right = fgets(STDIN);\nfor ($i = 0, $j = 1; $i < $itemsCount; $i++, $j++) {\n $leftItems[$left[$i]][] = $j;\n $rightItems[$right[$i]][] = $j;\n}\nunset($left, $right);\n\nforeach ($keys as $key) {\n while ($leftItems[$key] !== [] && $rightItems[$key] !== []) {\n $result++;\n $pairs[] = array_pop($leftItems[$key]) . ' ' . array_pop($rightItems[$key]);\n }\n while ($leftItems[$key] !== [] && $rightItems['?'] !== []) {\n $result++;\n $pairs[] = array_pop($leftItems[$key]) . ' ' . array_pop($rightItems['?']);\n }\n while ($leftItems['?'] !== [] && $rightItems[$key] !== []) {\n $result++;\n $pairs[] = array_pop($leftItems['?']) . ' ' . array_pop($rightItems[$key]);\n }\n}\nprint $result . PHP_EOL . implode(PHP_EOL, $pairs);\n"}], "negative_code": [{"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$x] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$x] == 0) && ($g > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\nif($f > 0)\n{\n $r = array();\n for($x = 0; $x < $a; $x++)\n {\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n }\n $s = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\nif($f > 0)\n{\n $r = array();\n for($x = 0; $x < $a; $x++)\n {\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n }\n $s = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"i\") && ($b[1] == \"z\"))\n{\n print count($i) . \"\\n\";\n print $f . \" \" . $g . \"\\n\";\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\n$r = array();\nfor($x = 0; $x < $a; $x++)\n{\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n}\n$s = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"i\"))\n{\n print count($i) . \"\\n\";\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\n$r = array();\nfor($x = 0; $x < $a; $x++)\n{\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n}\n$s = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$x] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$x] == 0) && ($g > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $g--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\nif($f > 0)\n{\n $r = array();\n for($x = 0; $x < $a; $x++)\n {\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n }\n $s = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$x] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$x] == 0) && ($g > 0) && ($k[$x] != \"?\"))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $g--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\nif($f > 0)\n{\n $r = array();\n for($x = 0; $x < $a; $x++)\n {\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n }\n $s = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\n$r = array();\nfor($x = 0; $x < $a; $x++)\n{\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n}\n$s = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"i\") && ($b[1] == \"z\"))\n{\n print count($i) . \"\\n\";\n print $f . \" \" . $g . \"\\n\";\n}\nif($f > 0)\n{\n $r = array();\n for($x = 0; $x < $a; $x++)\n {\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n }\n $s = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"i\") && ($b[1] == \"z\"))\n{\n print count($i) . \"\\n\";\n print $f . \" \" . $g . \"\\n\";\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$x] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$x] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\nif($f > 0)\n{\n $r = array();\n for($x = 0; $x < $a; $x++)\n {\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n }\n $s = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " count($n))\n {\n for($y = 0; $y < count($n); $y++)\n {\n $k[count($k)] = $m[$y] + 1;\n $l[count($l)] = $n[$y] + 1;\n }\n for($z = $y; $z < count($m); $z++)\n {\n if($g[$j] !== NULL)\n {\n $k[count($k)] = $m[$z] + 1;\n $l[count($l)] = $g[$j] + 1;\n $j++;\n }\n }\n }\n}\nwhile(TRUE)\n{\n if(($e[$i] == TRUE) && ($g[$j] == TRUE))\n {\n $k[count($k)] = $e[$i] + 1;\n $l[count($l)] = $g[$j] + 1;\n $i++;\n $j++;\n }\n else\n {\n break;\n }\n}\nprint count($k) . \"\\n\";\nfor($x = 0; $x < count($k); $x++)\n{\n print $k[$x] . \" \" . $l[$x] . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"f\") && ($b[1] == \"o\"))\n{\n print count($i) . \"\\n\";\n print $f . \" \" . $g . \"\\n\";\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$x] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$x] == 0) && ($g > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $g--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"f\") && ($b[1] == \"o\"))\n{\n print count($i) . \"\\n\";\n print $f . \" \" . $g . \"\\n\";\n}\nif($f > 0)\n{\n $r = array();\n for($x = 0; $x < $a; $x++)\n {\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n }\n $s = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"f\") && ($b[1] == \"o\"))\n{\n print count($i) . \"\\n\";\n print $f . \" \" . $g . \"\\n\";\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n for($y = 0; $y < $m; $y++)\n {\n $i[count($i)] = $d[$h[$x]][$y] + 1;\n $j[count($j)] = $e[$h[$x]][$y] + 1;\n $k[$d[$h[$x]][$y]] = 1;\n $l[$e[$h[$x]][$y]] = 1;\n }\n }\n}\nif(($a == 150000) && ($b[0] == \"i\") && ($b[1] == \"z\"))\n{\n print count($i) . \"\\n\";\n}\n$n = $a - (count($i) + $f);\n$o = $g - $n;\nif($g > 0)\n{\n if($g > $n)\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($b[$x] == \"?\") && ($o > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $o--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n elseif(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n else\n {\n $p = 0;\n for($x = 0; $x < $a; $x++)\n {\n if(($k[$b[$x]] == 0) && ($n > 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $g2[$p] + 1;\n $n--;\n $p++;\n $k[$x] = 1;\n $l[$g2[$p - 1]] = 1;\n }\n }\n }\n}\n$r = array();\nfor($x = 0; $x < $a; $x++)\n{\n if($l[$x] == 0)\n {\n $r[count($r)] = $x;\n }\n}\n$s = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if(($b[$x] == \"?\") && ($k[$x] == 0))\n {\n $i[count($i)] = $x + 1;\n $j[count($j)] = $r[$s] + 1;\n $s++;\n }\n}\nif(count($i) == 0)\n{\n print \"0\";\n}\nelse\n{\n print count($i) . \"\\n\";\n for($x = 0; $x < count($i); $x++)\n {\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n }\n}\n?>"}], "src_uid": "6bf3e5a542ebce81c1e6ce7260644a3c"} {"source_code": "= $a)\n {\n $g -= $a;\n }\n }\n else\n {\n $g = $b[$x] - $c;\n if($g < 0)\n {\n $g += $a;\n }\n }\n if($g != $x)\n {\n $e = 1;\n break;\n }\n}\nif($e == 0)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}], "negative_code": [], "src_uid": "6c65ca365352380052b0c9d693e6d161"} {"source_code": " $d)\n {\n $g = $c[$x] - $d;\n $h = $g % $b;\n $i = $g / $b;\n if($h == 0)\n {\n $e += $i;\n }\n else\n {\n $f = 1;\n break;\n }\n }\n}\nif($f == 0)\n{\n print $e;\n}\nelse\n{\n print \"-1\";\n}\n?>", "positive_code": [{"source_code": " 0) && ($x < count($b) - 1) && (strlen($b[$x]) == 1))\n {\n $c[0] = 9;\n break;\n }\n}\nif(($c[0] > 8) || ($c[count($c) - 1] > 3) || (max($c) > 11) || ($a[0] == \".\") || ($a[strlen($a) - 1] == \".\") || (count($c) == 1))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(count($c) == 2)\n {\n print $a;\n }\n else\n {\n $d = 0;\n print substr($a, $d, $c[0] + 1);\n $d = $c[0] + 1;\n $e += $c[0];\n $e++;\n if($c[1] < 9)\n {\n print substr($a, $d, 1) . \"\\n\";\n $d++;\n $e += $c[1];\n $e++;\n }\n else\n {\n print substr($a, $d, 3) . \"\\n\";\n $d += 3;\n $e += $c[1];\n $e++;\n }\n for($x = 2; $x < count($c) - 1; $x++)\n {\n if($c[$x] < 9)\n {\n print substr($a, $d, $e - $d + 1) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n else\n {\n print substr($a, $d, $e - $d + 3) . \"\\n\";\n $d += $e - $d + 3;\n $e += $c[$x];\n $e++;\n }\n }\n if($c[$x] < 9)\n {\n print substr($a, $d);\n }\n else\n {\n print substr($a, $d);\n }\n }\n}\n?>", "positive_code": [{"source_code": "Scan();\n\n\t$temp = $S;\n\t$Slen = strlen($temp); \n\tif (strpos($temp, \".\") === 0 || strrpos($temp, \".\") === $Slen - 1) print(\"NO\");\n\telseif (substr_count($temp, \".\") === 0) print(\"NO\");\n\telse {\n\t\t$flag = \"\";\n\t\t$temp_array = explode(\".\", $temp);\n\t\t$len = count($temp_array);\n\t\tif (strlen($temp_array[0]) > 8 || strlen($temp_array[$len - 1]) > 3) $flag = \"NO\";\n\t\telse {\n\t\t\tif ($len === 2) {\n\t\t\t\t$ans[0] = $temp_array[0]. \".\". $temp_array[$len - 1];\n\t\t\t} else {\n\t\t\t\t$ans[0] .= $temp_array[0];\n\t\t\t\tfor ($i = 1; $i < $len - 1; $i++) {\n\t\t\t\t\t$l = strlen($temp_array[$i]);\n\t\t\t\t\tif ($l > 11 || $l < 2) {\n\t\t\t\t\t\t$flag = \"NO\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($l <= 11 && $l >= 4) {\n\t\t\t\t\t\t$ans[$i - 1] .= \".\". substr($temp_array[$i], 0, 3);\n\t\t\t\t\t\t$ans[$i] .= substr($temp_array[$i], 3);\n\t\t\t\t\t} elseif ($l <= 4) {\n\t\t\t\t\t\t$ans[$i - 1] .= \".\". substr($temp_array[$i], 0, 1);\n\t\t\t\t\t\t$ans[$i] .= substr($temp_array[$i], 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$ans[$len - 2] .= \".\". $temp_array[$len - 1];\n\t\t\t}\n\t\t}\n\t\tif ($flag === \"NO\") {\n\t\t\tprint(\"NO\");\n\t\t} else {\n\t\t\tprint(\"YES\");\n\t\t\tprint(\"\\n\");\n\t\t\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\t\t\tprint($ans[$i]);\n\t\t\t\tif ($i !== $len - 2) print(\"\\n\");\n\t\t\t}\n\t\t}\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": " 11 || $len < 2) {\n res_no();\n }\n\n $ext_len = $len < 6 ? 1 : 3;\n\n return array(\n substr($part, 0, $ext_len),\n substr($part, $ext_len),\n );\n}\n\n\n$input = trim(fgets(STDIN));\n$names = array();\n\n$parts = explode('.', $input);\nif (!count($parts)) {\n res_no();\n}\n\n$name1 = array_shift($parts);\n$ext_last = array_pop($parts);\n\nif (strlen($name1) > 8 || strlen($name1) < 1 || strlen($ext_last) > 3 || strlen($ext_last) < 1) {\n res_no();\n}\n\nforeach ($parts as $part) {\n list($ext, $name) = _split($part);\n $names[] = $name1 .'.'. $ext;\n $name1 = $name;\n}\n\n$names[] = $name1 .'.'. $ext_last;\n\nres_yes($names);\n"}], "negative_code": [{"source_code": " 2))\n {\n $c[0] = 9;\n break;\n }\n}\nif(($c[0] > 8) || ($c[count($c) - 1] > 3) || (max($c) > 11) || ($a[0] == \".\") || ($a[strlen($a) - 1] == \".\") || (count($c) == 1))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(count($c) == 2)\n {\n print $a;\n }\n else\n {\n $d = 0;\n print substr($a, $d, $c[0] + 1);\n $d = $c[0] + 1;\n $e += $c[0];\n $e++;\n if($c[1] < 9)\n {\n print substr($a, $d, 1) . \"\\n\";\n $d++;\n $e += $c[1];\n $e++;\n }\n else\n {\n print substr($a, $d, 3) . \"\\n\";\n $d += 3;\n $e += $c[1];\n $e++;\n }\n for($x = 2; $x < count($c) - 1; $x++)\n {\n if($c[$x] < 9)\n {\n print substr($a, $d, $e - $d + 1) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n else\n {\n print substr($a, $d, $e - $d + 3) . \"\\n\";\n $d += $e - $d + 3;\n $e += $c[$x];\n $e++;\n }\n }\n if($c[$x] < 9)\n {\n print substr($a, $d);\n }\n else\n {\n print substr($a, $d);\n }\n }\n}\n?>"}, {"source_code": " 8) || ($c[count($c) - 1] > 3) || (max($c) > 11) || ($a[0] == \".\") || ($a[strlen($a) - 1] == \".\"))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(count($c) == 2)\n {\n print $a;\n }\n else\n {\n $d = 0;\n print substr($a, $d, $c[0] + 1);\n $d = $c[0] + 1;\n $e += $c[0];\n $e++;\n if($c[1] < 9)\n {\n print substr($a, $d, 1) . \"\\n\";\n $d++;\n $e += $c[1];\n $e++;\n }\n else\n {\n print substr($a, $d, 3) . \"\\n\";\n $d += 3;\n $e += $c[1];\n $e++;\n }\n for($x = 2; $x < count($c) - 1; $x++)\n {\n if($c[$x] < 9)\n {\n print substr($a, $d, $e - $d + 1) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n else\n {\n print substr($a, $d, $e - $d + 3) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n }\n if($c[$x] < 9)\n {\n print substr($a, $d);\n }\n else\n {\n print substr($a, $d);\n }\n }\n}\n?>"}, {"source_code": " 8) || ($c[count($c) - 1] > 3) || (max($c) > 11) || ($a[0] == \".\") || ($a[strlen($a) - 1] == \".\") || (count($c) == 1))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(count($c) == 2)\n {\n print $a;\n }\n else\n {\n $d = 0;\n print substr($a, $d, $c[0] + 1);\n $d = $c[0] + 1;\n $e += $c[0];\n $e++;\n if($c[1] < 9)\n {\n print substr($a, $d, 1) . \"\\n\";\n $d++;\n $e += $c[1];\n $e++;\n }\n else\n {\n print substr($a, $d, 3) . \"\\n\";\n $d += 3;\n $e += $c[1];\n $e++;\n }\n for($x = 2; $x < count($c) - 1; $x++)\n {\n if($c[$x] < 9)\n {\n print substr($a, $d, $e - $d + 1) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n else\n {\n print substr($a, $d, $e - $d + 3) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n }\n if($c[$x] < 9)\n {\n print substr($a, $d);\n }\n else\n {\n print substr($a, $d);\n }\n }\n}\n?>"}, {"source_code": " 0) || ($x != count($b) - 1)))\n {\n $c[0] = 9;\n break;\n }\n}\nif(($c[0] > 8) || ($c[count($c) - 1] > 3) || (max($c) > 11) || ($a[0] == \".\") || ($a[strlen($a) - 1] == \".\") || (count($c) == 1))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(count($c) == 2)\n {\n print $a;\n }\n else\n {\n $d = 0;\n print substr($a, $d, $c[0] + 1);\n $d = $c[0] + 1;\n $e += $c[0];\n $e++;\n if($c[1] < 9)\n {\n print substr($a, $d, 1) . \"\\n\";\n $d++;\n $e += $c[1];\n $e++;\n }\n else\n {\n print substr($a, $d, 3) . \"\\n\";\n $d += 3;\n $e += $c[1];\n $e++;\n }\n for($x = 2; $x < count($c) - 1; $x++)\n {\n if($c[$x] < 9)\n {\n print substr($a, $d, $e - $d + 1) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n else\n {\n print substr($a, $d, $e - $d + 3) . \"\\n\";\n $d += $e - $d + 3;\n $e += $c[$x];\n $e++;\n }\n }\n if($c[$x] < 9)\n {\n print substr($a, $d);\n }\n else\n {\n print substr($a, $d);\n }\n }\n}\n?>"}, {"source_code": " 11 || $len < 1) {\n res_no();\n }\n\n $ext_len = $len < 6 ? 1 : 3;\n\n return array(\n substr($part, 0, $ext_len),\n substr($part, $ext_len),\n );\n}\n\n\n$input = trim(fgets(STDIN));\n$names = array();\n\n$parts = explode('.', $input);\nif (!count($parts)) {\n res_no();\n}\n\n$name1 = array_shift($parts);\n$ext_last = array_pop($parts);\n\nif (strlen($name1) > 8 || strlen($name1) < 1 || strlen($ext_last) > 3 || strlen($ext_last) < 1) {\n res_no();\n}\n\nforeach ($parts as $part) {\n list($ext, $name) = _split($part);\n $names[] = $name1 .'.'. $ext;\n $name1 = $name;\n}\n\n$names[] = $name1 .'.'. $ext_last;\n\nres_yes($names);\n"}, {"source_code": " 11 || $len < 1) {\n res_no();\n }\n\n $ext_len = $len < 6 ? 1 : 3;\n\n return array(\n substr($part, 0, $ext_len),\n substr($part, $ext_len),\n );\n}\n\n\n$input = trim(fgets(STDIN));\n$names = array();\n\n$parts = explode('.', $input);\nif (!count($parts)) {\n res_no();\n}\n\n$name1 = array_shift($parts);\n$ext_last = array_pop($parts);\n\nif (strlen($name1) > 8 || strlen($name1) < 1 || strlen($ext_last) > 3 || strlen($ext_last) < 1) {\n res_no();\n}\n\nforeach ($parts as $part) {\n list($ext, $name) = _split($part);\n $names[] = $name1 .'.'. $ext;\n $name1 = $name;\n}\n\n$names[] = $name .'.'. $ext_last;\n\nres_yes($names);\n"}, {"source_code": " 8) || ($c[count($c) - 1] > 3) || (max($c) > 11) || ($a[0] == \".\") || ($a[strlen($a) - 1] == \".\") || (count($c) == 1))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(count($c) == 2)\n {\n print $a;\n }\n else\n {\n $d = 0;\n print substr($a, $d, $c[0] + 1);\n $d = $c[0] + 1;\n $e += $c[0];\n $e++;\n if($c[1] < 9)\n {\n print substr($a, $d, 1) . \"\\n\";\n $d++;\n $e += $c[1];\n $e++;\n }\n else\n {\n print substr($a, $d, 3) . \"\\n\";\n $d += 3;\n $e += $c[1];\n $e++;\n }\n for($x = 2; $x < count($c) - 1; $x++)\n {\n if($c[$x] < 9)\n {\n print substr($a, $d, $e - $d + 1) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n else\n {\n print substr($a, $d, $e - $d + 3) . \"\\n\";\n $d += $e - $d + 3;\n $e += $c[$x];\n $e++;\n }\n }\n if($c[$x] < 9)\n {\n print substr($a, $d);\n }\n else\n {\n print substr($a, $d);\n }\n }\n}\n?>"}, {"source_code": " 8) || ($c[count($c) - 1] > 3) || (max($c) > 11) || ($a[0] == \".\") || ($a[strlen($a) - 1] == \".\") || (count($c) == 1))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(count($c) == 2)\n {\n print $a;\n }\n else\n {\n $d = 0;\n print substr($a, $d, $c[0] + 1);\n $d = $c[0] + 1;\n $e += $c[0];\n $e++;\n if($c[1] < 9)\n {\n print substr($a, $d, 1) . \"\\n\";\n $d++;\n $e += $c[1];\n $e++;\n }\n else\n {\n print substr($a, $d, 3) . \"\\n\";\n $d += 3;\n $e += $c[1];\n $e++;\n }\n for($x = 2; $x < count($c) - 1; $x++)\n {\n if($c[$x] < 9)\n {\n print substr($a, $d, $e - $d + 1) . \"\\n\";\n $d += $e - $d + 1;\n $e += $c[$x];\n $e++;\n }\n else\n {\n print substr($a, $d, $e - $d + 3) . \"\\n\";\n $d += $e - $d + 3;\n $e += $c[$x];\n $e++;\n }\n }\n if($c[$x] < 9)\n {\n print substr($a, $d);\n }\n else\n {\n print substr($a, $d);\n }\n }\n}\n?>"}], "src_uid": "9c30697e71102ae10c55c14d9c1db006"} {"source_code": "=1 && $n<=3000)\n{\n $f=true;\n for ($i=0; $i<=$n-1; $i++)\n {\n if ($mas[$i]<1 || $mas[$i]>3000)\n {$f=false;}\n }\n if ($f)\n {\n $k=1; $f=false;\n while ($f==false)\n {\n $f1=true;\n for ($i=0; $i<$n; $i++)\n {\n if ($k==$mas[$i])\n {\n $f1=false; break;\n }\n }\n if (!$f1){$k++;}\n else {$f=true;}\n }\n fputs(STDOUT, \"$k\");\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"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 '';\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\nfunction eratosphen($n) {\n $isPrime = array();\n for ($i = 0; $i < $n; $i++) {\n $isPrime[$i] = 1;\n }\n\n $isPrime[0] = 0;\n $isPrime[1] = 0;\n\n for ($i = 2; $i * $i < $n; $i++)\n if ($isPrime[$i])\n for ($j = $i * $i; $j < $n; $j += $i)\n $isPrime[$j] = 0;\n\n $simple = array();\n for ($i = 0; $i < $n; $i++) {\n if ($isPrime[$i] == 1) {\n $simple[] = $i;\n }\n }\n\n echo implode(', ', $simple);\n}\n\n$stdin = stdin();\n/****************************************************** Solving block *****************************************************/\n$n = g();\n$a = explode(' ', g());\n\nsort($a);\n\nif($a[0] > 1) {\n echo 1;\n} else {\n array_shift($a);\n $test = 2;\n foreach($a as $item) {\n if($test == $item) {\n $test++;\n } else {\n break;\n }\n }\n\n echo $test;\n}\n?>"}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "\n "}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": "=0)&&($n<=exp(6*log(10))) && $run) \n {\n $stat = array('max' => 0, 'count' => 1);\n \n $ind = 0;\n \n $currentCount = 0;\n $bracketsLength = 0;\n \n while($ind < strlen($str))\n {\n if($str[$ind] == '(')\n {\n $currentCount++;\n $bracketsLength++;\n }\n elseif($str[$ind] == ')')\n {\n $currentCount--;\n \n if($currentCount >= 0)\n {\n $bracketsLength++;\n }\n }\n \n if($currentCount == 0)\n {\n if($stat['max'] < $bracketsLength)\n {\n $stat['max'] = $bracketsLength;\n $stat['count'] = 1;\n }\n elseif($stat['max'] == $bracketsLength)\n {\n $stat['count']++;\n }\n \n $bracketsLength = 0;\n }\n elseif($currentCount < 0)\n {\n $currentCount = 0;\n $bracketsLength = 0;\n }\n \n $ind++;\n }\n $st=$stat['max'];\n $k=$stat['count'];\n fputs(STDOUT, \"$st\");\n fputs(STDOUT, \"; \");\n fputs(STDOUT, \"$k\");\n fputs(STDOUT, \";\");\n}\n?>"}, {"source_code": "=1 && $n<=3000)\n\t{\n\t\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]>3000)\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]>3000)\n\t{$f=false;}\n\tif ($f)\n\t{\nfputs(STDOUT, \"Vihodnie dannie: \");\n\t$k=1; $f=false;\n\twhile ($f==false)\n\t\t{\n\t\t$f1=true;\n\tfor ($i=1; $i<=$n; $i++)\n\t{\n\t\tif ($k==$mas[$i])\n\t\t\t{\n\t\t\t\t $f1=false;\n\t\t\t\t}\n\t\t}\n\t\tif (!$f1){$k++;}\n\t\telse {$f=true;}\n\t\t}\n\t\tfputs(STDOUT, \"$k\");\n\t}\n\telse\n\t{fputs(STDOUT, \"\ufffd\ufffd\ufffd\ufffda \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd 1<=n<=3000\");\n\t}\n}\n\telse\n\t{fputs(STDOUT, \"\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd 1<=n<=3000\");\n\t\t}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "5e449867d9fcecc84333b81eac9b5d92"} {"source_code": "= $w) && ((floor(abs($k1 - $k2)/2) + min($n - $k1, $n - $k2)) >= $b)) {\n\t\t\tprint \"YES\\n\";\n\t\t} else {\n\t\t\tprint \"NO\\n\";\n\t\t}\n\t}\n?>", "positive_code": [{"source_code": " 'YES', false => 'NO'][$cw >= $w and $cb >= $b], \"\\n\";\r\n}"}, {"source_code": "= $w * 2 && $bl >= $b * 2) {\r\n echo 'YES'.PHP_EOL;\r\n } else {\r\n echo 'NO'.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}\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, $k1, $k2) = IO::arr();\r\n list($w, $b) = IO::arr();\r\n\r\n $w1 = (int)$k1 + (int)$k2;\r\n $b1 = (2 * (int)$n) - $w1;\r\n if (floor($w1 / 2) >= (int)$w && floor($b1 / 2) >= (int)$b) {\r\n IO::line('YES');\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}"}], "negative_code": [], "src_uid": "26354d2628f26eb2eff9432bd46400d5"} {"source_code": "", "positive_code": [{"source_code": " 0; $n--){\n\n\n\t\tlist($p, $c) = explode(' ', trim(fgets(STDIN)));\n\t\tif($p < $c) {$res = false;}\n\t\tif($p < $p1) {$res = false;}\n\t\tif($c < $c1) {$res = false;}\n\t\tif($c - $c1 > $p - $p1) {$res = false;}\n\n\n\t\t$p1 = $p; $c1 = $c;\n\n\t}\n\treturn $res;\n};\n\nfor($t = intval(fgets(STDIN)); $t > 0; $t--){\n\techo ($check() ? 'YES' : 'NO') . \"\\n\";\n}\n"}, {"source_code": " $c)\n {\n print \"NO\\n\";\n for($y = 1; $y < $b; $y++)\n {\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n }\n }\n elseif($b == 1)\n {\n print \"YES\\n\";\n }\n else\n {\n for($y = 1; $y < $b; $y++)\n {\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n if(($f < $c) || ($g < $d) || ($f < $g))\n {\n $e = 1;\n }\n elseif(($f == $c) && ($g > $d))\n {\n $e = 1;\n }\n elseif(($f - $c) < ($g - $d))\n {\n $e = 1;\n }\n else\n {\n $c = $f;\n $d = $g;\n }\n }\n if($e == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " $c)\n {\n print \"NO\\n\";\n for($y = 1; $y < $b; $y++)\n {\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n }\n }\n elseif($b == 1)\n {\n print \"YES\\n\";\n }\n else\n {\n for($y = 1; $y < $b; $y++)\n {\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n if(($f < $c) || ($g < $d) || ($f < $g))\n {\n $e = 1;\n }\n else\n {\n $c = $f;\n $d = $g;\n }\n }\n if($e == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " $c)\n {\n print \"NO\\n\";\n for($y = 1; $y < $b; $y++)\n {\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n }\n }\n elseif($b == 1)\n {\n print \"YES\\n\";\n }\n else\n {\n for($y = 1; $y < $b; $y++)\n {\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n if(($f < $c) || ($g < $d) || ($f < $g))\n {\n $e = 1;\n }\n elseif(($f == $c) && ($g > $d))\n {\n $e = 1;\n }\n else\n {\n $c = $f;\n $d = $g;\n }\n }\n if($e == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " $c)\n {\n print \"NO\\n\";\n }\n elseif($b == 1)\n {\n print \"YES\\n\";\n }\n else\n {\n for($y = 1; $y < $b; $y++)\n {\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n if(($f < $c) || ($g < $d) || ($f < $g))\n {\n $e = 1;\n }\n else\n {\n $c = $f;\n $d = $g;\n }\n }\n if($e == 0)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": ""}], "src_uid": "714834defd0390659f6ed5bc3024f613"} {"source_code": "= $d)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "positive_code": [{"source_code": " $b) ? -1 : 1;\n }\n $a_ = explode(\" \", fgets(STDIN));\n $b_ = explode(\" \", fgets(STDIN));\n $a = array();\n $b = array();\n for ($i = 0; $i < $n; $i++) {\n $a[$i] = intval($a_[$i]);\n $b[$i] = intval($b_[$i]);\n }\n usort($b, \"cmp\");\n //fprintf(STDOUT, \"\" . array_sum($a) . \" \" . array_sum(array_slice($b, 0, 2)) . \"\\n\");\n fprintf(STDOUT, array_sum($a) <= array_sum(array_slice($b, 0, 2)) ? \"YES\" : \"NO\");\n?>"}, {"source_code": " $b) ? -1 : 1;\n }\n $a = explode(\" \", fgets(STDIN));\n $b = explode(\" \", fgets(STDIN));\n for ($i = 0; $i < $n; $i++) {\n $a[$i] = intval($a[$i]);\n $b[$i] = intval($b[$i]);\n }\n usort($b, \"cmp\");\n //fprintf(STDOUT, \"\" . array_sum($a) . \" \" . array_sum(array_slice($b, 0, 2)) . \"\\n\");\n fprintf(STDOUT, array_sum($a) <= array_sum(array_slice($b, 0, 2)) ? \"YES\" : \"NO\");\n?>"}, {"source_code": "= 2){\n $cap_sum= $caps[0]+$caps[1];\n if($sum<=$cap_sum){\n $output=\"YES\";\n }\n}\n\nfwrite($write, $output.PHP_EOL);\nfclose($read);\nfclose($write);"}], "negative_code": [], "src_uid": "88390110e4955c521867864a6f3042a0"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "= 0; $i--)\n\t\t\t\t$ans .= $a[$i].\" \";\n\t\t\t$ans .= \"\\n\";\n\t\t}\n\t}\n\tprint $ans;\n?>"}], "src_uid": "1d89df4153d70087d212b711852eba5f"} {"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 list($n, $k) = IO::arr();\r\n\r\n if($k % $n == 0) {\r\n IO::line($k / $n);\r\n } else {\r\n if($n > $k) {\r\n if($n % $k == 0){\r\n IO::line(1);\r\n } else {\r\n IO::line(2);\r\n }\r\n } else {\r\n IO::line(ceil($k / $n));\r\n }\r\n }\r\n}\r\n", "positive_code": [{"source_code": " $k) { \r\n if ($n % $k != 0) {$s = 2; }\r\n else { $s = 1; }\r\n }\r\n else { $s = $k / $n; }\r\n \r\n echo ceil($s).PHP_EOL;\r\n}\r\n?>"}, {"source_code": " $k) {\r\n echo ($n % $k ? 2 : 1).PHP_EOL;\r\n } else {\r\n echo ceil($k / $n).PHP_EOL;\r\n }\r\n}\r\n"}, {"source_code": " $k && ($n % $k != 0)) { \r\n echo \"2\".PHP_EOL;\r\n\r\n continue;\r\n }\r\n\r\n if ($n >= $k && ($n % $k == 0)) { \r\n echo \"1\".PHP_EOL;\r\n\r\n continue;\r\n }\r\n// }\r\n \r\n// if ($i == 97) {\r\n// echo $n . \"000\" . $k;\r\n// } \r\n}"}, {"source_code": " $k) { \r\n echo \"2\".PHP_EOL;\r\n\r\n continue;\r\n }\r\n\r\n $maxElement = $k / $n;\r\n\r\n echo $maxElement.PHP_EOL;\r\n }\r\n \r\n if ($i == 97) {\r\n echo $n . \"000\" . $k;\r\n } \r\n}"}, {"source_code": " $k) { \r\n echo \"2\".PHP_EOL;\r\n\r\n continue;\r\n }\r\n\r\n $maxElement = $k / $n;\r\n\r\n echo $maxElement.PHP_EOL;\r\n }\r\n \r\n if ($i == 97) {\r\n echo $n . \" \" . $k;\r\n } \r\n}"}, {"source_code": " $k) { \r\n echo \"2\".PHP_EOL;\r\n\r\n continue;\r\n }\r\n\r\n $maxElement = $k / $n;\r\n\r\n echo $maxElement.PHP_EOL;\r\n }\r\n \r\n if ($i == 97) {\r\n var_dump($n, $k);\r\n } \r\n}"}, {"source_code": " $k) { \r\n echo \"2\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n $maxElement = $k / $n;\r\n \r\n echo $maxElement.PHP_EOL;\r\n}"}, {"source_code": " $k) {\r\n $maxElement = floor($k / $n);\r\n \r\n if ($k % $n != 0) {\r\n $maxElement ++;\r\n }\r\n \r\n echo $maxElement.PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n if ($n < $k) { \r\n echo \"2\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n $maxElement = $k / $n;\r\n \r\n echo $maxElement.PHP_EOL;\r\n}"}, {"source_code": " $k) {\r\n $maxElement = floor($k / $n);\r\n \r\n if ($k % $n != 0) {\r\n $maxElement ++;\r\n }\r\n \r\n echo $maxElement.PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n if ($n < $k) { \r\n echo \"2\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n $maxElement = $k / $n;\r\n \r\n echo $maxElement.PHP_EOL;\r\n}"}, {"source_code": " $k) { \r\n echo \"2\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n $maxElement = $k / $n;\r\n \r\n echo $maxElement.PHP_EOL;\r\n}"}, {"source_code": " $k) { \r\n echo \"2\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n $maxElement = $k / $n;\r\n \r\n echo $maxElement.PHP_EOL;\r\n}"}, {"source_code": " $k) {\r\n if ($k % 2 == 0) {\r\n echo 2 . PHP_EOL;\r\n } else {\r\n echo 1 . PHP_EOL;\r\n }\r\n } elseif($n < $k) {\r\n if ($k % $n) {\r\n echo bcdiv($k, $n) + 1 . PHP_EOL;\r\n } else {\r\n echo bcdiv($k, $n) . PHP_EOL;\r\n }\r\n }\r\n\r\n}"}, {"source_code": " $k) {\r\n echo 2 . PHP_EOL;\r\n } elseif($n < $k) {\r\n if ($k % $n) {\r\n echo bcdiv($k, $n) + 1 . PHP_EOL;\r\n } else {\r\n echo bcdiv($k, $n) . PHP_EOL;\r\n }\r\n }\r\n\r\n}"}, {"source_code": " $k) {\r\n echo $k - 1 . PHP_EOL;\r\n } elseif($n < $k) {\r\n if ($k % $n) {\r\n echo bcdiv($k, $n) + 1 . PHP_EOL;\r\n } else {\r\n echo bcdiv($k, $n) . PHP_EOL;\r\n }\r\n }\r\n\r\n}"}, {"source_code": " $k) { $k = $k * 2; }\r\n }\r\n \r\n $s = $k / $n;\r\n echo ceil($s).PHP_EOL;\r\n}\r\n?>"}, {"source_code": " $k) { $k = $k * 2; }\r\n \r\n $s = $k / $n;\r\n echo ceil($s).PHP_EOL;\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 list($n, $k) = IO::arr();\r\n\r\n if($k % $n == 0) {\r\n IO::line($k / $n);\r\n } else {\r\n $left = $k % $n;\r\n IO::line(ceil(($k + $left) / $n));\r\n }\r\n}\r\n"}], "src_uid": "a28b84c9d1a54e322ab2d54bd5ab45c8"} {"source_code": " 0; $z--)\n {\n if($d[$z] == FALSE)\n {\n $d[$z] = TRUE;\n $f[count($f)] = $z;\n break;\n }\n }\n $e = 1;\n }\n }\n if($e > 0)\n {\n for($z = $e; $z > 0; $z--)\n {\n if($d[$z] == FALSE)\n {\n $d[$z] = TRUE;\n $f[count($f)] = $z;\n break;\n }\n }\n $e = 1;\n }\n print array_sum($f) . \"\\n\";\n}\n?>"}, {"source_code": " $sV) {\n if (!isset($aResult[$sV])) {\n $aResult[$sV] = $sKey;\n $sum += $sV;\n } else {\n for ($o = $sV; $o >0; $o--) {\n if(!isset($aResult[$o])) {\n $aResult[$o] = $sKey;\n $sum += $o;\n break;\n }\n }\n }\n }\n \n echo $sum.\"\\n\";\n }\n\n\n?>"}], "negative_code": [{"source_code": " 0)\n {\n for($z = $h; $z <= $g[0]; $z++)\n {\n if($i[$z] == FALSE)\n {\n $i[$z] = TRUE;\n }\n }\n }\n }\n $j = array_keys($i);\n $k = array_sum($j);\n print $k . \"\\n\";\n}\n?>"}], "src_uid": "a00d831da539c69d571d9720fd94eee1"} {"source_code": "", "positive_code": [{"source_code": "= $g)\n {\n $e[$h] = $g;\n }\n }\n else\n {\n array_push($d, $f);\n array_push($e, $g);\n }\n}\n$i = array_sum($e);\nif($c <= $i)\n{\n print $c;\n}\nelse\n{\n print $i;\n}\n?>", "positive_code": [{"source_code": ""}, {"source_code": "= $g))\n {\n $e[$h] = $g;\n }\n else\n {\n array_push($d, $f);\n array_push($e, $g);\n }\n}\n$i = array_sum($e);\nif($c <= $i)\n{\n print $c;\n}\nelse\n{\n print $i;\n}\n?>"}, {"source_code": " $b)\n {\n break;\n }\n $x = $y - 1;\n }\n elseif($f > $c)\n {\n if($g > 0)\n {\n $f--;\n $g--;\n if($f <= $c)\n {\n for($y = $x + 1; $y < $x + $d[$h - 1] + 1; $y++)\n {\n $e[$y] = $h;\n }\n $h++;\n $x = $y - 1;\n }\n }\n elseif($g <= 0)\n {\n for($y = $x; $y < $x + $d[$h - 1]; $y++)\n {\n $e[$y] = $h;\n }\n $g = $c - 1;\n $h++;\n $x = $y - 1;\n }\n }\n }\n print \"YES\\n\";\n print implode(\" \", $e);\n}\n?>", "positive_code": [{"source_code": "type = $type;\n $candy->height = $height;\n $candy->mass = $mass;\n \n if ($type) {\n $start_map1[] = $candy;\n } else {\n $start_map0[] = $candy;\n }\n}\n\nuasort($start_map0, 'sort_mass');\nuasort($start_map1, 'sort_mass');\n\n$eaten0 = start_with(0);\n$eaten1 = start_with(1);\nfunction start_with($last_type) {\n $eaten = 0;\n $GLOBALS['last_type'] = $last_type;\n $map0 = $GLOBALS['start_map0'];\n $map1 = $GLOBALS['start_map1'];\n $GLOBALS['x'] = $GLOBALS['start_x'];\n while ($map0 || $map1) {\n if ($GLOBALS['last_type']) {\n $candy = find_next($map0);\n } else {\n $candy = find_next($map1);\n }\n \n if (!$candy) {\n #echo 'break', \"\\n\";\n break;\n }\n\n $eaten++;\n $GLOBALS['last_type'] = $candy->type;\n $GLOBALS['x'] += $candy->mass;\n }\n \n return $eaten;\n}\n\necho max(array($eaten0, $eaten1));\n\nfunction find_next(&$map) {\n $list = array_filter($map, 'filter_height');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $key = key($list);\n unset($map[$key]);\n\n return $list[$key];\n}\n\nfunction filter_height($candy) {\n return $candy->height <= $GLOBALS['x'];\n}\n\nfunction filter_type($candy) {\n return $candy->type != $GLOBALS['last_type'];\n}\n\nfunction sort_mass($candy1, $candy2) {\n if ($candy1->mass > $candy2->mass) {\n return -1;\n }\n \n if ($candy1->mass < $candy2->mass) {\n return 1;\n }\n \n return 0;\n}\n", "positive_code": [{"source_code": "= $f[$y])\n {\n $b += $g[$y];\n $f[$y] = 1000000000;\n $p++;\n $n = 1;\n break;\n }\n }\n }\n else\n {\n for($y = 0; $y < count($r); $y++)\n {\n if($b >= $h[$y])\n {\n $b += $i[$y];\n $h[$y] = 1000000000;\n $p++;\n $n = 0;\n break;\n }\n }\n }\n}\n$n2 = 1;\n$o2 = $g;\n$p2 = 0;\n$r2 = $i;\n$f = $s;\n$h = $t;\nfor($x = 1; $x <= $a; $x++)\n{\n if($n2 == 0)\n {\n for($y = 0; $y < count($o2); $y++)\n {\n if($b2 >= $f[$y])\n {\n $b2 += $g[$y];\n $f[$y] = 1000000000;\n $p2++;\n $n2 = 1;\n break;\n }\n }\n }\n else\n {\n for($y = 0; $y < count($r2); $y++)\n {\n if($b2 >= $h[$y])\n {\n $b2 += $i[$y];\n $h[$y] = 1000000000;\n $p2++;\n $n2 = 0;\n break;\n }\n }\n }\n}\nprint max($p, $p2);\n?>"}, {"source_code": "= $f[$y])\n {\n $b += $g[$y];\n $f[$y] = 1000000000;\n $p++;\n $n = 1;\n break;\n }\n }\n }\n else\n {\n for($y = 0; $y < count($r); $y++)\n {\n if($b >= $h[$y])\n {\n $b += $i[$y];\n $h[$y] = 1000000000;\n $p++;\n $n = 0;\n break;\n }\n }\n }\n}\n$n2 = 1;\n$o2 = $g;\n$p2 = 0;\n$r2 = $i;\n$f = $s;\n$h = $t;\nfor($x = 1; $x <= $a; $x++)\n{\n if($n2 == 0)\n {\n for($y = 0; $y < count($o2); $y++)\n {\n if($b2 >= $f[$y])\n {\n $b2 += $g[$y];\n $f[$y] = 1000000000;\n $p2++;\n $n2 = 1;\n break;\n }\n }\n }\n else\n {\n for($y = 0; $y < count($r2); $y++)\n {\n if($b2 >= $h[$y])\n {\n $b2 += $i[$y];\n $h[$y] = 1000000000;\n $p2++;\n $n2 = 0;\n break;\n }\n }\n }\n}\nprint max($p, $p2);\n?>"}], "negative_code": [{"source_code": "= $f[$x])\n {\n $l = $g[$x];\n break;\n }\n}\nfor($x = 0; $x <= count($i); $x++)\n{\n if($b >= $h[$x])\n {\n $m = $i[$x];\n break;\n }\n}\nif($l >= $m)\n{\n $n = 0;\n $o = $g;\n $p = 0;\n $r = $i;\n for($x = 1; $x <= $a; $x++)\n {\n if($n == 0)\n {\n for($y = 0; $y < count($o); $y++)\n {\n if($b >= $f[$y])\n {\n $b += $g[$y];\n $f[$y] = 1000000000;\n $p++;\n break;\n }\n }\n $n = 1;\n }\n else\n {\n for($y = 0; $y < count($r); $y++)\n {\n if($b >= $h[$y])\n {\n $b += $i[$y];\n $h[$y] = 1000000000;\n $p++;\n break;\n }\n }\n $n = 0;\n }\n }\n}\nelse\n{\n $n = 1;\n $o = $g;\n $p = 0;\n $r = $i;\n for($x = 1; $x <= $a; $x++)\n {\n if($n == 0)\n {\n for($y = 0; $y < count($o); $y++)\n {\n if($b >= $f[$y])\n {\n $b += $g[$y];\n $f[$y] = 1000000000;\n $p++;\n break;\n }\n }\n $n = 1;\n }\n else\n {\n for($y = 0; $y < count($r); $y++)\n {\n if($b >= $h[$y])\n {\n $b += $i[$y];\n $h[$y] = 1000000000;\n $p++;\n break;\n }\n }\n $n = 0;\n }\n }\n}\nprint $p;\n?>"}, {"source_code": "= $f[$x])\n {\n $l = $g[$x];\n break;\n }\n}\nfor($x = 0; $x <= count($i); $x++)\n{\n if($b >= $h[$x])\n {\n $m = $i[$x];\n break;\n }\n}\nif($l >= $m)\n{\n $n = 0;\n $o = $g;\n $p = 0;\n $r = $i;\n for($x = 1; $x <= $a; $x++)\n {\n if($n == 0)\n {\n for($y = 0; $y < count($o); $y++)\n {\n if($b >= $f[$y])\n {\n $b += $g[$y];\n $f[$y] = 1000000000;\n $p++;\n $n = 1;\n break;\n }\n }\n }\n else\n {\n for($y = 0; $y < count($r); $y++)\n {\n if($b >= $h[$y])\n {\n $b += $i[$y];\n $h[$y] = 1000000000;\n $p++;\n $n = 0;\n break;\n }\n }\n }\n }\n}\nelse\n{\n $n = 1;\n $o = $g;\n $p = 0;\n $r = $i;\n for($x = 1; $x <= $a; $x++)\n {\n if($n == 0)\n {\n for($y = 0; $y < count($o); $y++)\n {\n if($b >= $f[$y])\n {\n $b += $g[$y];\n $f[$y] = 1000000000;\n $p++;\n $n = 1;\n break;\n }\n }\n }\n else\n {\n for($y = 0; $y < count($r); $y++)\n {\n if($b >= $h[$y])\n {\n $b += $i[$y];\n $h[$y] = 1000000000;\n $p++;\n $n = 0;\n break;\n }\n }\n }\n }\n}\nprint $p;\n?>"}, {"source_code": "type = $type;\n $candy->height = $height;\n $candy->mass = $mass;\n \n $map[] = $candy;\n}\n\n$eaten = 0;\n$last_type = -1;\n$last_map_size = count($map);\n$runs = 0;\nwhile ($map) {\n $candy = find_next($map);\n if (!$candy) {\n #echo 'break', \"\\n\";\n break;\n }\n \n if ($last_map_size == count($map)) {\n echo 'size break', \"\\n\";\n break;\n }\n \n if ($runs++ > 100) {\n echo 'run break', \"\\n\";\n break;\n }\n \n if ($x < $candy->height) {\n echo 'very hight', \"\\n\";\n break;\n }\n \n if ($last_type == $candy->type) {\n echo 'same type', \"\\n\";\n break;\n }\n \n $eaten++;\n $last_type = $candy->type;\n $x += $candy->mass;\n $last_map_size = count($map);\n}\n\necho $eaten;\n\nfunction find_next(&$map) {\n $list = array_filter($map, 'filter_height');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $list = array_filter($list, 'filter_type');\n if (!$list) {\n $map = false;\n return false;\n }\n \n uasort($list, 'sort_mass');\n $key = key($list);\n unset($map[$key]);\n\n return $list[$key];\n}\n\nfunction filter_height($candy) {\n return $candy->height <= $GLOBALS['x'];\n}\n\nfunction filter_type($candy) {\n return $candy->type != $GLOBALS['last_type'];\n}\n\nfunction sort_mass($candy1, $candy2) {\n if ($candy1->mass > $candy2->mass) {\n return -1;\n }\n \n if ($candy1->mass < $candy2->mass) {\n return 1;\n }\n \n return 0;\n}"}, {"source_code": "type = $type;\n $candy->height = $height;\n $candy->mass = $mass;\n \n $map[] = $candy;\n}\n\nuasort($map, 'sort_mass');\n\n$eaten = 0;\n$last_type = -1;\n$last_map_size = count($map);\n$runs = 0;\nwhile ($map) {\n $candy = find_next($map);\n if (!$candy) {\n #echo 'break', \"\\n\";\n break;\n }\n \n if ($last_map_size == count($map)) {\n echo 'size break', \"\\n\";\n break;\n }\n \n if ($runs++ > 500) {\n echo 'run break', \"\\n\";\n break;\n }\n \n if ($x < $candy->height) {\n echo 'very hight', \"\\n\";\n break;\n }\n \n if ($last_type == $candy->type) {\n echo 'same type', \"\\n\";\n break;\n }\n \n $eaten++;\n $last_type = $candy->type;\n $x += $candy->mass;\n $last_map_size = count($map);\n}\n\necho $eaten;\n\nfunction find_next(&$map) {\n $list = array_filter($map, 'filter_height');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $list = array_filter($list, 'filter_type');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $key = key($list);\n unset($map[$key]);\n\n return $list[$key];\n}\n\nfunction filter_height($candy) {\n return $candy->height <= $GLOBALS['x'];\n}\n\nfunction filter_type($candy) {\n return $candy->type != $GLOBALS['last_type'];\n}\n\nfunction sort_mass($candy1, $candy2) {\n if ($candy1->mass > $candy2->mass) {\n return -1;\n }\n \n if ($candy1->mass < $candy2->mass) {\n return 1;\n }\n \n return 0;\n}"}, {"source_code": "type = $type;\n $candy->height = $height;\n $candy->mass = $mass;\n \n $map[] = $candy;\n}\n\n$eaten = 0;\n$last_type = -1;\nforeach ($map as $candy) {\n if ($x < $candy->height) {\n #echo 'very hight', \"\\n\";\n continue;\n }\n \n if ($last_type == $candy->type) {\n #echo 'same type', \"\\n\";\n continue;\n }\n \n $eaten++;\n $last_type = $candy->type;\n $x += $candy->mass;\n #echo 'x = ', $x, \"\\n\";\n}\n\necho $eaten;\n"}, {"source_code": ""}, {"source_code": "type = $type;\n $candy->height = $height;\n $candy->mass = $mass;\n \n $map[] = $candy;\n}\n\nuasort($map, 'sort_mass');\n\n$eaten = 0;\n$last_type = -1;\n$last_map_size = count($map);\n$runs = 0;\nwhile ($map) {\n $candy = find_next($map);\n if (!$candy) {\n #echo 'break', \"\\n\";\n break;\n }\n \n if ($last_map_size == count($map)) {\n echo 'size break', \"\\n\";\n break;\n }\n \n if ($runs++ > 2100) {\n echo 'run break', \"\\n\";\n break;\n }\n \n if ($x < $candy->height) {\n echo 'very hight', \"\\n\";\n break;\n }\n \n if ($last_type == $candy->type) {\n echo 'same type', \"\\n\";\n break;\n }\n \n $eaten++;\n $last_type = $candy->type;\n $x += $candy->mass;\n $last_map_size = count($map);\n}\n\necho $eaten;\n\nfunction find_next(&$map) {\n $list = array_filter($map, 'filter_height');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $list = array_filter($list, 'filter_type');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $key = key($list);\n unset($map[$key]);\n\n return $list[$key];\n}\n\nfunction filter_height($candy) {\n return $candy->height <= $GLOBALS['x'];\n}\n\nfunction filter_type($candy) {\n return $candy->type != $GLOBALS['last_type'];\n}\n\nfunction sort_mass($candy1, $candy2) {\n if ($candy1->mass > $candy2->mass) {\n return -1;\n }\n \n if ($candy1->mass < $candy2->mass) {\n return 1;\n }\n \n return 0;\n}"}, {"source_code": "type = $type;\n $candy->height = $height;\n $candy->mass = $mass;\n \n $map[] = $candy;\n}\n\nuasort($map, 'sort_mass');\n\n$eaten = 0;\n$last_type = -1;\n$last_map_size = count($map);\n$runs = 0;\nwhile ($map) {\n $candy = find_next($map);\n if (!$candy) {\n #echo 'break', \"\\n\";\n break;\n }\n \n if ($last_map_size == count($map)) {\n echo 'size break', \"\\n\";\n break;\n }\n \n if ($runs++ > 1500) {\n echo 'run break', \"\\n\";\n break;\n }\n \n if ($x < $candy->height) {\n echo 'very hight', \"\\n\";\n break;\n }\n \n if ($last_type == $candy->type) {\n echo 'same type', \"\\n\";\n break;\n }\n \n $eaten++;\n $last_type = $candy->type;\n $x += $candy->mass;\n $last_map_size = count($map);\n}\n\necho $eaten;\n\nfunction find_next(&$map) {\n $list = array_filter($map, 'filter_height');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $list = array_filter($list, 'filter_type');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $key = key($list);\n unset($map[$key]);\n\n return $list[$key];\n}\n\nfunction filter_height($candy) {\n return $candy->height <= $GLOBALS['x'];\n}\n\nfunction filter_type($candy) {\n return $candy->type != $GLOBALS['last_type'];\n}\n\nfunction sort_mass($candy1, $candy2) {\n if ($candy1->mass > $candy2->mass) {\n return -1;\n }\n \n if ($candy1->mass < $candy2->mass) {\n return 1;\n }\n \n return 0;\n}"}, {"source_code": ""}, {"source_code": "type = $type;\n $candy->height = $height;\n $candy->mass = $mass;\n \n $map[] = $candy;\n}\n\nuasort($map, 'sort_mass');\n\n$eaten0 = start_with(0);\n$eaten1 = start_with(1);\nfunction start_with($last_type) {\n $eaten = 0;\n $GLOBALS['last_type'] = $last_type;\n $map = $GLOBALS['map'];\n $last_map_size = count($map);\n while ($map) {\n $candy = find_next($map);\n if (!$candy) {\n #echo 'break', \"\\n\";\n break;\n }\n\n $eaten++;\n $GLOBALS['last_type'] = $candy->type;\n $GLOBALS['x'] += $candy->mass;\n $last_map_size = count($map);\n }\n \n return $eaten;\n}\n\necho max(array($eaten0, $eaten1));\n\nfunction find_next(&$map) {\n $list = array_filter($map, 'filter_height');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $list = array_filter($list, 'filter_type');\n if (!$list) {\n $map = false;\n return false;\n }\n \n $key = key($list);\n unset($map[$key]);\n\n return $list[$key];\n}\n\nfunction filter_height($candy) {\n return $candy->height <= $GLOBALS['x'];\n}\n\nfunction filter_type($candy) {\n return $candy->type != $GLOBALS['last_type'];\n}\n\nfunction sort_mass($candy1, $candy2) {\n if ($candy1->mass > $candy2->mass) {\n return -1;\n }\n \n if ($candy1->mass < $candy2->mass) {\n return 1;\n }\n \n return 0;\n}\n"}], "src_uid": "6253f6217c58a66573b1ddc6962c372c"} {"source_code": " $b)\n {\n $h = 1;\n }\n array_push($f, $h);\n $g[$h - 1]++;\n $h++;\n }\n sort($f);\n $d[$x] = $f;\n $e[$x] = $g;\n}\n$i = array();\nfor($x = 0; $x < $a; $x++)\n{\n $j = array();\n for($y = 0; $y < $a; $y++)\n {\n $j[$y] = $e[$y][$x];\n }\n sort($j);\n $k = $j[count($j) - 1] - $j[0];\n $i[$x] = $k;\n}\nsort($i);\nif($i[count($i) - 1] > 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\" . \"\\n\";\n for($x = 0; $x < $a - 1; $x++)\n {\n print implode(\" \", $d[$x]) . \"\\n\";\n }\n print implode(\" \", $d[$x]);\n}\n?>", "positive_code": [{"source_code": " $min + $nk[1]){\n echo \"NO\";\n}else{\n echo \"YES\" . PHP_EOL;\n for($i=0;$i<$nk[0];$i++){\n $result = [];\n for($m=0;$m<$min;$m++){\n array_push($result, 1);\n }\n for($j=1;$j<=$piles[$i]-$min;$j++){\n array_push($result, $j);\n }\n echo implode(' ', $result) . PHP_EOL;\n }\n}\n\n\n"}, {"source_code": " $b)\n {\n $h = 1;\n }\n array_push($f, $h);\n $g[$h - 1]++;\n $h++;\n }\n sort($f);\n $d[$x] = $f;\n $e[$x] = $g;\n}\n$i = array();\nfor($x = 0; $x < $a; $x++)\n{\n $j = array();\n for($y = 0; $y < $a; $y++)\n {\n $j[$y] = $e[$y][$x];\n }\n sort($j);\n $k = $j[count($j) - 1] - $j[0];\n $i[$x] = $k;\n}\nsort($i);\nif($i[count($i) - 1] > 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\" . \"\\n\";\n for($x = 0; $x < $a - 1; $x++)\n {\n print implode(\" \", $d[$x]) . \"\\n\";\n }\n}\nprint implode(\" \", $d[$x]);\n?>"}], "negative_code": [], "src_uid": "e512285d15340343e34f596de2be82eb"} {"source_code": ""}], "negative_code": [], "src_uid": "43a65d1cfe59931991b6aefae1ecd10e"} {"source_code": ""}], "negative_code": [{"source_code": " $a[$j]) { $ans++; }\r\n }\r\n echo $ans.PHP_EOL;\r\n }\r\n}\r\n\r\n?>"}], "src_uid": "d5627b9fe5f6c5a7247e1f9d9e9b0c6a"} {"source_code": " $b, 2 => $c, 3 => 0);\n$f = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($d[$x] == 1)\n {\n if($e[1] > 0)\n {\n $e[1]--;\n }\n elseif($e[2] > 0)\n {\n $e[2]--;\n $e[3]++;\n }\n elseif($e[3] > 0)\n {\n $e[3]--;\n }\n else\n {\n $f++;\n }\n }\n elseif($d[$x] == 2)\n {\n if($e[2] > 0)\n {\n $e[2]--;\n }\n else\n {\n $f += 2;\n }\n }\n}\nprint $f;\n?>", "positive_code": [{"source_code": "0){\n $a--;\n continue;\n }\n if($b>0){\n $b--;\n $c++;\n continue;\n }\n if($c>0){\n $c--;\n continue;\n }\n $reject_counter++;\n }else{\n if($b>0){\n $b--;\n continue;\n }\n $reject_counter+=2;\n }\n}\n\necho $reject_counter;"}, {"source_code": "0){\n $a[1]=intval($a[1])-1;\n }\n else{\n if ($a[2]>0){\n $a[2]=intval($a[2])-1;\n $a[3]=intval($a[3])+1;\n }\n else if($a[3]>0){\n $a[3]=$a[3]-1;\n }\n else{\n $c++;\n }\n }\n }\n else{\n if ($a[2]>0){\n $a[2]=intval($a[2])-1;\n }\n else{\n $c+=2;\n }\n }\n}\necho $c;\n?>"}], "negative_code": [{"source_code": "0){\n $a--;\n continue;\n }\n if($b>0){\n $b--;\n $c++;\n continue;\n }\n if($c>0){\n $c--;\n continue;\n }\n $reject_counter++;\n }else{\n if($b>0){\n $b--;\n continue;\n }\n $reject_counter++;\n }\n}"}, {"source_code": "0){\n $a--;\n continue;\n }\n if($b>0){\n $b--;\n $c++;\n continue;\n }\n if($c>0){\n $c--;\n continue;\n }\n $reject_counter++;\n }else{\n if($b>0){\n $b--;\n continue;\n }\n $reject_counter++;\n }\n}\n\necho $reject_counter;"}, {"source_code": "0){\n $a[1]--;\n }\n else{\n if ($a[2]>0){\n $a[2]--;\n $a[1]++;\n }\n else{\n $c++;\n }\n }\n }\n }\n else{\n if ($a[2]>0){\n $a[2]--;\n }\n else{\n $c+=2;\n }\n }\n}\necho $c;\n?>"}, {"source_code": "0){\n $a[1]=intval($a[1])-1;\n }\n else{\n if ($a[2]>0){\n $a[2]=intval($a[2])-1;\n $a[1]=intval($a[1])+1;\n }\n else{\n $c++;\n }\n }\n }\n else{\n if ($a[2]>0){\n $a[2]=intval($a[2])-1;\n }\n else{\n $c+=2;\n }\n }\n}\necho $c;\n?>"}], "src_uid": "e21e768dbb2e5f72873dc1c7de4879fd"} {"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\nfor ($i=0; $i<$n-1; $i++) {\n\tif (ord($s[$i]) > ord($s[$i+1]) ) {\n\t\techo 'YES' . PHP_EOL . ($i+1) . ' ' . ($i+2);\n\t\texit();\n\t}\n}\necho 'NO';\n", "positive_code": [{"source_code": " $m[$i+1]) {\n echo 'YES'.\"\\n\";\n echo ($i+1) . \" \". ($i + 2);\n $b = false;\n break;\n }\n }\n if ($b) {\n echo 'NO';\n }\n?>"}, {"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);\n$d = $c[$b[0]];\n$e = 1;\n$f = 0;\nfor($x = 1; $x < $a; $x++)\n{\n if($c[$b[$x]] > $d)\n {\n $d = $c[$b[$x]];\n $e = $x + 1;\n }\n elseif($c[$b[$x]] < $d)\n {\n $f = 1;\n break;\n }\n}\nif($f == 0)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n print $e . \" \" . ($x + 1);\n}\n?>"}, {"source_code": " $s[$i+1]) {\n echo 'YES'.\"\\n\";\n echo ($i+1) . \" \". ($i + 2);\n exit;\n }\n }\n echo 'NO';\n?>"}, {"source_code": ""}, {"source_code": "= $m){\n\t\t\t$m = ord($s[$i]);\n\t\t\t$i1 = $i;\n\t\t}else{\n\t\t\t$i2 = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\techo ($i1 < $i2 ? \"YES\\n\".($i1+1).\" \".($i2+1) : \"NO\");\n\t\n?>"}], "negative_code": [{"source_code": " $prev) {\n $no = false;\n echo 'YES' . PHP_EOL . ($i - 1) . ' ' . $i;\n break;\n }\n}\nif ($no === true) {\n echo 'NO';\n}\n"}, {"source_code": ""}, {"source_code": "= $m){\n\t\t\t$m = (int)$s[$i];\n\t\t\t$i1 = $i;\n\t\t}else{\n\t\t\t$i2 = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\techo ($i1 < $i2 ? \"YES\\n\".($i1+1).\" \".($i2+1) : \"NO\");\n\t\n?>"}, {"source_code": " $m){\n\t\t\t$m = $s[$i];\n\t\t\t$i1 = $i;\n\t\t}else{\n\t\t\t$i2 = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\techo ($i1 < $i2 ? \"YES\\n\".($i1+1).\" \".($i2+1) : \"NO\");\n\t\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $m[$i+1]) {\n echo 'YES'.\"\\n\";\n echo ($i+1) . \" \". ($i + 2);\n $b = false;\n break;\n }\n }\n if ($b) {\n echo 'NO';\n }\n?>"}, {"source_code": " $m[$i+1] || $m[$i+1] > $m[$i+2])) {\n echo 'YES'.\"\\n\";\n echo ($i + 2) . \" \". ($i + 3);\n $b = false;\n break;\n }\n }\n if ($b) {\n echo 'NO';\n }\n?>"}, {"source_code": ""}, {"source_code": " $v) {\n if (isset($m[$k + 2]) && $v == $m[$k + 2] && $m[$k + 1] != $m[$k + 2]) {\n echo 'YES'.\"\\n\";\n echo ($k + 2) . \" \". ($k + 3);\n $b = false;\n break;\n }\n }\n if ($b) {\n echo 'NO';\n }\n?>"}, {"source_code": " $m[$i+1]) {\n echo 'YES'.\"\\n\";\n echo ($i) . \" \". ($i + 1);\n $b = false;\n break;\n }\n }\n if ($b) {\n echo 'NO';\n }\n?>"}, {"source_code": ""}, {"source_code": " $v) {\n if (isset($m[$k + 2]) && $v == $m[$k + 2]) {\n echo 'YES'.\"\\n\";\n echo ($k + 2) . \" \". ($k + 3);\n $b = false;\n break;\n }\n }\n if ($b) {\n echo 'NO';\n }\n?>"}, {"source_code": " $m[$i+2]) {\n echo 'YES'.\"\\n\";\n echo ($i + 2) . \" \". ($i + 3);\n $b = false;\n break;\n }\n }\n if ($b) {\n echo 'NO';\n }\n?>"}], "src_uid": "d45f775613e701bbdaa4e457e6e189e2"} {"source_code": "= 0; $x--)\n {\n if($x == 0)\n {\n print \"PRINT \" . $c[$x];\n }\n else\n {\n print \"PRINT \" . $c[$x] . \"\\n\";\n print \"LEFT\" . \"\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " ($si / 2)) ? 1 : -1;\nwhile($p != 1 && $p != $si)\n{\n\techo ($m == -1) ? \"LEFT\" : \"RIGHT\";\n\techo PHP_EOL;\n\t\n\t$p += $m;\n}\n\n$m = ($m == -1) ? 1 : -1;\nwhile ($si > 0)\n{\n\techo \"PRINT \" . $sl[($p - 1)] . PHP_EOL;\n\t$si--;\n\t$p += $m;\n\tif($si > 0)\n\t{\n\t\techo ($m == -1) ? \"LEFT\" : \"RIGHT\";\n\t\techo PHP_EOL;\n\t}\n}"}], "negative_code": [{"source_code": ""}, {"source_code": " ($si / 2)) ? 1 : -1;\nwhile($p != 0 && $p != $si)\n{\n\techo ($m == -1) ? \"LEFT\" : \"RIGHT\";\n\techo PHP_EOL;\n\t\n\t$p += $m;\n}\n\n$m = ($m == -1) ? 1 : -1;\nwhile ($si > 0)\n{\n\techo \"PRINT \" . $sl[($p - 1)] . PHP_EOL;\n\t$si--;\n\t$p += $m;\n\tif($si > 0)\n\t{\n\t\techo ($m == -1) ? \"LEFT\" : \"RIGHT\";\n\t\techo PHP_EOL;\n\t}\n}"}], "src_uid": "e3a03f3f01a77a1983121bab4218c39c"} {"source_code": "$arval){\r\n// if($arval<$l){}\r\n// }\r\n $an1=array_filter($an,function($var)use($l,$r){\r\n// echo $var.\".($l,$r)\";\r\n // var_dump($rt);\r\n return ($var>=$l)? ($var<=$r?true:false):false;});\r\n// print_r($an1);\r\n $total=0;$count=0;\r\n foreach ($an1 as $ak=>$aval){\r\n if(($total+=$aval) >$k){break;}else{$count++;}\r\n// echo \"[$total][$aval]\\n\";\r\n }\r\n// echo \"[$count]\";\r\n $caseResult[]=$count;\r\n}\r\n//print_r($caseResult);\r\n$co=0;\r\nforeach ($caseResult as $item) {\r\n echo \"$item\";if($co++<$caseCount-1){echo \"\\n\";}\r\n}", "positive_code": [{"source_code": "= $l && $choco <= $r)\r\n {\r\n $buyables []= $choco;\r\n }\r\n }\r\n\r\n sort($buyables);\r\n\r\n $canBuy = 0;\r\n $price = 0;\r\n\r\n for($i=0; $i < count($buyables); $i++)\r\n {\r\n if($price + $buyables[$i] > $k)\r\n {\r\n break;\r\n }\r\n else\r\n {\r\n $price+= $buyables[$i];\r\n $canBuy++;\r\n }\r\n }\r\n\r\n echo $canBuy . PHP_EOL;\r\n}\r\n\r\n$t = + fgets($file);\r\n\r\nwhile($t--) solve();"}], "negative_code": [], "src_uid": "f577695d39a11e8507681f307677c883"} {"source_code": " $m || $n <= 2) {\n echo \"-1\" . \"\\n\";\n } else {\n $sum = array_sum($a)*2;\n echo $sum .\"\\n\";\n for ($k = 1; $k < $n; $k++) {\n echo $k . ' ' . ($k + 1) . \"\\n\";\n }\n echo $n . ' ' . 1 . \"\\n\";\n }\n }\n\n?>", "positive_code": [{"source_code": " $c) || ($b <= 2))\n {\n print \"-1\\n\";\n }\n else\n {\n $e = $d[0] + $d[$b - 1];\n $f = array(\"1\");\n $g = array($b);\n for($y = 0; $y < $b - 1; $y++)\n {\n $e += $d[$y] + $d[$y + 1];\n $f[count($f)] = $y + 1;\n $g[count($g)] = $y + 2;\n }\n if($c > $b)\n {\n asort($d);\n $h = array_keys($d);\n sort($d);\n for($y = 0; $y < $c - $b; $y++)\n {\n $e += $d[0] + $d[1];\n $f[count($f)] = $h[0];\n $g[count($g)] = $h[1];\n }\n }\n print $e . \"\\n\";\n for($y = 0; $y < count($f); $y++)\n {\n print $f[$y] . \" \" . $g[$y] . \"\\n\";\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " $c)\n {\n print \"-1\\n\";\n }\n else\n {\n $e = $d[0] + $d[$b - 1];\n $f = array(\"1\");\n $g = array($b);\n for($y = 0; $y < $b - 1; $y++)\n {\n $e += $d[$y] + $d[$y + 1];\n $f[count($f)] = $y + 1;\n $g[count($g)] = $y + 2;\n }\n if($c > $b)\n {\n asort($d);\n $h = array_keys($d);\n sort($d);\n for($y = 0; $y < $c - $b; $y++)\n {\n $e += $d[0] + $d[1];\n $f[count($f)] = $h[0];\n $g[count($g)] = $h[1];\n }\n }\n print $e . \"\\n\";\n for($y = 0; $y < count($f); $y++)\n {\n print $f[$y] . \" \" . $g[$y] . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $m) {\n echo \"-1\" . \"\\n\";\n } else {\n $sum = array_sum($a)*2;\n echo $sum .\"\\n\";\n for ($k = 1; $k < $n; $k++) {\n echo $k . ' ' . ($k + 1) . \"\\n\";\n }\n echo $n . ' ' . 1 . \"\\n\";\n }\n }\n\n?>"}], "src_uid": "f6e219176e846b16c5f52dee81601c8e"} {"source_code": "\n", "positive_code": [{"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n\t\tpreg_match($r, $s, $matches);\n\t\t$x = $matches[1];\n\t\tarray_push($res, $x);\n\t\t$s = substr($s, 0, strlen($s) - strlen($x));\n\t}\n\tprint(implode(',',array_reverse($res)).\"\\n\");\n}\n\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 0; $x--)\n {\n if(($c[$x] - $c[$x - 1]) <= 2)\n {\n $d = 1;\n break;\n }\n }\n if($d == 1)\n {\n print \"No solution\";\n }\n else\n {\n for($x = 0; $x < count($c); $x++)\n {\n $e = implode(array_slice($b, 0, $c[$x] + 2)) . \",\";\n array_push($f, $e);\n array_splice($b, 0, $c[$x] + 2);\n }\n }\n print substr(implode($f), 0, strlen(implode($f)) - 1);\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n\t\tpreg_match($r, $s, $matches);\n\t\t$x = $matches[1];\n\t\tarray_push($res, $x);\n\t\t$s = substr($s, 0, strlen($s) - strlen($x));\n\t}\n\tprint(implode(',',array_reverse($res)).\"\\n\");\n}\n\n?>\n"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "71b4674e91e0bc5521c416cfc570a090"} {"source_code": "= 0; $x--)\n{\n if($d[$x] <= 1)\n {\n $d = array_slice($d, $x);\n $e = array_slice($e, $x);\n break;\n }\n}\n$i = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if(($e[$x] - $d[$x] + 1 >= $a) && ($d[$x] <= 1) && ($e[$x] >= $a))\n {\n $i = 1;\n break;\n }\n}\nif($i == 1)\n{\n print \"1\";\n}\nelseif((($d[0] > 1) || ($e[count($e) - 1] < $a)) || (($b == 1) && (count($d) < $a)))\n{\n print \"-1\";\n}\nelse\n{\n $f = 1;\n $g = $e[0];\n $j = $d[0];\n while(TRUE)\n {\n $h = 0;\n for($x = count($d) - 1; $x >= 0; $x--)\n {\n if(($d[$x] <= $g + 1) && ($d[$x] > $j))\n {\n $f++;\n $g = $e[$x];\n $h = 1;\n $j = $d[$x];\n break;\n }\n }\n if($h == 0)\n {\n break;\n }\n elseif($g >= $a)\n {\n break;\n }\n }\n if($h == 1)\n {\n print $f;\n }\n else\n {\n print \"-1\";\n }\n}\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": "= 0; $x--)\n{\n if($d[$x] <= 1)\n {\n $d = array_slice($d, $x);\n $e = array_slice($e, $x);\n break;\n }\n}\nif(($a == 1000) && ($b == 501))\n{\n print implode(\" \", $d) . \"\\n\";\n print implode(\" \", $e) . \"\\n\";\n}\nif(($d[0] > 1) || ($e[count($e) - 1] < $a))\n{\n print \"-1\";\n}\nelse\n{\n $f = 1;\n $g = $e[0];\n while(TRUE)\n {\n $h = 0;\n for($x = count($d) - 1; $x >= 0; $x--)\n {\n if(($d[$x] <= $g + 1) && ($e[$x] != $g))\n {\n $f++;\n $g = $e[$x];\n $h = 1;\n break;\n }\n }\n if($h == 0)\n {\n break;\n }\n elseif($g >= $a)\n {\n break;\n }\n }\n if($h == 1)\n {\n print $f;\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": "= $a) && ($d[$x] <= 1) && ($e[$x] >= $a))\n {\n $i = 1;\n break;\n }\n}\nif($i == 1)\n{\n print \"1\";\n}\nelseif(($d[0] > 1) || ($e[count($e) - 1] < $a))\n{\n print \"-1\";\n}\nelse\n{\n $f = 1;\n $g = $e[0];\n while(TRUE)\n {\n $h = 0;\n for($x = count($d) - 1; $x >= 0; $x--)\n {\n if(($d[$x] <= $g + 1) && ($e[$x] != $g))\n {\n $f++;\n $g = $e[$x];\n $h = 1;\n break;\n }\n }\n if($h == 0)\n {\n break;\n }\n elseif($g >= $a)\n {\n break;\n }\n }\n if($h == 1)\n {\n print $f;\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": "= 0; $x--)\n{\n if($d[$x] <= 1)\n {\n $d = array_slice($d, $x);\n $e = array_slice($e, $x);\n break;\n }\n}\nif(($d[0] > 1) || ($e[count($e) - 1] < $a))\n{\n print \"-1\";\n}\nelse\n{\n $f = 1;\n $g = $e[0];\n while(TRUE)\n {\n $h = 0;\n for($x = count($d) - 1; $x >= 0; $x--)\n {\n if(($d[$x] <= $g + 1) && ($e[$x] != $g))\n {\n $f++;\n $g = $e[$x];\n $h = 1;\n break;\n }\n }\n if($h == 0)\n {\n break;\n }\n elseif($g >= $a)\n {\n break;\n }\n }\n if($h == 1)\n {\n print $f;\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": "= 0; $x--)\n{\n if($d[$x] <= 1)\n {\n $d = array_slice($d, $x);\n $e = array_slice($e, $x);\n break;\n }\n}\nif(($d[0] > 1) || ($e[count($e) - 1] < $a))\n{\n print \"-1\";\n}\nelse\n{\n $f = 1;\n $g = $e[0];\n while(TRUE)\n {\n $h = 0;\n for($x = count($d) - 1; $x >= 0; $x--)\n {\n if(($d[$x] <= $g + 1) && ($e[$x] != $g))\n {\n $f++;\n $g = $e[$x];\n $h = 1;\n break;\n }\n }\n if($h == 0)\n {\n break;\n }\n elseif($g >= $a)\n {\n break;\n }\n }\n if($h == 1)\n {\n print $f;\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": " 1) || ($e[count($e) - 1] < $a))\n{\n print \"-1\";\n}\nelseif(($e[0] - $d[0] + 1) >= $a)\n{\n print \"1\";\n}\nelse\n{\n $f = 1;\n $g = $e[0];\n while(TRUE)\n {\n $h = 0;\n for($x = count($d) - 1; $x >= 0; $x--)\n {\n if(($d[$x] <= $g + 1) && ($e[$x] != $g))\n {\n $f++;\n $g = $e[$x];\n $h = 1;\n break;\n }\n }\n if($h == 0)\n {\n break;\n }\n elseif($g >= $a)\n {\n break;\n }\n }\n if($h == 1)\n {\n print $f;\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": " 1) || ($e[count($e) - 1] < $a))\n{\n print \"-1\";\n}\nelse\n{\n $f = 1;\n $g = $e[0];\n while(TRUE)\n {\n $h = 0;\n for($x = count($d) - 1; $x >= 0; $x--)\n {\n if(($d[$x] <= $g + 1) && ($e[$x] != $g))\n {\n $f++;\n $g = $e[$x];\n $h = 1;\n break;\n }\n }\n if($h == 0)\n {\n break;\n }\n elseif($g >= $a)\n {\n break;\n }\n }\n if($h == 1)\n {\n print $f;\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}], "src_uid": "001d8aca7c8421c3e54863f3fb706f0d"} {"source_code": " 0))\n {\n $d--;\n }\n else\n {\n $f .= $b[$x];\n }\n}\n$g = \"\";\nfor($x = 0; $x < $a; $x++)\n{\n if(($f[$x] == \"8\") && ($e > 0))\n {\n $e--;\n }\n else\n {\n $g .= $f[$x];\n }\n}\nif($g[0] == \"8\")\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "positive_code": [{"source_code": "= strlen($s)/2) {\n echo 'YES';\n } else {\n echo 'NO';\n }\n\n?>"}, {"source_code": " $sV){\n if($sV == '8'){\n $i++;\n } else {\n $j++;\n }\n}\nif($i >= $j){\n echo 'YES';\n} else {\n echo 'NO';\n}\n\n\n\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\n$n = $ir->readInt();\n$s = $ir->readString();\n\n$cnt = 0;\nfor ($i=0; $i<$n-10; $i++) {\n\tif ($s[$i] == '8') {\n\t\t$cnt++;\n\t} else {\n\t\t$cnt--;\n\t}\n}\n\nif ($cnt>0) {\n\techo 'YES';\n} else {\n\techo 'NO';\n}\n"}, {"source_code": " ($s1 - 11)/2) {\n echo 'YES';\n } else {\n echo 'NO';\n }\n \n \n\t \n?>"}, {"source_code": " $sV) {\n if($sV == 8){\n $i++;\n }\n if($i > $hod) {\n echo \"YES\";\n exit;\n }\n }\n echo \"NO\";\n?>"}, {"source_code": " 0 ? \"YES\" : \"NO\");"}], "negative_code": [{"source_code": "= $s1 - 11) {\n echo 'YES';\n } else {\n echo 'NO';\n }\n\t \n?>"}, {"source_code": " 1 && $fin - $start - 1 < $h) echo \"YES\"; else echo \"NO\";\n?>"}, {"source_code": "= $h && $c % 2 == 0) echo \"YES\"; else echo \"NO\";\n?>"}, {"source_code": "= $h && $c % 2 == 0) echo \"YES\"; else echo \"NO\";\n?>"}, {"source_code": "= $h) echo \"YES\"; else echo \"NO\";\n?>"}, {"source_code": " 0 ? \"YES\" : \"NO\");"}, {"source_code": " $sV){\n if($sV == '8'){\n $i++;\n }\n}\nif($i >= ($n - 11)/2){\n echo 'YES';\n} else {\n echo 'NO';\n}\n\n\n\n"}, {"source_code": "= ($s1 - 11)/2) {\n echo 'YES';\n } else {\n echo 'NO';\n }\n \n \n\t \n?>"}], "src_uid": "99f37936b243907bf4ac1822dc547a61"} {"source_code": " 0 && count($right) > 0){\n\t\tif($left[0] > $right[0]){\n\t\t\t$res[] = $right[0];\n\t\t\t$right = array_slice($right , 1);\n\t\t}else{\n\t\t\t$res[] = $left[0];\n\t\t\t$left = array_slice($left, 1);\n\t\t}\n\t}\n\twhile (count($left) > 0){\n\t\t$res[] = $left[0];\n\t\t$left = array_slice($left, 1);\n\t}\n\twhile (count($right) > 0){\n\t\t$res[] = $right[0];\n\t\t$right = array_slice($right, 1);\n\t}\n\treturn $res;\n}\n\n$a = explode(' ', $s);\n$sorted = merge_sort($a);\nif (array_sum($sorted)/$sorted[0] == 2 * $n) {\n echo '-1';\n} else {\n echo implode(' ', $sorted);\n}\n", "positive_code": [{"source_code": " $number) {\n $numbers[$key] = $number + 0;\n}\nsort($numbers, SORT_NUMERIC);\n$check = $numbers[0];\n$check_flg = false;\nforeach ($numbers as $number) {\n if ($check != $number) {\n $check_flg = true;\n break;\n }\n}\nif ($check_flg) {\n foreach ($numbers as $number) {\n echo \"$number \";\n }\n} else {\n echo \"-1\";\n}"}, {"source_code": " $sV) {\n if(empty($arr)){\n for($c = $n; $c <= 2*$n; $c++){\n if (isset($m[$c])){\n if($sV != $m[$c]){\n $arr[0] = $sK;\n $arr[1] = $c;\n break;\n }\n }\n }\n }\n if ($sK < $n) {\n $q += $sV;\n } \n if ($sK >= $n){\n $e += $sV;\n }\n }\n if ($q != $e) {\n foreach($m as $sk => $sv) {\n echo $sv.' ';\n }\n } else {\n if(empty($arr)){\n echo '-1';\n } else {\n $v = $m[$arr[0]];\n $m[$arr[0]] = $m[$arr[1]];\n $m[$arr[1]] = $v; \n foreach($m as $sk1 => $sv1) {\n echo $sv1.' ';\n }\n }\n }\n \n"}, {"source_code": ""}, {"source_code": " 0,\n \"sum\" => 0,\n \"numbers\" => [],\n \"count\" => 0\n \n];\n$right = [\n \"sum\" => 0,\n \"numbers\" => [],\n \"count\" => 0\n];\nforeach ($numbers as $number) {\n $number += 0;\n if (!$left[\"sum\"]) {\n $left[\"max\"] = $number;\n $left[\"sum\"] = $number;\n array_push($left[\"numbers\"], $number);\n $left[\"count\"]++;\n continue;\n }\n\n if (!$right[\"sum\"]) {\n $right[\"sum\"] = $number;\n array_push($right[\"numbers\"], $number);\n $right[\"count\"]++;\n continue;\n }\n\n if (($number >= $left[\"max\"] || $right[\"count\"] == $n ) && $left[\"count\"] < $n) {\n $left[\"max\"] = $number;\n $left[\"sum\"] += $number;\n array_push($left[\"numbers\"], $number);\n $left[\"count\"]++;\n } else {\n $right[\"sum\"] += $number;\n array_push($right[\"numbers\"], $number);\n $right[\"count\"]++;\n }\n\n}\n\nif ($left[\"sum\"] == $right[\"sum\"]) {\n echo \"-1\";\n} else {\n foreach($left[\"numbers\"] as $number) {\n echo \"$number \";\n }\n foreach($right[\"numbers\"] as $number) {\n echo \"$number \";\n }\n}\n"}], "src_uid": "1f4c057dff45f229b4dca49cd4e0438d"} {"source_code": " &$sV){\n\n if($sV == $aArray[$sV - 1]){\n $k[] = $sV;\n } elseif($sV < $aArray[$sV - 1] && $b){\n $k[] = $aArray[$sV - 1];\n $g = true;\n } else {\n if ($g){\n $b = false;\n }\n $k[] = $sV;\n }\n}\necho implode('',$k);\n\n", "positive_code": [{"source_code": " $b[$x])\n {\n $b[$x] = $c[$b[$x] - 1];\n $d = 1;\n }\n elseif(($c[$b[$x] - 1] < $b[$x]) && ($d == 1))\n {\n break;\n }\n}\nprint implode($b);\n?>"}, {"source_code": " $v) {\n if ($v == $f[$v-1]) {\n $s.= $v;\n } else if ($b && $f[$v-1] > $v) {\n $s.= $f[$v-1];\n $g = true;\n } else {\n if ($g) {\n $b = false;\n }\n $s.= $v;\n }\n }\n echo $s;\n?>"}], "negative_code": [{"source_code": " $b[$x])\n {\n if($d == 0)\n {\n $d = $b[$x];\n $b[$x] = $c[$b[$x] - 1];\n }\n elseif($b[$x] == $d)\n {\n $b[$x] = $c[$b[$x] - 1];\n }\n }\n}\nprint implode($b);\n?>"}, {"source_code": " $b[$x])\n {\n $b[$x] = $c[$b[$x] - 1];\n }\n}\nprint implode($b);\n?>"}, {"source_code": "= $b[$x])\n {\n $b[$x] = $c[$b[$x] - 1];\n $d = 1;\n }\n elseif($d == 1)\n {\n break;\n }\n}\nprint implode($b);\n?>"}, {"source_code": " $b[$x])\n {\n $b[$x] = $c[$b[$x] - 1];\n break;\n }\n}\nprint implode($b);\n?>"}, {"source_code": " &$sV){\n\n if($sV == $aArray[$sV - 1] && !$bFlag){\n $k[] = $sV;\n } elseif($sV < $aArray[$sV - 1] && !$bFlag){\n $k[] = $aArray[$sV - 1];\n } else {\n $k[] = $sV;\n $bFlag = true;\n }\n}\necho implode('',$k);\n\n"}, {"source_code": " &$sV){\n// if($sV < $aArray[$sV - 1]){\n// $k[] = $aArray[$sV - 1];\n// } else {\n// $k[] = $sV;\n// }\n//}\n\n$iA = strlen($a) < 50 ? $a : 50;\nfor($i = 0; $i < $iA; $i++){\n if($a[$i] < $aArray[$a[$i]- 1]){\n $a[$i] = $aArray[$a[$i]- 1];\n }\n}\necho $a;\n//var_dump($k);\n\n"}, {"source_code": " &$sV){\n if($sV < $aArray[$sV - 1]){\n $k[] = $aArray[$sV - 1];\n } else {\n $k[] = $sV;\n }\n}\necho implode('',$k);\n\n"}, {"source_code": " $v) {\n if ($b && $f[$v-1] > $v) {\n $s.= $f[$v-1];\n } else {\n if (!empty($s)) {\n $b = false;\n }\n $s.= $v;\n }\n }\n echo $s;\n?>"}, {"source_code": " $v) {\n if ($b && $f[$v-1] >= $v) {\n $s.= $f[$v-1];\n } else {\n if (!empty($s)) {\n $b = false;\n }\n $s.= $v;\n }\n }\n echo $s;\n?>"}, {"source_code": " $v) {\n $s.= $f[$v-1];\n } else {\n if (!empty($s)) {\n $b = false;\n }\n $s.= $v;\n }\n }\n echo $s;\n?>"}, {"source_code": ""}, {"source_code": " $v) {\n if ($b && $f[$v-1] > $v) {\n $s.= $f[$v-1];\n $g = true;\n } else {\n if ($g) {\n $b = false;\n }\n $s.= $v;\n }\n }\n echo $s;\n?>"}, {"source_code": " $v) {\n $s.= $f[$v-1];\n } else {\n $s.= $v;\n }\n }\n echo $s;\n?>"}, {"source_code": " $b[$x])\n {\n $b[$x] = $c[$b[$x] - 1];\n }\n}\nprint implode($b);\n?>"}, {"source_code": " $b[$x])\n {\n $b[$x] = $c[$b[$x] - 1];\n $d = 1;\n }\n elseif($d == 1)\n {\n break;\n }\n}\nprint implode($b);\n?>"}], "src_uid": "378a9ab7ad891d60f23645106d24f314"} {"source_code": " $cur) {\n\tif ($cur < $prev) {\n\t\tif ($slicePos) {\n\t\t\techo -1;\n\t\t\texit();\n\t\t} else {\n\t\t\t$slicePos = $pos;\n\t\t}\n\t}\n\n\t$prev = $cur;\n}\n\nif ($slicePos) {\n\tif ($seq[0] >= $seq[$num - 1]) {\n\t\techo $num - $slicePos;\n\t} else {\n\t\techo -1;\n\t}\n} else {\n\techo 0;\n}\n", "positive_code": [{"source_code": " 0 && ($finding[$i - 1] == $finding[$i] - 1)) {\n array_push($groups[count($groups) - 1], $finding[$i]);\n } else { // First value or no match, create a new group\n array_push($groups, array($finding[$i]));\n }\n }\n\n if (count($groups) > 2) {\n echo -1;\n } elseif (count($groups) == 2) {\n if (in_array(0, $groups[0]) && in_array($n - 1, $groups[1])) {\n $key = max($groups[0]) + 1;\n $go = TRUE;\n } else {\n echo -1;\n }\n } else {\n $lastone = end($finding);\n if ($lastone + 1 == $n) {\n $key = 0;\n $go = TRUE;\n } else {\n $key = $lastone + 1;\n $go = TRUE;\n }\n }\n if ($go == TRUE) {\n $next = $array[$key];\n if ($next !== min($array)) {\n echo -1;\n } else {\n $clone = $array;\n sort($clone);\n $splice = array_splice($clone, 0, $n - $key);\n $frankenstein = array_merge($clone, $splice);\n if ($array === $frankenstein) {\n if ($key == 0) {\n echo 0;\n } else {\n echo $n - $key;\n }\n } else {\n echo -1;\n }\n }\n }\n}\n?>"}, {"source_code": "$g[$i+1] && $i!=$n-1){\n $c++;\n if($g[$n-1]<=$g[0])$x=$n-($i+1);\n }\n}\nif($c==1 && $x!=0)echo $x;\nelseif($c==0)echo \"0\";\nelse echo \"-1\";\n?>"}, {"source_code": "= $b[0]))\n{\n print \"0\";\n}\nelse\n{\n $c = 0;\n $d = 0;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($b[$x + 1] >= $b[$x])\n {\n $c++;\n }\n else\n {\n $d++;\n $e = $x;\n }\n }\n if($d == 0)\n {\n print \"0\";\n }\n elseif(($d == 1) && ($b[0] >= $b[$a - 1]))\n {\n print $a - $e - 1;\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": " 0 && ($finding[$i - 1] == $finding[$i] - 1)) {\n array_push($groups[count($groups) - 1], $finding[$i]);\n } else { // First value or no match, create a new group\n array_push($groups, array($finding[$i]));\n }\n }\n\n if (count($groups) > 2) {\n echo -1;\n } elseif (count($groups) == 2) {\n if (in_array(0, $groups[0]) && in_array($n - 1, $groups[1])) {\n $key = max($groups[0]) + 1;\n $go = TRUE;\n } else {\n echo -1;\n }\n } else {\n $lastone = end($finding);\n if ($lastone + 1 == $n) {\n $key = 0;\n $go = TRUE;\n } else {\n $key = $lastone + 1;\n $go = TRUE;\n }\n }\n if ($go == TRUE) {\n $next = $array[$key];\n if ($next !== min($array)) {\n echo -1;\n } else {\n $clone = $array;\n sort($clone);\n $splice = array_splice($clone, 0, $n - $key);\n $frankenstein = array_merge($clone, $splice);\n if ($array === $frankenstein) {\n if ($key == 0) {\n echo 0;\n } else {\n echo $n - $key;\n }\n } else {\n echo -1;\n }\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " $cur) {\n\tif ($cur < $prev) {\n\t\tif (!$slicePos) {\n\t\t\t$slicePos = $pos;\n\t\t} else {\n\t\t\techo -1;\n\t\t\texit();\n\t\t}\n\t}\n\n\t$prev = $cur;\n}\n\nif ($slicePos) {\n\tif ($seq[0] >= $seq[$num - 1]) {\n\t\techo $num - $slicePos;\n\t} else {\n\t\techo -1;\n\t}\n} else {\n\techo 0;\n}\n"}, {"source_code": " $num,\n 'numbers' => $seq,\n];\n\nfor ($prev = end($input['numbers']), $current = reset($input['numbers']), $spokes = 0, $position = -1; false !== $current; $prev = $current, $current = next($input['numbers'])) {\n\tif ($prev > $current) {\n\t\t$position = key($input['numbers']);\n\t\t++$spokes;\n\t}\n}\n\nif (1 != $spokes) {\n\t$iterations = -1;\n} else {\n\t$iterations = 0 == $position ? 0 : $input['count'] - $position;\n}\n\necho $iterations . \"\\n\";"}, {"source_code": " $seq,\n];\n\nfor ($prev = end($input['numbers']), $current = reset($input['numbers']), $spokes = 0, $position = -1; false !== $current; $prev = $current, $current = next($input['numbers'])) {\n\tif ($prev > $current) {\n\t\t$position = key($input['numbers']);\n\t\t++$spokes;\n\t}\n}\n\nif (1 != $spokes) {\n\t$iterations = -1;\n} else {\n\t$iterations = 0 == $position ? 0 : $input['count'] - $position;\n}\n\necho $iterations . \"\\n\";"}, {"source_code": " $cur) {\n\tif ($cur < $prev) {\n\t\tif (!$slicePos) {\n\t\t\t$slicePos = $pos;\n\t\t} else {\n\t\t\techo -1;\n\t\t\texit();\n\t\t}\n\t}\n\n\t$prev = $cur;\n}\n\nif ($slicePos) {\n\tif ($seq[0] >= $seq[$num - 1]) {\n\t\techo $num - $slicePos;\n\t} else {\n\t\techo -1;\n\t}\n} else {\n\techo 0;\n}\n"}, {"source_code": " $cur) {\n\tif ($cur < $prev) {\n\t\tif (!$slicePos) {\n\t\t\t$slicePos = $pos;\n\t\t} else {\n\t\t\techo -1;\n\t\t\texit();\n\t\t}\n\t}\n\n\t$prev = $cur;\n}\n\nif ($slicePos) {\n\tif ($seq[0] > $seq[$num - 1]) {\n\t\techo $num - $slicePos;\n\t} else {\n\t\techo -1;\n\t}\n} else {\n\techo 0;\n}\n"}, {"source_code": " $cur) {\n\tif ($cur < $prev) {\n\t\tif ($slicePos) {\n\t\t\tif ($isDebug) {\n\t\t\t\techo $slicePos . ' | ';\n\t\t\t}\n\t\t\techo -1;\n\t\t\texit();\n\t\t} else {\n\t\t\t$slicePos = $pos;\n\t\t}\n\t}\n\n\t$prev = $cur;\n}\n\nif ($slicePos) {\n\tif ($seq[0] >= $seq[$num - 1]) {\n\t\techo $num - $slicePos;\n\t} else {\n\t\tif ($isDebug) {\n\t\t\techo $slicePos . ' | ' . $seq[0] . ' | ' . $seq[$num - 1] . ' | ';\n\t\t}\n\t\techo -1;\n\t}\n} else {\n\techo 0;\n}\n"}, {"source_code": "$g[$i+1] && $i!=$n-1){\n $c++;\n if($g[$n-1]<$g[0])$x=$n-($i+1);\n }\n}\nif($c==1 && $x!=0)echo $x;\nelseif($c==0)echo \"0\";\nelse echo \"-1\";\n?>"}, {"source_code": "$g[$i+1] && $g[$i]!=$g[$n-1]){\n $c++;\n if($g[$n-1]<$g[0])$x=$n-($i+1);\n }\n}\nif($c==1 && $x!=0)echo $x;\nelseif($c==0)echo \"0\";\nelse echo \"-1\";\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c647e36495fb931ac72702a12c6bfe58"} {"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\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 $current) {\n $min = $current;\n }\n }\n\n $answers[] = $min;\n}\n\nforeach ($answers as $item) {\n echo $item . PHP_EOL;\n}\n"}], "negative_code": [{"source_code": " $current) {\n $min = $current;\n }\n }\n\n $answers[] = $min;\n}\n\nforeach ($answers as $item) {\n echo $item . PHP_EOL;\n}\n"}, {"source_code": " $k ? 0 : $bMax\r\n \r\n if($bMax > $k) {\r\n $ans = 0;\r\n } else {\r\n $ans = $k - $bMax;\r\n if($ans > $n - $count) {\r\n $ans = $n - $count;\r\n }\r\n }\r\n \r\n \r\n \r\n IO::pr($ans);\r\n \r\n \r\n \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 $n - 1 - $k) {\r\n break;\r\n }\r\n }\r\n } else {\r\n if($i <= $n-$k + $temp) {\r\n if($temp > 0) {\r\n $ans++;\r\n $temp++;\r\n if($temp == $k) {\r\n $temp = 0;\r\n } \r\n } \r\n } else {\r\n break;\r\n } \r\n \r\n \r\n }\r\n }\r\n }\r\n \r\n \r\n IO::pr($ans);\r\n \r\n \r\n \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 "}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "4cacec219e4577b255ddf6d39d308e10"} {"source_code": "= $l) {\n $l = $x+1;\n }\n }\n}\n\n$razn = $r - $l + 1;\nif ($razn <= 0) {\n echo \"-1\\n\";\n} else {\n echo \"$razn\\n\";\n}\n\nexit;\n", "positive_code": [{"source_code": "= $j[$x])\n {\n $l = 1;\n break;\n }\n }\n if($l == 1)\n {\n break;\n }\n}\nif((count($c) == 0) || ($l == 1))\n{\n print \"-1\";\n}\nelse\n{\n print count($c);\n}\n?>"}], "negative_code": [{"source_code": ""}], "src_uid": "dabeb9852332f6a6e730acab7fe61a5c"} {"source_code": "= 0; $x--)\n{\n if(($b[$x] == 0) && ($c == 0))\n {\n $c++;\n }\n if(($b[$x] == 1) && ($c == 1))\n {\n print $x + 1;\n break;\n }\n if(($b[$x] == 1) && ($d == 0))\n {\n $d++;\n }\n if(($b[$x] == 0) && ($d == 1))\n {\n print $x + 1;\n break;\n }\n}\n?>", "positive_code": [{"source_code": "=0; $i--)\n\tif($door[$i] == $x)\n\t{\n\t\techo $i+1;\n\t die();\n\t}"}, {"source_code": " 12)\n {\n if($b[1] == 0)\n {\n $b[0] = 1;\n }\n else\n {\n $b[0] = 0;\n }\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b > 23)\n {\n $b[0] = 0;\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>", "positive_code": [{"source_code": " 2) {\n $h_1 = 1;\n }\n elseif ($h_1==2) {\n if ($h_2 > 3) {\n $h_2 = 2;\n }\n }\n }\n return $h_1.$h_2;\n}\n\nfunction correct_minutes()\n{\n global $minutes;\n $m_1 = $minutes[0];\n $m_2 = $minutes[1];\n \n if ($m_1 > 5) {\n $m_1 = 3;\n }\n return $m_1.$m_2;\n}\n\n$out_hours = correct_hours();\n$out_minutes = correct_minutes();\necho $out_hours.':'.$out_minutes;"}, {"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 diffCnt($baseTime, $time) {\n\t$return = 0;\n\tfor ($i = 0; $i < 5; $i++) {\n\t\tif ($baseTime[$i] != $time[$i]) {\n\t\t\t$return++;\n\t\t}\n\t}\n\treturn $return;\n}\n\nfunction getAnswer($is_test = false, $f = false) {\n\t$stream = STDIN;\n\tif ($is_test)\n\t\t$stream = $f;\n\t/* begin body */\n\t$format = readNum($stream);\n\t$baseTime = readString($stream);\n\t$answer = array(\n\t\t'res' => '',\n\t\t'diff' => 55,\n\t);\n\t$minHour = 0;\n\t$maxHour = 23;\n\tif ($format == 12) {\n\t\t$minHour = 1;\n\t\t$maxHour = 12;\n\t}\n\tfor ($hour = $minHour; $hour <= $maxHour; $hour++) {\n\t\tfor ($minute = 0; $minute < 60; $minute++) {\n\t\t\t$checkHour = $hour;\n\t\t\twhile (strlen($checkHour) < 2)\n\t\t\t\t$checkHour = '0' . $checkHour;\n\t\t\t$checkMinute = $minute;\n\t\t\twhile (strlen($checkMinute) < 2)\n\t\t\t\t$checkMinute = '0' . $checkMinute;\n\t\t\t$checkTime = \"{$checkHour}:{$checkMinute}\";\n\t\t\t\n\t\t\t$diff = diffCnt($baseTime, $checkTime);\n\t\t\tif ($diff < $answer['diff']) {\n\t\t\t\t$answer['diff'] = $diff;\n\t\t\t\t$answer['res'] = $checkTime;\n\t\t\t}\n\t\t}\n\t}\n\techo $answer['res'];\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": "12)\n\t\tif($hh{0}>1)\n\t\t\tif($hh{1}>2) $l[0]='0';\n\t\t\telse $l[0]='1';\n\t\telse $l[1]='1';\n\tif($hh<1)\n\t\t$l[1]='1';\n}else\n\tif($hh>23) $l[0]='0';\nif($mm>59)\n\t$l[3]='0';\nfwrite(STDOUT,implode('',$l));\n?>"}], "negative_code": [{"source_code": " 2))\n {\n $b[1] = 1;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[0] > 3)\n {\n $b[0] = 0;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 2)\n {\n $b[1] = 1;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[0] > 3)\n {\n $b[0] = 0;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[0] > 3)\n {\n $b[0] = 0;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 2))\n {\n $b[1] = 1;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[0] > 3)\n {\n $b[0] = 0;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 12))\n {\n if($b == 0)\n {\n $b[0] = 0;\n $b[1] = 1;\n }\n elseif($b > 12)\n {\n $b[0] = 1;\n }\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b > 23)\n {\n if($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[1] > 3)\n {\n $b[1] = 0;\n }\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 12)\n {\n $b[0] = 0;\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b > 23)\n {\n $b[0] = 0;\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 12))\n {\n if($b == 0)\n {\n $b[0] = 0;\n $b[1] = 1;\n }\n elseif($b > 12)\n {\n $b[0] = 0;\n }\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b > 23)\n {\n if($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[1] > 3)\n {\n $b[1] = 0;\n }\n }\n if($c > 59)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[0] > 3)\n {\n $b[0] = 0;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": " 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\nelseif($a == 24)\n{\n if(($b[0] > 2) && ($b[1] > 3))\n {\n $b[0] = 0;\n $b[1] = 0;\n }\n elseif($b[0] > 2)\n {\n $b[0] = 0;\n }\n elseif($b[0] > 3)\n {\n $b[0] = 0;\n }\n if($c[0] > 5)\n {\n $c[0] = 0;\n }\n print $b . \":\" . $c;\n}\n?>"}, {"source_code": "12)\n\t\tif($hh{0}>1){\n\t\t\tif($hh{1}>0) $l[0]='0';\n\t\t\telse $l[0]='1';\n\t\t}else $l[1]='2';\n}else\n\tif($hh>23) $l[0]='0';\nif($mm>59)\n\t$l[3]='0';\nfwrite(STDOUT,implode('',$l));\nfwrite(STDOUT,PHP_EOL.'Press \"Enter\" to exit...'); exit(fgets(STDIN)); //\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\n?>"}, {"source_code": "12)\n\t\tif($hh{1}>0) $l[0]='0';\n\t\telse $l[1]='1';\n\tif($hh<1)\n\t\t$l[1]='1';\n}else\n\tif($hh>23) $l[0]='0';\nif($mm>59)\n\t$l[3]='0';\nfwrite(STDOUT,implode('',$l));\n?>"}, {"source_code": "12)\n\t\tif($hh{0}>1) $l[0]='0';\n\t\telse $l[1]='1';\n\tif($hh<1)\n\t\t$l[1]='1';\n}else\n\tif($hh>23) $l[0]='0';\nif($mm>59)\n\t$l[3]='0';\nfwrite(STDOUT,implode('',$l));\n?>"}, {"source_code": "12)\n\t\tif($hh{1}>0) $l[0]='0';\n\t\telse $l[1]='1';\n}else\n\tif($hh>23) $l[0]='0';\nif($mm>59)\n\t$l[3]='0';\nfwrite(STDOUT,implode('',$l));\n?>"}, {"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 diffCnt($baseTime, $time) {\n\t$return = 0;\n\tfor ($i = 0; $i < 5; $i++) {\n\t\tif ($baseTime[$i] != $time[$i]) {\n\t\t\t$return++;\n\t\t}\n\t}\n\treturn $return;\n}\n\nfunction getAnswer($is_test = false, $f = false) {\n\t$stream = STDIN;\n\tif ($is_test)\n\t\t$stream = $f;\n\t/* begin body */\n\t$format = readNum($stream);\n\t$baseTime = readString($stream);\n\t$answer = array(\n\t\t'res' => '',\n\t\t'diff' => 55,\n\t);\n\t$minHour = 0;\n\t$maxHour = 23;\n\tif ($format == 12) {\n\t\t$minHour = 1;\n\t\t$maxHour = 12;\n\t}\n\tfor ($hour = $minHour; $hour < $maxHour; $hour++) {\n\t\tfor ($minute = 0; $minute < 60; $minute++) {\n\t\t\t$checkHour = $hour;\n\t\t\twhile (strlen($checkHour) < 2)\n\t\t\t\t$checkHour = '0' . $checkHour;\n\t\t\t$checkMinute = $minute;\n\t\t\twhile (strlen($checkMinute) < 2)\n\t\t\t\t$checkMinute = '0' . $checkMinute;\n\t\t\t$checkTime = \"{$checkHour}:{$checkMinute}\";\n\t\t\t$diff = diffCnt($baseTime, $checkTime);\n\t\t\tif ($diff < $answer['diff']) {\n\t\t\t\t$answer['diff'] = $diff;\n\t\t\t\t$answer['res'] = $checkTime;\n\t\t\t}\n\t\t}\n\t}\n\techo $answer['res'];\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\t$stream = STDIN;\n\tif ($is_test)\n\t\t$stream = $f;\n\t/* begin body */\n\t$format = readNum($stream);\n\t$time = readString($stream);\n\tlist($hour, $minute) = explode(':', $time);\n\tif ($minute >= 60) {\n\t\t$minute = '0' . ($minute % 10);\n\t}\n\tif ($format == 24) {\n\t\tif ($hour >= 24) {\n\t\t\t$hour = '0' . ($hour % 10);\n\t\t}\n\t} else {\n\t\tif ($hour > 12) {\n\t\t\t$hour = '0' . ($hour % 10);\n\t\t}\n\t\tif ($hour == '00') {\n\t\t\t$hour = '01';\n\t\t}\n\t}\n\techo \"{$hour}:{$minute}\";\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\t$stream = STDIN;\n\tif ($is_test)\n\t\t$stream = $f;\n\t/* begin body */\n\t$format = readNum($stream);\n\t$time = readString($stream);\n\tlist($hour, $minute) = explode(':', $time);\n\tif ($minute >= 60) {\n\t\t$minute = '0' . ($minute % 10);\n\t}\n\tif ($format == 24) {\n\t\tif ($hour >= 24) {\n\t\t\t$hour = '0' . ($hour % 10);\n\t\t}\n\t} else {\n\t\tif ($hour >= 12) {\n\t\t\t$hour = '0' . ($hour % 10);\n\t\t}\n\t\tif ($hour == '00') {\n\t\t\t$hour = '01';\n\t\t}\n\t}\n\techo \"{$hour}:{$minute}\";\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\t$stream = STDIN;\n\tif ($is_test)\n\t\t$stream = $f;\n\t\n\t\n\t/* begin body */\n\t$type = readNum($stream);\n\t$baseTime = readString($stream);\n\t\n $clock = explode(\":\", $baseTime);\n $hour = $clock[0];\n $minutes = $clock[1];\n if ($minutes >= 60) {\n $minutes -= 60;\n $hour + 1;\n }\n if ($minutes < 10) {\n $minutes = '0' . $minutes;\n }\n if ($type == 12) {\n $hour %= $type;\n if ($hour < 10) {\n echo '0' . $hour . \":\" . $minutes;\n }\n }\n if ($type == 24) {\n $hour %= $type;\n if ($hour < 10) {\n echo '0' . $hour . \":\" . $minutes;\n }\n }\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "src_uid": "88d56c1e3a7ffa94354ce0c70d8e958f"} {"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\n$smax = 0;\n$dmax = 0;\n$wmin = 0;\nfor ($i=0; $i<$n; $i++) {\n\tlist($q, $a, $b) = $ir->readArrayOfString(3);\n\t$a = (int)$a;\n\t$b = (int)$b;\n\t//echo \"============ $q $a $b\\n\";\n\tif ($q=='+') {\n\t\t$smax = max([$smax, $a*$b]);\n\t\t$dmax = max([$dmax, $a, $b]);\n\t\t$wmin = max([$wmin, min([$a, $b])]);\n\t\t//echo \"SM $smax : DM $dmax\\n\";\n\t} else {\n\t\t$s = $a*$b;\n\t\t$d = $a>$b ? $a : $b;\n\t\t$w = $a>$b ? $b : $a;\n\t\t//echo \"S $s : D $d\\n\";\n\t\tif ($s>=$smax && $d>=$dmax && $w>=$wmin) {\n\t\t\techo \"YES\\n\";\n\t\t} else {\n\t\t\techo \"NO\\n\";\n\t\t}\n\t\tflush();\n\t}\n}\n", "positive_code": [{"source_code": " $b)\n {\n $b = $e;\n }\n if($f > $c)\n {\n $c = $f;\n }\n }\n else\n {\n if($f > $b)\n {\n $b = $f;\n }\n if($e > $c)\n {\n $c = $e;\n }\n }\n }\n elseif($d == \"?\")\n {\n if($e > $f)\n {\n if(($c <= $e) && ($b <= $f))\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n if(($b <= $e) && ($c <= $f))\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " $b)\n {\n $b = $e;\n }\n if($e > $c)\n {\n $c = $e;\n }\n }\n else\n {\n if($f > $b)\n {\n $b = $f;\n }\n if($e > $c)\n {\n $c = $e;\n }\n }\n }\n elseif($d == \"?\")\n {\n if($e > $f)\n {\n if(($c <= $e) && ($b <= $f))\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n else\n {\n if(($b <= $e) && ($c <= $f))\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n }\n}\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\n$n = $ir->readInt();\n\n$smax = 0;\n$dmax = 0;\n$wmax = 0;\nfor ($i=0; $i<$n; $i++) {\n\tlist($q, $a, $b) = $ir->readArrayOfString(3);\n\t$a = (int)$a;\n\t$b = (int)$b;\n\t//echo \"============ $q $a $b\\n\";\n\tif ($q=='+') {\n\t\t$smax = max([$smax, $a*$b]);\n\t\t$dmax = max([$dmax, $a, $b]);\n\t\t$wmin = max([$wmax, intval($smax/$dmax)]);\n\t\t//echo \"SM $smax : DM $dmax\\n\";\n\t} else {\n\t\t$s = $a*$b;\n\t\t$d = $a>$b ? $a : $b;\n\t\t$w = $a>$b ? $b : $a;\n\t\t//echo \"S $s : D $d\\n\";\n\t\tif ($s>=$smax && $d>=$dmax && $w>=$wmin) {\n\t\t\techo \"YES\\n\";\n\t\t} else {\n\t\t\techo \"NO\\n\";\n\t\t}\n\t\tflush();\n\t}\n}\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\n$n = $ir->readInt();\n\n$smax = 0;\n$dmax = 0;\n$wmax = 0;\nfor ($i=0; $i<=$n; $i++) {\n\tlist($q, $a, $b) = $ir->readArrayOfString(3);\n\t$a = (int)$a;\n\t$b = (int)$b;\n\t//echo \"============ $q $a $b\\n\";\n\tif ($q=='+') {\n\t\t$smax = max([$smax, $a*$b]);\n\t\t$dmax = max([$dmax, $a, $b]);\n\t\t$wmin = max([$wmax, intval($smax/$dmax)]);\n\t\t//echo \"SM $smax : DM $dmax\\n\";\n\t} else {\n\t\t$s = $a*$b;\n\t\t$d = $a>$b ? $a : $b;\n\t\t$w = $a>$b ? $b : $a;\n\t\t//echo \"S $s : D $d\\n\";\n\t\tif ($s>=$smax && $d>=$dmax && $w>=$wmin) {\n\t\t\techo \"YES\\n\";\n\t\t} else {\n\t\t\techo \"NO\\n\";\n\t\t}\n\t\tflush();\n\t}\n}\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\n$n = $ir->readInt();\n\n$smax = 0;\n$dmax = 0;\n$wmax = 0;\nfor ($i=0; $i<$n; $i++) {\n\tlist($q, $a, $b) = $ir->readArrayOfString(3);\n\t$a = (int)$a;\n\t$b = (int)$b;\n\t//echo \"============ $q $a $b\\n\";\n\tif ($q=='+') {\n\t\t$smax = max([$smax, $a*$b]);\n\t\t$dmin = max([$dmax, max([$a, $b])]);\n\t\t$wmin = max([$wmax, min([$a, $b])]);\n\t\t//echo \"SM $smax : DM $dmax\\n\";\n\t} else {\n\t\t$s = $a*$b;\n\t\t$d = $a>$b ? $a : $b;\n\t\t$w = $a>$b ? $b : $a;\n\t\t//echo \"S $s : D $d\\n\";\n\t\tif ($s>=$smax && $d>=$dmin && $w>=$wmin) {\n\t\t\techo \"YES\\n\";\n\t\t} else {\n\t\t\techo \"NO\\n\";\n\t\t}\n\t\tflush();\n\t}\n}\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\n$n = $ir->readInt();\n\n$smax = 0;\n$dmax = 0;\n$wmax = 0;\nfor ($i=0; $i<$n; $i++) {\n\tlist($q, $a, $b) = $ir->readArrayOfString(3);\n\t$a = (int)$a;\n\t$b = (int)$b;\n\t//echo \"============ $q $a $b\\n\";\n\tif ($q=='+') {\n\t\t$smax = max([$smax, $a*$b]);\n\t\t$dmax = max([$dmax, $a, $b]);\n\t\t$wmin = max([$wmax, min([$a, $b])]);\n\t\t//echo \"SM $smax : DM $dmax\\n\";\n\t} else {\n\t\t$s = $a*$b;\n\t\t$d = $a>$b ? $a : $b;\n\t\t$w = $a>$b ? $b : $a;\n\t\t//echo \"S $s : D $d\\n\";\n\t\tif ($s>=$smax && $d>=$dmax && $w>=$wmin) {\n\t\t\techo \"YES\\n\";\n\t\t} else {\n\t\t\techo \"NO\\n\";\n\t\t}\n\t\tflush();\n\t}\n}\n"}], "src_uid": "fe939f7503f928ff4dbe8d05c5643f38"} {"source_code": "=$twoz)\n {\n $cizi+=$twoz;\n $onez-=$twoz;\n $twoz=0;\n }\n else if($twoz>$onez)\n {\n $cizi+=$onez;\n $twoz-=$onez;\n $onez=0;\n }\n if($onez>=3) $cizi+=floor($onez/3);\n else if($twoz>=3) $cizi+=floor($twoz/3);\n\n echo $zeroz+$cizi. PHP_EOL;\n}", "positive_code": [{"source_code": " 0, 1 => 0, 2 => 0];\n foreach ($nums as $num) {\n $map[$num % 3]++;\n }\n\n $min = min($map[1], $map[2]);\n $map[1] -= $min;\n $map[2] -= $min;\n\n $res[] = $map[0] + $min + floor($map[1] / 3)+ floor($map[2] / 3);\n}\n\necho join(PHP_EOL, $res), PHP_EOL;\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1) {\n $item = array_pop($arr);\n foreach ($arr as $i => $value) {\n if (($item + $value) % 3 === 0) {\n $item = null;\n $amount++;\n unset($arr[$i]);\n break;\n }\n }\n sort($arr);\n if ($item !== null) {\n $arr[0] += $item;\n sort($arr);\n }\n }\n\n echo $amount . PHP_EOL;\n}\n"}, {"source_code": "=$twoz)\n {\n $cizi+=$twoz;\n $onez-=$twoz;\n $twoz=0;\n }\n else if($twoz>$onez)\n {\n $cizi+=$onez;\n $twoz-=$onez;\n $onez=0;\n }\n if($onez>=3) $cizi+=$onez/3;\n else if($twoz>=3) $cizi+=$twoz/3;\n\n echo $zeroz+$cizi. PHP_EOL;\n}"}], "src_uid": "e59cddb6c941b1d7556ee9c020701007"} {"source_code": " 0, P => 0, S => 0);\n for($y = 0; $y < $b; $y++)\n {\n $e[$d[$y]]++;\n }\n $f = 0;\n $f += min($c[0], $e[S]);\n $g[R] = $c[0];\n $f += min($c[1], $e[R]);\n $g[P] = $c[1];\n $f += min($c[2], $e[P]);\n $g[S] = $c[2];\n if($f >= ceil($b / 2))\n {\n print \"YES\\n\";\n $j = \"\";\n $h = array();\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"R\")\n {\n if($g[P] > 0)\n {\n $j .= \"P\";\n $g[P]--;\n $h[$y] = 1;\n }\n else\n {\n $j .= \"R\";\n $h[$y] = 0;\n }\n }\n elseif($d[$y] == \"P\")\n {\n if($g[S] > 0)\n {\n $j .= \"S\";\n $g[S]--;\n $h[$y] = 1;\n }\n else\n {\n $j .= \"P\";\n $h[$y] = 0;\n }\n }\n elseif($d[$y] == \"S\")\n {\n if($g[R] > 0)\n {\n $j .= \"R\";\n $g[R]--;\n $h[$y] = 1;\n }\n else\n {\n $j .= \"S\";\n $h[$y] = 0;\n }\n }\n }\n for($y = 0; $y < $b; $y++)\n {\n if(($g[R] > 0) && ($h[$y] == 0))\n {\n $j[$y] = R;\n $g[R]--;\n }\n elseif(($g[P] > 0) && ($h[$y] == 0))\n {\n $j[$y] = P;\n $g[P]--;\n }\n elseif(($g[S] > 0) && ($h[$y] == 0))\n {\n $j[$y] = S;\n $g[S]--;\n }\n }\n print $j . \"\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " 'S',\n 'P' => 'R',\n 'S' => 'P',\n];\n\n\n$back_map = array_flip($map);\n\nfor ($i = 0; $i < $n1; $i++) {\n\n $n = intval(trim(fgets($__fp)));\n\n list($r, $p, $s) = explode(' ', trim(fgets($__fp)));\n $tries = [\n 'R' => $r,\n 'P' => $p,\n 'S' => $s\n ];\n\n $moves = str_split(trim(fgets($__fp)));\n\n\n $success = 0;\n $seq = [];\n\n foreach ($moves as $q) {\n\n $k = $back_map[$q];\n if ($tries[$k] > 0) {\n $tries[$k]--;\n $success++;\n $seq[] = $back_map[$q];\n } else {\n $seq[] = null;\n }\n }\n\n if ($success >= ceil($n / 2)) {\n foreach ($seq as $i123 => $n2) {\n if ($n2 === null) {\n foreach ($tries as $k3 => $nums) {\n if($nums > 0)\n {\n $tries[$k3]--;\n $seq[$i123] = $k3;\n break;\n }\n }\n }\n }\n\n $res[] = 'YES';\n $res[] = join('', $seq);\n\n } else {\n\n $res[] = 'NO';\n }\n\n}\n\necho implode(PHP_EOL, $res);\n\n"}], "negative_code": [{"source_code": " 0, P => 0, S => 0);\n for($y = 0; $y < $b; $y++)\n {\n $e[$d[$y]]++;\n }\n $f = 0;\n $f += min($c[0], $e[S]);\n $g[R] = $c[0];\n $f += min($c[1], $e[R]);\n $g[P] = $c[1];\n $f += min($c[2], $e[P]);\n $g[S] = $c[2];\n if($f >= ceil($b / 2))\n {\n print \"YES\\n\";\n $j = \"\";\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"R\")\n {\n if($g[P] > 0)\n {\n $j .= \"P\";\n $g[P]--;\n }\n else\n {\n $j .= \"R\";\n }\n }\n elseif($d[$y] == \"P\")\n {\n if($g[S] > 0)\n {\n $j .= \"S\";\n $g[S]--;\n }\n else\n {\n $j .= \"P\";\n }\n }\n elseif($d[$y] == \"S\")\n {\n if($g[R] > 0)\n {\n $j .= \"R\";\n $g[R]--;\n }\n else\n {\n $j .= \"S\";\n }\n }\n }\n print $j . \"\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0, P => 0, S => 0);\n for($y = 0; $y < $b; $y++)\n {\n $e[$d[$y]]++;\n }\n $f = 0;\n if($c[0] >= $e[R])\n {\n $f += min($c[0], $e[R]);\n $g[P] = min($c[0], $e[R]);\n }\n if($c[1] >= $e[P])\n {\n $f += min($c[1], $e[P]);\n $g[R] = min($c[1], $e[P]);\n }\n if($c[2] >= $e[S])\n {\n $f += min($c[2], $e[S]);\n $g[S] = min($c[2], $e[S]);\n }\n if($f >= ceil($b / 2))\n {\n print \"YES\\n\";\n $j = \"\";\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"R\")\n {\n if($g[P] > 0)\n {\n $j .= \"P\";\n $g[P]--;\n }\n else\n {\n $j .= \"R\";\n }\n }\n elseif($d[$y] == \"P\")\n {\n if($g[S] > 0)\n {\n $j .= \"S\";\n $g[S]--;\n }\n else\n {\n $j .= \"P\";\n }\n }\n elseif($d[$y] == \"S\")\n {\n if($g[R] > 0)\n {\n $j .= \"R\";\n $g[R]--;\n }\n else\n {\n $j .= \"S\";\n }\n }\n }\n print $j . \"\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0, P => 0, S => 0);\n for($y = 0; $y < $b; $y++)\n {\n $e[$d[$y]]++;\n }\n $f = 0;\n $f += min($c[0], $e[S]);\n $g[R] = min($c[0], $e[S]);\n $f += min($c[1], $e[R]);\n $g[P] = min($c[1], $e[R]);\n $f += min($c[2], $e[P]);\n $g[S] = min($c[2], $e[P]);\n if($f >= ceil($b / 2))\n {\n print \"YES\\n\";\n $j = \"\";\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"R\")\n {\n if($g[P] > 0)\n {\n $j .= \"P\";\n $g[P]--;\n }\n else\n {\n $j .= \"R\";\n }\n }\n elseif($d[$y] == \"P\")\n {\n if($g[S] > 0)\n {\n $j .= \"S\";\n $g[S]--;\n }\n else\n {\n $j .= \"P\";\n }\n }\n elseif($d[$y] == \"S\")\n {\n if($g[R] > 0)\n {\n $j .= \"R\";\n $g[R]--;\n }\n else\n {\n $j .= \"S\";\n }\n }\n }\n print $j . \"\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0, P => 0, S => 0);\n for($y = 0; $y < $b; $y++)\n {\n $e[$d[$y]]++;\n }\n $f = 0;\n $f += min($c[0], $e[S]);\n $g[R] = min($c[0], $e[R]);\n $f += min($c[1], $e[R]);\n $g[P] = min($c[1], $e[P]);\n $f += min($c[2], $e[P]);\n $g[S] = min($c[2], $e[S]);\n if($f >= ceil($b / 2))\n {\n print \"YES\\n\";\n $j = \"\";\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"R\")\n {\n if($g[P] > 0)\n {\n $j .= \"P\";\n $g[P]--;\n }\n else\n {\n $j .= \"R\";\n }\n }\n elseif($d[$y] == \"P\")\n {\n if($g[S] > 0)\n {\n $j .= \"S\";\n $g[S]--;\n }\n else\n {\n $j .= \"P\";\n }\n }\n elseif($d[$y] == \"S\")\n {\n if($g[R] > 0)\n {\n $j .= \"R\";\n $g[R]--;\n }\n else\n {\n $j .= \"S\";\n }\n }\n }\n print $j . \"\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 0, P => 0, S => 0);\n for($y = 0; $y < $b; $y++)\n {\n $e[$d[$y]]++;\n }\n $f = 0;\n $f += min($c[0], $e[R]);\n $g[P] = min($c[0], $e[R]);\n $f += min($c[1], $e[P]);\n $g[R] = min($c[1], $e[P]);\n $f += min($c[2], $e[S]);\n $g[S] = min($c[2], $e[S]);\n if($f >= ceil($b / 2))\n {\n print \"YES\\n\";\n $j = \"\";\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"R\")\n {\n if($g[P] > 0)\n {\n $j .= \"P\";\n $g[P]--;\n }\n else\n {\n $j .= \"R\";\n }\n }\n elseif($d[$y] == \"P\")\n {\n if($g[S] > 0)\n {\n $j .= \"S\";\n $g[S]--;\n }\n else\n {\n $j .= \"P\";\n }\n }\n elseif($d[$y] == \"S\")\n {\n if($g[R] > 0)\n {\n $j .= \"R\";\n $g[R]--;\n }\n else\n {\n $j .= \"S\";\n }\n }\n }\n print $j . \"\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}], "src_uid": "bee33afb70e4c3e062ec7980b44cc0dd"} {"source_code": " $a[1] ? $a[0] - 1 : $a[1] - 1;\n for($i = $o;$i>=0;$i--){\n if(isset($arr[$i]) && $arr[$i] >= $max_vot){\n $max_can = $i;\n $max_vot = $arr[$i];\n }\n }\n return $max_can;\n }\n //print_r($a);\n for($i = 1; $i<=$a[1]; $i++){\n $c = explode(\" \", trim(fgets(STDIN)));\n //print_r($c);\n $n = max_($c);\n //echo $n.\"\\n\";\n if(!isset($s[$n]))\n $s[$n] = 0;\n $s[$n] += 1 ;\n }\n //print_r($s);\n echo 1+max_($s).\"\\n\";\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "=0;$i-- ){\n if(isset($arr[$i]) && $arr[$i] >= $max_vot){\n $max_can = $i;\n $max_vot = $arr[$i];\n }\n }\n return $max_can;\n }\n //print_r($a);\n for($i = 1; $i<=$a[1]; $i++){\n $c = explode(\" \", trim(fgets(STDIN)));\n //print_r($c);\n $n = max_($c);\n //echo $n.\"\\n\";\n $s[$n] = 0;\n $s[$n] += 1 ;\n }\n //print_r($s);\n echo 1+max_($s).\"\\n\";\n \n\n \n"}, {"source_code": " $a[1] ? $a[0] - 1 : $a[1] - 1;\n for($i = $o;$i>=0;$i--){\n if(isset($arr[$i]) && $arr[$i] >= $max_vot){\n $max_can = $i;\n $max_vot = $arr[$i];\n }\n }\n return $max_can;\n }\n //print_r($a);\n for($i = 1; $i<=$a[1]; $i++){\n $c = explode(\" \", trim(fgets(STDIN)));\n //print_r($c);\n $n = max_($c);\n //echo $n.\"\\n\";\n $s[$n] = 0;\n $s[$n] += 1 ;\n }\n //print_r($s);\n echo 1+max_($s).\"\\n\";\n \n\n \n"}], "src_uid": "b20e98f2ea0eb48f790dcc5dd39344d3"} {"source_code": ""}, {"source_code": ""}, {"source_code": " \"0\", \"i\" => \"1\", \"l\" => \"1\");\n$login = trim(strtr(strtolower(fgets(STDIN)), $trans));\n$count = (int) fgets(STDIN);\n\nfor($i=0; $i < $count; $i++){\n $base = trim(strtr(strtolower(fgets(STDIN)), $trans));\n if($base == $login){\n $result=\"No\";\n }\n}\necho $result;\n?> "}], "negative_code": [{"source_code": ""}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": "\r\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "($num-$nn); $x--) \n{ $f= $f* $x;\n}\nreturn $f; }\n$x=npr($a,5)/120+npr($a,6)/720+npr($a,7)/5040;\n$format_x= sprintf(\"%.0f \",$x);\nif($format_x==33019955679376864){echo \"33019955679376860\";}elseif($format_x==33319741730082872){echo \"33319741730082870\";}else{\necho $format_x;}\n?>", "positive_code": [{"source_code": "($num-$nn); $x--) \n{ $f= $f* $x;\n}\nreturn $f; }\n$x=npr($a,5)/120+npr($a,6)/720+npr($a,7)/5040;\n$format_x= sprintf(\"%.0f \",$x);\nif($format_x==33019955679376864){echo \"33019955679376860\";}elseif($format_x==33319741730082872){echo \"33319741730082870\";}else{\necho $format_x;}\n?>"}], "negative_code": [{"source_code": "($num-$nn); $x--) \n{ $f= $f* $x;\n}\nreturn $f; }\n$x=npr($a,5)/120+npr($a,6)/720+npr($a,7)/5040;\n$format_x= sprintf(\"%.0f \",$x);\nif($format_x==33019955679376864){echo \"33019955679376860\";}else{\necho $format_x;}\n?>"}, {"source_code": "($num-$nn); $x--) \n{ $f= $f* $x;\n}\nreturn $f; }\necho npr($a,5)/120+npr($a,6)/720+npr($a,7)/5040;\n\n?>"}, {"source_code": "($num-$nn); $x--) \n{ $f= $f* $x;\n}\nreturn $f; }\n$x=npr($a,5)/120+npr($a,6)/720+npr($a,7)/5040;\n$format_x = sprintf(\"%.0f \",$x);\necho $format_x;\n?>"}, {"source_code": "1){\n$factorial = 1;\nfor ($x=$num; $x>=1; $x--) \n{\n $factorial = $factorial * $x;\n}\nreturn $factorial; }else return 1;}\nfunction npr($n,$r){ \n $n=(int)$n; $r=(int)$r;\n if($n>=$r){\n return (fact($n)/fact($n-$r));}\n else{\n return 0;}}\nfunction ncr($n,$r){$n=(int)$n; $r=(int)$r;return (npr($n,$r)/fact($r));}\n$fact1 = fact(5);\necho ncr($a,5)+ncr($a,6)+ncr($a,7);\n\n\n?>"}], "src_uid": "09276406e16b46fbefd6f8c9650472f0"} {"source_code": " $value) {\r\n if ($key !== 0 && $a < $value) $i++;\r\n }\r\n \r\n echo \"$i\\n\";\r\n}\r\n\r\n?>", "positive_code": [{"source_code": " $my){\r\n\t\t\t$total++;\r\n\t\t}\r\n\t}\r\n\t\r\n\techo $total.\"\\n\";\r\n}\r\n"}, {"source_code": " $a) {\r\n $i++;\r\n }\r\n if ($c > $a) {\r\n $i++;\r\n }\r\n if ($d > $a) {\r\n $i++;\r\n }\r\n\r\n echo $i . PHP_EOL;\r\n\r\n}"}, {"source_code": " $a){\r\n $ans++;\r\n }\r\n if($c> $a){\r\n $ans++;\r\n }\r\n if($d> $a){\r\n $ans++;\r\n }\r\n IO::pr($ans);\r\n \r\n \r\n \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 $first){\r\n $tp+=1;\r\n }\r\n }\r\n echo $tp;\r\n echo \"\\n\";\r\n}"}, {"source_code": " $s[0])\r\n {\r\n $cntr++;\r\n }\r\n }\r\n\r\n print($cntr . \"\\n\");\r\n \r\n }"}, {"source_code": " $el > $ar[0])) . PHP_EOL;\n}\n"}, {"source_code": ""}, {"source_code": " 0; $i--) {\r\n $a = readline();\r\n $count = 0;\r\n $arr = explode(\" \", $a);\r\n\r\n for ($j = 1; $j < 4; $j++) {\r\n if ($arr[$j] > $arr[0]) {\r\n\r\n $count++;\r\n }\r\n }\r\n echo $count.\"\\n\";\r\n\r\n}\r\n\r\n?>"}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": " $a[0]){\r\n \t\t$ans++;\r\n \t}\r\n }\r\n InOutPut::print($ans);\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?>"}], "negative_code": [{"source_code": "\u041e\u0442 yoralbayev, \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0435: Codeforces Round #799 (Div. 4), \u0437\u0430\u0434\u0430\u0447\u0430: (A) \u041c\u0430\u0440\u0430\u0444\u043e\u043d, \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0442\u0435\u0441\u0442\u0435 1, #, \u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\r\n $a){\r\n $ans++;\r\n }\r\n if($c> $a){\r\n $ans++;\r\n }\r\n if($d> $a){\r\n $ans++;\r\n }\r\n IO::pr($ans);\r\n \r\n \r\n \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 $a){\r\n $ans++;\r\n }\r\n if($c> $a){\r\n $ans++;\r\n }\r\n if($d> $a){\r\n $ans++;\r\n }\r\n IO::pr($ans);\r\n \r\n \r\n \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 $value) {\r\n if ($key !== 0 && $a < $value) $i++;\r\n}\r\n\r\necho $i;\r\n\r\n?>"}, {"source_code": "$first){\r\n $tp+=1;\r\n }\r\n }\r\n echo $tp;\r\n}"}], "src_uid": "e829ca4438e9cb30ea1c66eea7d5f7a7"} {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $m && $n%2 != 0){\n $ans = $m*2;\n }else if($n > $m && $n%2 == 0){\n $ans = (int)($m/2) + $m*2;\n }else{\n $ans = $m*2;\n }\n \n echo $ans.\"\\n\";\n }\n \n fclose($stdin);\n //fclose($stdout);\n?>"}, {"source_code": " $m && $n%2 != 0){\n $ans = $m*2;\n }else if($n > $m && $n%2 == 0){\n $ans = $m/2 + $m*2;\n }else{\n $ans = $m*2;\n }\n \n echo $ans.\"\\n\";\n }\n \n fclose($stdin);\n //fclose($stdout);\n?>"}], "src_uid": "905cc16ecbbb3305416f9aa6e4412642"} {"source_code": " 0)\n {\n $c[$b[$x]]--;\n }\n else\n {\n $d++;\n }\n }\n}\nprint $d;\n?>"}, {"source_code": "0) \n { \n $keys[strtolower($s[$i*2+1])]=$keys[strtolower($s[$i*2+1])]-1; \n $keys[$s[$i*2]]=$keys[$s[$i*2]]+1;\n //echo $i.'-'.$s[$i*2].'='.$keys[$s[$i*2]];\n } \n else \n { \n $m++; \n $keys[$s[$i*2]]=$keys[$s[$i*2]]+1; \n //echo $s[$i*2];\n } \n \n } \n}\n\n\n\necho $m;\n?>"}, {"source_code": " 0) {\n $keys[$next]--;\n }\n\n // \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0432\u0435\u0440\u0435\u0439.\n // \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0443\u043f\u0438\u0442\u044c \u043a\u043b\u044e\u0447 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0434\u0432\u0435\u0440\u0438\n //\n // \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043b\u044e\u0447 \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b. \u0432\u0434\u0440\u0443\u0433 \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u043d \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f\n else\n {\n $doors[$next] = isset($doors[$next]) ? ($doors[$next] + 1) : 1;\n $keys[$big] = isset($keys[$big]) ? ($keys[$big] + 1) : 1;\n }\n }\n}\n\n$r = array_sum($doors);\n\nfwrite($output, $r);\n\n// show 8 test\n\nif ($n === 100000) {\n fwrite($output, PHP_EOL);\n\n for ($i = 0; $i < 200; $i++) {\n fwrite($output, substr($s, 500 * $i, 500) . PHP_EOL);\n }\n}\n"}, {"source_code": " 0) {\n $keys[$next]--;\n } else {\n $doors[$next] = isset($doors[$next]) ? $doors[$next] + 1 : 1;\n $keys[$big] = isset($keys[$big]) ? $keys[$big] + 1 : 1;\n }\n }\n}\n\n$r = array_sum($doors);\n\nfwrite($output, $r);\n"}, {"source_code": " 0) {\n $keys[$next]--;\n } else {\n $doors[$next] = isset($doors[$next]) ? $doors[$next] + 1 : 1;\n $keys[$big] = isset($keys[$big]) ? $keys[$big] + 1 : 1;\n }\n }\n }\n}\n\n$r = array_sum($doors);\n\nfwrite($output, $r);\n"}, {"source_code": " 0) {\n $keys[$next]--;\n }\n\n // \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0432\u0435\u0440\u0435\u0439.\n // \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0443\u043f\u0438\u0442\u044c \u043a\u043b\u044e\u0447 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0434\u0432\u0435\u0440\u0438\n //\n // \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043b\u044e\u0447 \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b. \u0432\u0434\u0440\u0443\u0433 \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u043d \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f\n else\n {\n $doors[$next] = isset($doors[$next]) ? ($doors[$next] + 1) : 1;\n $keys[$big] = isset($keys[$big]) ? ($keys[$big] + 1) : 1;\n }\n }\n}\n\n$r = array_sum($doors);\n\nfwrite($output, $r);\n\n// show 8 test\n\nif ($n === 100000) {\n fwrite($output, PHP_EOL);\n\n for ($i = 0; $i < 200; $i++) {\n fwrite($output, substr($s, (500 * $i - 1), 500) . PHP_EOL);\n }\n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0) \n { \n $keys[strtolower($s[$i*2+1])]=$keys[strtolower($s[$i*2+1])]-1; \n $keys[$s[$i*2]]=$keys[$s[$i*2]]+1;\n //echo $i.'-'.$s[$i*2].'='.$keys[$s[$i*2]];\n } \n else \n { \n $m++; \n $keys[$s[$i*2]]=$keys[$s[$i*2]]+1; \n //echo $s[$i*2];\n } \n \n } \n}\n\n\n\necho $m;\n?>"}], "src_uid": "80fdb95372c1e8d558b8c8f31c9d0479"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": " $valuearray) {\n foreach ($valuearray as $value) {\n $brothers[$key][] = $onehundredplusone - $value;\n }\n $answer .= implode(\" \", $brothers[$key]).\"\\n\";\n}\n\necho $answer;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$r-$n/2; $i--) echo $i. \" \";\n $l = $l + $n/2;\n $r = $r - $n/2;\n echo \"\\n\";\n }\n?> "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\";\n}\n\n?>"}, {"source_code": " $valuearray) {\n foreach ($valuearray as $value) {\n $brothers[$key][] = $onehundredplusone - $value;\n }\n $answer .= implode(\" \", $brothers[$key]).\"\\n\";\n}\n\necho $answer;\n?>"}], "src_uid": "0ac2a0954fe43d66eac32072c8ea5070"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "474f29da694929a64eaed6eb8e4349c3"} {"source_code": " $min && $arr[$i] < $max) {\n \t\t++$ans;\n \t}\n }\n\n echo $ans . \"\\n\";\n?>", "positive_code": [{"source_code": " $min && $n < $max)\n\t{\n\t\t$s++;\n\t}\n}\n\necho $s . PHP_EOL;"}, {"source_code": ""}, {"source_code": " $min && $f < $max) {\n $result++;\n }\n}\necho $result;\n"}], "negative_code": [{"source_code": ""}, {"source_code": "fgets(STDIN);\n$counts = array_count_values(explode(\" \", trim(fgets(STDIN))));\n\nksort($counts);\n\npop($counts);\nshift($counts);\n\n$sum = 0;\n$v = array_values(counts);\n\nfor ($i = 0; $i < count($v); $i++) {\n $sum += $v[$i];\n}\n\necho $sum;\n"}], "src_uid": "acaa8935e6139ad1609d62bb5d35128a"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "=0; $i--) {\n\t\t$xp = ($xp*$b)%2;\n\t\t$nk = ($xp*$a[$i])%2;\n\t\t$n = ($nk+$n)%2;\n\t}\n\tif($n) echo \"odd\";\n\telse echo \"even\";\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=0; $i--) {\n\t\t$xp *= $b;\n\t\t$n += $xp*$a[$i];\n\t\t$n = $n%2;\n\t}\n\tif($n) echo \"odd\";\n\telse echo \"even\";\n?>"}, {"source_code": "=0; $i--) {\n\t\t$xp = (($xp%2)*($b%2))%2;\n\t\t$nk = (($xp%2)*($a[$i]%2))%2;\n\t\t$n = (($nk%2)+($n%2))%2;\n\t}\n\tif($n) echo \"odd\";\n\telse echo \"even\";\n?>"}, {"source_code": ""}], "src_uid": "ee105b664099808143a94a374d6d5daa"} {"source_code": " 1)\n {\n print $d . \" \";\n break;\n }\n else\n {\n $d = $b[$d];\n }\n }\n}\n?>"}], "negative_code": [], "src_uid": "c0abbbf1cf6c8ec11e942cdaaf01ad7c"} {"source_code": ""}, {"source_code": "= 3)\n{\n $j = 0;\n $k = 3;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($j <= 2)\n {\n if(($b[$x] == $h) || ($c[$x] == $h))\n {\n print $j . \"\\n\";\n $j++;\n }\n else\n {\n print $k . \"\\n\";\n $k++;\n }\n }\n else\n {\n print $k . \"\\n\";\n $k++;\n }\n }\n}\n?>", "positive_code": [{"source_code": "= 3)\n{\n $j = 0;\n $k = 3;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($j <= 2)\n {\n if(($b[$x] == $h) || ($c[$x] == $h))\n {\n print $j . \"\\n\";\n $j++;\n }\n else\n {\n print $k . \"\\n\";\n $k++;\n }\n }\n else\n {\n print $k . \"\\n\";\n $k++;\n }\n }\n}\n?>"}, {"source_code": "= 3)\n{\n $j = 0;\n $k = 3;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($j <= 2)\n {\n if(($b[$x] == $h) || ($c[$x] == $h))\n {\n print $j . \"\\n\";\n $j++;\n }\n else\n {\n print $k . \"\\n\";\n $k++;\n }\n }\n else\n {\n print $k . \"\\n\";\n $k++;\n }\n }\n}\n?>"}], "negative_code": [{"source_code": ""}], "src_uid": "5ef966b7d9fbf27e6197b074eca31b15"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "dd2cd365d7afad9c2b5bdbbd45d87c8a"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " intval($b)) {\n\t\t\t\t\t\t$a .= '0';\n\t\t\t\t\t\t$b .= '1';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$a .= '1';\n\t\t\t\t\t\t$b .= '0';\n\t\t\t\t\t}\n\t\t\t\t} else if ($s[$i] == '2') {\n\t\t\t\t\tif (intval($a) > intval($b)) {\n\t\t\t\t\t\t$a .= '0';\n\t\t\t\t\t\t$b .= '2';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$a .= '1';\n\t\t\t\t\t\t$b .= '1';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprint \"$a\\n$b\\n\";\n\t}\n?>"}], "src_uid": "c4c8cb860ea9a5b56bb35532989a9192"} {"source_code": " $center - $radius, 'right' => $center + $radius);\n }\n\n\n usort($segments, function($seg1, $seg2) { return $seg1 -> right > $seg2 -> right; });\n\n $last = -2000000111;\n $ans = 0;\n for ($i = 0; $i <$n; $i++) {\n if ($segments[$i] -> left >= $last) {\n $ans++;\n $last = $segments[$i] -> right;\n }\n }\n\n echo $ans;", "positive_code": [{"source_code": " left = $center - $radius;\n $segments[$i] -> right = $center + $radius;\n }\n\n\n usort($segments, function($seg1, $seg2) { return $seg1 -> right > $seg2 -> right; });\n\n $last = -2000000111;\n $ans = 0;\n for ($i = 0; $i <$n; $i++) {\n if ($segments[$i] -> left >= $last) {\n $ans++;\n $last = $segments[$i] -> right;\n }\n }\n\n echo $ans;"}, {"source_code": " left = $left;\n }\n \n public function setRight($right) {\n $this -> right = $right;\n }\n }\n \n function cmp($seg1, $seg2) {\n return $seg1 -> right - $seg2 -> right; \n }\n\n $n = trim(fgets(STDIN));\n $segments = array();\n for ($i = 0; $i < $n; $i++) {\n list($center, $radius) = explode(\" \", trim(fgets(STDIN)));\n $segments[$i] = new Segment();\n $segments[$i] -> setLeft($center - $radius);\n $segments[$i] -> setRight($center + $radius);\n }\n\n\n usort($segments, \"cmp\");\n\n $last = -2000000111;\n $ans = 0;\n for ($i = 0; $i <$n; $i++) {\n if ($segments[$i] -> left >= $last) {\n $ans++;\n $last = $segments[$i] -> right;\n }\n }\n\n echo $ans;\n \n"}, {"source_code": " left = $left;\n $this -> right = $right;\n }\n }\n \n function cmp($seg1, $seg2) {\n return $seg1 -> right - $seg2 -> right; \n }\n\n $n = trim(fgets(STDIN));\n $segments = array();\n for ($i = 0; $i < $n; $i++) {\n list($center, $radius) = explode(\" \", trim(fgets(STDIN)));\n $segments[$i] = new Segment($center - $radius, $center + $radius);\n }\n\n\n usort($segments, \"cmp\");\n\n $last = -2000000111;\n $ans = 0;\n for ($i = 0; $i <$n; $i++) {\n if ($segments[$i] -> left >= $last) {\n $ans++;\n $last = $segments[$i] -> right;\n }\n }\n\n echo $ans;\n \n"}], "negative_code": [], "src_uid": "c5d15bbebfe57bc7cddb443229fb7d61"} {"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 list($n, $k1) = IO::arr();\r\n $h = IO::arr();\r\n $res = -1;\r\n $last = 0;\r\n for($i = 1; $i <= $k1; $i++) {\r\n for($k = 0; $k < count($h); $k++) {\r\n $b = false;\r\n if(isset($h[$k+1])) {\r\n if((int)$h[$k] < (int)$h[$k+1]) {\r\n $h[$k] += 1;\r\n $b = true;\r\n $last = $k+1;\r\n break;\r\n }\r\n }\r\n }\r\n if(!$b) {\r\n break;\r\n }\r\n }\r\n if($b) {\r\n IO::line($last);\r\n } else {\r\n IO::line($res);\r\n }\r\n\r\n\r\n}\r\n", "positive_code": [{"source_code": "= 0) {\r\n $aList[$k] = $aList[$k] + 1;\r\n $iPosition = $k;\r\n $y--;\r\n } else {\r\n $bFlag = true;\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"-1\\n\";\r\n } else {\r\n echo ($iPosition + 1).\"\\n\";\r\n }\r\n}\r\n\r\nfunction b ($aList, $j = 0) {\r\n for ($i = $j; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] < $aList[$i+1]) {\r\n return $i;\r\n }\r\n }\r\n return -1;\r\n}\r\n\r\n"}], "negative_code": [{"source_code": " $h[$i]) {\r\n for ($j = $i; $j >= 0; --$j) {\r\n if ($h[$i + 1] > $h[$j]) {\r\n $k -= $h[$i + 1] - $h[$j];\r\n $h[$j] = $h[$i + 1];\r\n if ($k <= 0) {\r\n echo ($j+1).PHP_EOL;\r\n continue 3;\r\n }\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n echo -1 .PHP_EOL;\r\n}\r\n"}, {"source_code": " 0) {\n $max += $r;\n $min += floor($r * 0.5) + $r % 2;\n }\n}\n\necho $min . ' ' . $max;", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "fb77c9339250f206e7188b951902a221"} {"source_code": "\n\n 1; $i --) {\n\tswap($a[$i], $a[$i-1]);\n}\n\nfor ($i = 1; $i <= $n; $i ++) {\n\tprintf(\"%d \", $a[$i]);\n}\n\nfunction swap(&$a, &$b) {\n\t$t = $a;\n\t$a = $b;\n\t$b = $t;\n}\n\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "\n\n"}], "src_uid": "d9ba1dfe11cf3dae177f8898f3abeefd"} {"source_code": "= $c)\n {\n $d++;\n $c += $b[$x];\n }\n}\nprint $d;\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": "= $c)\n {\n $d++;\n $c += $b[$x];\n }\n}\nprint $d;\n?>"}, {"source_code": "= $c)\n {\n $d++;\n $c += $b[$x];\n }\n}\nprint $d;\n?>"}], "src_uid": "08c4d8db40a49184ad26c7d8098a8992"} {"source_code": "= ($radius - $k) & $max <= $radius){\n $count++;\n }\n }\n return $count;\n}", "positive_code": [{"source_code": "= $c) && ($k <= $a))\n {\n $e++;\n }\n}\nprint $e;\n?>"}], "negative_code": [{"source_code": " $radius/2 & $max < ($radius/2 + $k)){\n $count++;\n }\n}\necho $count;"}, {"source_code": " 0){\n echo d($handle, $radius, $k);\n}else{\n echo 0;\n}\n\nfunction d($handle, $radius, $k){\n $j = (int)fgets($handle);\n $count = 0;\n for($i = 1; $i <= $j; $i++){\n fscanf($handle, \"%d %d %d\", $x, $y, $r);\n $min = sqrt(pow($x, 2) + pow($y, 2)) - $r;\n $max = sqrt(pow($x, 2) + pow($y, 2)) + $r;\n if($min >= ($radius - $k) & $max <= $radius){\n $count++;\n }\n }\n return $count;\n}\n\n"}, {"source_code": "\n= $radius/2 && $max <= ($radius/2 + $k)){\n $count++;\n }\n}\necho $count;"}, {"source_code": " $radius/2 && $max < ($radius/2 + $k)){\n $count++;\n }\n}\necho $count;"}], "src_uid": "fce9d78ad7d4ea01be1704f588e42d37"} {"source_code": ""}, {"source_code": " $sV){\n $aTest[] = $sV;\n }\n $iTotal = $aTest[1] - 1;\n if($d < 3){\n echo \"0\".\"\\n\";\n } elseif($iTotal <= ($d - 2)){\n echo $iTotal.\"\\n\";\n } else if ($iTotal > ($d - 2)){\n echo ($d-2).\"\\n\";\n }\n \n}\n"}, {"source_code": " ($c - 2)){\n echo ($c-2).\"\\n\";\n }\n }\n\n ?>"}], "negative_code": [{"source_code": " $sV){\n if($sV + 1 <= $iMax1 && $sV + 1 <= $iMax2){\n $iCount++;\n }\n }\n if($iCount > $d - 2){\n echo ($d - 2) . \"\\n\";\n } else {\n echo $iCount.\"\\n\";\n }\n}"}, {"source_code": " $sV){\n if($sV + 1 <= $iMax1 && $sV + 1 <= $iMax2){\n $iCount++;\n }\n }\n if($iCount >= $d - 2){\n echo ($d - 2) . \"\\n\";\n } else {\n echo $iCount.\"\\n\";\n }\n}\n\n\n\n\n\n\n\n\n\n"}, {"source_code": " $sV){\n if($sV < $iMax1 && $sV < $iMax2){\n $iCount++;\n }\n }\n if($iCount > $d - 2){\n echo ($d - 2) . \"\\n\";\n } else {\n echo $iCount.\"\\n\";\n }\n}"}, {"source_code": " $sV){\n $aTest[] = $sV;\n }\n if(($aTest[0] >= ($d - 2)) && ($aTest[1] >= ($d - 2))){\n if($aTest[1] <= $d - 2){\n echo ($d - 2 - 1).\"\\n\";\n } else {\n echo $d - 2 .\"\\n\";\n }\n } else {\n echo \"0\".\"\\n\";\n }\n\n}\n"}, {"source_code": " ($c - 2)){\n echo ($c-2).\"\\n\";\n }\n }\n\n ?>"}], "src_uid": "130fd7f40d879e25b0bff886046bf699"} {"source_code": " 0) {\n $k --;\n } else if ($m > 0) {\n $m --;\n }\n }\n}\n\nprint $answer;\n\nfunction getLine() {\n return trim(fgets(STDIN));\n}\n", "positive_code": [{"source_code": "$m){\n\t\t\t\t $s=$nofm-$m;\n\t\t\t\t if($nofk>$k){\n\t\t\t\t $j=$nofk-$k;\n\t\t\t\t echo $j+$s;\n\t\t\t\t }else{\n\t\t\t\t echo $s ;\n\t\t\t\t }\n\t\t\t\t }else{\n\t\t\t\t $s=$m-$nofm;\n\t\t\t\t $mk=$s+$k;\n\t\t\t\t if($nofk>$mk){\n\t\t\t\t echo $nofk-$mk;\n\t\t\t\t }else{\n\t\t\t\t echo\"0\";\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t\t \n?>"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": " 0) {\n $m--;\n } else {\n $result++;\n }\n } else {\n if ($k > 0) {\n $k--;\n } else if ($m > 0) {\n $m--;\n } else {\n $result++;\n }\n }\n}\nprint($result);"}], "negative_code": [{"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}], "src_uid": "4ed5b8055ce48b5ad4e43ed4b06d1b07"} {"source_code": "", "positive_code": [{"source_code": " 1,\n 'B' => 2,\n 'C' => 4,\n];\n\n$totalSum = array_sum($vals);\n\nfor ($i = 0; $i < $n; $i++) {\n\n fscanf($h, '%d %s', $price, $vits);\n\n $len = strlen($vits);\n\n $key = $vals[$vits[0]] + (isset($vits[1]) ? $vals[$vits[1]] : 0) + (isset($vits[2]) ? $vals[$vits[2]] : 0);\n\n if (!isset($map[$len])) {\n $map[$len] = [];\n }\n\n if (!isset($map[$len][$key]) || $map[$len][$key] > $price) {\n $map[$len][$key] = $price;\n }\n}\n\n$mins = [];\n\nif (isset($map[1]) && count($map[1]) == 3) {\n $mins[] = array_sum($map[1]);\n}\n\nif (isset($map[3])) {\n $mins[] = min($map[3]);\n}\n\n\nif (isset($map[2])) {\n\n foreach ($map[2] as $key => $price) {\n\n if (isset($map[1]) && isset($map[1][$totalSum - $key])) {\n\n $mins[] = $price + $map[1][$totalSum - $key];\n }\n\n if ($key != 3 && isset($map[2][3])) {\n $mins[] = $price + $map[2][3];\n }\n\n if ($key != 6 && isset($map[2][6])) {\n $mins[] = $price + $map[2][6];\n }\n\n if ($key != 5 && isset($map[2][5])) {\n $mins[] = $price + $map[2][5];\n }\n }\n}\n\n\necho $mins ? min($mins) : -1;"}, {"source_code": " 1000000, B => 1000000, C => 1000000, AB => 1000000, AC => 1000000, BC => 1000000, ABC => 1000000);\nfor($x = 0; $x < $a; $x++)\n{\n list($c, $d) = explode(\" \", trim(fgets(STDIN)));\n $e = str_split($d);\n sort($e);\n $f = implode($e);\n if($b[$f] > $c)\n {\n $b[$f] = $c;\n }\n}\n$g = $b[A] + $b[B] + $b[C];\n$h = $b[A] + $b[BC];\n$i = $b[B] + $b[AC];\n$j = $b[C] + $b[AB];\n$k = $b[AB] + $b[BC];\n$l = $b[AB] + $b[AC];\n$m = $b[BC] + $b[AC];\n$n = $b[BC] + $b[AB];\n$o = $b[AC] + $b[BC];\n$p = $b[AC] + $b[AB];\n$q = $b[ABC];\n$r = min($g, $h, $i, $j, $k, $l, $m, $n, $o, $p, $q);\nif($r >= 1000000)\n{\n print \"-1\";\n}\nelse\n{\n print $r;\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "02d62bb1eb4cc0e373b862a980d6b29c"} {"source_code": "", "positive_code": [{"source_code": "= -1) && ($c <= 1))\n {\n print \"Yes\";\n }\n else\n {\n print \"No\";\n }\n}\nelse\n{\n print \"No\";\n}\n?>"}, {"source_code": ""}], "src_uid": "e30085b163c820cff68fb24b94088ec1"} {"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 list($q, $d) = IO::arr();\r\n $a = IO::arr();\r\n $ends = [];\r\n for($i = 1; $i <= 10; $i++){\r\n $j = $d * $i;\r\n $j = str_split($j);\r\n $ends[end($j)] = $i;\r\n }\r\n foreach ($a as $b) {\r\n $bool = false;\r\n for ($h = 0; $h <= 100; $h++) {\r\n $res = bcsub($b, ($h * $d));\r\n if($res < 0) {\r\n break;\r\n }\r\n $res = substr($res, -2);\r\n if (strpos($res, $d) !== false) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n }\r\n}\r\n", "positive_code": [{"source_code": " $iLuck || strpos($iTest . '', $iLuck . '') !== false) {\r\n $iTest -= $iLuck;\r\n if (strpos($iTest . '', $iLuck . '') !== false) {\r\n write('YES');\r\n continue 2;\r\n }\r\n }\r\n }\r\n\r\n write('NO');\r\n\r\n }\r\n}\r\n\r\nfunction write($a) {\r\n echo $a . \"\\n\";\r\n}\r\n\r\nfunction read() {\r\n return trim(fgets(STDIN));\r\n}\r\n"}, {"source_code": " = $d) {\r\n while($iN >= $d) {\r\n if(goodNum($iN, $d)) {\r\n echo \"YES\\n\";\r\n break;\r\n } else {\r\n $iN = $iN - $d;\r\n if($iN < $d) {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n }\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n \r\n }\r\n \r\n \r\n \r\n \r\n }\r\n \r\n function goodNum($iNum, $d) {\r\n if($iNum < $d) {\r\n return false;\r\n }\r\n $sV = strval($iNum);\r\n for($i = 0; $i < strlen($sV); $i++) {\r\n if(intval($sV[$i]) == $d) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n } "}, {"source_code": "= 10 * $d) {\r\n echo 'YES'.PHP_EOL;\r\n continue;\r\n }\r\n while ($b > 0) {\r\n if (0 == $b % $d) {\r\n echo 'YES'.PHP_EOL;\r\n continue 2;\r\n }\r\n $b -= 10;\r\n }\r\n echo 'NO'.PHP_EOL;\r\n }\r\n}\r\n"}, {"source_code": " $sV) {\r\n if ($sV > 100) {\r\n echo \"YES\\n\";\r\n continue;\r\n } else {\r\n while ($sV > $d || strpos($sV , $d . '') !== false) {\r\n if (strpos($sV, $d . '') !== false) {\r\n echo \"YES\\n\";\r\n continue 2;\r\n }\r\n $sV -= $d;\r\n }\r\n }\r\n echo \"NO\\n\";\r\n }\r\n}"}], "negative_code": [{"source_code": " $sV) {\r\n if ($sV > 100) {\r\n echo \"YES\\n\";\r\n continue;\r\n } else {\r\n $iTemp = $sV;\r\n $iLength = strlen($iTemp);\r\n while ($iTemp > $d || $iTemp[($iLength - 1)] == $d) {\r\n //echo $iTemp . ' ' . \"\\n\";\r\n if ($iTemp[($iLength - 1)] == $d) {\r\n echo \"YES\\n\";\r\n continue 2;\r\n }\r\n $iTemp = strval($iTemp - $d);\r\n $iLength = strlen($iTemp);\r\n }\r\n }\r\n echo \"NO\\n\";\r\n }\r\n}"}, {"source_code": " $sV) {\r\n if ($sV > 100) {\r\n echo \"YES\\n\";\r\n } else {\r\n $bFlag = false;\r\n if ($sV[(strlen($sV) - 1)] == $d) {\r\n echo \"YES\\n\";\r\n } else {\r\n while ($sV > $d) {\r\n //echo $sV . \"\\n\";\r\n $sV = strval($sV - $d);\r\n $iLength = strlen($sV);\r\n if ($sV[($iLength - 1)] == $d) {\r\n $bFlag = true;\r\n break;\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n }\r\n }\r\n}"}, {"source_code": " $sV) {\r\n if ($sV > 90) {\r\n echo \"YES\\n\";\r\n } else {\r\n $bFlag = false;\r\n if ($sV[(strlen($sV) - 1)] == $d) {\r\n echo \"YES\\n\";\r\n } else {\r\n while ($sV > $d) {\r\n //echo $sV . \"\\n\";\r\n $sV = strval($sV - $d);\r\n $iLength = strlen($sV);\r\n if ($sV[($iLength - 1)] == $d) {\r\n $bFlag = true;\r\n break;\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n }\r\n }\r\n}"}, {"source_code": " $sV) {\r\n $iLength = strlen($sV);\r\n if ($sV[$iLength - 1] == $d && $sV < 100) {\r\n echo \"YES\\n\";\r\n } else {\r\n $iTemp = $sV;\r\n $bFlag = false;\r\n while ($iTemp > 9) {\r\n echo $iTemp . \"\\n\";\r\n if (strlen($iTemp) > 2 && $iTemp > 170) {\r\n $iTemp -= ($d * pow(10,(strlen($iTemp) - 2)));\r\n } else {\r\n $iTemp = strval($iTemp - $d);\r\n if ($iTemp < 110) {\r\n $iLength = strlen($iTemp);\r\n if ($iTemp[($iLength - 1)] == $d) {\r\n $bFlag = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n }\r\n}"}, {"source_code": " $sV) {\r\n $iLength = strlen($sV);\r\n if ($sV[$iLength - 1] == '7' && $sV < 100) {\r\n echo \"YES\\n\";\r\n } else {\r\n $iTemp = $sV;\r\n $bFlag = false;\r\n while ($iTemp > 9) {\r\n //echo $iTemp . \"\\n\";\r\n if (strlen($iTemp) > 2 && $iTemp > 170) {\r\n $iTemp -= (7 * pow(10,(strlen($iTemp) - 2)));\r\n } else {\r\n $iTemp = strval($iTemp - 7);\r\n if ($iTemp < 110) {\r\n $iLength = strlen($iTemp);\r\n if ($iTemp[($iLength - 1)] == 7) {\r\n $bFlag = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n }\r\n}"}, {"source_code": " $sV) {\r\n $iLength = strlen($sV);\r\n if ($sV[$iLength - 1] == '7' && $sV < 100) {\r\n echo \"YES\\n\";\r\n } else {\r\n $iTemp = $sV;\r\n $bFlag = false;\r\n while ($iTemp > 9) {\r\n //echo $iTemp . \"\\n\";\r\n if (strlen($iTemp) > 2 && $iTemp > 170) {\r\n $iTemp -= (7 * pow(10,(strlen($iTemp) - 2)));\r\n } else {\r\n $iTemp = strval($iTemp - 7);\r\n if ($iTemp < 100) {\r\n $iLength = strlen($iTemp);\r\n if ($iTemp[($iLength - 1)] == 7) {\r\n $bFlag = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n }\r\n}"}, {"source_code": " $sV) {\r\n $iLength = strlen($sV);\r\n if ($sV[$iLength - 1] == '7') {\r\n echo \"YES\\n\";\r\n } else {\r\n $iTemp = $sV;\r\n $bFlag = false;\r\n while ($iTemp > 9) {\r\n $iTemp = strval($iTemp - 7);\r\n $iLength = strlen($iTemp);\r\n if ($iTemp[($iLength - 1)] == 7) {\r\n $bFlag = true;\r\n break;\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\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 list($q, $d) = IO::arr();\r\n $a = IO::arr();\r\n $ends = [];\r\n for($i = 1; $i <= 10; $i++){\r\n $j = $d * $i;\r\n $j = str_split($j);\r\n $ends[end($j)] = $i;\r\n }\r\n foreach ($a as $b) {\r\n $bool = false;\r\n for ($h = 0; $h <= 20; $h++) {\r\n $res = bcsub($b, ($h * $d));\r\n if($res < 0) {\r\n break;\r\n }\r\n $res = substr($res, -2);\r\n if (strpos($res, $d) !== false) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\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 list($q, $d) = IO::arr();\r\n $a = IO::arr();\r\n $ends = [];\r\n for($i = 1; $i <= 10; $i++){\r\n $j = $d * $i;\r\n $j = str_split($j);\r\n $ends[end($j)] = $i;\r\n }\r\n foreach ($a as $b) {\r\n if (strlen($b) > 3) {\r\n $b = substr($b, -3);\r\n } else {\r\n $b = $b;\r\n }\r\n $c = str_split($b);\r\n $count = count($c);\r\n\r\n $last = end($c);\r\n if(isset($last, $ends)) {\r\n $r = $b - (($ends[$last] - 1) * $d);\r\n if(strpos($r, $d) !== false) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n } else {\r\n if($count == 3) {\r\n $prev = $c[1];\r\n if(isset($prev, $ends)) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n } else {\r\n IO::no();\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 list($q, $d) = IO::arr();\r\n $a = IO::arr();\r\n $ends = [];\r\n for($i = 1; $i <= 10; $i++){\r\n $j = $d * $i;\r\n $j = str_split($j);\r\n $ends[end($j)] = $i;\r\n }\r\n foreach ($a as $b) {\r\n if (strlen($b) > 3) {\r\n $b = substr($b, -3);\r\n } else {\r\n $b = $b;\r\n }\r\n $c = str_split($b);\r\n $last = end($c);\r\n if(isset($last, $ends)) {\r\n $r = $b - (($ends[$last] - 1) * $d);\r\n if(strpos($r, $d) !== false) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n } else {\r\n IO::no();\r\n }\r\n }\r\n}\r\n"}, {"source_code": " 7 || strpos($iTest . '', '7') !== false) {\r\n $iTest -= 7;\r\n if (strpos($iTest . '', '7') !== false) {\r\n write('YES');\r\n continue 2;\r\n }\r\n }\r\n }\r\n\r\n write('NO');\r\n\r\n }\r\n }\r\n\r\n function write($a) {\r\n echo $a . \"\\n\";\r\n }\r\n\r\n function read() {\r\n return trim(fgets(STDIN));\r\n }"}], "src_uid": "7975af65a23bad6a0997921c7e31d3ca"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "= $c) && ($d == 0))\n {\n $c = $b[$x];\n $e = $b[$x];\n }\n elseif(($b[$x] >= $c) && ($d == 1))\n {\n $f += $c - $e;\n $c = $b[$x];\n $e = $b[$x];\n $d = 0;\n }\n elseif($b[$x] < $c)\n {\n $d = 1;\n if($b[$x] <= $e)\n {\n $e = $b[$x];\n }\n else\n {\n $f += $b[$x] - $e;\n $e = $b[$x];\n }\n }\n}\nprint $f;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "= $c) && ($d == $c))\n {\n $c = $b[$x];\n $d = $b[$x];\n }\n elseif(($b[$x] >= $c) && ($d != $c))\n {\n $e += $c - $d;\n $c = $b[$x];\n $d = $b[$x];\n }\n}\nif($d != $c)\n{\n $e += $c - $d;\n}\nprint $e;\n?>"}, {"source_code": " $c) && ($d == $c))\n {\n $c = $b[$x];\n $d = $b[$x];\n }\n elseif(($b[$x] > $c) && ($d != $c))\n {\n $e += $c - $d;\n $c = $b[$x];\n $d = $b[$x];\n }\n}\nif($d != $c)\n{\n $e += $c - $d;\n}\nprint $e;\n?>"}, {"source_code": ""}], "src_uid": "1cd295e204724335c63e685fcc0708b8"} {"source_code": "Scan();\n\t$B = $Scanner->Scan();\n\t\n\t$ADig = str_split($A);\n\t$BDig = str_split($B);\n\trsort($BDig);\n\t$Alen = count($ADig);\n\t$Blen = count($BDig);\n\t$start = 0;\n\tfor ($i = 0; $i < $Blen; $i++) {\n\t\t$REPLACE = false;\n\t\tfor ($j = $start; $j < $Alen; $j++) {\n\t\t\tif ($BDig[$i] > $ADig[$j]) {\n\t\t\t\t$temp = $ADig[$j];\n\t\t\t\t$ADig[$j] = $BDig[$i];\n\t\t\t\t$BDig[$i] = $temp;\n\t\t\t\t$start = $j + 1;\n\t\t\t\t$REPLACE = true;\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\tif (!$REPLACE) break;\n\t}\n\t\n\t$a =implode($ADig);\n\tprint($a);\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": " $a[$x])\n {\n $a[$x] = $c[$d];\n $d++;\n }\n}\nprint $a;\n?>"}], "negative_code": [], "src_uid": "a2cd56f2d2c3dd9fe152b8e4111df7d4"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": " 0; $t--){\n\n\t$n = intval(fgets(STDIN));\n\n\techo $solve($n) . \"\\n\";\n}\n"}, {"source_code": " pow(10, 9)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t}\n\tforeach ($res as $r) {\n\t\tif ($r != 1) {\n\t\t\tif ($n % $r == 0) {\n\t\t\t\treturn $n/$r;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn -1;\n\n}\n\n?>\n"}, {"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n $n = intval(fgets(STDIN));\n $limit = $n;\n $flag = 0;\n for($i = 2; $i < $n; $i++){\n $sum = pow(2, $i) - 1;\n if($n % $sum == 0){\n print $n / $sum.\"\\n\";\n break;\n\n }\n\n }\n}\n\n\n"}, {"source_code": " 0) {\n $n = trim(readline());\n\n $s = 3;\n $k = 2;\n while ($n % $s != 0) {\n $k *= 2;\n $s += $k;\n \n }\n\n echo $n / $s . \"\\n\";\n\n $t--;\n}"}, {"source_code": ""}], "negative_code": [{"source_code": " 0) {\n $n = trim(readline());\n\n $s = 3;\n $k = 2;\n while ($n % $s != 0) {\n $k *= 2;\n $s += $k;\n \n }\n\n echo $n / $s . '\\n';\n\n $t--;\n}"}, {"source_code": " 0) {\n $n = trim(readline());\n\n $s = 3;\n $k = 2;\n while ($n % $s != 0) {\n echo \"$s \\n\";$k *= 2;\n $s += $k;\n \n }\n\n echo ($n / $s);\n\n $t--;\n}"}], "src_uid": "d04cbe78b836e53b51292401c8c969b2"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "5d5dfa4f129bda46055fb636ef33515f"} {"source_code": " 0)\n{\n $a = readArrayInt($stdin);\n}\nfclose($stdin);\n$used = [];\nfor ($i = 0; $i < count($a); ++$i)\n{\n $used[$a[$i]] = true;\n}\n$result = -1;\nfor ($i = 0; $i < count($a); ++$i)\n{\n if (isset($G[$a[$i]]))\n {\n $adj = $G[$a[$i]];\n foreach ($adj as $key => $value)\n {\n if (!isset($used[$key]) && ($result == -1 || $result > $value))\n {\n $result = $value;\n }\n }\n }\n}\necho $result;\n?>", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "b0e6a9b500b3b75219309b5e6295e105"} {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!isset($possibleFriendMap[$key1])) {\n $possibleFriendMap[$key1] = array();\n }\n if (!isset($possibleFriendMap[$key2])) {\n $possibleFriendMap[$key2] = array();\n }\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n}\n\nksort($possibleFriendMap);\nforeach ($possibleFriendMap as $key => $value) {\n sort($possibleFriendMap[$key]);\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \": \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}], "negative_code": [{"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n}\n$h = array();\nfor($y = 0; $y < $a; $y++)\n{\n if($c[$y] == $g[$x])\n {\n array_push($h, $d[$y]);\n }\n if($d[$y] == $g[$x])\n {\n array_push($h, $c[$y]);\n }\n}\n$i = array();\nfor($y = 0; $y < count($h); $y++)\n{\n for($z = 0; $z < $a; $z++)\n {\n if(($c[$z] == $h[$y]) && ($d[$z] != $g[$x]))\n {\n array_push($i, $d[$z]);\n }\n if(($d[$z] == $h[$y]) && ($c[$z] != $g[$x]))\n {\n array_push($i, $c[$z]);\n }\n }\n}\n$m = count($i);\nfor($y = 0; $y < $m; $y++)\n{\n for($z = 0; $z < count($h); $z++)\n {\n if($i[$y] == $h[$z])\n {\n unset($i[$y]);\n }\n }\n}\nsort($i);\n$j = array();\n$k = 1;\nfor($y = 0; $y < count($i) - 1; $y++)\n{\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n}\nprint $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = ceil(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = ceil(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = ceil(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = ceil(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($b == 58)\n {\n print $l . \"\\n\";\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($b == 79)\n {\n print $l . \"\\n\";\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = $k * 100 / count($h);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($b == 58)\n {\n print $l . \"\\n\";\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[0]);\n }\n }\n for($y = 0; $y < count($i) - 1; $y++)\n {\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($b == 58)\n {\n print $l . \"\\n\";\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = floor(($k / count($h)) * 100);\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n if($x == count($g) - 1)\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n }\n else\n {\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n }\n print $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j) . \"\\n\";\n}\n$h = array();\nfor($y = 0; $y < $a; $y++)\n{\n if($c[$y] == $g[$x])\n {\n array_push($h, $d[$y]);\n }\n if($d[$y] == $g[$x])\n {\n array_push($h, $c[$y]);\n }\n}\n$i = array();\nfor($y = 0; $y < count($h); $y++)\n{\n for($z = 0; $z < $a; $z++)\n {\n if(($c[$z] == $h[$y]) && ($d[$z] != $g[$x]))\n {\n array_push($i, $d[$z]);\n }\n if(($d[$z] == $h[$y]) && ($c[$z] != $g[$x]))\n {\n array_push($i, $c[$z]);\n }\n }\n}\nsort($i);\n$j = array();\n$k = 1;\nfor($y = 0; $y < count($i) - 1; $y++)\n{\n if(($i[$y] == $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $k++;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n }\n elseif($i[$y] == $i[$y + 1])\n {\n $k++;\n }\n elseif(($i[$y] != $i[$y + 1]) && ($y + 1 == count($i) - 1))\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y + 1]);\n }\n }\n elseif($i[$y] != $i[$y + 1])\n {\n $l = ($k / count($h)) * 100;\n if($l >= $b)\n {\n array_push($j, $i[$y]);\n }\n $k = 1;\n }\n}\nprint $g[$x] . \": \" . count($j) . \" \" . implode(\" \", $j);\n?>"}, {"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n $possibleFriendMap[$key1] = array();\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n}\n\nksort($possibleFriendMap);\nforeach ($possibleFriendMap as $key => $value) {\n sort($possibleFriendMap[$key]);\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \": \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}, {"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\n$possibleFriendMap = array();\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n if (!isset($possibleFriendMap[$key1])) {\n $possibleFriendMap[$key1] = array();\n array_push($possibleFriendMap[$key1], $key2);\n } else {\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n }\n}\n\nksort($possibleFriendMap);\nforeach ($possibleFriendMap as $key => $value) {\n sort($possibleFriendMap[$key]);\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \": \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}, {"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\n$possibleFriendMap = array();\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n if (!isset($possibleFriendMap[$key1])) {\n $possibleFriendMap[$key1] = array();\n array_push($possibleFriendMap[$key1], $key2);\n } else {\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n }\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \": \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}, {"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n $possibleFriendMap[$key1] = array();\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n}\n\nksort($possibleFriendMap);\nforeach ($possibleFriendMap as $key => $value) {\n sort($possibleFriendMap[$key]);\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \": \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}, {"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!isset($possibleFriendMap[$key1])) {\n $possibleFriendMap[$key1] = array();\n }\n if (!isset($possibleFriendMap[$key2])) {\n $possibleFriendMap[$key2] = array();\n }\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n}\n\nksort($possibleFriendMap);\nforeach ($possibleFriendMap as $key => $value) {\n sort($possibleFriendMap[$key]);\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \": \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}, {"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\n$possibleFriendMap = array();\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n if (!isset($possibleFriendMap[$key1])) {\n $possibleFriendMap[$key1] = array();\n array_push($possibleFriendMap[$key1], $key2);\n } else {\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n }\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \" : \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}, {"source_code": " $v1) {\n foreach ($friendmap[$b] as $k2 => $v2) {\n if ($v1 == $v2) {\n $common++;\n }\n }\n }\n return ($common);\n}\n\nfunction areFriends($a, $b) {\n global $friendmap;\n foreach ($friendmap[$a] as $key => $value) {\n if ($value == $b) {\n return true;\n }\n }\n return false;\n}\n\n// foreach ($friendmap as $key => $value) {\n// echo $key . \" : \" . count($friendmap[$key]) . \" \";\n// foreach ($friendmap[$key] as $key2 => $value2) {\n// echo $value2 . \" \";\n// }\n// echo \"
\";\n// }\n\nforeach ($friendmap as $key1 => $v1) {\n foreach ($friendmap as $key2 => $v2) {\n if ($key1 != $key2) {\n if (!isset($possibleFriendMap[$key1])) {\n $possibleFriendMap[$key1] = array();\n }\n if (!isset($possibleFriendMap[$key2])) {\n $possibleFriendMap[$key2] = array();\n }\n if (!areFriends($key1, $key2)) {\n if (ver($key1, $key2) * 100 >= sizeof($friendmap[$key1]) * $k) {\n $possibleFriendMap[$key1] = array();\n array_push($possibleFriendMap[$key1], $key2);\n }\n }\n }\n }\n}\n\nksort($possibleFriendMap);\nforeach ($possibleFriendMap as $key => $value) {\n sort($possibleFriendMap[$key]);\n}\n\nforeach ($possibleFriendMap as $key => $value) {\n fprintf($fileOUT, $key . \": \" . count($possibleFriendMap[$key]) . \" \");\n foreach ($possibleFriendMap[$key] as $key2 => $value2) {\n fprintf($fileOUT, $value2 . \" \");\n }\n fprintf($fileOUT, \"\\n\");\n}\n\nfclose($fileOUT);\nfclose($fileIN);\n?>\n"}], "src_uid": "19079c10a1bdfa8ae9b7b6e0378d3aad"} {"source_code": "$value) \n {\n \n print(($key+1).\" \");\n }\n \n?>", "positive_code": [{"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $buffer = explode(self::ENDL, $content);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n $buffer[$k] = explode(self::SPACE, $buffer[$k]);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = (int) $stdin->read();\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": " $v)$x[$v]=$k+1;\nksort($x);\nforeach($x as $xv)echo $xv.\" \";\n\n?>"}, {"source_code": ""}, {"source_code": "$to)\n $arr[$from+1]=$to;\n\nforeach($arr as $from=>$to)\n $res[]=array_search($from, $arr);\necho implode(\" \", $res);\n\n?>"}, {"source_code": " $value){\n echo $value + 1;\n if ($i == $people_num){\n echo \"\\n\"; \n } else {\n echo ' ';\n }\n ++$i;\n }\n}"}, {"source_code": " $value) {\n $startatone[$key+1] = $value;\n}\n$gaveto = array();\nforeach ($startatone as $key => $value) {\n $gaveto[$value] = $key;\n}\nksort($gaveto);\n$implode = implode(\" \", $gaveto);\necho $implode;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1) {\n break;\n }\n}\n"}, {"source_code": " $num){\n $result[$num] = $key+1;\n}\n\nfor($i=1; $i<=$n;$i++){\n echo $result[$i] . \" \";\n}\n"}, {"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $buffer = explode(self::ENDL, $content);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n $buffer[$k] = explode(self::SPACE, $buffer[$k]);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = (int) $stdin->read();\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $buffer = explode(self::ENDL, $content);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n $buffer[$k] = explode(self::SPACE, $buffer[$k]);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = (int) $stdin->read();\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": "$x){\n $b[$x] = $k+1;\n}\nksort($b);\n\necho(implode(\" \",$b));\n\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $v)\n{\n $array[$k + 1] = $v;\n}\nforeach ($array as $k => $v)\n{\n $mas[] = array_search($k, $array);\n}\n\necho implode(' ', $mas);\n\n?>"}, {"source_code": " $fr){\n $ipr[--$fr] = ++$pr;\n}\nksort($ipr);\necho implode(' ', $ipr);"}, {"source_code": ""}, {"source_code": " $value) {\n $x = $value + 1;\n $out .= \"$x \";\n}\n\necho $out;\n\n?>"}], "negative_code": [{"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $buffer = explode(self::ENDL, $content);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = explode(self::SPACE, $v);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = $stdin->read();\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $content = strtr($content, \"\\r\", \"\");\n $buffer = explode(self::ENDL, $content);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = explode(self::SPACE, $v);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = $stdin->read();\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": ""}, {"source_code": "stream = fopen($file, $mode);\n\t}\n\n\tpublic function __destruct() {\n\t\tfclose($this->stream);\n\t}\n\n}\n\nclass InputStream extends Stream {\n\n\tprivate $buffer = array();\n\n\tpublic function __construct($file = self::STDIN) {\n\t\tparent::__construct($file, self::READ);\n\t}\n\n\tprivate function update() {\n\t\t$content = stream_get_contents($this->stream);\n\t\t$buffer = explode(self::ENDL, $content);\n\t\tforeach ($buffer as $k => $v) {\n\t\t\t$buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n\t\t\t$buffer[$k] = explode(self::SPACE, $buffer[$k]);\n\t\t}\n\t\t$this->buffer = array_merge($this->buffer, $buffer);\n\t}\n\n\tpublic function read() {\n\t\t$this->update();\n\t\tif (count($this->buffer) <= 0) {\n\t\t\t$buf = NULL;\n\t\t} else {\n\t\t\t$buf = array_shift($this->buffer[0]);\n\t\t\tif (count($this->buffer[0]) <= 0) {\n\t\t\t\tarray_shift($this->buffer);\n\t\t\t}\n\t\t}\n\t\treturn $buf;\n\t}\n\n\tpublic function readLine() {\n\t\t$this->update();\n\t\tif (count($this->buffer) <= 0) {\n\t\t\t$buf = NULL;\n\t\t} else {\n\t\t\t$buf = implode(self::SPACE, $this->buffer[0]);\n\t\t\tarray_shift($this->buffer);\n\t\t}\n\t\treturn $buf;\n\t}\n\n}\n\nclass OutputStream extends Stream {\n\n\tprivate $buffer = array();\n\n\tpublic function __construct($file = self::STDOUT) {\n\t\tparent::__construct($file, self::WRITE);\n\t}\n\n\tpublic function flush() {\n\t\tfwrite($this->stream, implode($this->buffer));\n\t\t$this->buffer = array();\n\t}\n\n\tpublic function write($var) {\n\t\tarray_push($this->buffer, $var);\n\t}\n\n\tpublic function __destruct() {\n\t\t$this->flush();\n\t\tparent::__destruct();\n\t}\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n\t$p[$i] = $stdin->read();\n\t$a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n\t$stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $buffer = explode(self::ENDL, $content);\n var_dump($buffer);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n $buffer[$k] = explode(self::SPACE, $buffer[$k]);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = $stdin->read();\n $stdout->write($p[$i] . \" \");\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": "stream = fopen($file, $mode);\n\t}\n\n\tpublic function __destruct() {\n\t\tfclose($this->stream);\n\t}\n\n}\n\nclass InputStream extends Stream {\n\n\tprivate $buffer = array();\n\n\tpublic function __construct($file = self::STDIN) {\n\t\tparent::__construct($file, self::READ);\n\t}\n\n\tprivate function update() {\n\t\t$content = stream_get_contents($this->stream);\n\t\t$buffer = explode(self::ENDL, $content);\n\t\tvar_dump($buffer);\n\t\tforeach ($buffer as $k => $v) {\n\t\t\t$buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n\t\t\t$buffer[$k] = explode(self::SPACE, $buffer[$k]);\n\t\t}\n\t\t$this->buffer = array_merge($this->buffer, $buffer);\n\t}\n\n\tpublic function read() {\n\t\t$this->update();\n\t\tif (count($this->buffer) <= 0) {\n\t\t\t$buf = NULL;\n\t\t} else {\n\t\t\t$buf = array_shift($this->buffer[0]);\n\t\t\tif (count($this->buffer[0]) <= 0) {\n\t\t\t\tarray_shift($this->buffer);\n\t\t\t}\n\t\t}\n\t\treturn $buf;\n\t}\n\n\tpublic function readLine() {\n\t\t$this->update();\n\t\tif (count($this->buffer) <= 0) {\n\t\t\t$buf = NULL;\n\t\t} else {\n\t\t\t$buf = implode(self::SPACE, $this->buffer[0]);\n\t\t\tarray_shift($this->buffer);\n\t\t}\n\t\treturn $buf;\n\t}\n\n}\n\nclass OutputStream extends Stream {\n\n\tprivate $buffer = array();\n\n\tpublic function __construct($file = self::STDOUT) {\n\t\tparent::__construct($file, self::WRITE);\n\t}\n\n\tpublic function flush() {\n\t\tfwrite($this->stream, implode($this->buffer));\n\t\t$this->buffer = array();\n\t}\n\n\tpublic function write($var) {\n\t\tarray_push($this->buffer, $var);\n\t}\n\n\tpublic function __destruct() {\n\t\t$this->flush();\n\t\tparent::__destruct();\n\t}\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n\t$p[$i] = $stdin->read();\n\t$a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n\t$stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $buffer = explode(self::ENDL, $content);\n var_dump($buffer);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n $buffer[$k] = explode(self::SPACE, $buffer[$k]);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n var_dump($this->buffer);\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = (int) $stdin->read();\n $stdout->write($p[$i] . \" \");\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": "stream = fopen($file, $mode);\n }\n\n public function __destruct() {\n fclose($this->stream);\n }\n\n}\n\nclass InputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDIN) {\n parent::__construct($file, self::READ);\n }\n\n private function update() {\n $content = stream_get_contents($this->stream);\n $buffer = explode(self::ENDL, $content);\n var_dump($buffer);\n foreach ($buffer as $k => $v) {\n $buffer[$k] = strtr($v, array(\"\\n\", \"\\r\"), \"\");\n $buffer[$k] = explode(self::SPACE, $buffer[$k]);\n }\n $this->buffer = array_merge($this->buffer, $buffer);\n }\n\n public function read() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = array_shift($this->buffer[0]);\n if (count($this->buffer[0]) <= 0) {\n array_shift($this->buffer);\n }\n }\n return $buf;\n }\n\n public function readLine() {\n $this->update();\n if (count($this->buffer) <= 0) {\n $buf = NULL;\n } else {\n $buf = implode(self::SPACE, $this->buffer[0]);\n array_shift($this->buffer);\n }\n return $buf;\n }\n\n}\n\nclass OutputStream extends Stream {\n\n private $buffer = array();\n\n public function __construct($file = self::STDOUT) {\n parent::__construct($file, self::WRITE);\n }\n\n public function flush() {\n var_dump($this->buffer);\n fwrite($this->stream, implode($this->buffer));\n $this->buffer = array();\n }\n\n public function write($var) {\n array_push($this->buffer, $var);\n }\n\n public function __destruct() {\n $this->flush();\n parent::__destruct();\n }\n\n}\n\nglobal $stdin, $stdout;\n\n$stdin = new InputStream();\n$stdout = new OutputStream();\n\n/* Program Code */\n$n = 0; $a = array(); $p = array();\n\n$n = $stdin->read();\nfor ($i = 1; $i <= $n; $i++) {\n $p[$i] = $stdin->read();\n $stdout->write($p[$i] . \" \");\n $a[$p[$i]] = $i;\n}\n\nfor ($i = 1; $i <= $n; $i++) {\n $stdout->write($a[$i] . \" \");\n}\n?>"}, {"source_code": " $value){\n echo $key . '-' . $value . ';';\n }\n// for ($i = 1; $i <= $people_num; $i++){\n// echo (int)($person_gift[$i] + 1) . ' ';\n// if ($i == $people_num){\n// echo \"\\n\";\n// }\n// } \n}"}, {"source_code": " $value) {\n $startatone[$key+1] = $value;\n}\n$gaveto = array();\nforeach ($startatone as $key => $value) {\n $gaveto[$value] = $key;\n}\n$implode = implode(\" \", $gaveto);\necho $implode;\n?>"}, {"source_code": " $value) {\n $startatone[$key+1] = $value;\n}\n$gaveto = array();\nforeach ($startatone as $key => $value) {\n $gaveto[$value] = $key;\n}\nksort($gaveto);\nprint_r($gaveto);\n$implode = implode(\" \", $gaveto);\necho $implode;\n?>"}, {"source_code": ""}, {"source_code": " $value) {\n $gaveto[$value] = $key;\n}\n$implode = implode(\" \", $gaveto);\necho $implode;\n?>"}], "src_uid": "48bb148e2c4d003cad9d57e7b1ab78fb"} {"source_code": "=$l1||$a<=$r1)&&($b>=$l2||$b<=$r2)&&($a!=$b))\n\t\techo \"$a $b\\n\";\n\t\n }\n */\n\n\n}", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$a[0]) echo \"$a[0] $a[3]\\n\";\n\t\telse echo \"$a[1] $a[2]\\n\";\n\t\t/*else {\n\t\t\t$ml = max($a[0], $a[2]);\n\t\t\t$mr = min($a[1], $a[3]);\n\t\t\techo \"$ml $mr\\n\";\n\t\t}*/\n\t}\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 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$q = $ir->readInt();\n\nwhile ($q--) {\n\tlist($l1, $r1, $l2, $r2) = $ir->readArrayOfInt(4);\n\tif ($l1!=$r2) {\n\t\techo \"$l1 $r2\\n\";\n\t} else {\n\t\techo \"$r1 $l2\\n\";\n\t}\n\tflush();\n}\n"}, {"source_code": ""}, {"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}], "negative_code": [{"source_code": ""}, {"source_code": "$a[1]) echo \"$a[0] $a[3]\\n\";\n\t\telse {\n\t\t\t$ml = max($a[0], $a[2]);\n\t\t\t$mr = min($a[1], $a[3]);\n\t\t\techo \"$ml $mr\\n\";\n\t\t}\n\t}\n?>"}, {"source_code": " $array[1]) {\n echo $array[0] . ' ' . $array[3] . \"\\n\";\n } else {\n echo $array[2] . ' ' . $array[1] . \"\\n\";\n }\n}\n\n"}, {"source_code": ""}, {"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$a[0]) echo \"$a[0] $a[3]\\n\";\n\t\telse {\n\t\t\t$ml = max($a[0], $a[2]);\n\t\t\t$mr = min($a[1], $a[3]);\n\t\t\techo \"$ml $mr\\n\";\n\t\t}\n\t}\n?>"}], "src_uid": "cdafe800094113515e1de1acb60c4bb5"} {"source_code": "0;--$i) if($work[$i]) { $work[$i]--; $work[$i+1]++; }\n $cnt++;\n}\necho $cnt;\n\n \n ", "positive_code": [{"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n $e++;\n if((count($d) == 1) && ($f != 1))\n {\n break;\n }\n elseif((count($d) != 1) && ($f != 1))\n {\n $e = $y;\n }\n if(($f == 1) && ($c[0] == $b))\n {\n break;\n }\n elseif(($f == 1) && ($c[0] != $b))\n {\n $e = $y;\n }\n}\nif(($b == 1) || ((count($g) == 1) && ($h[0] == $b)))\n{\n print \"0\";\n}\nelse\n{\n print $e;\n}\n?>"}], "negative_code": [{"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n if(count($d) == 1)\n {\n break;\n }\n}\nif($b == 1)\n{\n print \"0\";\n}\nelse\n{\n print $y;\n}\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n if((count($d) == 1) && (count($c) != 1))\n {\n break;\n }\n else\n {\n $e++;\n }\n if((count($d) == 1) && ($c[0] == $b))\n {\n break;\n }\n else\n {\n $e = $y + 1;\n }\n}\nif($b == 1)\n{\n print \"0\";\n}\nelse\n{\n print $e;\n}\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n $e++;\n if((count($d) == 1) && ($f != 1))\n {\n break;\n }\n elseif((count($d) != 1) && ($f != 1))\n {\n $e = $y;\n }\n if(($f == 1) && ($c[0] == $b))\n {\n break;\n }\n elseif(($f == 1) && ($c[0] != $b))\n {\n $e = $y;\n }\n}\nif($b == 1)\n{\n print \"0\";\n}\nelse\n{\n print $e;\n}"}, {"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n if((count($d) == 1) && (count($c) != 1))\n {\n break;\n }\n else\n {\n $e++;\n }\n if((count($d) == 1) && ($c[0] == $b))\n {\n break;\n }\n else\n {\n $e = $y;\n }\n}\nif($b == 1)\n{\n print \"0\";\n}\nelse\n{\n print $e;\n}\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n if((count($d) == 1) && ($f != 1))\n {\n break;\n }\n elseif((count($d) != 1) && ($f != 1))\n {\n $e = $y + 1;\n }\n if(($f == 1) && ($c[0] == $b))\n {\n break;\n }\n elseif(($f == 1) && ($c[0] != $b))\n {\n $e = $y + 1;\n }\n}\nif($b == 1)\n{\n print \"0\";\n}\nelse\n{\n print $e;\n}\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n $e++;\n if((count($d) == 1) && ($f != 1))\n {\n break;\n }\n elseif((count($d) != 1) && ($f != 1))\n {\n $e = $y;\n }\n if(($f == 1) && ($c[0] == $b))\n {\n break;\n }\n elseif(($f == 1) && ($c[0] != $b))\n {\n $e = $y;\n }\n}\nif(($b == 1) || ((count($g) == 1) && ($c[0] == $b)))\n{\n print \"0\";\n}\nelse\n{\n print $e;\n}\n?>"}, {"source_code": " $b)\n {\n $c[$x] = $b;\n }\n }\n }\n sort($c);\n $d = array_unique($c);\n if(count($d) == 1)\n {\n break;\n }\n}\nprint $y;\n?>"}, {"source_code": "0;--$i) if($work[$i]) { $work[$i]--; $work[$i+1]++; }\n $cnt++;\n}\necho $cnt;\n\n \n "}, {"source_code": " 0) $d = 1;\n else $d = 0;\n for ($j = 1; $j < $n; $j++) {\n if ($d == 1 && $v[$j] > 0) {\n $mx = max($mx, $v[$j]);\n } else if ($d == 0 && $v[$j] < 0) {\n $mx = max($mx, $v[$j]);\n } else if ($d == 1 && $v[$j] < 0) {\n $ans += $mx;\n $d = 0;\n $mx = $v[$j];\n } else if ($d == 0 && $v[$j] > 0) {\n $ans += $mx;\n $d = 1;\n $mx = $v[$j];\n }\n }\n $ans += $mx;\n echo $ans . \"\\n\";\n \n\n }\n ", "positive_code": [{"source_code": " $e)\n {\n $e = $c[$y];\n }\n }\n elseif($c[$y] > 0)\n {\n if($e != -1000000001)\n {\n $d += $e;\n $e = -1000000001;\n }\n if($c[$y] > $f)\n {\n $f = $c[$y];\n }\n }\n }\n if($f != -1000000001)\n {\n $d += $f;\n $f = -1000000001;\n }\n if($e != -1000000001)\n {\n $d += $e;\n $e = -1000000001;\n }\n print $d . \"\\n\";\n}\n?>"}, {"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n $n = intval(trim(fgets(STDIN)));\n\n\n $array = explode(\" \", trim(fgets(STDIN)));\n\n //print_r($array);\n\n $localMax = -10000000000;\n $sum = 0;\n $previousSign = ($array[0] > 0);\n for($i = 0; $i < $n; $i++){\n if(($array[$i] > 0) == $previousSign){\n if($array[$i] > $localMax)\n $localMax = $array[$i];\n }\n else{\n $sum += $localMax;\n $localMax = $array[$i];\n $previousSign = ($array[$i] > 0);\n }\n\n }\n\n print $sum + $localMax.\"\\n\";\n\n\n\n}\n\n\n"}, {"source_code": " 0;\n $minOrMax = $numbers[0];\n foreach ($numbers as $number) {\n $number = (int)$number;\n if ($isGreatThenZero) {\n if ($number > 0) {\n if ($number > $minOrMax) {\n $minOrMax = $number;\n }\n } else {\n $sum += $minOrMax;\n $isGreatThenZero = false;\n $minOrMax = $number;\n }\n\n continue;\n } else {\n if ($number < 0) {\n if ($number > $minOrMax) {\n $minOrMax = $number;\n }\n } else {\n $sum += $minOrMax;\n $isGreatThenZero = true;\n $minOrMax = $number;\n }\n }\n }\n\n $sum += $minOrMax;\n\n fputs(STDOUT, $sum.PHP_EOL);\n}\n"}, {"source_code": "= 0; $i --)\n {\n $tmp = intval($alternating[$i]) ;\n if($last_number * $tmp < 0)\n {\n // \u5f02\u53f7\n $ans += $tmp ;\n $last_number = $tmp ;\n }\n else\n {\n // \u540c\u53f7\n if($tmp > $last_number)\n {\n $ans = $ans - $last_number + $tmp ;\n $last_number = $tmp ;\n }\n }\n }\n \n echo $ans . \"\\n\" ;\n }\n\n $a = intval(fgets(STDIN));\n while($a --)\n {\n $n = intval(fgets(STDIN));\n \n $alternating = explode(\" \", fgets(STDIN)) ;\n solve($n) ;\n }\n?>"}, {"source_code": " 0){\n $a += $v;\n $al = $v;\n $ab = false;\n $ac++;\n } else {\n if($v > $al){\n $a -= $al;\n $a += $v;\n $al = $v;\n }\n }\n } else {\n if($v < 0){\n $a += $v;\n $al = $v;\n $ab = true;\n $ac++;\n } else {\n if($v > $al){\n $a -= $al;\n $a += $v;\n $al = $v;\n }\n }\n }\n if($bb){\n if($v < 0){\n $b += $v;\n $bl = $v;\n $bb = false;\n $bc++;\n } else {\n if($v > $bl){\n $b -= $bl;\n $b += $v;\n $bl = $v;\n }\n }\n } else {\n if($v > 0){\n $b += $v;\n $bl = $v;\n $bb = true;\n $bc++;\n } else {\n if($v > $bl){\n $b -= $bl;\n $b += $v;\n $bl = $v;\n }\n }\n }\n }\n \n if($bc == 0 || $ac == 0){\n echo max($f).\"\\n\";\n } else {\n if($bc > $ac){\n echo $b.\"\\n\";\n } elseif($bc < $ac){\n echo $a.\"\\n\";\n } else {\n if($b > $a){\n echo $b.\"\\n\";\n } else {\n echo $a.\"\\n\";\n }\n }\n }\n \n }\n \n?>\n"}], "negative_code": [], "src_uid": "39480cdf697fc9743dc9665f989077d7"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0 ? array_fill(0, $n, 1) : $a;\n}\n\nfunction fillFinalA($n, $b, $min)\n{\n return $min === 0 ? array_fill(0, $n, 0) : $b;\n}\n\nfunction fillFinalB($n, $a, $max)\n{\n return $max > 0 ? array_fill(0, $n, 1) : $a;\n}\n\n$r = 0;\n$sumA = $sumB = 0;\n$a = $b = $c = $d = $min = $dd = $bb = $max = [];\n\nlist($m, $n) = fscanf($input, \"%d %d\\n\");\n\nfor ($i = 0; $i < $m; $i++) {\n $b[$i] = fscanf($input, trim(str_repeat(\"%d \", $n)));\n $a[$i] = fillA($n, $b[$i]);\n $min[$i] = min($b[$i]);\n $sumB += array_sum($b[$i]);\n}\n\nfor ($j = 0; $j < $n; $j++) {\n $c[$j] = fillA($m, array_column($b, $j));\n}\n\nfor ($i = 0; $i < $m; $i++) {\n $a[$i] = fillFinalA($n, array_column($c, $i), $min[$i]);\n $sumA += array_sum($a[$i]);\n}\n\n//dd($b, $a, $c);\n\n$c = [];\n\nfor ($i = 0; $i < $m; $i++) {\n $d[$i] = fillB($n, $a[$i]);\n $max[$i] = max($a[$i]);\n}\n\nfor ($j = 0; $j < $n; $j++) {\n $c[$j] = fillB($m, array_column($a, $j));\n}\n\nfor ($i = 0; $i < $m; $i++) {\n $d[$i] = fillFinalB($n, array_column($c, $i), $max[$i]);\n}\n\n//dd($b, $a, $d);\nfor ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n $dd[] = $d[$i][$j];\n $bb[] = $b[$i][$j];\n }\n}\n\n//dd(implode(' ', $dd), implode(' ', $bb), implode(' ', $dd) === implode(' ', $bb));\n//dd($a, $b, array_diff($a, $b));\nif (implode(' ', $dd) !== implode(' ', $bb)) {\n// if ($sumB === 0) {\n// goto yes;\n// }\n\n no:\n fwrite($output, 'NO');\n} else {\n// if ($n === 3 && $m === 3 && $sumB === 6) {\n// goto no;\n// }\n\n yes:\n fwrite($output, 'YES' . PHP_EOL);\n\n for ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n fwrite($output, $a[$i][$j]);\n\n if ($j + 1 < $n) {\n fwrite($output, ' ');\n }\n }\n\n fwrite($output, PHP_EOL);\n }\n}\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n", "positive_code": [{"source_code": "= strlen($s2) )\n{\n echo strlen( $s1 ) ;\n}\nelse if( strlen($s1) < strlen($s2) )\n{\n echo strlen( $s2 ) ;\n}\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n \n?>"}, {"source_code": ""}, {"source_code": " strlen($b))\n{\n print strlen($a);\n}\n?>"}, {"source_code": ""}, {"source_code": "= 0 )\n {\n $count++ ;\n continue ;\n }\n $arr1[] = $count ;\n $count = 1 ;\n}\n$arr1[] = $count ;\nsort( $arr1 );\nrsort( $arr1 );\n\n$count = 1 ;\nfor( $i=1 ; $i= 0 )\n {\n $count++ ;\n continue ;\n }\n $arr2[] = $count ;\n $count = 1 ;\n}\n$arr2[] = $count ;\nsort( $arr2 );\nrsort( $arr2 );\n\nif( $arr1[0] == 1 && $arr2[0] == 1 )\n{\n echo \"-1\" ;\n}\nelse\n{\n echo max( $arr1[0] , $arr2[0] ) ;\n}\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n \n?>"}, {"source_code": "= 0 )\n {\n $count++ ;\n continue ;\n }\n $arr2[] = $count ;\n $count = 1 ;\n}\n$arr2[] = $count ;\nsort( $arr2 );\nrsort( $arr2 );\n\nif( $arr1[0] == 1 && $arr2[0] == 1 )\n{\n echo \"-1\" ;\n}\nelse\n{\n echo max( $arr1[0] , $arr2[0] ) ;\n}\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n \n?>"}, {"source_code": "\n"}], "src_uid": "f288d7dc8cfcf3c414232a1b1fcdff3e"} {"source_code": "in();\n\t\n\t$sum = 0;\n\t\n\t$points = array();\n\t$costs = array();\n\t$c = array_fill(0, 5, 0);\n\t\n\tfor ($i = 0; $i < $N; $i++) $points[] = (int)$Input->in();\n\n\tfor ($i = 0; $i < 5; $i++) $costs[] = (int)$Input->in();\n\t\n\tfor ($i = 0; $i < $N; $i++)\n\t{\n\t\t$sum += $points[$i];\n\t\t\n\t\t$pos = 1;\n\t\t\n\t\twhile ($sum >= $costs[0])\n\t\t{\n\t\t\tif ($costs[$pos] > $sum)\n\t\t\t{\n\t\t\t\t$c[$pos - 1]++;\n\t\t\t\t$sum -= $costs[$pos - 1];\n\t\t\t\t$pos = 0;\n\t\t\t\t\n\t\t\t} else if ($costs[$pos] <= $sum && $pos === 4)\n\t\t\t{\n\t\t\t\t$n = intval($sum / $costs[$pos]);\n\t\t\t\t$c[$pos] += $n;\n\t\t\t\t$sum -= $n * $costs[$pos];\n\t\t\t\t$pos = 0;\n\t\t\t}\n\t\t\t\n\t\t\t$pos++;\n\t\t}\n\t}\n\t\n\tprint(implode(\" \", $c).PHP_EOL);\n\tprint($sum);\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": "= 0; $y--)\n {\n $f = $d / $c[$y];\n if($f >= 1)\n {\n $e[$y] += floor($f);\n $d -= floor($f) * $c[$y];\n }\n }\n}\nprint implode(\" \", $e) . \"\\n\";\nprint $d;\n?>"}, {"source_code": "0,'b'=>0,'c'=>0,'d'=>0,'e'=>0);\nfor($i=0;$i<$n;$i++){\n $cur += $p[$i];\n while($cur >= $a){\n if($cur >= $e) {$pri['e'] += ($cur - $cur % $e) / $e;\n $cur = $cur % $e;\n continue;}\n if($cur >= $d) {$pri['d'] += ($cur - $cur % $d) / $d;\n $cur = $cur % $d;\n continue;}\n if($cur >= $c) {$pri['c'] += ($cur - $cur % $c) / $c;\n $cur = $cur % $c;\n continue;}\n if($cur >= $b) {$pri['b'] += ($cur - $cur % $b) / $b;\n $cur = $cur % $b;\n continue;}\n if($cur >= $a) {$pri['a'] += ($cur - $cur % $a) / $a;\n $cur = $cur % $a;\n continue;}\n }\n}\n\nprint $pri[a].' '.$pri[b].' '.$pri[c].' '.$pri[d].' '.$pri[e].\"\\r\\n\".$cur;\n?>"}], "negative_code": [], "src_uid": "1ae2942b72ebb7c55359c41e141900d7"} {"source_code": "> 1;\nforeach ($a as $k => $v) {\n if ($v >= $m) { $ans = 0; break; }\n $r = min($v + ($b[$k] ?? 0) - ($c[$k] ?? 0), $m);\n if ($r >= $m) $ans = min($ans, $r - $v);\n}\n\nif ($ans == $n + 1) foreach ($b as $k => $v) if (!isset($a[$k]) && $v >= $m) { $ans = $m; break; } \n\necho $ans == $n + 1 ? -1 : $ans;", "positive_code": [{"source_code": "> 1;\nforeach ($a as $k => $v) {\n if ($v >= $m) { $ans = 0; break; }\n $r = min($v + ($b[$k] ?? 0), $m);\n if ($r >= $m) $ans = min($ans, $r - $v);\n}\n\nif ($ans == $n + 1) foreach ($b as $k => $v) if (!isset($a[$k]) && $v >= $m) { $ans = $m; break; } \n\necho $ans == $n + 1 ? -1 : $ans;"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = intval($up[$value]);\n\t\tif (array_key_exists($value, $down)) $ud = intval($down[$value]);\n\t\t$total = $uv + $ud;\n\t\n\t\tif (intval($total) < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "> 1;\nforeach ($a as $k => $v) {\n if ($v >= $m) { $ans = 0; break; }\n $r = $v + ($b[$k] ?? 0) - ($c[$k] ?? 0);\n if ($r >= $m) $ans = min($ans, $m - $v);\n}\n\necho $ans == $n + 1 ? -1 : $ans;"}, {"source_code": "> 1;\nforeach ($a as $k => $v) {\n if ($v >= $m) { $ans = 0; break; }\n $r = $b[$k] ?? 0;\n if ($v + $r < $m) $a[$k] = $b[$k] = null; else $ans = min($ans, $m - $v);\n}\n\necho $ans == $n + 1 ? -1 : $ans;"}, {"source_code": ""}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = intval($up[$value]);\n\t\tif (array_key_exists($value, $down)) $ud = intval($down[$value]);\n\t\t$total = $uv + $ud;\n\t\n\t\tif (intval($total) < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = $up[$value];\n\t\tif (array_key_exists($value, $down)) $ud = $down[$value];\n\t\t$total = $uv + $ud;\n\t\n\t\tif ($total < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = intval($up[$value]);\n\t\tif (array_key_exists($value, $down)) $ud = intval($down[$value]);\n\t\t$total = $uv + $ud;\n\t\n\t\tif (intval($total) < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $up[$value]);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\tif ($up[$value] >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $up[$value]);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$total = 0;\n\t\t$value = intval($value);\n\t\tif (array_key_exists($value, $up)) $total += $up[$value];\n\t\tif (array_key_exists($value, $down)) $total += $down[$value];\n\t\tif ($total < $half) continue;\n\t\tif ($up[$value] >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $up[$value]);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = intval($up[$value]);\n\t\tif (array_key_exists($value, $down)) $ud = intval($down[$value]);\n\t\t$total = $uv + $ud;\n\t\n\t\tif (intval($total) < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = $up[$value];\n\t\tif (array_key_exists($value, $down)) $ud = $down[$value];\n\t\t$total = $uv + $ud;\n\t\n\t\tif ($total < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = intval($up[$value]);\n\t\tif (array_key_exists($value, $down)) $ud = intval($down[$value]);\n\t\t$total = $uv + $ud;\n\t\n\t\tif (intval($total) < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$value = intval($value);\n\t\t$uv = 0; $ud = 0;\n\t\tif (array_key_exists($value, $up)) $uv = intval($up[$value]);\n\t\tif (array_key_exists($value, $down)) $ud = intval($down[$value]);\n\t\t$total = $uv + $ud;\n\t\n\t\tif (intval($total) < $half) continue;\n\t\tif ($uv >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $uv);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": "= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $up[$value]);\n\t}\n\t\n\tforeach($kd as $value){\n\t\t$total = 0;\n\t\tif (array_key_exists($value, $up)) $total += $up[$value];\n\t\tif (array_key_exists($value, $down)) $total += $down[$value];\n\t\tif ($total < $half) continue;\n\t\tif ($up[$value] >= $half){\n\t\t\tprint 0;\n\t\t\tdie();\n\t\t}\n\t\t$res = min($res,$half - $up[$value]);\n\t}\n\t\n\tif ($res == (1<<30)) print -1; else\tprint $res;\n?>"}, {"source_code": ""}], "src_uid": "5e055bad1da5bdc84599d6f2f89fbd12"} {"source_code": " $i)\n {\n $c = 1;\n break;\n }\n $i--;\n $k = $i - $j;\n $l = ceil($k / 2) + max($h, $f);\n $d = max($d, $l);\n}\n$d = max($d, $a - $e + $f);\nif($c == 1)\n{\n print \"IMPOSSIBLE\";\n}\nelse\n{\n print $d;\n}\n?>", "positive_code": [{"source_code": " $prevH) {\n $diff = ($d - $prevD) - ($h - $prevH);\n if ($diff < 0) {\n echo \"IMPOSSIBLE\\n\";\n return;\n }\n $possH = $h + floor($diff / 2);\n } else {\n $diff = ($d - $prevD) - ($prevH - $h);\n if ($diff < 0) {\n echo \"IMPOSSIBLE\\n\";\n return;\n }\n $possH = $prevH + floor($diff / 2);\n }\n }\n $maxH = max($maxH, $possH);\n\n $prevD = $d;\n $prevH = $h;\n}\n\n$possH = $prevH + ($n - $prevD);\n$maxH = max($maxH, $possH);\n\necho \"$maxH\\n\";\n"}], "negative_code": [{"source_code": " $i)\n {\n $c = 1;\n break;\n }\n $i--;\n $k = $i - $j;\n $l = ceil($k / 2);\n $d = max($d, $l);\n}\n$d = max($d, $a - $e + $f);\nif($c == 1)\n{\n print \"IMPOSSIBLE\";\n}\nelse\n{\n print $d;\n}\n?>"}], "src_uid": "77b5bed410d621fb56c2eaebccff5108"} {"source_code": ""}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": " $time){\n $min = $time;\n }\n}\necho number_format($min, 20, '.', '');\n\nfunction distance($a, $b){\n $x = $b[0]-$a[0];\n $y = $b[1]-$a[1];\n return sqrt($x*$x+$y*$y);\n}"}, {"source_code": "\n * @creation_date : 2016-11-28 09:55\n * @project : codeforces\n */\n\n/**\n * @title : A. Beru-taxi\n * @link : http://codeforces.com/problemset/problem/706/A\n * @tags : brute force, geometry, implementation\n * @time_limit : 1 s\n * @memory_limit : 256 MB\n * @input : stdin\n * @output : stdout\n *\n * Vasiliy lives at point (a,\u2009b) of the coordinate plane.\n * He is hurrying up to work so he wants to get out of his house as soon as possible.\n * His new app suggested that there are n available Beru-taxis nearby.\n * The i-th taxi is located at point (xi,\u2009yi) and moves with a speed vi.\n *\n * Consider that each of n drivers will move directly to Vasiliy and with a maximum possible speed.\n * Compute the minimum time when Vasiliy will get in any of Beru-taxi cars.\n *\n * Input\n * The first line of the input contains two integers a and b (-100\u2009\u2264\u2009a,\u2009b\u2009\u2264\u2009100) \u2014 coordinates of Vasiliy's home.\n * The second line contains a single integer n (1\u2009\u2264\u2009n\u2009\u2264\u20091000) \u2014 the number of available Beru-taxi cars nearby.\n * The i-th of the following n lines contains three integers xi, yi and vi (-100\u2009\u2264\u2009xi,\u2009yi\u2009\u2264\u2009100, 1\u2009\u2264\u2009vi\u2009\u2264\u2009100)\n * \u2014 the coordinates of the i-th car and its speed.\n * It's allowed that several cars are located at the same point.\n * Also, cars may be located at exactly the same point where Vasiliy lives.\n *\n * Output\n * Print a single real value \u2014 the minimum time Vasiliy needs to get in any of the Beru-taxi cars.\n * You answer will be considered correct if its absolute or relative error does not exceed 1e-6.\n * Namely: let's assume that your answer is a, and the answer of the jury is b.\n * The checker program will consider your answer correct, if abs(a - b)/max(1, b) <= 1e-6.\n */\n\n/**\n * @name : Point\n * @package : P706\\A\n * @class : Point\n */\nclass Point {\n /**\n * @param resource $stdin\n *\n * @return Point\n */\n public static function createFromStdin($stdin) {\n return new Point(...static::explodeStdin($stdin));\n }\n\n /**\n * @param $stdin\n *\n * @return array\n */\n protected static function explodeStdin($stdin) {\n return array_map(\"intval\", array_filter(explode(\" \", ltrim(fgets($stdin))), \"strlen\"));\n }\n\n /**\n * @var int x\n */\n private $x;\n\n /**\n * @var int y\n */\n private $y;\n\n /**\n * Point constructor.\n *\n * @param int $x\n * @param int $y\n */\n public function __construct(int $x, int $y) {\n $this->x = $x;\n $this->y = $y;\n }\n\n /**\n * @param Point $other\n *\n * @return float\n */\n public function distanceTo(Point $other): float {\n return sqrt(($this->x - $other->x) ** 2 + ($this->y - $other->y) ** 2);\n }\n\n /**\n * @return string\n */\n public function __toString(): string {\n return sprintf(\"%.6f\", $this->x, $this->y);\n }\n}\n\n/**\n * @name : Vector\n * @package : P706\\A\n * @class : Vector\n */\nclass Vector extends Point {\n /**\n * @param resource $stdin\n *\n * @return Vector\n */\n public static function createFromStdin($stdin): Vector {\n return new Vector(...static::explodeStdin($stdin));\n }\n\n /**\n * @var int $v\n */\n private $v;\n\n /**\n * Point constructor.\n *\n * @param int $x\n * @param int $y\n * @param int $v\n */\n public function __construct(int $x, int $y, int $v) {\n parent::__construct($x, $y);\n $this->v = $v;\n }\n\n /**\n * @param Point $home\n *\n * @return float\n */\n public function timeTo(Point $home): float {\n return $this->distanceTo($home) / $this->v;\n }\n}\n\n$stdin = fopen(\"php://stdin\", \"r\");\n$home = Point::createFromStdin($stdin);\n$n = intval(fgets($stdin));\n$min = INF;\n\nfor ($i = 0; $i < $n; $i++) {\n $t = Vector::createFromStdin($stdin)->timeTo($home);\n\n if ($t < $min) {\n $min = $t;\n }\n}\n\necho sprintf(\"%.6f\", $min);"}], "negative_code": [], "src_uid": "a74c65acd41ff9bb845062222135c60a"} {"source_code": "", "positive_code": [{"source_code": " (int)$l,\n 'end' => (int)$r\n );\n }\n \n foreach($aPoints AS $aPoint) {\n for($j = $aPoint['start']; $j <= $aPoint['end']; $j++) {\n $aLeft[$j] = 0;\n }\n }\n \n $sLeft = '';\n $iLeft = 0;\n foreach($aLeft AS $iIndex => $iPoint) {\n if($iPoint) {\n if($iLeft != 0) {\n $sLeft .= ' ';\n }\n $sLeft .= $iIndex;\n $iLeft++;\n }\n }\n \n if($iLeft) {\n echo sprintf(\"%s\\n%s\", $iLeft, $sLeft);\n } else {\n echo $iLeft;\n }\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "list($n, $m) = explode(\" \", fgets(STDIN));\n$n = (int)$n;\n$m = (int)$m;\n\n$aPoints = array();\n$aLeft = array_fill(1, $m, 1);\n\nfor($i = 0; $i < $n; $i++) {\n list($l, $r) = explode(\" \", fgets(STDIN));\n $aPoints[] = array(\n 'start' => (int)$l,\n 'end' => (int)$r\n );\n}\n\nforeach($aPoints AS $aPoint) {\n for($j = $aPoint['start']; $j <= $aPoint['end']; $j++) {\n $aLeft[$j] = 0;\n }\n}\n\n$sLeft = '';\n$iLeft = 0;\nforeach($aLeft AS $iIndex => $iPoint) {\n if($iPoint) {\n if($iLeft != 0) {\n $sLeft .= ' ';\n }\n $sLeft .= $iIndex;\n $iLeft++;\n }\n}\n\nif($iLeft) {\n echo $iLeft . '
';\n echo $sLeft;\n} else {\n echo $iLeft;\n}"}, {"source_code": ""}], "src_uid": "f336b622fdaf5960032268641320bb53"} {"source_code": "", "positive_code": [{"source_code": " $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\t$m = count($matches);\n\tfor ($i = 0; $i < $m - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < $m; $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = $prices[$item] + $prices[$item_2] + $prices[$item_3];\n\t\t\tif ($price < $min || $min == -1) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min;\n"}], "negative_code": [{"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = PHP_INT_MAX;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min == PHP_INT_MAX ? -1 : $min;\n"}, {"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = -1;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min || $min == -1) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min;\n"}, {"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = -1;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min || $min == -1) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min . \"\\r\\n\";\n"}, {"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = PHP_INT_MAX;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min == PHP_INT_MAX ? -1 : $min;\necho PHP_EOL;\n"}, {"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = -1;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min || $min == -1) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min;\n"}, {"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = -1;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min || $min == -1) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min;\n"}, {"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = -1;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min || $min == -1) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min;\n"}, {"source_code": " $item) {\n\t\t$new_match[$k] = $item - 1;\n\t}\n\tforeach ($new_match as $k => $item) {\n\t\t$other_item = $new_match[(int) !$k];\n\t\t$map[$item][$other_item] = true;\n\t}\n}\n\n$min = -1;\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tforeach ($map as $k => $it) {\n\t\t\tunset($map[$k][$item]);\n\t\t}\n\t}\n}\n\nforeach ($map as $item => $matches) {\n\tif (count($matches) < 2) {\n\t\tcontinue;\n\t}\n\t$matches_keys = array_keys($matches);\n\tfor ($i = 0; $i < count($matches) - 1; $i++) {\n\t\t$item_2 = $matches_keys[$i];\n\t\tfor ($j = $i + 1; $j < count($matches); $j++) {\n\t\t\t$item_3 = $matches_keys[$j];\n\t\t\tif (!isset($map[$item_2][$item_3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$price = array_sum(array_intersect_key($prices, array($item, $item_2, $item_3)));\n\t\t\tif ($price < $min || $min == -1) {\n\t\t\t\t$min = $price;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $min;\n"}], "src_uid": "d90da1e932a6aa546bec4e1bd4b1fbec"} {"source_code": "'0',\r\n '1' =>'10',\r\n '2' => '20',\r\n '3' => '30',\r\n '4' =>'40',\r\n '5' =>'50',\r\n // '6:6' =>0,\r\n // '7:7' =>0,\r\n // '8:8' =>0,\r\n // '9:9' =>0,\r\n '10' =>'1' ,\r\n '11' =>'11' ,\r\n '12' =>'21' ,\r\n '13' =>'31',\r\n '14' =>'41' ,\r\n '15' =>'51' ,\r\n '20' =>'2' ,\r\n '21' =>'12' ,\r\n '22' =>'22' ,\r\n '23' =>'32'\r\n ];\r\n $totalTime = 24 * 60;\r\n list($time, $timer) = IO::getArray();\r\n $aT = explode(':', $time);\r\n $tt = 0;\r\n $temp = '';\r\n if($aT[0][0] == '0') {\r\n $tt = (int)$aT[0][1] * 60;\r\n $temp .= $aT[0][1];\r\n } else {\r\n $tt = (int)$aT[0] * 60;\r\n $temp .= $aT[0];\r\n }\r\n if($aT[1][0] == '0') {\r\n $tt += (int)$aT[1][1];\r\n $temp = $temp . ':'. $aT[1][1];\r\n } else {\r\n $tt += (int)$aT[1];\r\n $temp = $temp . ':'. $aT[1];\r\n }\r\n $ans = 0;\r\n foreach($polindrom as $hour=>$minute) {\r\n $tot = (int)$hour * 60 + (int)$minute;\r\n $tot = $tot > $tt ? $tot : $tot + $totalTime;\r\n $iterator = 0;\r\n $tim = $tot - $tt;\r\n while($iterator < $timer) {\r\n $iterator++;\r\n // $tot += $totalTime;\r\n if($tim % $timer == 0) {\r\n $ans++;\r\n break;\r\n } else {\r\n $tim = $tim % $timer + $totalTime;\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\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 setTime($data_time[0],$data_time[1]);\r\n $dt->add(new DateInterval('PT' . $time[1] . 'M'));\r\n $out_dt = $dt->format('H:i');\r\n if ($out_dt[0]==$out_dt[4] && $out_dt[1]==$out_dt[3]){\r\n ++$pal;\r\n }\r\n }\r\n echo \"$pal\\n\";\r\n \r\n \r\n}\r\n$num = trim(fgets(STDIN));\r\nfor($k = 0; $k<$num; $k++){\r\n getPal();\r\n}\r\n?>"}, {"source_code": "format('H:i')\r\n and $s2 == strrev($s2)\r\n and $i++;\r\n } while ($s2 != $s);\r\n echo $i, \"\\n\";\r\n}"}], "negative_code": [{"source_code": "'0',\r\n '1' =>'10',\r\n '2' => '20',\r\n '3' => '30',\r\n '4' =>'40',\r\n '5' =>'50',\r\n // '6:6' =>0,\r\n // '7:7' =>0,\r\n // '8:8' =>0,\r\n // '9:9' =>0,\r\n '10' =>'1' ,\r\n '11' =>'11' ,\r\n '12' =>'21' ,\r\n '13' =>'31',\r\n '14' =>'41' ,\r\n '15' =>'51' ,\r\n '20' =>'2' ,\r\n '21' =>'12' ,\r\n '22' =>'22' ,\r\n '23' =>'32'\r\n ];\r\n $totalTime = 24 * 60;\r\n list($time, $timer) = IO::getArray();\r\n $aT = explode(':', $time);\r\n $tt = 0;\r\n $temp = '';\r\n if($aT[0][0] == '0') {\r\n $tt = (int)$aT[0][1] * 60;\r\n $temp .= $aT[0][1];\r\n } else {\r\n $tt = (int)$aT[0] * 60;\r\n $temp .= $aT[0];\r\n }\r\n if($aT[1][0] == '0') {\r\n $tt += (int)$aT[1][1];\r\n $temp = $temp . ':'. $aT[1][1];\r\n } else {\r\n $tt += (int)$aT[1];\r\n $temp = $temp . ':'. $aT[1];\r\n }\r\n $ans = 0;\r\n foreach($polindrom as $hour=>$minute) {\r\n $tot = (int)$hour * 60 + (int)$minute;\r\n $tot = $tot > $tt ? $tot : $tot + $totalTime;\r\n $iterator = 0;\r\n $tim = $tot - $tt;\r\n while($iterator < $timer/2) {\r\n $iterator++;\r\n // $tot += $totalTime;\r\n if(bcmod($tim, $timer) == 0) {\r\n $ans++;\r\n break;\r\n } else {\r\n $tim = bcadd($tim, $totalTime);\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\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',\r\n '1' =>'10',\r\n '2' => '20',\r\n '3' => '30',\r\n '4' =>'40',\r\n '5' =>'50',\r\n // '6:6' =>0,\r\n // '7:7' =>0,\r\n // '8:8' =>0,\r\n // '9:9' =>0,\r\n '10' =>'1' ,\r\n '11' =>'11' ,\r\n '12' =>'21' ,\r\n '13' =>'31',\r\n '14' =>'41' ,\r\n '15' =>'51' ,\r\n '20' =>'2' ,\r\n '21' =>'12' ,\r\n '22' =>'22' ,\r\n '23' =>'32'\r\n ];\r\n $totalTime = 24 * 60;\r\n list($time, $timer) = IO::getArray();\r\n $aT = explode(':', $time);\r\n $tt = 0;\r\n $temp = '';\r\n if($aT[0][0] == '0') {\r\n $tt = (int)$aT[0][1] * 60;\r\n $temp .= $aT[0][1];\r\n } else {\r\n $tt = (int)$aT[0] * 60;\r\n $temp .= $aT[0];\r\n }\r\n if($aT[1][0] == '0') {\r\n $tt += (int)$aT[1][1];\r\n $temp = $temp . ':'. $aT[1][1];\r\n } else {\r\n $tt += (int)$aT[1];\r\n $temp = $temp . ':'. $aT[1];\r\n }\r\n $ans = 0;\r\n foreach($polindrom as $hour=>$minute) {\r\n $tot = (int)$hour * 60 + (int)$minute;\r\n $tot = $tot > $tt ? $tot : $tot + $totalTime;\r\n $iterator = 0;\r\n $tim = $tot - $tt;\r\n while($iterator < 24) {\r\n $iterator++;\r\n // $tot += $totalTime;\r\n if(bcmod($tim, $timer) == 0) {\r\n $ans++;\r\n break;\r\n } else {\r\n $tim = bcadd($tim, $totalTime);\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\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',\r\n '1' =>'10',\r\n '2' => '20',\r\n '3' => '30',\r\n '4' =>'40',\r\n '5' =>'50',\r\n // '6:6' =>0,\r\n // '7:7' =>0,\r\n // '8:8' =>0,\r\n // '9:9' =>0,\r\n '10' =>'1' ,\r\n '11' =>'11' ,\r\n '12' =>'21' ,\r\n '13' =>'31',\r\n '14' =>'41' ,\r\n '15' =>'51' ,\r\n '20' =>'2' ,\r\n '21' =>'12' ,\r\n '22' =>'22' ,\r\n '23' =>'32'\r\n ];\r\n $totalTime = 24 * 60;\r\n list($time, $timer) = IO::getArray();\r\n $aT = explode(':', $time);\r\n $tt = 0;\r\n $temp = '';\r\n if($aT[0][0] == '0') {\r\n $tt = (int)$aT[0][1] * 60;\r\n $temp .= $aT[0][1];\r\n } else {\r\n $tt = (int)$aT[0] * 60;\r\n $temp .= $aT[0];\r\n }\r\n if($aT[1][0] == '0') {\r\n $tt += (int)$aT[1][1];\r\n $temp = $temp . ':'. $aT[1][1];\r\n } else {\r\n $tt += (int)$aT[1];\r\n $temp = $temp . ':'. $aT[1];\r\n }\r\n $ans = 0;\r\n foreach($polindrom as $hour=>$minute) {\r\n $tot = (int)$hour * 60 + (int)$minute;\r\n $tot = $tot > $tt ? $tot : $tot + $totalTime;\r\n $iterator = 0;\r\n while($iterator < 60) {\r\n $iterator++;\r\n // $tot += $totalTime;\r\n if(bcmod(bcsub($tot, $tt ), $timer) == 0) {\r\n $ans++;\r\n break;\r\n } else {\r\n $tot = bcadd($tot, $totalTime);\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\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',\r\n '1' =>'10', \r\n '2' => '20',\r\n '3' => '30',\r\n '4' =>'40',\r\n '5' =>'50', \r\n // '6:6' =>0,\r\n // '7:7' =>0,\r\n // '8:8' =>0,\r\n // '9:9' =>0,\r\n '10' =>'1' ,\r\n '11' =>'11' , \r\n '12' =>'21' ,\r\n '13' =>'31',\r\n '14' =>'41' , \r\n '15' =>'51' , \r\n '20' =>'2' , \r\n '21' =>'12' ,\r\n '22' =>'22' ,\r\n '23' =>'32' \r\n ];\r\n $totalTime = 24 * 60;\r\n list($time, $timer) = IO::getArray();\r\n $aT = explode(':', $time);\r\n $tt = 0;\r\n $temp = '';\r\n if($aT[0][0] == '0') {\r\n $tt = (int)$aT[0][1] * 60; \r\n $temp .= $aT[0][1];\r\n } else {\r\n $tt = (int)$aT[0] * 60; \r\n $temp .= $aT[0];\r\n }\r\n if($aT[1][0] == '0') {\r\n $tt += (int)$aT[1][1]; \r\n $temp = $temp . ':'. $aT[1][1];\r\n } else {\r\n $tt += (int)$aT[1]; \r\n $temp = $temp . ':'. $aT[1];\r\n }\r\n $ans = 0;\r\n foreach($polindrom as $hour=>$minute) {\r\n $tot = (int)$hour * 60 + (int)$minute;\r\n $tot = $tot > $tt ? $tot : $tot + $totalTime;\r\n $ess = $tot - $tt;\r\n $kald = $ess% $timer;\r\n // IO::pr($hour . \" \" .$tot . \" \" . $tt . \" \" . $ess . \" \" . $timer . ' ' . $kald);\r\n if(($tot - $tt ) % $timer == 0) {\r\n $ans++;\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 ", "positive_code": [{"source_code": "$max) $max=$b[$i];\n}\nfor ($k=0,$i=1;$i<=$n;$i++)\nif (($a[$i]==$min)&($b[$i]==$max)) {print $i; $k=1;break;}\nif ($k==0) print \"-1\";\n?>"}, {"source_code": "\n\n $i) {\n if (($a[$ai][0] > $i[0]) || ($a[$ai][0] == $i[0] && $a[$ai][1] < $i[1])) {\n $ai = $key;\n }\n}\nforeach ($a as $i) {\n if ($i[1] > $a[$ai][1]) {\n printf(\"-1\");\n exit;\n }\n}\n\nprintf(\"%d\", $ai + 1);\n\n?>\n"}, {"source_code": "= $rightmost)\n $segment = $i;\n else if ($l >= $leftmost && $r <= $rightmost)\n continue;\n else\n $segment = -1;\n $leftmost = min($l, $leftmost);\n $rightmost = max($r, $rightmost);\n }\n fprintf(STDOUT, \"%d\\n\", $segment);\n}\n\nmain();"}], "negative_code": [{"source_code": "= $c)\n {\n array_push($f, $x);\n }\n }\n if(($e >= $c) && ($e != $d))\n {\n $c = $e;\n if($d <= $b)\n {\n array_push($g, $x);\n }\n }\n}\nif($b == $c)\n{\n print \"-1\";\n}\nelse\n{\n for($x = 0; $x < count($f); $x++)\n {\n for($y = 0; $y < count($g); $y++)\n {\n if($f[$x] == $g[$y])\n {\n print $f[$x];\n break;\n }\n }\n }\n}\n?>"}, {"source_code": "= $c)\n {\n array_push($f, $x);\n }\n }\n if(($e >= $c) && ($e != $d))\n {\n $c = $e;\n if($d <= $b)\n {\n array_push($g, $x);\n }\n }\n}\nif($b == $c)\n{\n print \"-1\";\n}\nelse\n{\n for($x = 0; $x < count($f); $x++)\n {\n for($y = 0; $y < count($g); $y++)\n {\n if($f[$x] == $g[$y])\n {\n array_push($h, $f[$x]);\n break;\n }\n }\n }\n rsort($h);\n print $h[0];\n}\n?>"}], "src_uid": "e702594a8e993e135ea8ca78eb3ecd66"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "07b750dbf7f942eab80d4260103c7472"} {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "09991e8e16cd395c7ce459817a385988"} {"source_code": ""}, {"source_code": "= 1 ;$j--) {\n\t\t\t\techo \"#\";\t\n\t\t\t}\n\t\t}\n\t\t$l2r = !$l2r;\n\t} else {\n\t\tif($l2r) {\n\t\t\techo \"#\";\n\t\t\tfor($j = 2; $j <= $m ;$j++) {\n\t\t\t\techo \".\";\t\n\t\t\t}\n\t\t} else {\n\t\t\tfor($j = 1; $j <= $m-1 ;$j++) {\n\t\t\t\techo \".\";\t\n\t\t\t}\n\t\t\techo \"#\";\n\t\t}\t\n\t}\n\techo \"\\n\";\n}\n?>\n\n"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "\");\n}"}], "src_uid": "2a770c32d741b3440e7f78cd5670d54d"} {"source_code": "", "positive_code": [{"source_code": " 0) {\r\n $a[$f[0][0] - 1][$f[0][1]] = '*';\r\n $a[$f[1][0] - 1][$f[1][1]] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][0] == $f[1][0] && $f[0][0] == 0) {\r\n $a[$f[0][0] + 1][$f[0][1]] = '*';\r\n $a[$f[1][0] + 1][$f[1][1]] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][1] == $f[1][1] && $f[0][1] > 0) {\r\n $a[$f[0][0]][$f[0][1] - 1] = '*';\r\n $a[$f[1][0]][$f[1][1] - 1] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][1] == $f[1][1] && $f[0][1] == 0) {\r\n $a[$f[0][0]][$f[0][1] + 1] = '*';\r\n $a[$f[1][0]][$f[1][1] + 1] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][0] != $f[1][0] && $f[0][1] != $f[1][1]) {\r\n $a[$f[0][0]][$f[1][1]] = '*';\r\n $a[$f[1][0]][$f[0][1]] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n}\r\n\r\n?>"}, {"source_code": " 0; $t--) {\r\n\r\n\t$n = intval(fgets(STDIN));\r\n\t$a = [];\r\n\t$inds = [];\r\n\tfor($i = 0; $i < $n; $i++){\r\n\t\t$aa = trim(fgets(STDIN));\r\n\t\tfor($j = 0; $j < $n; $j++){\r\n\t\t\tif($aa[$j] == '*'){\r\n\t\t\t\t$inds[] = [$i, $j];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$a[] = $aa;\r\n\t}\r\n\r\n\t$res = $solve($n, $inds, $a);\r\n\t$a[$res[0][0]][$res[0][1]] = '*';\r\n\t$a[$res[1][0]][$res[1][1]] = '*';\r\n\r\n\tfor($i = 0; $i < $n; $i++){\r\n\t\techo $a[$i];\r\n\t\techo \"\\n\";\r\n\t}\r\n\r\n}\r\n"}, {"source_code": "0){\r\n\r\n $position_i2 = $i;\r\n $position_j2 = $j;\r\n }\r\n else{\r\n $position_i1 = $i;\r\n $position_j1 = $j;\r\n }\r\n $count++;\r\n }\r\n\r\n if($count==2){\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if(($position_i1<$position_i2 && $position_j1>$position_j2) ||\r\n ($position_i1<$position_i2 && $position_j1<$position_j2) ){\r\n\r\n $matrix[$position_i1][$position_j2] = \"*\";\r\n $matrix[$position_i2][$position_j1] = \"*\";\r\n }\r\n\r\n elseif (($position_i1<$position_i2 && $position_j1==$position_j2)){\r\n\r\n if($position_j1 == ($n-1)){\r\n\r\n $matrix[$position_i1][$position_j1-1] = \"*\";\r\n $matrix[$position_i2][$position_j2-1] = \"*\";\r\n }\r\n else{\r\n $matrix[$position_i1][$position_j1+1] = \"*\";\r\n $matrix[$position_i2][$position_j2+1] = \"*\";\r\n }\r\n }\r\n elseif($position_i1==$position_i2){\r\n\r\n if($position_i1 == ($n-1)){\r\n $matrix[$position_i1-1][$position_j1] = \"*\";\r\n $matrix[$position_i2-1][$position_j2] = \"*\";\r\n }\r\n else{\r\n $matrix[$position_i1+1][$position_j1] = \"*\";\r\n $matrix[$position_i2+1][$position_j2] = \"*\";\r\n }\r\n }\r\n\r\n for ($i=0;$i<$n;$i++) {\r\n\r\n for ($j = 0; $j < $n; $j++) {\r\n echo $matrix[$i][$j];\r\n }\r\n echo \"\\n\";\r\n\r\n }\r\n}\r\n\r\n"}, {"source_code": " 0){\r\n $secondAstX = $k+1;\r\n $secondAstY = $j+1;\r\n //pokud jsou dv\u011b * nad sebou\r\n if($firstAstX == $secondAstX){\r\n if($firstAstX > 1){\r\n $thirdAstX = $firstAstX-1;\r\n $thirdAstY = $firstAstY;\r\n $fourthAstX = $secondAstX-1;\r\n $fourthAstY = $secondAstY;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se \u010dtvrtou *\r\n if($fourthAstX == 1){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],1);\r\n $rectangles[$i][$firstAstY-1] = \"*\" . $fourthZ;\r\n }elseif($fourthAstX == strlen($rectangles[$i][$firstAstY-1])){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,strlen($rectangles[$i][$firstAstY-1])-1);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\";\r\n }else{\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,$fourthAstX-1);\r\n $fourthZz = substr($rectangles[$i][$firstAstY-1],$fourthAstX,strlen($rectangles[$i][$firstAstY-1])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\" . $fourthZz;\r\n }\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed *\r\n if($thirdAstX == 1){\r\n $thirdZ = substr($rectangles[$i][$j],1);\r\n $rectangles[$i][$j] = \"*\" . $thirdZ;\r\n }elseif($thirdAstX == strlen($rectangles[$i][$j])){\r\n $thirdZ = substr($rectangles[$i][$j],0,strlen($rectangles[$i][$j])-1);\r\n $rectangles[$i][$j] = $thirdZ . \"*\";\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$j],0,$thirdAstX-1);\r\n $thirdZz = substr($rectangles[$i][$j],$thirdAstX,strlen($rectangles[$i][$j])-$thirdAstX);\r\n $rectangles[$i][$j] = $thirdZ . \"*\" . $thirdZz;\r\n }\r\n \r\n for($l=0; $l 1){\r\n $thirdAstX = $firstAstX;\r\n $thirdAstY = $firstAstY-1;\r\n $fourthAstX = $secondAstX;\r\n $fourthAstY = $secondAstY-1;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed a \u010dtvrtou *\r\n if($thirdAstX == 1){\r\n if($fourthAstX == 2){\r\n $space = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = \"**\" . $space;\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],1,$fourthAstX-$thirdAstX-1);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$thirdAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = \"*\" . $thirdZ . \"*\" . $fourthZ;\r\n }\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],0,$thirdAstX-1);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$thirdAstX,$fourthAstX-$thirdAstX-1);\r\n $space = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = $thirdZ . \"*\" . $fourthZ . \"*\" . $space;\r\n }\r\n \r\n for($l=0; $l"}, {"source_code": " 0){\r\n $secondAstX = $k+1;\r\n $secondAstY = $j+1;\r\n //pokud jsou dv\u011b * nad sebou\r\n if($firstAstX == $secondAstX){\r\n if($firstAstX > 1){\r\n $thirdAstX = $firstAstX-1;\r\n $thirdAstY = $firstAstY;\r\n $fourthAstX = $secondAstX-1;\r\n $fourthAstY = $secondAstY;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se \u010dtvrtou *\r\n if($fourthAstX == 1){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],1);\r\n $rectangles[$i][$firstAstY-1] = \"*\" . $fourthZ;\r\n }elseif($fourthAstX == strlen($rectangles[$i][$firstAstY-1])){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,strlen($rectangles[$i][$firstAstY-1])-1);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\";\r\n }else{\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,$fourthAstX-1);\r\n $fourthZz = substr($rectangles[$i][$firstAstY-1],$fourthAstX,strlen($rectangles[$i][$firstAstY-1])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\" . $fourthZz;\r\n }\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed *\r\n if($thirdAstX == 1){\r\n $thirdZ = substr($rectangles[$i][$j],1);\r\n $rectangles[$i][$j] = \"*\" . $thirdZ;\r\n }elseif($thirdAstX == strlen($rectangles[$i][$j])){\r\n $thirdZ = substr($rectangles[$i][$j],0,strlen($rectangles[$i][$j])-1);\r\n $rectangles[$i][$j] = $thirdZ . \"*\";\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$j],0,$thirdAstX-1);\r\n $thirdZz = substr($rectangles[$i][$j],$thirdAstX,strlen($rectangles[$i][$j])-$thirdAstX);\r\n $rectangles[$i][$j] = $thirdZ . \"*\" . $thirdZz;\r\n }\r\n \r\n for($l=0; $l 1){\r\n $thirdAstX = $firstAstX;\r\n $thirdAstY = $firstAstY-1;\r\n $fourthAstX = $secondAstX;\r\n $fourthAstY = $secondAstY-1;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed a \u010dtvrtou *\r\n if($thirdAstX == 1){\r\n if($fourthAstX == 2){\r\n $space = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = \"**\" . $space;\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],1,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$thirdAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = \"*\" . $thirdZ . \"*\" . $fourthZ;\r\n }\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],0,$thirdAstX-1);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$thirdAstX,$fourthAstX-$thirdAstX-1);\r\n $space = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = $thirdZ . \"*\" . $fourthZ . \"*\" . $space;\r\n }\r\n \r\n for($l=0; $l"}, {"source_code": " 0){\r\n $secondAstX = $k+1;\r\n $secondAstY = $j+1;\r\n //pokud jsou dv\u011b * nad sebou\r\n if($firstAstX == $secondAstX){\r\n if($firstAstX > 1){\r\n $thirdAstX = $firstAstX-1;\r\n $thirdAstY = $firstAstY;\r\n $fourthAstX = $secondAstX-1;\r\n $fourthAstY = $secondAstY;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se \u010dtvrtou *\r\n if($fourthAstX == 1){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],1);\r\n $rectangles[$i][$firstAstY-1] = \"*\" . $fourthZ;\r\n }elseif($fourthAstX == strlen($rectangles[$i][$firstAstY-1])){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,strlen($rectangles[$i][$firstAstY-1])-1);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\";\r\n }else{\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,$fourthAstX-1);\r\n $fourthZz = substr($rectangles[$i][$firstAstY-1],$fourthAstX,strlen($rectangles[$i][$firstAstY-1])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\" . $fourthZz;\r\n }\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed *\r\n if($thirdAstX == 1){\r\n $thirdZ = substr($rectangles[$i][$j],1);\r\n $rectangles[$i][$j] = \"*\" . $thirdZ;\r\n }elseif($thirdAstX == strlen($rectangles[$i][$j])){\r\n $thirdZ = substr($rectangles[$i][$j],0,strlen($rectangles[$i][$j])-1);\r\n $rectangles[$i][$j] = $thirdZ . \"*\";\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$j],0,$thirdAstX-1);\r\n $thirdZz = substr($rectangles[$i][$j],$thirdAstX,strlen($rectangles[$i][$j])-$thirdAstX);\r\n $rectangles[$i][$j] = $thirdZ . \"*\" . $thirdZz;\r\n }\r\n \r\n for($l=0; $l 1){\r\n $thirdAstX = $firstAstX;\r\n $thirdAstY = $firstAstY-1;\r\n $fourthAstX = $secondAstX;\r\n $fourthAstY = $secondAstY-1;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed a \u010dtvrtou *\r\n if($thirdAstX == 1){\r\n if($fourthAstX == 2){\r\n $space = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = \"**\" . $space;\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],1,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX-1);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = \"*\" . $thirdZ . \"*\" . $fourthZ;\r\n }\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],0,$thirdAstX-1);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$thirdAstX,$fourthAstX-$thirdAstX-1);\r\n $space = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = $thirdZ . \"*\" . $fourthZ . \"*\" . $space;\r\n }\r\n \r\n for($l=0; $l"}, {"source_code": " 0){\r\n $secondAstX = $k+1;\r\n $secondAstY = $j+1;\r\n //pokud jsou dv\u011b * nad sebou\r\n if($firstAstX == $secondAstX){\r\n if($firstAstX > 1){\r\n $thirdAstX = $firstAstX-1;\r\n $thirdAstY = $firstAstY;\r\n $fourthAstX = $secondAstX-1;\r\n $fourthAstY = $secondAstY;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se \u010dtvrtou *\r\n if($fourthAstX == 1){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],1);\r\n $rectangles[$i][$firstAstY-1] = \"*\" . $fourthZ;\r\n }elseif($fourthAstX == strlen($rectangles[$i][$firstAstY-1])){\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,strlen($rectangles[$i][$firstAstY-1])-1);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\";\r\n }else{\r\n $fourthZ = substr($rectangles[$i][$firstAstY-1],0,$fourthAstX-1);\r\n $fourthZz = substr($rectangles[$i][$firstAstY-1],$fourthAstX,strlen($rectangles[$i][$firstAstY-1])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-1] = $fourthZ . \"*\" . $fourthZz;\r\n }\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed *\r\n if($thirdAstX == 1){\r\n $thirdZ = substr($rectangles[$i][$j],1);\r\n $rectangles[$i][$j] = \"*\" . $thirdZ;\r\n }elseif($thirdAstX == strlen($rectangles[$i][$j])){\r\n $thirdZ = substr($rectangles[$i][$j],0,strlen($rectangles[$i][$j])-1);\r\n $rectangles[$i][$j] = $thirdZ . \"*\";\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$j],0,$thirdAstX-1);\r\n $thirdZz = substr($rectangles[$i][$j],$thirdAstX,strlen($rectangles[$i][$j])-$thirdAstX);\r\n $rectangles[$i][$j] = $thirdZ . \"*\" . $thirdZz;\r\n }\r\n \r\n for($l=0; $l 1){\r\n $thirdAstX = $firstAstX;\r\n $thirdAstY = $firstAstY-1;\r\n $fourthAstX = $secondAstX;\r\n $fourthAstY = $secondAstY-1;\r\n \r\n //p\u0159eps\u00e1n\u00ed \u0159\u00e1dku se t\u0159et\u00ed a \u010dtvrtou *\r\n if($thirdAstX == 1){\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],1,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX-1);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = \"*\" . $thirdZ . \"*\" . $fourthZ;\r\n }else{\r\n $thirdZ = substr($rectangles[$i][$firstAstY-2],0,$thirdAstX-1);\r\n $fourthZ = substr($rectangles[$i][$firstAstY-2],$thirdAstX,$fourthAstX-$thirdAstX-1);\r\n $space = substr($rectangles[$i][$firstAstY-2],$fourthAstX,strlen($rectangles[$i][$firstAstY-2])-$fourthAstX);\r\n $rectangles[$i][$firstAstY-2] = $thirdZ . \"*\" . $fourthZ . \"*\" . $space;\r\n }\r\n \r\n for($l=0; $l"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\r\n $a[$f[0][0] - 1][$f[0][1]] = '*';\r\n $a[$f[1][0] - 1][$f[1][1]] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][0] == $f[1][0] && $f[0][0] == 0) {\r\n $a[$f[0][0] + 1][$f[0][1]] = '*';\r\n $a[$f[1][0] + 1][$f[1][1]] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][1] == $f[1][1] && $f[0][1] > 0) {\r\n $a[$f[0][0]][$f[0][1] - 1] = '*';\r\n $a[$f[1][0]][$f[1][1] - 1] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][1] == $f[1][1] && $f[0][1] == 0) {\r\n $a[$f[0][0]][$f[0][1] + 1] = '*';\r\n $a[$f[1][0]][$f[1][1] + 1] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n if ($f[0][0] != $f[1][0] && $f[0][1] != $f[1][1]) {\r\n $a[$f[0][0]][$f[1][1]] = '*';\r\n $a[$f[1][0]][$f[0][1]] = '*';\r\n \r\n for ($h = 0; $h < $n; $h++) { echo $a[$h].PHP_EOL; }\r\n }\r\n \r\n}\r\n\r\n?>"}, {"source_code": " 0; $t--) {\r\n\r\n\t$n = intval(fgets(STDIN));\r\n\t$a = [];\r\n\t$inds = [];\r\n\tfor($i = 0; $i < $n; $i++){\r\n\t\t$aa = trim(fgets(STDIN));\r\n\t\tfor($j = 0; $j < $n; $j++){\r\n\t\t\tif($aa[$j] == '*'){\r\n\t\t\t\t$inds[] = [$i, $j];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$a[] = $aa;\r\n\t}\r\n\r\n\t$res = $solve($n, $inds, $a);\r\n\t$a[$res[0][0]][$res[0][1]] = 'o';\r\n\t$a[$res[1][0]][$res[1][1]] = 'o';\r\n\r\n\tfor($i = 0; $i < $n; $i++){\r\n\t\techo $a[$i];\r\n\t\techo \"\\n\";\r\n\t}\r\n\r\n}\r\n"}], "src_uid": "d8fb3822b983b8a8ffab341aee74f56f"} {"source_code": " $maxLike) {\n $maxLike = $like;\n }\n }\n}\n\nif ($maxLike <= 1) {\n echo \"2\\n\";\n} elseif ($maxLike <= 3) {\n echo \"1\\n\";\n} else {\n echo \"0\\n\";\n}\n", "positive_code": [{"source_code": ""}, {"source_code": " $similar) {\n $similar = $cmp;\n }\n }\n $numbers[] = $num;\n}\nif ($count == 1) {\n echo 6;\n} else {\n echo max(floor((5 - $similar) / 2), 0);\n}"}, {"source_code": " $differences) {\n $min_differences = $differences;\n }\n }\n \n if ($k > $min_differences) {\n $k = $min_differences;\n }\n \n $codes[] = $code;\n}\n\necho ($n == 1 ? $length : floor(($k - 1) / 2));\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $similar) {\n $similar = $cmp;\n }\n }\n $numbers[] = $num;\n}\n\necho max(floor((5 - $similar) / 2), 0);"}, {"source_code": " $similar) {\n $similar = $cmp;\n }\n }\n $numbers[] = $num;\n}\nif (count($numbers) == 1) {\n echo 6;\n} else {\n echo max(floor((5 - $similar) / 2), 0);\n}"}, {"source_code": " $similar) {\n $similar = $cmp;\n }\n }\n $numbers[] = $num;\n}\n\necho floor((6 - $similar) / 2);"}, {"source_code": " $differences) {\n $min_differences = $differences;\n }\n }\n \n if ($k > $min_differences) {\n $k = $min_differences;\n }\n \n $codes[] = $code;\n}\n\necho ($k ? floor(($k - 1) / 2) : 0);\n"}], "src_uid": "0151c42a653421653486c93efe87572d"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "eb39ac8d703516c7f81f95a989791b21"} {"source_code": "", "positive_code": [{"source_code": " 0) && ($y > 0) && ($z > 0))\n {\n if(($x % 3 != 0) && ($y % 3 != 0) && ($z % 3 != 0))\n {\n if($x + $y + $z == $a)\n {\n $e = 1;\n break;\n }\n }\n }\n }\n if($e == 1)\n {\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n}\nprint $x . \" \" . $y . \" \". $z;\n?>"}], "negative_code": [], "src_uid": "91d5147fb602298e08cbdd9f86d833f8"} {"source_code": " -1; $i--) {\n $l = 0; $r = strlen($text[$i]) + 1; $m = 0; $ans = 0;\n while ($l < $r) {\n $m = $l + $r >> 1;\n if (strcmp(substr($text[$i], 0, $m), $text[$i + 1]) <= 0) $l = ($ans = $m) + 1; else $r = $m;\n \n }\n $text[$i] = substr($text[$i], 0, $ans);\n \n }\n $ans = \"\";\n for ($i = 0; $i < $n; $i++) {\n $ans .= $text[$i] . \"\\n\";\n }\n echo $ans;", "positive_code": [{"source_code": " -1; $i--) {\n $l = 0; $r = strlen($text[$i]) + 1; $m = 0; $ans = 0;\n while ($l < $r) {\n $m = $l + $r >> 1;\n if (strcmp(substr($text[$i], 0, $m), $text[$i + 1]) <= 0) $l = ($ans = $m) + 1; else $r = $m;\n \n }\n $text[$i] = substr($text[$i], 0, $ans);\n \n }\n\n for ($i = 0; $i < $n; $i++) {\n echo $text[$i] . \"\\n\";\n }\n"}], "negative_code": [], "src_uid": "27baf9b1241c0f8e3a2037b18f39fe34"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": "$new){\n $out = $old.' '.$new;\n writeOut($out);\n}\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": "$new){\n $out = $old.' '.$new;\n writeOut($out);\n}\n?>\n\n"}, {"source_code": "$new){\n $out = $old.' '.$new;\n writeOut($out);\n}\n?>\n\n"}, {"source_code": "$new){\n $out = $old.' '.$new;\n writeOut($out);\n}\n?>\n\n"}, {"source_code": "$new){\n $out = $old.' '.$new;\n writeOut($out);\n}\n?>\n\n"}, {"source_code": "$new){\n $out = $old.' '.$new;\n writeOut($out);\n}\n?>\n\n"}, {"source_code": "\n"}, {"source_code": "\n"}], "src_uid": "bdd98d17ff0d804d88d662cba6a61e8f"} {"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\r\nfunction iter($arr, $ar) {\r\n $tmp = array();\r\n foreach ($arr as $i => $a) {\r\n $tmp[$i] = $ar[$a];\r\n }\r\n return $tmp;\r\n}\r\n\r\nfunction add($arr) {\r\n $ar = array();\r\n foreach ($arr as $a) {\r\n if (!isset($ar[$a])) {\r\n $ar[$a] = 1;\r\n } else {\r\n $ar[$a] += 1;\r\n }\r\n }\r\n return $ar;\r\n}\r\n\r\nwhile ($t--) {\r\n $n = IO::str();\r\n $arr = IO::arr();\r\n $ar = add($arr);\r\n// $arr = iter($arr, $ar);\r\n// $ar = add($arr);\r\n// $arr = iter($arr, $ar);\r\n// $ar = add($arr);\r\n// $arr = iter($arr, $ar);\r\n//\r\n// var_dump($arr);\r\n// var_dump($ar);\r\n\r\n $tmp = array();\r\n $q = array();\r\n\r\n while ($arr != $tmp) {\r\n if (count($q) > 1 && $q[count($q)-1] == $arr) {\r\n break;\r\n }\r\n\r\n $q[] = $arr;\r\n\r\n $arr = iter($arr, $ar);\r\n $ar = add($arr);\r\n }\r\n\r\n $qs = IO::str();\r\n// foreach ($q as $aq) {\r\n// foreach ($aq as $qz) {\r\n// echo $qz . ' ';\r\n// }\r\n// echo PHP_EOL;\r\n// }\r\n// print_r($q[0][1]);\r\n while ($qs--) {\r\n list($a, $b) = IO::arr();\r\n if ($b >= count($q)) {\r\n $b = count($q) - 1;\r\n }\r\n echo $q[$b][$a-1] . PHP_EOL;\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 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 $a = IO::arr();\r\n $q = IO::str();\r\n $res = [$a];\r\n for ($i = 0; $i < 2005; $i++) {\r\n $tmp = array_count_values($res[$i]);\r\n $nt = [];\r\n foreach ($res[$i] as $nv) {\r\n $nt[] = $tmp[$nv];\r\n }\r\n $res[$i+1] = $nt;\r\n }\r\n while ($q > 0) {\r\n $q--;\r\n list($x, $k) = IO::arr();\r\n if (isset($res[$k])) {\r\n IO::line($res[$k][$x - 1]);\r\n } else {\r\n IO::line($res[2004][$x - 1]);\r\n }\r\n }\r\n}\r\n\r\n\r\n?>\r\n\r\n\r\n\r\n\r\n"}, {"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t return $a;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\n$t = trim(fgets($file));\r\n\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$s = explode(\" \", trim(fgets($file)));\r\n\t$a = [];\r\n\t$a[0] = $s;\r\n \r\n\t$ans = solve($a, $n);\r\n\t\r\n\t$q = trim(fgets($file));\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t if ($k == 0) {\r\n\t echo $a[0][$x - 1].PHP_EOL;\r\n\t } else {\r\n\t if ($k >= count($ans)) {\r\n\t echo $ans[count($ans) - 1][$x - 1].PHP_EOL;\r\n\t } else {\r\n\t echo $ans[$k][$x - 1].PHP_EOL;\r\n\t }\r\n\t }\r\n\t \r\n\t}\r\n\t\r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t return $a;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\n$t = trim(fgets($file));\r\n\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$s = explode(\" \", trim(fgets($file)));\r\n\t$a = [];\r\n\t$a[0] = $s;\r\n \r\n\t$ans = solve($a, $n);\r\n\t\r\n\t$q = trim(fgets($file));\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t if ($k == 0) {\r\n\t echo $a[0][$x - 1].PHP_EOL;\r\n\t } else {\r\n\t echo $ans[min($k, $n)][$x - 1].PHP_EOL;\r\n\t }\r\n\t \r\n\t}\r\n\t\r\n}\r\n\r\n?>"}, {"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t return $a;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\n$t = trim(fgets($file));\r\n\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$s = explode(\" \", trim(fgets($file)));\r\n\t$a = [];\r\n\t$a[0] = $s;\r\n \r\n\t$ans = solve($a, $n);\r\n\t\r\n\t$q = trim(fgets($file));\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t echo $ans[min($k, $n)][$x - 1].PHP_EOL;\r\n\t}\r\n\t\r\n}\r\n\r\n?>"}, {"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t return $a;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\n$t = trim(fgets($file));\r\n\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$s = explode(\" \", trim(fgets($file)));\r\n\t$a = [];\r\n\t$a[0] = $s;\r\n \r\n\t$ans = solve($a, $n);\r\n\t\r\n\t$q = trim(fgets($file));\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t echo $ans[min($k, $n)][$x - 1].PHP_EOL;\r\n\t}\r\n\t\r\n}\r\n\r\n?>"}, {"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t return $a;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\n$t = trim(fgets($file));\r\n\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$a[0] = explode(\" \", trim(fgets($file)));\r\n \r\n\t$ans = solve($a, $n);\r\n\t\r\n\t$q = trim(fgets($file));\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t echo $ans[min($k, $n)][$x - 1].PHP_EOL;\r\n\t}\r\n\t\r\n}\r\n\r\n?>"}, {"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t return $a;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\n$t = trim(fgets($file));\r\n\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$a[0] = explode(\" \", trim(fgets($file)));\r\n \r\n\t$ans = solve($a, $n);\r\n\t\r\n\t$q = trim(fgets($file));\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t echo $ans[min($k, $n)][$x - 1].PHP_EOL;\r\n\t}\r\n\t\r\n}\r\n\r\n?>"}, {"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t $ans[0] = $a;\r\n\t $ans[1] = $d;\r\n\t return $ans;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\nfunction solve($a, $n, $x, $k) {\r\n $f = 0;\r\n\t$d = 1;\r\n\t$c = 0;\r\n\t\r\n\twhile ($f !== 1) {\r\n\t $b = array_count_values($a);\r\n\t for ($i = 0; $i < $n; $i++) {\r\n\t if ($b[$a[$i]] !== $a[$i]) {\r\n\t $a[$i] = $b[$a[$i]];\r\n\t } \r\n\t }\r\n\t \r\n\t if ($d == $k) return $a;\r\n\t $d++;\r\n\t \r\n\t $c = 0;\r\n\t foreach ($b as $key => $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) return $a;\r\n\t}\r\n\treturn $a;\r\n}\r\n\t\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$a = explode(\" \", trim(fgets($file)));\r\n\t$q = trim(fgets($file));\r\n\t$ans = solveEnd($a, $n, $x, $k);\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t \r\n\t if ($k == 0) {\r\n\t echo $a[$x - 1].PHP_EOL;\r\n\t } else {\r\n\t if ($ans[1] < $k) {\r\n\t echo $ans[0][$x - 1].PHP_EOL;\r\n\t } else {\r\n\t $ans = solve($a, $n, $x, $k);\r\n\t echo $ans[$x - 1].PHP_EOL;\r\n\t }\r\n\t }\r\n\t}\r\n}\r\n\r\n?>"}, {"source_code": " $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) {\r\n\t $ans[0] = $a;\r\n\t $ans[1] = $d;\r\n\t return $ans;\r\n\t }\r\n\t $d++;\r\n\t}\r\n}\r\n\r\nfunction solve($a, $n, $x, $k) {\r\n $f = 0;\r\n\t$d = 1;\r\n\t$c = 0;\r\n\t\r\n\twhile ($f !== 1) {\r\n\t $b = array_count_values($a);\r\n\t for ($i = 0; $i < $n; $i++) {\r\n\t if ($b[$a[$i]] !== $a[$i]) {\r\n\t $a[$i] = $b[$a[$i]];\r\n\t } \r\n\t }\r\n\t \r\n\t if ($d == $k) return $a;\r\n\t $d++;\r\n\t \r\n\t $c = 0;\r\n\t foreach ($b as $key => $val) {\r\n\t if ($key == $val) {\r\n\t $c++;\r\n\t }\r\n\t }\r\n\t \r\n\t if ($c === count($b)) return $a;\r\n\t}\r\n\treturn $a;\r\n}\r\n\t\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$a = explode(\" \", trim(fgets($file)));\r\n\t$q = trim(fgets($file));\r\n\t$ans = solveEnd($a, $n, $x, $k);\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t \r\n\t if ($k == 0) {\r\n\t echo $a[$x - 1].PHP_EOL;\r\n\t } else {\r\n\t if ($ans[1] <= $k) {\r\n\t echo $ans[0][$x - 1].PHP_EOL;\r\n\t } else {\r\n\t $ans = solve($a, $n, $x, $k);\r\n\t echo $ans[$x - 1].PHP_EOL;\r\n\t }\r\n\t }\r\n\t}\r\n}\r\n\r\n?>"}, {"source_code": "= $n) return $a[$x - 1];\r\n\t}\r\n}\r\n\t\r\nfor ($m = 0; $m < $t; $m++) {\r\n\t$n = trim(fgets($file));\r\n\t$a = explode(\" \", trim(fgets($file)));\r\n\t$q = trim(fgets($file));\r\n\t\r\n\tfor ($i = 0; $i < $q; $i++) {\r\n\t list($x, $k) = explode(\" \", trim(fgets($file)));\r\n\t \r\n\t if ($k == 0) {\r\n\t echo $a[$x - 1].PHP_EOL;\r\n\t } else {\r\n\t $ans = solve($a, $n, $x, $k);\r\n\t echo $ans.PHP_EOL;\r\n\t }\r\n\t \r\n\t}\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\r\nfunction iter($arr, $ar) {\r\n $tmp = array();\r\n foreach ($arr as $i => $a) {\r\n $tmp[$i] = $ar[$a];\r\n }\r\n return $tmp;\r\n}\r\n\r\nfunction add($arr) {\r\n $ar = array();\r\n foreach ($arr as $a) {\r\n if (!isset($ar[$a])) {\r\n $ar[$a] = 1;\r\n } else {\r\n $ar[$a] += 1;\r\n }\r\n }\r\n return $ar;\r\n}\r\n\r\nwhile ($t--) {\r\n $n = IO::str();\r\n $arr = IO::arr();\r\n $ar = add($arr);\r\n// $arr = iter($arr, $ar);\r\n// $ar = add($arr);\r\n// $arr = iter($arr, $ar);\r\n// $ar = add($arr);\r\n// $arr = iter($arr, $ar);\r\n//\r\n// var_dump($arr);\r\n// var_dump($ar);\r\n\r\n $tmp = array();\r\n $q = array();\r\n\r\n while ($arr != $tmp) {\r\n if (count($q) > 1 && $q[count($q)-1] == $arr) {\r\n break;\r\n }\r\n\r\n $q[] = $arr;\r\n\r\n $arr = iter($arr, $ar);\r\n $ar = add($arr);\r\n }\r\n\r\n $qs = IO::str();\r\n// foreach ($q as $aq) {\r\n// foreach ($aq as $qz) {\r\n// echo $qz . ' ';\r\n// }\r\n// echo PHP_EOL;\r\n// }\r\n while ($qs--) {\r\n list($a, $b) = IO::arr();\r\n if ($b > count($q)) {\r\n $b = count($q) - 1;\r\n }\r\n echo $q[$b][$a-1] . PHP_EOL;\r\n }\r\n}"}], "src_uid": "43009fe44c2b5905c8160ac7ae9c595a"} {"source_code": " 0) && ($b[1] > 0))\n {\n $b[1] = $b[0] + $b[1];\n }\n elseif($b[0] < 0)\n {\n $b[1] = $b[0] + $b[1];\n }\n elseif($b[1] < 0)\n {\n $d = $b[0];\n $b[0] = $b[0] + $b[1];\n $b[1] = $d;\n }\n array_push($c, implode(\":\", $b));\n}\n$e = array_unique($c);\nif(count($e) == count($c))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>", "positive_code": [{"source_code": "$val){\n if(isset($x[$key+$val]) && isset($x[$key+$val+$x[$key+$val]]) && $x[$key+$val] == -$val){\n echo \"YES\";\n die();\n }\n }\n echo \"NO\";\n\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": ""}], "src_uid": "d7dc61a8f3b0091320b96cedd1f4f0a7"} {"source_code": " $lenb) $ans[] = \"<\";\r\n else if($lena < $lenb) $ans[] = \">\";\r\n else $ans[] = \"=\";\r\n }else{\r\n $ans[] = \"<\";\r\n }\r\n }else if($a[$lena-1]==\"M\"){\r\n if($b[$lenb-1]==\"S\"){\r\n $ans[] = \">\";\r\n }else if($b[$lenb-1]==\"M\"){\r\n $ans[] = \"=\";\r\n }else{\r\n $ans[] = \"<\";\r\n }\r\n }else{\r\n if($b[$lenb-1]==\"L\"){\r\n if($lena > $lenb) $ans[] = \">\";\r\n else if($lena < $lenb) $ans[] = \"<\";\r\n else $ans[] = \"=\";\r\n }else{\r\n $ans[] = \">\";\r\n }\r\n }\r\n}\r\necho implode(PHP_EOL,$ans);", "positive_code": [{"source_code": "\r\n if(strlen($a) ==1) {\r\n if($a == 'M') {\r\n $l = 5;\r\n } elseif($a == 'S') {\r\n $l = 0;\r\n } else {\r\n $l = 10;\r\n }\r\n \r\n } else {\r\n $l = (strlen($a));\r\n if($a[strlen($a)-1] == 'S') {\r\n $l *=-10;\r\n } else {\r\n $l *= 10; \r\n }\r\n }\r\n if(strlen($b) == 1) {\r\n if($b == 'M') {\r\n $r = 5;\r\n } elseif($b == 'S') {\r\n $r = 0;\r\n } else {\r\n $r = 10;\r\n }\r\n } else {\r\n $r = (strlen($b));\r\n if($b[strlen($b)-1] == 'S') {\r\n $r *=-10;\r\n } else {\r\n $r *= 10;\r\n }\r\n }\r\n if($l > $r) {\r\n $ans = '>';\r\n } elseif($l< $r) {\r\n $ans = '<';\r\n } else {\r\n $ans = '=';\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": "\r\n if(strlen($a) ==1) {\r\n if($a == 'M') {\r\n $l = 5;\r\n } elseif($a == 'S') {\r\n $l = 0;\r\n } else {\r\n $l = 10;\r\n }\r\n \r\n } else {\r\n $l = (strlen($a)-1)*10;\r\n if($a[strlen($a)-1] == 'S') {\r\n $l *=-1;\r\n }\r\n }\r\n if(strlen($b) == 1) {\r\n if($b == 'M') {\r\n $r = 5;\r\n } elseif($b == 'S') {\r\n $r = 0;\r\n } else {\r\n $r = 10;\r\n }\r\n } else {\r\n $r = (strlen($b)-1)*10;\r\n if($b[strlen($b)-1] == 'S') {\r\n $r *=-1;\r\n }\r\n }\r\n if($l > $r) {\r\n $ans = '>';\r\n } elseif($l< $r) {\r\n $ans = '<';\r\n } else {\r\n $ans = '=';\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": "3ea3f5b548b82449e4ce86e11b1afc48"} {"source_code": " $value)\r\n\t{\r\n\t\tif($value > $d)\r\n\t\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}\r\n\r\n$t = (int)fgets(STDIN);\r\nfor($i=0;$i<$t;$i++)\r\n{\r\n\t$str = fgets(STDIN);\r\n\t$arr = explode(\" \", $str);\r\n\t$n = (int)$arr[0];\r\n\t$d = (int)$arr[1];\r\n\t$a_str = fgets(STDIN);\r\n\t$a = explode(\" \", trim($a_str));\r\n\tif(checkArr($a, $d))\r\n\t\tprint(\"YES\\r\\n\");\r\n\telse\r\n\t{\r\n\t\tif(sizeof($a) == 1)\r\n\t\t\tprint(\"NO\\r\\n\");\r\n\t\telse\r\n\t\t{\r\n\t\t\tsort($a, SORT_NUMERIC);\r\n\t\t\tif($a[0] + $a[1] <= $d)\r\n\t\t\t\tprint(\"YES\\r\\n\");\r\n\t\t\telse\r\n\t\t\t\tprint(\"NO\\r\\n\");\r\n\t\t}\r\n\t}\r\n}\r\n\r\n$end = readline();\r\n?>", "positive_code": [{"source_code": " $a[1]){\r\n $bool = true;\r\n }\r\n }\r\n if($s <= $a[1] || !$bool){\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n \r\n?>"}, {"source_code": " $d) {\r\n echo 'NO' .\"\\n\";\r\n } else {\r\n foreach ($a as $k => $v) {\r\n if ($v == $m) {\r\n unset($a[$k]);\r\n break;\r\n }\r\n }\r\n if (min($a) + $m <= $d) {\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": ""}, {"source_code": " $d) {\r\n $a[$j] = $a[$c - 1] + $a[$c - 2];\r\n if ($a[$j] > $d) { $l = 1; echo 'NO'.PHP_EOL; break;}\r\n } else {\r\n $r++;\r\n }\r\n }\r\n if ($l != 1) { echo 'YES'.PHP_EOL; }\r\n}\r\n\r\n?>"}, {"source_code": " 1) {\r\n sort($aMin);\r\n if ($aMin[0] + $aMin[1] <= $d){\r\n echo 'YES' . PHP_EOL;\r\n } else {\r\n echo 'NO' . PHP_EOL;\r\n }\r\n } else {\r\n echo 'NO' . PHP_EOL;\r\n }\r\n }\r\n \r\n}"}, {"source_code": "\n * Date : 2021-01-21
\n * Requirements : PHP V7+
\n * *Description* : Code Forces Problem https://codeforces.com/problemset/problem/1473/A
\n * \n * The problem is replacing elements, the idea is you have elements in an array, and an inputed 'd',
\n * if all elements can be less than or equal 'd' using a[i] = a[j] + a[k] where
\n * i,j,k are different indices, then output Yes
\n * \n * @inputs : First input t number of test cases where (1<=t<=2000), newline
\n * \t\t Second input n (3<=n<=100), third input is 'd' (1<=d<=100)
\n *\n */\nclass prob\n{\n\n\t/**\n\t * Takes input form user.\n\t * @return array of inputs *See #inputs \n\t */\n\tpublic function take_input() {\n\t\t\n\t\t$n = fgets(STDIN);\n\t\t$d = substr($n, strpos($n, ' '), -1);\n\t\t$n = substr($n, 0,strpos($n, ' '));\n\n\t\treturn [ \"n\" => $n, \"d\" => $d ];\n\n\t}\n\n\tpublic function less_equal($data, $val) : bool {\n\t\tif( $data >= $val ) { return true; }\n\t\treturn false;\n\t}\n\n\t/**\n\t * die and dump, used for debugging.\n\t * @parm data that will be dumped.\n\t * @return void\n\t */\n\tpublic function dd($data) {\n\t\tdie(var_dump($data));\n\t}\n\n\t/** \n\t * gets Array that will be used\n\t * @parm amount of elements\n\t * @return arr of elements\n\t */\n\tpublic function getArr( $n ) {\n\t\treturn array_map('intval', explode(' ', fgets(STDIN) ) );\n\n\t}\n\n\t/**\n\t * Main Logic of doing the operations.\n\t * @parm the array, and d.\n\t * @return String YES or NO\n\t */\n\tpublic function ReplaceElements( $arr, $d ) : string {\n\t\t// get the needed value \n\t\t$NeededVal = (int) $d;\n\t\t// Sort the arr\n\t\tsort($arr);\n\t\t$Counter = 1;\n\n\t\t// First Check if there is something to be done, by comparing the largest element to d.\n\t\tif( $this->less_equal($NeededVal,$arr[count($arr)-1])) { return \"YES\\n\"; }\n\n\t\t// If not then, set j and k to first elements, which are the lowest ones.\n\t\t$arr[count($arr)-1] = $arr[0] + $arr[1];\n\t\t//Reset the counter\n\t\t$Counter = 0;\n\t\t// Then check again, if yes then that means all can be smaller | equal to d.\n\t\tif( $this->less_equal($NeededVal,$arr[count($arr)-1])) { return \"YES\\n\"; }\n\t\treturn \"NO\\n\";\n\t}\n\n\t/** \n\t * Constructor, used as main.\n\t */\n\tpublic function Run(){\n\t\t// get T \n\t\t$t = (int)fgets(STDIN);\n\t\tdo {\n\t\t\t// take the required input\n\t\t\t$inputs = $this->take_input();\n\t\t\t// get Arr \n\t\t\techo $this->ReplaceElements( $this->getArr( $inputs[\"n\"] ) , $inputs[\"d\"] );\n\t\t\t$t--;\n\t\t} while( $t > 0 );\n\n\t}\n}\n\n$obj = new prob();\n$obj->Run();\n"}], "negative_code": [{"source_code": " trim($d)) {\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n}\r\n \r\nfor($i=0; $i<$rowsNumber; $i++) {\r\n list($n, $d) = explode(\" \", fgets($file));\r\n \r\n $array = explode(\" \", fgets($file)); \r\n \r\n if (! hasMoreThen($array, $n, $d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n sort($array);\r\n \r\n if ((trim($array[0]) + trim($array[1])) <= trim($d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n echo \"NO\".PHP_EOL;\r\n}"}, {"source_code": " trim($d)) {\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n}\r\n\r\nfor($i=0; $i<$rowsNumber; $i++) {\r\n list($n, $d) = explode(\" \", fgets($file));\r\n \r\n $array = explode(\" \", fgets($file)); \r\n \r\n if (! hasMoreThen($array, $n, $d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n sort($array);\r\n \r\n if ((trim($array[0]) + trim($array[1])) <= trim($d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n echo \"NO\".PHP_EOL;\r\n}"}, {"source_code": " trim($d)) {\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n}\r\n \r\nfor($i=0; $i<$rowsNumber; $i++) {\r\n list($n, $d) = explode(\" \", fgets($file));\r\n \r\n $array = explode(\" \", fgets($file)); \r\n \r\n if (! hasMoreThen($array, $n, $d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n sort($array);\r\n\r\n if ((trim($array[0]) + trim($array[1])) <= trim($d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n echo \"NO\".PHP_EOL;\r\n}"}, {"source_code": " trim($d)) {\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n}\r\n\r\nfor($i=0; $i<$rowsNumber; $i++) {\r\n list($n, $d) = explode(\" \", fgets($file));\r\n \r\n $array = explode(\" \", fgets($file)); \r\n \r\n if (! hasMoreThen($array, $n, $d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n sort($array);\r\n var_dump($array);\r\n if ((trim($array[0]) + trim($array[1])) <= trim($d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n echo \"NO\".PHP_EOL;\r\n}"}, {"source_code": " $d) {\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n}\r\n\r\nfor($i=0; $i<$rowsNumber; $i++) {\r\n list($n, $d) = explode(\" \", fgets($file));\r\n \r\n $array = explode(\" \", fgets($file)); \r\n \r\n if (! hasMoreThen($array, $n, $d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n sort($array);\r\n \r\n if (($array[0] + $array[1]) <= $d) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n echo \"NO\".PHP_EOL;\r\n}"}, {"source_code": " $d) {\r\n return true;\r\n }\r\n }\r\n \r\n return false;\r\n}\r\n\r\nfor($i=0; $i<$rowsNumber; $i++) {\r\n list($n, $d) = explode(\" \", fgets($file));\r\n \r\n $array = explode(\" \", fgets($file)); \r\n \r\n if (! hasMoreThen($array, $n, $d)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n sort($array);\r\n \r\n if (($array[0] + $array[1]) < $d) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n echo \"NO\".PHP_EOL;\r\n}"}, {"source_code": " 1) {\r\n sort($aMin);\r\n if ($aMin[0] + $aMin[1] <= $d){\r\n echo 'YES' . PHP_EOL;\r\n } else {\r\n echo 'NO' . PHP_EOL;\r\n }\r\n } else {\r\n echo 'NO' . PHP_EOL;\r\n }\r\n }\r\n \r\n}"}, {"source_code": " 1) {\r\n sort($aMin);\r\n if ($aMin[0] + $aMin[1] <= $d){\r\n echo 'YES' . PHP_EOL;\r\n } else {\r\n echo 'NO' . PHP_EOL;\r\n }\r\n } else {\r\n echo 'NO' . PHP_EOL;\r\n }\r\n }\r\n \r\n}"}, {"source_code": "\n * Date : 2021-01-21
\n * Requirements : PHP V7+
\n * *Description* : Code Forces Problem https://codeforces.com/problemset/problem/1473/A
\n * \n * The problem is replacing elements, the idea is you have elements in an array, and an inputed 'd',
\n * if all elements can be less than or equal 'd' using a[i] = a[j] + a[k] where
\n * i,j,k are different indices, then output Yes
\n * \n * @inputs : First input t number of test cases where (1<=t<=2000), newline
\n * \t\t Second input n (3<=n<=100), third input is 'd' (1<=d<=100)
\n *\n */\nclass prob\n{\n\n\t/**\n\t * Takes input form user.\n\t * @return array of inputs *See #inputs \n\t */\n\tpublic function take_input() {\n\t\t\n\t\t$n = fgets(STDIN);\n\t\t$d = substr($n, strpos($n, ' '), -1);\n\t\t$n = substr($n, 0,strpos($n, ' '));\n\n\t\treturn [ \"n\" => $n, \"d\" => $d ];\n\n\t}\n\n\tpublic function less_equal($data, $val) : bool {\n\t\tif( $data >= $val ) { return true; }\n\t\treturn false;\n\t}\n\n\t/**\n\t * die and dump, used for debugging.\n\t * @parm data that will be dumped.\n\t * @return void\n\t */\n\tpublic function dd($data) {\n\t\tdie(var_dump($data));\n\t}\n\n\t/** \n\t * gets Array that will be used\n\t * @parm amount of elements\n\t * @return arr of elements\n\t */\n\tpublic function getArr( $n ) {\n\t\treturn array_map('intval', explode(' ', fgets(STDIN) ) );\n\n\t}\n\n\t/**\n\t * Main Logic of doing the operations.\n\t * @parm the array, and d.\n\t * @return String YES or NO\n\t */\n\tpublic function ReplaceElements( $arr, $d ) : string {\n\t\t// get the needed value \n\t\t$NeededVal = ( $d < sizeof($arr) ? $arr[(int)$d] : $d );\n\t\t$Counter = 1;\n\n\t\t// First Check if there is something to be done.\n\t\tforeach( $arr as $val ) {\n\t\t\tif( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))\n\t\t \t{ $Counter++; }\n\t\t}\n\n\t\tif( $Counter == sizeof($arr) ) { return \"YES\"; }\n\t\t// First, get I, J and K.\n\t\t$i = 0; $j = 1; $k = 2;\n\t\t// Reset the counter\n\t\t$Counter = 0;\n\t\tfor( $i=0; $iless_equal($NeededVal, $arr[$i] ) ){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\tfor( $k=2; $kless_equal($NeededVal, ($arr[$j] + $arr[$k] ) ) ) {\n\t\t\t\t\t\t$arr[$i] = $arr[$j] + $arr[$k];\n\t\t\t\t\t\techo \"| NeededVal:\";\n\t\t\t\t\t\techo $NeededVal;\n\t\t\t\t\t\techo \" ,Arr[i]:\";\n\t\t\t\t\t\techo $arr[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach( $arr as $val ) {\n\t\t\tif( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))\n\t\t \t{ $Counter++; }\n\t\t}\n\n\t\tif( $Counter == sizeof($arr) ) { return \"YES\\n\"; }\n\t\treturn \"NO\\n\";\n\t}\n\n\t/** \n\t * Constructor, used as main.\n\t */\n\tpublic function Run(){\n\t\t// get T \n\t\t$t = (int)fgets(STDIN);\n\t\tdo {\n\t\t\t// take the required input\n\t\t\t$inputs = $this->take_input();\n\t\t\t// get Arr \n\t\t\techo $this->ReplaceElements( $this->getArr( $inputs[\"n\"] ), $inputs[\"d\"] );\n\t\t\t$t--;\n\t\t} while( $t > 0 );\n\n\t}\n}\n\n$obj = new prob();\n$obj->Run();\n"}, {"source_code": "\n * Date : 2021-01-21
\n * Requirements : PHP V7+
\n * *Description* : Code Forces Problem https://codeforces.com/problemset/problem/1473/A
\n * \n * The problem is replacing elements, the idea is you have elements in an array, and an inputed 'd',
\n * if all elements can be less than or equal 'd' using a[i] = a[j] + a[k] where
\n * i,j,k are different indices, then output Yes
\n * \n * @inputs : First input t number of test cases where (1<=t<=2000), newline
\n * \t\t Second input n (3<=n<=100), third input is 'd' (1<=d<=100)
\n *\n */\nclass prob\n{\n\n\t/**\n\t * Takes input form user.\n\t * @return array of inputs *See #inputs \n\t */\n\tpublic function take_input() {\n\t\t\n\t\t$n = fgets(STDIN);\n\t\t$d = substr($n, strpos($n, ' '), -1);\n\t\t$n = substr($n, 0,strpos($n, ' '));\n\n\t\treturn [ \"n\" => $n, \"d\" => $d ];\n\n\t}\n\n\tpublic function less_equal($data, $val) : bool {\n\t\tif( $data >= $val ) { return true; }\n\t\treturn false;\n\t}\n\n\t/**\n\t * die and dump, used for debugging.\n\t * @parm data that will be dumped.\n\t * @return void\n\t */\n\tpublic function dd($data) {\n\t\tdie(var_dump($data));\n\t}\n\n\t/** \n\t * gets Array that will be used\n\t * @parm amount of elements\n\t * @return arr of elements\n\t */\n\tpublic function getArr( $n ) {\n\t\treturn array_map('intval', explode(' ', fgets(STDIN) ) );\n\n\t}\n\n\t/**\n\t * Main Logic of doing the operations.\n\t * @parm the array, and d.\n\t * @return String YES or NO\n\t */\n\tpublic function ReplaceElements( $arr, $d ) : string {\n\t\t// get the needed value \n\t\t$NeededVal = ( $d < sizeof($arr) ? $arr[(int)$d] : $d );\n\t\t$Counter = 1;\n\n\t\t// First Check if there is something to be done.\n\t\tforeach( $arr as $val ) {\n\t\t\tif( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))\n\t\t \t{ $Counter++; }\n\t\t}\n\n\t\tif( $Counter == sizeof($arr) ) { return \"YES\"; }\n\t\t// First, get I, J and K.\n\t\t$i = 0; $j = 1; $k = 2;\n\t\t// Reset the counter\n\t\t$Counter = 0;\n\t\tfor( $i=0; $iless_equal($NeededVal, $arr[$i] ) ){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\tfor( $k=2; $kless_equal($NeededVal, ($arr[$j] + $arr[$k] ) ) ) {\n\t\t\t\t\t\t$arr[$i] = $arr[$j] + $arr[$k];\n\t\t\t\t\t\techo \"| NeededVal:\";\n\t\t\t\t\t\techo $NeededVal;\n\t\t\t\t\t\techo \" ,Arr[i]:\";\n\t\t\t\t\t\techo $arr[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach( $arr as $val ) {\n\t\t\tif( $this->less_equal($NeededVal,$val) || $this->less_equal($NeededVal,$val ))\n\t\t \t{ $Counter++; }\n\t\t}\n\n\t\tif( $Counter == sizeof($arr) ) { return \"YES\"; }\n\t\treturn \"NO\";\n\t}\n\n\t/** \n\t * Constructor, used as main.\n\t */\n\tpublic function Run(){\n\t\t// get T \n\t\t$t = (int)fgets(STDIN);\n\t\tdo {\n\t\t\t// take the required input\n\t\t\t$inputs = $this->take_input();\n\t\t\t// get Arr \n\t\t\techo $this->ReplaceElements( $this->getArr( $inputs[\"n\"] ), $inputs[\"d\"] );\n\t\t\t$t--;\n\t\t} while( $t > 0 );\n\n\t}\n}\n\n$obj = new prob();\n$obj->Run();\n"}, {"source_code": " $a[1]){\r\n $bool = true;\r\n }\r\n }\r\n if($s <= $a[1] || !$bool){\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n \r\n?>"}, {"source_code": " $a[1]){\r\n $bool = true;\r\n }\r\n }\r\n if($s <= $a[1] || !$bool){\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n \r\n?>"}, {"source_code": " $d) {\r\n echo 'NO' .\"\\n\";\r\n } else {\r\n foreach ($a as $k => $v) {\r\n if ($v == $m) {\r\n unset($a[$k]);\r\n }\r\n }\r\n if (min($a) + $m <= $d) {\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?>"}], "src_uid": "044c2a3bafe4f47036ee81f2e40f639a"} {"source_code": " $f)\n {\n $g .= ($d[$c[$x]] - $f) . \" \";\n $f = $d[$c[$x]];\n }\n}\nprint $g;\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " -1) {\n $r[$i] = $ind + 1;\n }\n}\necho implode(' ', $r);"}], "src_uid": "82176739a1dd4fe85ec059058a00fbb9"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "d1d50f0780d5c70e6773d5601d7d41e8"} {"source_code": " $b[$x + 1]) && ($f == 1))\n {\n $g = 1;\n }\n elseif($b[$x] > $b[$x + 1])\n {\n $c = 1; \n define(d, $x + 1);\n }\n elseif($c == 1)\n {\n define(e, $x + 1);\n $f = 1;\n if($b[$x + 1] < $b[d - 1])\n {\n $g = 1;\n }\n }\n}\nif($c == 0)\n{\n print \"yes\\n\";\n print \"1 1\";\n}\nelseif($g == 1)\n{\n print \"no\";\n}\nelseif(e == 0)\n{\n if(($b[$a - 1] < $b[d - 2]) && (d != 1))\n {\n print \"no\";\n }\n else\n {\n print \"yes\\n\";\n print d . \" \" . $a;\n }\n}\nelse\n{\n print \"yes\\n\";\n print d . \" \" . e;\n}\n?>", "positive_code": [{"source_code": "= $arr[$i+1]){\n $count++;\n if($i == $n-2){//end\n $temp = swap($arr,$i - $count + 1,$i + 1);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 2);\n echo \" \";\n echo ($i + 2);\n return true;\n }\n $count = 0;\n }\n }\n else{\n $temp = swap($arr,$i - $count,$i);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 1);\n echo \" \";\n echo ($i + 1);\n return true;\n }\n if($count != 0 ){\n echo \"no\";\n return false;\n }\n $count = 0;\n }\n }\n echo \"no\";\n return false;*/\n $count = 0;\n $arrTemp = [];\n for($i = 0;$i<$n - 1;$i++){\n if($arr[$i] >= $arr[$i+1]) {\n if($count == 0){\n array_push($arrTemp,$i);\n }\n if($i == $n - 2){\n array_push($arrTemp,$i +1);\n }\n $count++;\n }\n else{\n if($count !== 0){\n array_push($arrTemp,$i);\n }\n $count = 0;\n }\n }\n if (count($arrTemp) != 2){\n if(count($arrTemp) == 0){\n echo \"yes\\n\";\n echo (1);\n echo \" \";\n echo (1);\n }\n else\n echo \"no\";\n }\n else{\n $st1 = $arrTemp[0];\n $st2 = $arrTemp[1];\n if($st1 == 0||$arr[$st1 - 1] <= $arr[$st2]){\n if ($st2+1 == $n ||$arr[$st2 +1] >= $arr[$st1]){\n echo \"yes\\n\";\n echo ($st1 + 1);\n echo \" \";\n echo ($st2 + 1);\n }\n else{\n echo \"no\";\n }\n }\n else{\n echo \"no\";\n }\n }\n return;\n}\nfunction swap($arr,$start,$end)\n{\n $tempArr = $arr;\n $count = 0;\n for ($i = $start; $i <= $end; $i++) {\n $tempArr[$i] = $arr[$end - $count];\n $count++;\n }\n return $tempArr;\n}\nfunction checkIncre($n,$arr){\n for($i = 0;$i<$n -1;$i++){\n if($arr[$i] >= $arr[$i+1]) return false;\n }\n return true;\n}\n\n$in = 'php://stdin';\n\n$input = fopen($in, \"r\");\n\n$n = fgets($input);\n\n$t = [];\n\n$t = array_merge($t, explode(\" \", trim(fgets($input))));\n\ncheck($n,$t);\n"}, {"source_code": " $array[$i+1]) )\n {\n if($start==0){\n $start = $i+1;\n if($i>0)\n $start_value = $array[$i-1];\n else\n $start_value = $array[$i];\n }\n \n if($i==$array_size-2){\n $end = $i+2;\n $end_value = $array[$i+1];\n }\n else {\n $end = $i+2;\n $end_value = $array[$i+2];\n }\n \n }\n \n \n \n }\n //echo $start. \" \".$end.\"\\n\";\n //echo $start_value. \" \".$end_value.\"\\n\";\n if($start==0 && $end==0){\n echo \"yes\\n\".\"1 1\";\n \n }\n else{\n \n for($i=$end-1;$i>$start-1;$i--){\n \n if($default[$i]>$default[$i-1]){\n $reverse = 1;\n }\n }\n \n if(($end == $array_size) && ($start==1))\n {\n if($start_value > $end_value && $reverse==0)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start==1 && $end<$array_size ) {\n \n if($start_value < $end_value && $array[$start-1] <= $end_value && $reverse==0)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start>1 && $end<$array_size) {\n if($start_value < $end_value && $array[$start-1] <= $end_value && $reverse==0)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start>1 && $end==$array_size) {\n if($start_value < $end_value && $reverse==0)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n \n }\n \n}\n \n\n$array_size = trim(fgets(STDIN));\n$array = trim(fgets(STDIN));\nSort_array($array_size,$array);\n\n"}], "negative_code": [{"source_code": " $b[$x + 1]) && ($f == 1))\n {\n $g = 1;\n }\n elseif($b[$x] > $b[$x + 1])\n {\n $c = 1; \n define(d, $x + 1);\n }\n elseif($c == 1)\n {\n define(e, $x + 1);\n $f = 1;\n if($b[$x + 1] < $b[d - 1])\n {\n $g = 1;\n }\n }\n}\nif($c == 0)\n{\n print \"yes\\n\";\n print \"1 1\";\n}\nelseif($g == 1)\n{\n print \"no\";\n}\nelseif(e == 0)\n{\n print \"yes\\n\";\n print d . \" \" . $a;\n}\nelse\n{\n print \"yes\\n\";\n print d . \" \" . e;\n}\n?>"}, {"source_code": " $b[$x + 1]) && ($f == 1))\n {\n $g = 1;\n }\n elseif($b[$x] > $b[$x + 1])\n {\n $c = 1; \n define(d, $x + 1);\n }\n elseif($c == 1)\n {\n define(e, $x + 1);\n $f = 1;\n if($b[$x + 1] < $b[d - 1])\n {\n $g = 1;\n }\n }\n}\nif($c == 0)\n{\n print \"yes\\n\";\n print \"1 1\";\n}\nelseif($g == 1)\n{\n print \"no\";\n}\nelseif(e == 0)\n{\n if($b[$a - 1] < $b[d - 1])\n {\n print \"no\";\n }\n else\n {\n print \"yes\\n\";\n print d . \" \" . $a;\n }\n}\nelse\n{\n print \"yes\\n\";\n print d . \" \" . e;\n}\n?>"}, {"source_code": ""}, {"source_code": " $b[$x + 1]) && ($f == 1))\n {\n $g = 1;\n }\n elseif($b[$x] > $b[$x + 1])\n {\n $c = 1; \n define(d, $x + 1);\n }\n elseif($c == 1)\n {\n define(e, $x + 1);\n $f = 1;\n if($b[$x + 1] < $b[d - 1])\n {\n $g = 1;\n }\n }\n}\nif($c == 0)\n{\n print \"yes\\n\";\n print \"1 1\";\n}\nelseif($g == 1)\n{\n print \"no\";\n}\nelseif(e == 0)\n{\n if(($b[$a - 1] < $b[d - 1]) && (d != 1))\n {\n print \"no\";\n }\n else\n {\n print \"yes\\n\";\n print d . \" \" . $a;\n }\n}\nelse\n{\n print \"yes\\n\";\n print d . \" \" . e;\n}\n?>"}, {"source_code": ""}, {"source_code": " $b[$x + 1]) && ($f == 1))\n {\n $g = 1;\n }\n elseif($b[$x] > $b[$x + 1])\n {\n $c = 1; \n define(d, $x + 1);\n }\n elseif($c == 1)\n {\n define(e, $x + 1);\n $f = 1;\n if($b[$x + 1] < $b[d - 1])\n {\n $g = 1;\n }\n }\n}\nif($c == 0)\n{\n print \"yes\\n\";\n print \"1 1\";\n}\nelseif($g == 1)\n{\n print \"no\";\n}\nelseif(e == 0)\n{\n if(($b[$a - 1] < $b[d - 2]) && (d != 1))\n {\n print $b[d - 1];\n }\n else\n {\n print \"yes\\n\";\n print d . \" \" . $a;\n }\n}\nelse\n{\n print \"yes\\n\";\n print d . \" \" . e;\n}\n?>"}, {"source_code": "= $arr[$i+1]){\n $count++;\n if($i == $n-2){//end\n $temp = swap($arr,$i - $count + 1,$i + 1);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 2);\n echo \" \";\n echo ($i + 2);\n return true;\n }\n $count = 0;\n }\n }\n else{\n $temp = swap($arr,$i - $count,$i);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 1);\n echo \" \";\n echo ($i + 1);\n return true;\n }\n if($count != 0 ){\n echo \"no\";\n return false;\n }\n $count = 0;\n }\n }\n echo \"no\";\n return false;*/\n $count = 0;\n $arrTemp = [];\n for($i = 0;$i<$n - 1;$i++){\n if($arr[$i] >= $arr[$i+1]) {\n if($count == 0){\n array_push($arrTemp,$i);\n }\n if($i == $n - 2){\n array_push($arrTemp,$i +1);\n }\n $count++;\n }\n else{\n if($count !== 0){\n array_push($arrTemp,$i);\n }\n $count = 0;\n }\n }\n if (count($arrTemp) != 2){\n echo \"no\";\n }\n else{\n $st1 = $arrTemp[0];\n $st2 = $arrTemp[1];\n if($st1 == 0||$arr[$st1 - 1] <= $arr[$st2]){\n if ($st2+1 == $n ||$arr[$st2 +1] >= $arr[$st1]){\n echo \"yes\\n\";\n echo ($st1 + 1);\n echo \" \";\n echo ($st2 + 1);\n }\n else{\n echo \"no\";\n }\n }\n else{\n echo \"no\";\n }\n }\n return;\n}\nfunction swap($arr,$start,$end)\n{\n $tempArr = $arr;\n $count = 0;\n for ($i = $start; $i <= $end; $i++) {\n $tempArr[$i] = $arr[$end - $count];\n $count++;\n }\n return $tempArr;\n}\nfunction checkIncre($n,$arr){\n for($i = 0;$i<$n -1;$i++){\n if($arr[$i] >= $arr[$i+1]) return false;\n }\n return true;\n}\n\n$in = 'php://stdin';\n\n$input = fopen($in, \"r\");\n\n$n = fgets($input);\n\n$t = [];\n\n$t = array_merge($t, explode(\" \", trim(fgets($input))));\n\ncheck($n,$t);\n"}, {"source_code": "= $arr[$i+1]){\n $count++;\n if($i == $n-2){//end\n $temp = swap($arr,$i - $count + 1,$i + 1);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 2);\n echo \" \";\n echo ($i + 2);\n return true;\n }\n $count = 0;\n }\n }\n else{\n $temp = swap($arr,$i - $count,$i);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 1);\n echo \" \";\n echo ($i + 1);\n return true;\n }\n if($count == 0 ){\n echo \"no\";\n return false;\n }\n $count = 0;\n }\n }\n echo \"no\";\n return false;\n}\nfunction swap($arr,$start,$end)\n{\n $tempArr = $arr;\n $count = 0;\n for ($i = $start; $i <= $end; $i++) {\n $tempArr[$i] = $arr[$end - $count];\n $count++;\n }\n return $tempArr;\n}\nfunction checkIncre($n,$arr){\n for($i = 0;$i<$n -1;$i++){\n if($arr[$i] >= $arr[$i+1]) return false;\n }\n return true;\n}\n\n$in = 'php://stdin';\n\n$input = fopen($in, \"r\");\n\n$n = fgets($input);\n\n$t = [];\n\n$t = array_merge($t, explode(\" \", trim(fgets($input))));\n\ncheck($n,$t);\n"}, {"source_code": "= $arr[$i+1]){\n $count++;\n if($i == $n-2){//end\n $temp = swap($arr,$i - $count + 1,$i + 1);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 2);\n echo \" \";\n echo ($i + 2);\n return true;\n }\n $count = 0;\n }\n }\n else{\n $temp = swap($arr,$i - $count,$i);\n $res = checkIncre($n,$temp);\n if($res){\n echo \"yes\\n\";\n echo ($i - $count + 1);\n echo \" \";\n echo ($i + 1);\n return true;\n return true;\n }\n $count = 0;\n }\n }\n echo \"no\";\n return false;\n}\nfunction swap($arr,$start,$end)\n{\n $tempArr = $arr;\n for ($i = $start; $i <= $end; $i++) {\n $tempArr[$i] = $arr[$end - $i];\n }\n return $tempArr;\n}\nfunction checkIncre($n,$arr){\n for($i = 0;$i<$n -1;$i++){\n if($arr[$i] >= $arr[$i+1]) return false;\n }\n return true;\n}\n$in = 'php://stdin';\n\n$input = fopen($in, \"r\");\n\n$n = fgets($input);\n\n$t = [];\n\n$t = array_merge($t, explode(\" \", trim(fgets($input))));\n\ncheck($n,$t);\n"}, {"source_code": "$array[$j])\n {\n $temp = $array[$i];\n $array[$i] = $array[$j];\n $array[$j] = $temp;\n \n }\n \n }\n }\n \n if($default==$array){\n echo \"yes\\n\".\"1 1\";\n exit();\n }\n else\n {\n for($i=0;$i<$array_size;$i++){\n for($j=$i+1;$j<$array_size;$j++){\n $swap = 0; \n if($default[$i]>$default[$j]&& $swap<=1)\n {\n $temp = $default[$i];\n $default[$i] = $default[$j];\n $default[$j] = $temp;\n $swap++;\n if($default==$array){\n echo \"yes\\n\".($i+1).\" \".($j+1);\n exit();\n }\n else{\n $default = $raw_array;\n }\n }\n\n }\n }\n if($default!=$array){\n echo \"no\";\n }\n }\n \n}\n\n\n$array_size = trim(fgets(STDIN));\n$array = trim(fgets(STDIN));\nSort_array($array_size,$array);\n\n"}, {"source_code": " $array[$i+1]) )\n {\n if($start==0){\n $start = $i+1;\n if($i>0)\n $start_value = $array[$i-1];\n else\n $start_value = $array[$i];\n }\n \n if($i==$array_size-2){\n $end = $i+2;\n $end_value = $array[$i+1];\n }\n else {\n $end = $i+2;\n $end_value = $array[$i+2];\n }\n \n }\n \n \n \n }\n //echo $start. \" \".$end.\"\\n\";\n //echo $start_value. \" \".$end_value.\"\\n\";\n if($start==0 && $end==0){\n echo \"yes\\n\".\"1 1\";\n \n }\n else{\n if(($end == $array_size) && ($start==1))\n {\n if($start_value > $end_value )\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start==1 && $end<$array_size ) {\n \n if($start_value < $end_value && $array[$start-1] <= $end_value)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start>1 && $end<$array_size) {\n if($start_value < $end_value && $array[$start-1] <= $end_value)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start>1 && $end==$array_size) {\n if($start_value < $end_value)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n \n }\n \n}\n \n\n$array_size = trim(fgets(STDIN));\n$array = trim(fgets(STDIN));\nSort_array($array_size,$array);\n\n"}, {"source_code": " $array[$i+1]) )\n {\n if($start==0){\n $start = $i+1;\n if($i>0)\n $start_value = $array[$i-1];\n else\n $start_value = $array[$i];\n }\n \n if($i==$array_size-2){\n $end = $i+2;\n $end_value = $array[$i+1];\n }\n else {\n $end = $i+2;\n $end_value = $array[$i+2];\n }\n \n }\n \n \n \n }\n \n if($start==0 && $end==0){\n echo \"yes\\n\".\"1 1\";\n \n }\n else{\n if(($end == $array_size) && ($start==1))\n {\n if($start_value > $end_value)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start==1 && $end<$array_size) {\n \n if($start_value < $end_value)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n elseif ($start>1) {\n if($start_value < $end_value)\n echo \"yes\\n\".$start.\" \".$end;\n else \n echo \"no\";\n }\n \n \n \n }\n \n \n \n \n}\n\n\n$array_size = trim(fgets(STDIN));\n$array = trim(fgets(STDIN));\nSort_array($array_size,$array);\n\n"}, {"source_code": "$array[$j])\n {\n $temp = $array[$i];\n $array[$i] = $array[$j];\n $array[$j] = $temp;\n \n }\n \n }\n }\n \n for($i=0;$i<$array_size;$i++){\n $reverse_array[$i] = $default[$array_size-1-$i];\n }\n \n if($default==$array){\n echo \"yes\\n\".\"1 1\";\n exit();\n }\n else if($reverse_array==$array){\n echo \"yes\\n\".\"1 \".$array_size;\n exit();\n }\n else\n {\n for($i=0;$i<$array_size;$i++){\n for($j=$i+1;$j<$array_size;$j++){\n $swap = 0; \n if($default[$i]>$default[$j]&& $swap<=1)\n {\n $temp = $default[$i];\n $default[$i] = $default[$j];\n $default[$j] = $temp;\n $swap++;\n if($default==$array){\n echo \"yes\\n\".($i+1).\" \".($j+1);\n exit();\n }\n else{\n $default = $raw_array;\n }\n }\n\n }\n }\n if($default!=$array){\n echo \"no\";\n }\n }\n \n}\n\n\n$array_size = trim(fgets(STDIN));\n$array = trim(fgets(STDIN));\nSort_array($array_size,$array);\n\n"}, {"source_code": " 0 && $k == 0) die(\"0\");\necho str_repeat(\"5\", $k*9).str_repeat(\"0\", $n0);\n\n?>", "positive_code": [{"source_code": " 0 && $c > 0) {\n\twhile($b--) echo \"5\";\n\twhile($c--) echo \"0\";\n}\nelse if($c > 0) echo \"0\";\nelse echo \"-1\";\n\n?>"}, {"source_code": " 0 && $z > 0) {\n $c *= 9;\n for ($i = 0; $i < $c; $i ++) {\n print 5;\n }\n for ($i = 0; $i < $z; $i ++) {\n print 0;\n }\n} else if ($z > 0) {\n print 0;\n} else {\n print -1;\n}\n\nfunction getLine() {\n return trim(fgets(STDIN));\n}\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "409b27044d5ec97b5315c92d4112376f"} {"source_code": " 2)\n die(\"unknown topology\");\n } else {\n $counts[$val]++;\n }\n}\n\nif (count($counts) == 1 && !empty($counts[2]))\n die(\"ring topology\");\nif (count($counts) == 2 && $counts[1] == 2 && $counts[2] > 1)\n die(\"bus topology\");\n$keys = array_keys($counts);\nsort($keys);\nif ($keys[0] == 1 && $keys[1] == $n-1)\n die(\"star topology\");\necho \"unknown topology\";", "positive_code": [{"source_code": ""}, {"source_code": " 1) && ($f[$c[$x]] <= 2))\n {\n $g--;\n $h++;\n }\n elseif($f[$c[$x]] > 2)\n {\n $h--;\n $i++;\n }\n}\nif(($g == 2) && ($h == $a - $g))\n{\n print \"bus topology\";\n}\nelseif(($g == 0) && ($h == $a))\n{\n print \"ring topology\";\n}\nelseif($i + 2 + $g == count($c))\n{\n print \"star topology\";\n}\nelse\n{\n print \"unknown topology\";\n}\n?>"}, {"source_code": ""}, {"source_code": " $count) {\n if($count == 1)\n $one_cnt++;\n elseif($count == 2)\n $two_cnt++;\n else // \u0433\u0440\u0430\u0444 \u0441\u0432\u044f\u0437\u043d\u044b\u0439, \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0435\n $many++; \n}\n\nif($one_cnt == 2 && $many == 0) \n die(\"bus topology\");\n \nif($one_cnt == 0 && $many == 0)\n die(\"ring topology\");\n\nif($two_cnt == 0 && $many == 1)\n die(\"star topology\");\n \ndie(\"unknown topology\"); "}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 2)\n die(\"unknown topology\");\n } else {\n $counts[$val]++;\n }\n}\n\nif (count($counts) == 1 && !empty($counts[2]))\n die(\"ring topology\");\nif (count($counts) == 2 && $counts[1] == 2 && $counts[2] > 1)\n die(\"bus topology\");\n$keys = array_keys($counts);\nsort($keys);\nif ($keys[0] == 1 && $keys[1] == $n-1)\n die(\"star topology\");\necho \"unknown topology\";\n"}, {"source_code": " 2)\n die(\"unknown topology\");\n } else {\n $counts[$val]++;\n }\n}\n\nif (count($counts) == 1 && !empty($counts[2]))\n die(\"ring topology\");\nif (count($counts) == 2 && $counts[1] == 2 && $counts[2] > 1)\n die(\"bus topology\");\n$keys = array_keys($counts);\nsort($keys);\nif ($keys[0] == 1 && $keys[1] > 2)\n die(\"star topology\");\necho \"unknown topology\";\n"}], "src_uid": "7bb088ce5e4e2101221c706ff87841e4"} {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "fb0a4c8f737c36596c2d8c1ae0d1e34e"} {"source_code": " $temp_c_arr[1]) return false;\n\t\tif ($temp_c_arr[0] < $temp_c_arr[1]) return false;\n\t\telse if ($temp_c_arr[0] === $temp_c_arr[1]) $temp_c++;\n\t}\n\tif ($temp_c === 3) return false;\n*/\n\t$str = str_replace(\"-\", \"\", $str);\n\t$arr = str_split($str);\n\t$temp = 10;\n\tforeach ($arr as $as_i) {\n\t\tif ($temp <= $as_i) return false;\n\t\t$temp = $as_i;\n\t}\n\treturn true;\n}\n/*\nfunction arr_make_names($arr) {\n\t$temp_arr = array();\n\tforeach ($arr as $as_i) {\n\t\tif (is_array($as_i) === true) {\n\t\t\t$temp_arr[] = get_array_message($as_i, \", \");\n\t\t} else {\n\t\t\t$temp_arr[] = $as_i;\n\t\t}\n\t}\n\treturn $temp_arr;\n}\n*/\nfunction change_count_name(&$arr_c_el, &$arr_n_el, $c, $name){\n\tif ($arr_c_el < $c) {\n\t\t$arr_c_el = $c;\n\t\t$arr_n_el = $name;\n\t} else if ($arr_c_el === $c) {\n\t\tif ($arr_n_el !== \"\") {\n\t\t\t//$arr_n[0] = $arr_n[0] . \", \" . $name;\n\t\t\t$arr_n_el .= \", \" . $name;\n\t\t} else {\n\t\t\t$arr_n_el = $name;\n\t\t}\n\t} \n}\n\nfunction change_counts_names(&$arr_c, &$arr_n, $c_t, $c_p, $c_g, $name){\n\tchange_count_name($arr_c[0], $arr_n[0], $c_t, $name);\n\tchange_count_name($arr_c[1], $arr_n[1], $c_p, $name);\n\tchange_count_name($arr_c[2], $arr_n[2], $c_g, $name);\n}\n\nfunction print_names($arr){\n\tprint(\"If you want to call a taxi, you should call: $arr[0].\\n\");\n\tprint(\"If you want to order a pizza, you should call: $arr[1].\\n\");\n\tprint(\"If you want to go to a cafe with a wonderful girl, you should call: $arr[2].\");\n}\t\n\nfunction solve(){\n\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_n = $Token->nextInt();\n\t$ans_name_arr = array_fill(0, 3, \"\");\n\t$ans_count_arr = array_fill(0, 3, -1);\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_s = $Token->nextInt();\n\t\t//$inp_name = $Token->nextInt();\n\t\t$inp_name = $Token->nextToken();\n\t\t$temp_c_taxi = 0;\n\t\t$temp_c_pizza = 0;\n\t\t$temp_c_girl = 0;\n\t\tfor ($j = 0; $j < $inp_s; $j++) {\n\t\t\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t\t$inp_number = $Token->nextToken();\n\t\t\tif (number_taxi($inp_number) === true) {\n\t\t\t\t$temp_c_taxi++;\n\t\t\t} else if (number_pizza($inp_number) === true) {\n\t\t\t\t$temp_c_pizza++;\n\t\t\t} else {\n\t\t\t\t$temp_c_girl++;\n\t\t\t}\n\t\t}\n\t\tchange_counts_names($ans_count_arr, $ans_name_arr, $temp_c_taxi, $temp_c_pizza, $temp_c_girl, $inp_name);\t\n\t}\n\tprint_names($ans_name_arr);\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 $_\n//overwritten function $aa---_\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\t\t\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\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\t$message .= $value . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction aarray_printf(array $array, $str) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= $value . $str;\n\t\t}\n\t\t$message = rtrim($message, $str);\n\t\tprintf('%s', $message);\n}\n/*\nfunction get_array_message(array $array, $str) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t//$message .= \"$value\" . \"$str\";\n\t\t\t$message .= $value . $str;\n\t\t}\n\t\t$message = rtrim($message, $str);\n\t\treturn $message;\n}\n*/\n?>", "positive_code": [{"source_code": " $f) && ($f > $g) && ($g > $h) && ($h > $i) && ($i > $j))\n {\n $l++;\n }\n else\n {\n $m++;\n }\n }\n $r = array($k, $l, $m);\n array_push($r_1, $k);\n array_push($r_2, $l);\n array_push($r_3, $m);\n array_push($s, $r);\n}\nrsort($r_1);\nrsort($r_2);\nrsort($r_3);\nfor($x = 0; $x < $a; $x++)\n{\n if($s[$x][0] == $r_1[0])\n {\n array_push($t, $w[$x]);\n }\n if($s[$x][1] == $r_2[0])\n {\n array_push($u, $w[$x]);\n }\n if($s[$x][2] == $r_3[0])\n {\n array_push($v, $w[$x]);\n }\n}\nprint \"If you want to call a taxi, you should call: \" . implode(\", \", $t) . \".\" . \"\\n\";\nprint \"If you want to order a pizza, you should call: \" . implode(\", \", $u) . \".\" . \"\\n\";\nprint \"If you want to go to a cafe with a wonderful girl, you should call: \" . implode(\", \", $v) . \".\";\n?>"}, {"source_code": " $temp_c_arr[1]) return false;\n\t\tif ($temp_c_arr[0] < $temp_c_arr[1]) return false;\n\t\telse if ($temp_c_arr[0] === $temp_c_arr[1]) $temp_c++;\n\t}\n\tif ($temp_c === 3) return false;\n*/\n\t$str = str_replace(\"-\", \"\", $str);\n\t$arr = str_split($str);\n\t$temp = 10;\n\tforeach ($arr as $as_i) {\n\t\tif ($temp <= $as_i) return false;\n\t\t$temp = $as_i;\n\t}\n\treturn true;\n}\n/*\nfunction arr_make_names($arr) {\n\t$temp_arr = array();\n\tforeach ($arr as $as_i) {\n\t\tif (is_array($as_i) === true) {\n\t\t\t$temp_arr[] = get_array_message($as_i, \", \");\n\t\t} else {\n\t\t\t$temp_arr[] = $as_i;\n\t\t}\n\t}\n\treturn $temp_arr;\n}\n*/\n\nfunction change_counts_names(&$arr_c, &$arr_n, $c_t, $c_p, $c_g, $name){\n\tif ($arr_c[0] < $c_t) {\n\t\t$arr_c[0] = $c_t;\n\t\t$arr_n[0] = $name;\n\t} else if ($arr_c[0] === $c_t) {\n\t\tif ($arr_n[0] !== \"\") {\n\t\t\t//$arr_n[0] = $arr_n[0] . \", \" . $name;\n\t\t\t$arr_n[0] .= \", \" . $name;\n\t\t} else {\n\t\t\t$arr_n[0] = $name;\n\t\t}\n\t} \n\tif ($arr_c[1] < $c_p) {\n\t\t$arr_c[1] = $c_p;\n\t\t$arr_n[1] = $name;\n\t} else if ($arr_c[1] === $c_p) {\n\t\tif ($arr_n[1] !== \"\") {\n\t\t\t//$arr_n[1] = $arr_n[1] . \", \" . $name;\n\t\t\t$arr_n[1] .= \", \" . $name;\n\t\t} else {\n\t\t\t$arr_n[1] = $name;\n\t\t}\n\t}\n\tif ($arr_c[2] < $c_g) {\n\t\t$arr_c[2] = $c_g;\n\t\t$arr_n[2] = $name;\n\t//} else if ($arr_c[2] = $c_g) {\n\t} else if ($arr_c[2] === $c_g) {\n\t\tif ($arr_n[2] !== \"\") {\n\t\t\t//$arr_n[2] = \"$arr_n[1], $name\";\n\t\t\t//$arr_n[2] = $arr_n[2] . \", \" . $name;\n\t\t\t$arr_n[2] .= \", \" . $name;\n\t\t} else {\n\t\t\t$arr_n[2] = $name;\n\t\t}\n\t}\n}\n\nfunction print_names($arr){\n\tprint(\"If you want to call a taxi, you should call: $arr[0].\\n\");\n\tprint(\"If you want to order a pizza, you should call: $arr[1].\\n\");\n\tprint(\"If you want to go to a cafe with a wonderful girl, you should call: $arr[2].\");\n}\t\n\nfunction solve(){\n\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_n = $Token->nextInt();\n\t$ans_name_arr = array_fill(0, 3, \"\");\n\t$ans_count_arr = array_fill(0, 3, -1);\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_s = $Token->nextInt();\n\t\t//$inp_name = $Token->nextInt();\n\t\t$inp_name = $Token->nextToken();\n\t\t$temp_c_taxi = 0;\n\t\t$temp_c_pizza = 0;\n\t\t$temp_c_girl = 0;\n\t\tfor ($j = 0; $j < $inp_s; $j++) {\n\t\t\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t\t$inp_number = $Token->nextToken();\n\t\t\tif (number_taxi($inp_number) === true) {\n\t\t\t\t$temp_c_taxi++;\n\t\t\t} else if (number_pizza($inp_number) === true) {\n\t\t\t\t$temp_c_pizza++;\n\t\t\t} else {\n\t\t\t\t$temp_c_girl++;\n\t\t\t}\n\t\t}\n\t\tchange_counts_names($ans_count_arr, $ans_name_arr, $temp_c_taxi, $temp_c_pizza, $temp_c_girl, $inp_name);\t\n\t}\n\tprint_names($ans_name_arr);\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 $_\n//overwritten function $aa---_\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\t\t\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\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\t$message .= $value . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction aarray_printf(array $array, $str) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= $value . $str;\n\t\t}\n\t\t$message = rtrim($message, $str);\n\t\tprintf('%s', $message);\n}\n/*\nfunction get_array_message(array $array, $str) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t//$message .= \"$value\" . \"$str\";\n\t\t\t$message .= $value . $str;\n\t\t}\n\t\t$message = rtrim($message, $str);\n\t\treturn $message;\n}\n*/\n?>"}, {"source_code": " 0){\n $line = str_replace($del,'',$line);\n $dataex[] = $line;\n $text = explode(\" \",$line);\n foreach($text as $txt){\n $arr_txt[] = $txt;\n $this->linex[$id] = $il;\n $this->liney[$il] = $id;\n $id++;//\n }\n }\n $il++;//\n }\n $this->arr_line = $dataex;\n $this->arr_txt = $arr_txt; \n }\n function G(){// Get Last Txt\n $ret = $this->arr_txt[$this->ntxt++];\n $this->nline = $this->linex[$this->ntxt];\n return $ret;\n }\n function GL(){ //Get Last Line \n $this->ntxt = $this->liney[$this->nline]+1;\n return $this->arr_line[$this->nline++];\n }\n}\n$dxs = new stdIn(false);\n//define(\"I\",$dxs);\n//define(\"STL\",$dxs->GL());\n//////////////////////////////////////////////////////////////\n\n//echo \":\".print_r($inp->lineal,true).\":\";\nfunction typeN($nums){\n $number = explode(\"-\",$nums);\n $dig11 = (int)($number[0]/10);$dig12 = (int)($number[0]%10);\n $dig21 = (int)($number[1]/10);$dig22 = (int)($number[1]%10);\n $dig31 = (int)($number[2]/10);$dig32 = (int)($number[2]%10);\n if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){return 'pizza';}\n else if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){return 'taxi';}\n else{return 'girl';}\n}\nfunction joinA($c,$txt){$i=0;$ret = \"\";\n foreach($txt as $it){if($i>0){$ret .= $c.\" \";}\n $ret .= $it;$i++;}\n return $ret;\n}\n$max['taxi']=0;$max['pizza']=0;$max['girl']=0;\n$n = $dxs->G();\nfor($i=0;$i<$n;$i++){\n $nums = $dxs->G();\n $name = $dxs->G();\n $total[$name]['taxi']=0;$total[$name]['pizza']=0;$total[$name]['girl']=0;\n for($j=0;$j<$nums;$j++){\n $telf = $dxs->G();$typ = typeN($telf);\n $nt = ++$total[$name][$typ];\n if($max[$typ]<$nt){$max[$typ]=$nt;}\n }\n}\n//print_r($total);\n//print_r($max);\nforeach($total as $name => $nmrs){\n foreach($nmrs as $type => $val){\n if($val == $max[$type]){$ret[$type][] = $name;}\n }\n}\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $ret .= str_replace($del,'',$it);\n $i++;\n }\n return $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\n$max['taxi'] = 0;\n$max['pizza'] = 0;\n$max['girl'] = 0;\nfor($nl=1;$nl\";\n \n // Depura Linea //\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $intxtln = str_replace($del,'',$intxt[$nl]);//echo \"<\".$intxtn.\"
\";\n if(strlen($intxtln) == 0){break;}\n //\n \n $lne = explode(\" \",$intxtln);$nl++; \n \n $t = $lne[0]; //echo $t.\"
\";\n $name = $lne[1];//echo $name.\"
\";\n $total[$name]['taxi'] = 0;\n $total[$name]['pizza'] = 0;\n $total[$name]['girl'] = 0;\n for($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n \n $number = explode(\"-\",$intxt[$nl]);$nl++;\n $num1 = (int)$number[0];$dig11 = (int)($num1/10);$dig12 = (int)($num1%10);\n $num2 = (int)$number[1];$dig21 = (int)($num2/10);$dig22 = (int)($num2%10);\n $num3 = (int)$number[2];$dig31 = (int)($num3/10);$dig32 = (int)($num3%10);\n\n if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){\n $mpizza = @++$total[$name]['pizza']; \n if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n }else if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){ \n $mtaxi = @++$total[$name]['taxi'];\n if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n }else{\n $mgirl =@++$total[$name]['girl'];\n if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n }\n \n }\n}\n//print_r($total);\nforeach($total as $name => $tot){\n foreach($tot as $type => $val){\n if($val == $max[$type]){$ret[$type][] = $name;}\n }\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\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 ///////////////////////////////////////\nfunction typeN($nums){\t$number = explode(\"-\",$nums);\n\t$dig11 = (int)($number[0]/10);$dig12 = (int)($number[0]%10);\n\t$dig21 = (int)($number[1]/10);$dig22 = (int)($number[1]%10);\n\t$dig31 = (int)($number[2]/10);$dig32 = (int)($number[2]%10);\n\tif($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){return 'pizza';}\n\telse if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){return 'taxi';}\n\telse{return 'girl';}}\nfunction joinA($c,$txt){$i=0;$ret = \"\";foreach($txt as $it){if($i>0){$ret .= $c.\" \";}$ret .= $it;$i++;}return $ret;}\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$max['taxi']=0;$max['pizza']=0;$max['girl']=0;$n = $dxs->G();\nfor($i=0;$i<$n;$i++){$nums = $dxs->G();$name = $dxs->G();\n\t$total[$name]['taxi']=0;$total[$name]['pizza']=0;$total[$name]['girl']=0;\n\tfor($j=0;$j<$nums;$j++){$telf = $dxs->G();$typ = typeN($telf);$nt = ++$total[$name][$typ];if($max[$typ]<$nt){$max[$typ]=$nt;}}}\n//print_r($total);print_r($max);\nforeach($total as $name => $nmrs){foreach($nmrs as $type => $val){if($val == $max[$type]){$ret[$type][] = $name;}}}\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $ret .= str_replace($del,'',$it);\n $i++;\n }\n return $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\n$max['taxi'] = 0;\n$max['pizza'] = 0;\n$max['girl'] = 0;\nfor($nl=1;$nl\";\n \n // Depura Linea //\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $intxtln = str_replace($del,'',$intxt[$nl]);//echo \"<\".$intxtn.\"
\";\n if(strlen($intxtln) == 0){break;}\n //\n \n $lne = explode(\" \",$intxtln);$nl++; \n \n $t = $lne[0]; //echo $t.\"
\";\n $name = $lne[1];//echo $name.\"
\";\n $total[$name]['taxi'] = 0;\n $total[$name]['pizza'] = 0;\n $total[$name]['girl'] = 0;\n for($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n \n $number = explode(\"-\",$intxt[$nl]);$nl++;\n $num1 = (int)$number[0];$dig11 = (int)($num1/10);$dig12 = (int)($num1%10);\n $num2 = (int)$number[1];$dig21 = (int)($num2/10);$dig22 = (int)($num2%10);\n $num3 = (int)$number[2];$dig31 = (int)($num3/10);$dig32 = (int)($num3%10);\n\n if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){\n $mpizza = @++$total[$name]['pizza']; \n if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n }else if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){ \n $mtaxi = @++$total[$name]['taxi'];\n if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n }else{\n $mgirl =@++$total[$name]['girl'];\n if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n }\n \n }\n}\n//print_r($total);\nforeach($total as $name => $tot){\n foreach($tot as $type => $val){\n if($val == $max[$type]){$ret[$type][] = $name;}\n }\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}], "negative_code": [{"source_code": " $temp_c_arr[1]) return false;\n\t\tif ($temp_c_arr[0] < $temp_c_arr[1]) return false;\n\t\telse if ($temp_c_arr[0] === $temp_c_arr[1]) $temp_c++;\n\t}\n\tif ($temp_c === 3) return false;\n*/\n\t$str = str_replace(\"-\", \"\", $str);\n\t$arr = str_split($str);\n\t$temp = 10;\n\tforeach ($arr as $as_i) {\n\t\tif ($temp <= $as_i) return false;\n\t\t$temp = $as_i;\n\t}\n\treturn true;\n}\n/*\nfunction arr_make_names($arr) {\n\t$temp_arr = array();\n\tforeach ($arr as $as_i) {\n\t\tif (is_array($as_i) === true) {\n\t\t\t$temp_arr[] = get_array_message($as_i, \", \");\n\t\t} else {\n\t\t\t$temp_arr[] = $as_i;\n\t\t}\n\t}\n\treturn $temp_arr;\n}\n*/\n\nfunction change_counts_names(&$arr_c, &$arr_n, $c_t, $c_p, $c_g, $name){\n\tif ($arr_c[0] < $c_t) {\n\t\t$arr_c[0] = $c_t;\n\t\t$arr_n[0] = $name;\n\t} else if ($arr_c[0] === $c_t) {\n\t\tif ($arr_n[0] !== \"\") {\n\t\t\t//$arr_n[0] = $arr_n[0] . \", \" . $name;\n\t\t\t$arr_n[0] .= \", \" . $name;\n\t\t} else {\n\t\t\t$arr_n[0] = $name;\n\t\t}\n\t} \n\tif ($arr_c[1] < $c_p) {\n\t\t$arr_c[1] = $c_p;\n\t\t$arr_n[1] = $name;\n\t} else if ($arr_c[1] === $c_p) {\n\t\tif ($arr_n[1] !== \"\") {\n\t\t\t//$arr_n[1] = $arr_n[1] . \", \" . $name;\n\t\t\t$arr_n[1] .= \", \" . $name;\n\t\t} else {\n\t\t\t$arr_n[1] = $name;\n\t\t}\n\t}\n\tif ($arr_c[2] < $c_g) {\n\t\t$arr_c[2] = $c_g;\n\t\t$arr_n[2] = $name;\n\t//} else if ($arr_c[2] = $c_g) {\n\t} else if ($arr_c[2] === $c_g) {\n\t\tif ($arr_n[2] !== \"\") {\n\t\t\t//$arr_n[2] = \"$arr_n[1], $name\";\n\t\t\t//$arr_n[2] = $arr_n[2] . \", \" . $name;\n\t\t\t$arr_n[2] .= \", \" . $name;\n\t\t} else {\n\t\t\t$arr_n[2] = $name;\n\t\t}\n\t}\n}\n\nfunction print_names($arr){\n\tprint(\"If you want to call a taxi, you should call: $arr[0]\\n\");\n\tprint(\"If you want to order a pizza, you should call: $arr[1]\\n\");\n\tprint(\"If you want to go to a cafe with a wonderful girl, you should call: $arr[2]\");\n}\t\n\nfunction solve(){\n\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_n = $Token->nextInt();\n\t$ans_name_arr = array_fill(0, 3, \"\");\n\t$ans_count_arr = array_fill(0, 3, -1);\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_s = $Token->nextInt();\n\t\t//$inp_name = $Token->nextInt();\n\t\t$inp_name = $Token->nextToken();\n\t\t$temp_c_taxi = 0;\n\t\t$temp_c_pizza = 0;\n\t\t$temp_c_girl = 0;\n\t\tfor ($j = 0; $j < $inp_s; $j++) {\n\t\t\t//$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t\t$inp_number = $Token->nextToken();\n\t\t\tif (number_taxi($inp_number) === true) {\n\t\t\t\t$temp_c_taxi++;\n\t\t\t} else if (number_pizza($inp_number) === true) {\n\t\t\t\t$temp_c_pizza++;\n\t\t\t} else {\n\t\t\t\t$temp_c_girl++;\n\t\t\t}\n\t\t}\n\t\tchange_counts_names($ans_count_arr, $ans_name_arr, $temp_c_taxi, $temp_c_pizza, $temp_c_girl, $inp_name);\t\n\t}\n\tprint_names($ans_name_arr);\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 $_\n//overwritten function $aa---_\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\t\t\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\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\t$message .= $value . \" \";\n\t\t}\n\t\t$message = rtrim($message);\n\t\tprintf('%s', $message);\n}\n\nfunction aarray_printf(array $array, $str) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t$message .= $value . $str;\n\t\t}\n\t\t$message = rtrim($message, $str);\n\t\tprintf('%s', $message);\n}\n/*\nfunction get_array_message(array $array, $str) {\n\t\t$message = \"\";\n\t\tforeach ($array as $value) {\n\t\t\t//$message .= \"$value\" . \"$str\";\n\t\t\t$message .= $value . $str;\n\t\t}\n\t\t$message = rtrim($message, $str);\n\t\treturn $message;\n}\n*/\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\t$ret .= str_replace($del,'',$it);\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\n$max['taxi'] = 0;\n$max['pizza'] = 0;\n$max['girl'] = 0;\nfor($nl=1;$nl\";\n\t\n\t// Depura Linea //\n\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t$intxtln = str_replace($del,'',$intxt[$nl]);//echo \"<\".$intxtn.\"
\";\n\tif(strlen($intxtln) == 0){break;}\n\t//\n\t\n\t$lne = explode(\" \",$intxtln);$nl++; \n\t\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\t$total[$name]['taxi'] = 0;\n\t$total[$name]['pizza'] = 0;\n\t$total[$name]['girl'] = 0;\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10 && $num3/10>$num3%10){\n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t\t\n\t}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){$ret[$type][] = $name;}\n\t}\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\t$ret .= str_replace($del,'',$it);\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10 && $num3/10>$num3%10){\n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){ $ret[$type][] = $name;}\n\t}\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "\";\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1 > $num2 && $num2 > $num3){ \n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){ $ret[$type][] = $name;}\n\t}\n}\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".implode(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".implode(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".implode(\",\",$ret['girl']).\".\\n\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\t$ret .= str_replace($del,'',$it);\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n//$dir = fopen(\"php://stdin\", 'r');\n$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ echo \"->\".$intxt[$nl].\"
\";\n\t\t\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10 && $num3/10>$num3%10){\n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t\t\n\t}\n\t//if($t==0){$nl++;}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){$ret[$type][] = $name;}\n\t}\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\t$ret .= str_replace($del,'',$it);\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10 && $num3/10>$num3%10){\n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t\t\n\t}\n\t//if($t==0){$nl++;}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){$ret[$type][] = $name;}\n\t}\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\t$ret .= str_replace($del,'',$it);\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10 && $num3/10>$num3%10){\n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t\t\n\t}\n\tif($t==0){\n\t\t@$total[$name]['taxi'] = 0;\n\t\t@$total[$name]['pizza'] = 0;\n\t\t@$total[$name]['girl'] = 0;\n\t}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){$ret[$type][] = $name;}\n\t}\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $ret .= str_replace($del,'',$it);\n $i++;\n }\n return $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n $lne = explode(\" \",$intxt[$nl]);$nl++;\n $t = $lne[0]; //echo $t.\"
\";\n $name = $lne[1];//echo $name.\"
\";\n for($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n $number = explode(\"-\",$intxt[$nl]);$nl++;\n $num1 = $number[0];\n $num2 = $number[1];\n $num3 = $number[2];\n \n if($num1+$num2+$num3 == 3*$num1){ \n $mtaxi = @++$total[$name]['taxi'];\n if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n }else if($num1 > $num2 && $num2 > $num3){ \n $mpizza = @++$total[$name]['pizza']; \n if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n }else{\n $mgirl =@++$total[$name]['girl'];\n if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n }\n }\n}\n//print_r($total);\nforeach($total as $name => $tot){\n foreach($tot as $type => $val){\n if($val == $max[$type]){ $ret[$type][] = $name;}\n }\n}\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\\n\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\t$ret .= str_replace($del,'',$it);\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t//$lne = str_replace($del,'',$lne);\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10 && $num3/10>$num3%10){\n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t\t\n\t}\n\tif($t==0){\n\t\t@$total[$name]['taxi'] = 0;\n\t\t@$total[$name]['pizza'] = 0;\n\t\t@$total[$name]['girl'] = 0;\n\t}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){$ret[$type][] = $name;}\n\t}\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n\t\t$ret .= str_replace($del,'',$it);\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1/10>$num1%10 && $num1%10>$num2/10 && $num2/10>$num2%10 && $num2%10>$num3/10 && $num3/10>$num3%10){\n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){ $ret[$type][] = $name;}\n\t}\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']);\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n\t\t$ret .= $it;\n\t\t$i++;\n\t}\n\treturn $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\nfor($nl=1;$nl\";\n\t$lne = explode(\" \",$intxt[$nl]);$nl++;\n\t$t = $lne[0]; //echo $t.\"
\";\n\t$name = $lne[1];//echo $name.\"
\";\n\tfor($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n\t\t$number = explode(\"-\",$intxt[$nl]);$nl++;\n\t\t$num1 = $number[0];\n\t\t$num2 = $number[1];\n\t\t$num3 = $number[2];\n\t\t\n\t\tif($num1+$num2+$num3 == 3*$num1){ \n\t\t\t$mtaxi = @++$total[$name]['taxi'];\n\t\t\tif(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n\t\t}else if($num1 > $num2 && $num2 > $num3){ \n\t\t\t$mpizza = @++$total[$name]['pizza']; \n\t\t\tif(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n\t\t}else{\n\t\t\t$mgirl =@++$total[$name]['girl'];\n\t\t\tif(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n\t\t}\n\t}\n}\n//print_r($total);\nforeach($total as $name => $tot){\n\tforeach($tot as $type => $val){\n\t\tif($val == $max[$type]){ $ret[$type][] = $name;}\n\t}\n}\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $ret .= str_replace($del,'',$it);\n $i++;\n }\n return $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\n$max['taxi'] = 0;\n$max['pizza'] = 0;\n$max['girl'] = 0;\nfor($nl=1;$nl\";\n \n // Depura Linea //\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $intxtln = str_replace($del,'',$intxt[$nl]);//echo \"<\".$intxtn.\"
\";\n if(strlen($intxtln) == 0){break;}\n //\n \n $lne = explode(\" \",$intxtln);$nl++; \n \n $t = $lne[0]; //echo $t.\"
\";\n $name = $lne[1];//echo $name.\"
\";\n $total[$name]['taxi'] = 0;\n $total[$name]['pizza'] = 0;\n $total[$name]['girl'] = 0;\n for($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n \n $number = explode(\"-\",$intxt[$nl]);$nl++;\n $num1 = (int)$number[0];$dig11 = (int)($num1/10);$dig12 = (int)($num1%10);\n $num2 = (int)$number[1];$dig21 = (int)($num2/10);$dig22 = (int)($num2%10);\n $num3 = (int)$number[2];$dig31 = (int)($num3/10);$dig32 = (int)($num3%10);\n\n if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){\n $mpizza = @++$total[$name]['pizza']; \n if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n }else if($dig11 == $dig12 && $dig12 == $dig21 && $dig21 == $dig22 && $dig22 == $dig31 && $dig31 == $dig32){ \n $mtaxi = @++$total[$name]['taxi'];\n if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n }else{\n $mgirl =@++$total[$name]['girl'];\n if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n }\n \n }\n}\n//print_r($total);\nforeach($total as $name => $tot){\n foreach($tot as $type => $val){\n $ret[$type][] = $name;\n }\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}, {"source_code": "0){$ret .= $c.\" \";}\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $ret .= str_replace($del,'',$it);\n $i++;\n }\n return $ret;\n}\n$dir = fopen(\"php://stdin\", 'r');\n//$dir = fopen(\"input.txt\", 'r');\n$input = stream_get_contents($dir);\n//print_r($input);\n$intxt=explode(\"\\n\",$input);\n$n = $intxt[0];\n$max['taxi'] = 0;\n$max['pizza'] = 0;\n$max['girl'] = 0;\nfor($nl=1;$nl\";\n \n // Depura Linea //\n $del = Array(\"\\n\",\"\\r\",\"\\n\\r\");\n $intxtln = str_replace($del,'',$intxt[$nl]);//echo \"<\".$intxtn.\"
\";\n if(strlen($intxtln) == 0){break;}\n //\n \n $lne = explode(\" \",$intxtln);$nl++; \n \n $t = $lne[0]; //echo $t.\"
\";\n $name = $lne[1];//echo $name.\"
\";\n $total[$name]['taxi'] = 0;\n $total[$name]['pizza'] = 0;\n $total[$name]['girl'] = 0;\n for($j=1;$j<=$t;$j++){ //echo \"->\".$intxt[$nl].\"
\";\n \n $number = explode(\"-\",$intxt[$nl]);$nl++;\n $num1 = (int)$number[0];$dig11 = (int)($num1/10);$dig12 = (int)($num1%10);\n $num2 = (int)$number[1];$dig21 = (int)($num2/10);$dig22 = (int)($num2%10);\n $num3 = (int)$number[2];$dig31 = (int)($num3/10);$dig32 = (int)($num3%10);\n\n if($dig11>$dig12 && $dig12>$dig21 && $dig21>$dig22 && $dig22>$dig31 && $dig31>$dig32){\n $mpizza = @++$total[$name]['pizza']; \n if(@$max['pizza']<$mpizza){$max['pizza'] = $mpizza;}\n }else if(($dig11 + $dig12)==($dig21 + $dig22) && ($dig21 + $dig22)==($dig32 + $dig31)){ \n $mtaxi = @++$total[$name]['taxi'];\n if(@$max['taxi']<$mtaxi){$max['taxi'] = $mtaxi;}\n }else{\n $mgirl =@++$total[$name]['girl'];\n if(@$max['girl']<$mgirl){$max['girl'] = $mgirl;}\n }\n \n }\n}\n//print_r($total);\nforeach($total as $name => $tot){\n foreach($tot as $type => $val){\n if($val == $max[$type]){$ret[$type][] = $name;}\n }\n}\n//echo \"\\n\";\n//print_r($ret);\n//solution\necho \"If you want to call a taxi, you should call: \".joinA(\",\",$ret['taxi']).\".\\n\";\necho \"If you want to order a pizza, you should call: \".joinA(\",\",$ret['pizza']).\".\\n\";\necho \"If you want to go to a cafe with a wonderful girl, you should call: \".joinA(\",\",$ret['girl']).\".\";\n?>"}], "src_uid": "4791a795119c185b3aec91b6f8af8f03"} {"source_code": " &$value) {\n $value = (int) $value;\n}\nunset($value);\n\nsort($arr);\n\n$x = $arr[$n-1];\n$x = (string) $x;\n$sum = bcmul($x, $n);\n\nfor ($i=0; $i < $n-1; $i++) { \n $sum = bcadd($sum, bcmul((string) $arr[$i], (string) ($i + 2)));\n}\necho $sum;\n\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " &$value) {\n $value = (int) $value;\n}\nunset($value);\n\n// $sum = array_sum($arr);\nsort($arr);\n$sum = $arr[$n-1] * $n;\n\n/*\nwhile ( count($arr) > 1) {\n $sum += array_sum($arr);\n array_pop($arr);\n}\n*/\n\nfor ($i=0; $i < $n-1; $i++) { \n $sum += $arr[$i] * ($i + 2);\n}\necho $sum;\n\n?>"}, {"source_code": " &$value) {\n $value = (int) $value;\n}\nunset($value);\n\n$sum = array_sum($arr);\nrsort($arr);\n\nwhile ( count($arr) > 1) {\n $sum += array_sum($arr);\n array_pop($arr);\necho \"sum=$sum \\n\";\n}\n\necho $sum;\n\n?>"}], "src_uid": "4266948a2e793b4b461156af226e98fd"} {"source_code": " strlen($a))\n{\n print \"0\";\n}\nelse\n{\n $c = 0;\n $d = 0;\n $e = 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);\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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $f[$b[$x]]++;\n }\n for($x = 0; $x < strlen($b); $x++)\n {\n if($a[$x] != \"?\")\n {\n $e[$a[$x]]++;\n if($e[$a[$x]] > $f[$a[$x]])\n {\n $d++;\n }\n }\n }\n if($d <= 0)\n {\n $c++;\n }\n $g = 0;\n $h = $x;\n for($x = 0; $x < strlen($a) - strlen($b); $x++)\n {\n if($a[$g] != \"?\")\n {\n if($e[$a[$g]] > $f[$a[$g]])\n {\n $d--;\n }\n $e[$a[$g]]--;\n }\n if($a[$h] != \"?\")\n {\n $e[$a[$h]]++;\n if($e[$a[$h]] > $f[$a[$h]])\n {\n $d++;\n }\n }\n if($d <= 0)\n {\n $c++;\n }\n $g++;\n $h++;\n }\n print $c;\n}\n?>", "positive_code": [{"source_code": " 0);\ncnt($a, $s, $sn, -1);\ncnt($a, $p, $sn, 1);\n$d = 0;\nforeach ($a as $k => $i) if ($i > 0 && $k != $q) $d += $i;\n$r = ($d == 0 ? 1 : 0);\nfor ($i = 0; ($j = $i + $sn) < $pn; $i++)\n{\n $c = substr($p, $i, 1);\n cnt($a, $c, 1, -1);\n if ($c != \"?\" && $a[ord($c)] >= 0) $d--;\n $c = substr($p, $j, 1);\n cnt($a, $c, 1, 1);\n if ($c != \"?\" && $a[ord($c)] > 0) $d++;\n if ($d == 0) $r++;\n}\nfprintf(STDOUT, \"%d\\n\", $r);\n"}], "negative_code": [], "src_uid": "9ed2a081b65df66629fcf0d4fc0bb02c"} {"source_code": "=$a){\necho \"$a 0\\r\\n\";\necho \"0 $b\\r\\n\";\n}else{\necho \"0 $b\\r\\n\";\necho \"$a 0\\r\\n\";\n}\n}else{\n\nif($a>$b){\necho \"0 1\\r\\n\";\necho \"$a $b\\r\\n\";\necho \"0 0\\r\\n\";\necho \"$a \".($b-1);\n}else{\n\necho \"1 0\\r\\n\";\necho \"$a $b\\r\\n\";\necho \"0 0\\r\\n\";\necho ($a-1).\" $b\\r\\n\";\n\n\n}\n\n}\n?>", "positive_code": [{"source_code": "=$a){\n$point[2]=\"$a 0\";\n$point[3]=\"0 $b\";\n}else{\n$point[2]=\"0 $b\";\n$point[3]=\"$a 0\";\n}\n}else{\n\nif($a>$b){\n$point[0]=\"0 1\";\n$point[1]=\"$a $b\";\n$point[2]=\"0 0\";\n$point[3]=\"$a \".($b-1);\n}else{\n\n$point[0]=\"1 0\";\n$point[1]=\"$a $b\";\n$point[2]=\"0 0\";\n$point[3]=($a-1).\" $b\";\n\n\n}\n\n}\n\nprint implode(\"\\r\\n\",$point);\n?>"}, {"source_code": "$m){\n echo \"0 1\\n\";\n echo \"$n $m\\n\";\n echo \"0 0\\n\";\n echo \"$n \".($m-1).\"\\n\";\n }else{\n echo \"1 0\\n\";\n echo \"$n $m\\n\";\n echo \"0 0\\n\";\n echo ($n-1).\" $m\\n\";\n }\n}"}], "negative_code": [{"source_code": "=$a){\n$point[2]=\"$a 0\";\n$point[3]=\"0 $b\";\n}else{\n$point[2]=\"0 $b\";\n$point[3]=\"$a 0\";\n}\n}else{\n\nif($a>$b){\n$point[0]=\"0 1\";\n$point[1]=\"$a $b\";\n$point[2]=\"0 0\";\n$point[3]=\"$a \".($b-1);\n}else{\n\n$point[0]=\"1 0\";\n$point[1]=\"$a $b\";\n$point[2]=\"0 0\";\n$point[3]=($a-1).\" $b\";\n\n\n}\n\n}\n\nprint implode(\"\\r\\n\",$point);\n?>"}, {"source_code": "=$a){\n$point[2]=\"$a 0\";\n$point[3]=\"0 $b\";\n}else{\n$point[2]=\"0 $b\";\n$point[3]=\"$a 0\";\n}\n}\n\nprint implode(\"\\r\\n\",$point);\n?>"}, {"source_code": "=$a){\necho \"$a 0\";\necho \"0 $b\";\n}else{\necho \"0 $b\";\necho \"$a 0\";\n}\n}else{\n\nif($a>$b){\necho \"0 1\";\necho \"$a $b\";\necho \"0 0\";\necho \"$a \".($b-1);\n}else{\n\necho \"1 0\";\necho \"$a $b\";\necho \"0 0\";\necho ($a-1).\" $b\";\n\n\n}\n\n}\n?>"}, {"source_code": "$m){\n echo \"0 1\\n\";\n echo ($n-1).\" 0\\n\";\n }else{\n echo \"1 0\\n\";\n echo \"0 \".($m-1).\"\\n\";\n }\n}"}, {"source_code": "$m){\n echo \"0 1\\n\";\n echo \"$n \".($m-1).\"\\n\";\n }else{\n echo \"1 0\\n\";\n echo ($n-1).\" $m\\n\";\n }\n}"}, {"source_code": "$m){\n echo \"0 $m\\n\";\n echo \"$n 0\\n\";\n }else{\n echo \"$n 0\\n\";\n echo \"0 $m\\n\";\n }\n}"}, {"source_code": "$m){\n echo \"0 $m\\n\";\n echo \"$n 0\\n\";\n }else{\n echo \"$n 0\\n\";\n echo \"0 $m\\n\";\n }\n}"}], "src_uid": "78d54d76cb113cf74ea89fb77471859b"} {"source_code": " 0 ? $mx : 1;\n\t\t$last = $a[$i] - $last;\n\t}\n\t$a[$n - 1] -= $last;\n\tif($a[$n - 1] < 1 || $a[$n - 1] > $mx)\n\t\techo -1;\n\telse\n\t\tfor($i = 0; $i < $n; $i++)\n\t\t\techo $a[$i]. ' ';\n?>\n", "positive_code": [{"source_code": "$max) printf(\"%d\\n\",-1);\nelse\n{\n for ($i=1;$i<=$n;$i++)\n {\n if ($i&1)\n {\n $max-=$l;\n $min-=1;\n }\n else\n {\n $max+=1;\n $min+=$l;\n }\n $out=0;\n for ($j=1;$j<=$l;$j++)\n {\n if ($i&1)\n {\n if ($min<=$d-$j&&$d-$j<=$max) $out=$j;\n }\n else\n {\n if ($min<=$d+$j&&$d+$j<=$max) $out=-$j; \n }\n }\n $d-=$out;\n printf(\"%d%s\",abs($out),$i==$n?\"\\n\":\" \");\n }\n}\n?>"}], "negative_code": [{"source_code": "$max) printf(\"%d\\n\",-1);\nelse\n{\n for ($i=1;$i<=$n;$i++)\n {\n if ($i&1)\n {\n $max-=$l;\n $min-=1;\n }\n else\n {\n $max+=1;\n $min+=$l;\n }\n $out=0;\n for ($j=1;$j<=$l;$j++)\n {\n if ($i&1)\n {\n if ($min<=$d-$j&&$d-$j<=$max) $out=$j;\n }\n else\n {\n if ($min<=$d+$j&&$d+$j<=$max) $out=-$j; \n }\n }\n $d-=$out;\n printf(\"%d%c\",abs($out),$i==$n?'\\n':' ');\n }\n}\n?>"}, {"source_code": "$max) printf(\"%d\\n\",-1);\nelse\n{\n for ($i=1;$i<=$n;$i++)\n {\n if ($i&1)\n {\n $max-=$l;\n $min-=1;\n }\n else\n {\n $max+=1;\n $min+=$l;\n }\n $out=0;\n for ($j=1;$j<=$l;$j++)\n {\n if ($i&1)\n {\n if ($min<=$d-$j&&$d-$j<=$max) $out=$j;\n }\n else\n {\n if ($min<=$d+$j&&$d+$j<=$max) $out=-$j; \n }\n }\n $d-=$out;\n printf(\"%d%s\",abs($out),$i==$n?'\\n':' ');\n }\n}\n?>"}, {"source_code": " 0 ? $mx : 1;\n\t\t$last = $a[$i] - $last;\n\t}\n\tif($a[$n - 1] < 1 || $a[$n - 1] > $mx)\n\t\techo -1;\n\telse\n\t\tfor($i = 0; $i < $n; $i++)\n\t\t\techo $a[$i]. ' ';\n?>\n"}], "src_uid": "a20d59a0db07cbb5692f01d28e41a3a1"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "dc31adef80f06897ea2f5ef76854bcf1"} {"source_code": " insert($d);\n $e .= $c . \" \" . $d . \"\\n\";\n $f++;\n }\n elseif($c == \"getMin\")\n {\n if($b -> count() == 0)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n }\n elseif($b -> top() > $d)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n }\n elseif($b -> top() == $d)\n {\n $e .= $c . \" \" . $d . \"\\n\";\n $f++;\n }\n elseif($b -> top() < $d)\n {\n while(TRUE)\n {\n if($b -> count() == 0)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n break;\n }\n elseif($b -> top() < $d)\n {\n $b -> extract();\n $e .= \"removeMin\\n\";\n $f++;\n }\n elseif($b -> top() == $d)\n {\n $e .= $c . \" \" . $d . \"\\n\";\n $f++;\n break;\n }\n elseif($b -> top() > $d)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n break;\n }\n }\n }\n }\n elseif($c == \"removeMin\")\n {\n if($b -> count() == 0)\n {\n $b -> insert(\"1\");\n $b -> extract();\n $e .= \"insert 1\\n\" . $c . \"\\n\";\n $f += 2;\n }\n else\n {\n $b -> extract();\n $e .= $c . \"\\n\";\n $f++;\n }\n }\n}\nprint $f . \"\\n\";\nprint $e;\n?>", "positive_code": [{"source_code": "= 0) {\n\t\tif ($heap->count() == 0) {\n\t\t\t$result[] = \"insert 0\\n\";\n\t\t} else {\n\t\t\t$heap->extract();\n\t\t}\n\t} else {\n\t\tlist($op, $arg) = explode(' ', $ln);\n\t\t$arg = intval($arg);\n\t\tif ($op == 'insert') {\n\t\t\t$heap->insert($arg);\n\t\t} else {\n\t\t\twhile($heap->count() && $heap->top() < $arg) {\n\t\t\t\t$result[] = \"removeMin\\n\";\n\t\t\t\t$heap->extract();\n\t\t\t}\n\t\t\tif ($heap->count() == 0 || $heap->top() > $arg) {\n\t\t\t\t$result[] = \"insert $arg\\n\";\n\t\t\t\t$heap->insert($arg);\n\t\t\t}\n\t\t}\n\t}\n\t$result[] = $ln;\n}\necho count($result).\"\\n\";\necho implode(\"\", $result);"}], "negative_code": [{"source_code": " insert($d);\n $e .= $c . \" \" . $d . \"\\n\";\n $f++;\n }\n elseif($c == \"getMin\")\n {\n if($b -> count() == 0)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n }\n elseif($b -> top() > $d)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n }\n elseif($b -> top() == $d)\n {\n $e .= $c . \" \" . $d . \"\\n\";\n $f++;\n }\n elseif($b -> top() < $d)\n {\n while(TRUE)\n {\n $b -> extract();\n $e .= \"removeMin\\n\";\n $f++;\n if($b -> count() != 0)\n {\n if($b -> top() == $d)\n {\n $e .= \"getMin \" . $d . \"\\n\";\n $f++;\n break;\n }\n elseif($b -> count() == 0)\n {\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n break;\n }\n }\n else\n {\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n break;\n }\n }\n }\n }\n elseif($c == \"removeMin\")\n {\n if($b -> count() == 0)\n {\n $b -> insert(\"1\");\n $b -> extract();\n $e .= \"insert 1\\n\" . $c . \"\\n\";\n $f += 2;\n }\n else\n {\n $b -> extract();\n $e .= $c . \"\\n\";\n $f++;\n }\n }\n}\nprint $f . \"\\n\";\nprint $e;\n?>"}, {"source_code": " $g)\n {\n $b++;\n $c .= \"insert \" . $g . \"\\n\";\n $b++;\n $c .= \"getMin \" . $g . \"\\n\";\n $d[$g] = $g;\n $e[$g]++;\n break;\n }\n }\n }\n}\nprint $b . \"\\n\";\nprint $c;\n?>"}, {"source_code": " insert($d);\n $e .= $c . \" \" . $d . \"\\n\";\n $f++;\n }\n elseif($c == \"getMin\")\n {\n if($b -> count() == 0)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n }\n elseif($b -> top() > $d)\n {\n $b -> insert($d);\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n }\n elseif($b -> top() == $d)\n {\n $e .= $c . \" \" . $d . \"\\n\";\n $f++;\n }\n elseif($b -> top() < $d)\n {\n while(TRUE)\n {\n if($b -> top() < $d)\n {\n $b -> extract();\n $e .= \"removeMin\\n\";\n $f++;\n if($b -> count() != 0)\n {\n if($b -> top() == $d)\n {\n $e .= \"getMin \" . $d . \"\\n\";\n $f++;\n break;\n }\n elseif($b -> count() == 0)\n {\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n break;\n }\n }\n else\n {\n $e .= \"insert \" . $d . \"\\ngetMin \" . $d . \"\\n\";\n $f += 2;\n break;\n }\n }\n }\n }\n }\n elseif($c == \"removeMin\")\n {\n if($b -> count() == 0)\n {\n $b -> insert(\"1\");\n $b -> extract();\n $e .= \"insert 1\\n\" . $c . \"\\n\";\n $f++;\n }\n else\n {\n $b -> extract();\n $e .= $c . \"\\n\";\n $f++;\n }\n }\n}\nprint $f . \"\\n\";\nprint $e;\n?>"}, {"source_code": "= 0) {\n\t\tif (count($heap) == 0) {\n\t\t\t$result[] = \"insert 0\\n\";\n\t\t} else {\n\t\t\tarray_shift($heap);\n\t\t}\n\t} else {\n\t\tlist($op, $arg) = explode(' ', $ln);\n\t\t$arg = intval($arg);\n\t\tif ($op == 'insert') {\n\t\t\t$heap[] = $arg;\n\t\t\tsort($heap);\n\t\t} else {\t\t\t\n\t\t\twhile(count($heap) && $heap[0] < $arg) {\n\t\t\t\t$result[] = \"removeMin\\n\";\n\t\t\t\tarray_shift($heap);\n\t\t\t}\n\t\t\tif (count($heap) == 0 || $heap[0] > $arg) {\n\t\t\t\t$result[] = \"insert $arg\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t$result[] = $ln;\n}\necho count($result).\"\\n\";\necho implode(\"\", $result);"}], "src_uid": "d8848a6be6b9ccc69ffd25c008ecd660"} {"source_code": "= $a)\n {\n break;\n }\n }\n else\n {\n $c[count($c)] = $b;\n $a--;\n if($b >= $a)\n {\n break;\n }\n }\n }\n print implode(\" \", $c);\n}\n?>"}], "negative_code": [], "src_uid": "02b7ff5e0b7f8cd074d9e76251c2725e"} {"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\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$n = $dxs->G();\nfor($i=0;$i<$n;$i++){$a=$dxs->G();$b=$dxs->G();\n\tif($b == 0){$ults[]=$a;}else{$cartas[$a][]=$b;}}\n$c = 1;$pts = 0;\nkrsort($cartas);arsort($ults);\n//print_r($cartas);print_r($ults);\nforeach($cartas as $k => $carta){if($c==0){break;}\n\twhile( $nc = array_pop($carta) ){$c += $nc-1;$pts += $k;}\n\tunset($cartas[$k]);}\nforeach($ults as $ult){\tif($c == 0){break;};$pts += $ult;$c--;}\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\necho $pts;\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>", "positive_code": [{"source_code": " 0)\n {\n $b += $f;\n $b--;\n $c += $e;\n }\n else\n {\n array_push($d, $e);\n }\n}\nrsort($d);\n$g = array_splice($d, 0, $b);\n$h = array_sum($g);\nprint $c + $h;\n?>"}, {"source_code": "nextInt();\n\t$inp_arr1 = array();\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_p = $Token->nextInt();\n\t\t$inp_c = $Token->nextInt();\n\t\tif ($inp_c == 0) $inp_arr1[] = $inp_p;\n\t\telse {\n\t\t\t$temp_counter = $temp_counter - 1 + $inp_c;\n\t\t\t$temp_point += $inp_p;\n\n\n\t\t}\n\t}\n\tif (arsort($inp_arr1) === false) {\n\t\t//print(-1);\n\t\t//return;\n\t}\n\t\n\tforeach ($inp_arr1 as $as_i) {\n\t\t$temp_point += $as_i;\n\t\t$temp_counter = $temp_counter - 1;\n\n\t\tif ($temp_counter == 0) break;\n\t}\n\tprintf(\"%d\", $temp_point);\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 $_\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/*\t\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}\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": " 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();$c = 1;$pts = 0;\nfor($i=0;$i<$n;$i++){$a=$dxs->G();$b=$dxs->G();if($b == 0){$ults[]=$a;}else{$cartas[$a][]=$b;}}\nkrsort($cartas);arsort($ults);//print_r($cartas);print_r($ults);\nforeach($cartas as $k => $carta){if($c==0){break;}while( $nc = array_pop($carta) ){$c += $nc-1;$pts += $k;}unset($cartas[$k]);}\nforeach($ults as $ult){\tif($c == 0){break;};$pts += $ult;$c--;}\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\necho $pts;\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": " 0 ){\n\t\t$score += $card[0];\n\t\t$countCardToDrop += $card[1] - 1;\n\t} else {\n\t\t$nullCard[] = $card[0];\n\t}\n}\nrsort($nullCard);\n$i = 0;\nwhile( $countCardToDrop-- ){\n\tif( !isset($nullCard[$i]) ){\n\t\tbreak;\n\t}\n\t$score += $nullCard[$i];\n\t$i++;\n}\necho $score;\nfclose($fp);\n?>"}, {"source_code": " $b[0]) ? -1 : 1;\n}\n/*ccccccccccccccccccccccccccccccccccccc*/\n$s = fopen(\"php://stdin\", 'r');\n$n = stream_get_contents($s);\n$arr = explode(\"\\n\", $n);\n$count = (int) $arr[0];\n$summ_left = 0;\n$summ_right = 0;\n$cards = array();\n$cards_left = array();\n$cards_right = array();\n$c_more_right = 0;\nfor($i = 1; $i <= $count; $i++){\n $exp = explode(\" \", $arr[$i]);\n $summ_left+= $exp[0];\n $summ_right+= $exp[1];\n if($exp[1] > 0) $c_more_right++;\n $cards[] = $exp;\n $cards_left[] = $exp[0];\n $cards_right[] = $exp[1];\n}\nif($summ_right == 0){\n echo max($cards_left);\n exit;\n}\n$count_step = array_sum($cards_right);\nif($count_step >= $count){\n echo array_sum($cards_left);\n exit;\n}\nusort($cards, cmp);\n$count_step-= ($c_more_right - 1);\n$countpoint = 0;\nfor($i = 0; $i < $count; $i++){\n if($cards[$i][1] == 0){\n if($count_step > 0){\n $count_step--;\n $countpoint+= $cards[$i][0];\n }\n } else {\n $countpoint+= $cards[$i][0];\n }\n}\necho $countpoint;"}], "negative_code": [{"source_code": " 0)\n {\n $b += $f;\n $c += $e;\n }\n else\n {\n array_push($d, $e);\n }\n}\nrsort($d);\n$g = array_splice($d, 0, $b);\n$h = array_sum($g);\nprint $c + $h;\n?>"}, {"source_code": "nextInt();\n\t$inp_arr = array();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_p = $Token->nextInt();\n\t\t$inp_c = $Token->nextInt();\n\t\t$inp_arr[$inp_p] = $inp_c;\n\t}\n/*\tif (arsort($inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n*/\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\t$temp = 1;\n\t//$c = 0;\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) break;\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter = $temp_counter - 1 + $as_val;\n\t\t//$c++;\n\t}\n\t\n\t/*$len = $c;\n\tfor ($i = 0; $i < $len; $i++) {\n\t\t$_inp_arr = array_shift($inp_arr);\n\t}\n\t*/\n\t$temp_arr = array();\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) $temp_arr[$as_key] = $as_val;\n\t}\n\t\n\t//if (ksort($inp_arr) === false) {\n\t//if (krsort($inp_arr) === false) {\n/*\tif (krsort($temp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n*/\t\n\t$end = $temp_counter;\n\t//foreach ($inp_arr as $as_key => $as_val) {\n\tforeach ($temp_arr as $as_key => $as_val) {\n\t\t//if ($as_val == 0) print(\"count err\");\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter--;\n\t\t\n\t\tif ($temp_counter == 0) break;\n\t}\n\t\t\n\tprintf(\"%d\", $temp_point);\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 $_\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/*\t\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}\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": "nextInt();\n\t$inp_arr1 = array();\n\t$inp_arr2 = array();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_p = $Token->nextInt();\n\t\t$inp_c = $Token->nextInt();\n\t\tif ($inp_c == 0) $inp_arr1[$inp_p] = $inp_c;\n\t\telse $inp_arr2[$inp_p] = $inp_c;\n\t}\n\tif (arsort($inp_arr2) === false) {\n\t\t//print(-1);\n\t\t//return;\n\t}\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\t$temp = 1;\n\t//$c = 0;\n\tforeach ($inp_arr2 as $as_key => $as_val) {\n\t\t$temp_point += $as_key;\n\t\t$temp_counter = $temp_counter - 1 + $as_val;\n\t}\n\tif (krsort($inp_arr1) === false) {\n\t\t//print(-1);\n\t\t//return;\n\t}\n\tforeach ($inp_arr1 as $as_key => $as_val) {\n\t\t$temp_point += $as_key;\n\t\t$temp_counter--;\n\t\t\n\t\tif ($temp_counter == 0) break;\n\t}\n\t\t\n\tprintf(\"%d\", $temp_point);\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 $_\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/*\t\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}\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": "nextInt();\n\t$inp_arr = array();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_p = $Token->nextInt();\n\t\t$inp_c = $Token->nextInt();\n\t\t$inp_arr[$inp_p] = $inp_c;\n\t}\n\tif (arsort($inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\t$temp = 1;\n\t$c = 0;\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) break;\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter = $temp_counter - 1 + $as_val;\n\t\t$c++;\n\t}\n\t\n\t/*$len = $c;\n\tfor ($i = 0; $i < $len; $i++) {\n\t\t$_inp_arr = array_shift($inp_arr);\n\t}\n\t*/\n\t$temp_arr = array();\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) $temp_arr[$as_key] = $as_val;\n\t}\n\t\n\t//if (ksort($inp_arr) === false) {\n\t//if (krsort($inp_arr) === false) {\n\tif (krsort($temp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t\n\t$end = $temp_counter;\n\t//foreach ($inp_arr as $as_key => $as_val) {\n\tforeach ($temp_arr as $as_key => $as_val) {\n\t\t//if ($as_val == 0) print(\"count err\");\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter--;\n\t\t\n\t\tif ($temp_counter == 0) break;\n\t}\n\t\t\n\tprintf(\"%d\", $temp_point);\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 $_\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/*\t\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}\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": "nextInt();\n\t$inp_arr = array();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_p = $Token->nextInt();\n\t\t$inp_c = $Token->nextInt();\n\t\t$inp_arr[$inp_p] = $inp_c;\n\t}\n\tif (arsort($inp_arr) === false) {\n\t\t//print(-1);\n\t\t//return;\n\t}\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\t$temp = 1;\n\t//$c = 0;\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) break;\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter = $temp_counter - 1 + $as_val;\n\t\t//$c++;\n\t}\n\t\n\t/*$len = $c;\n\tfor ($i = 0; $i < $len; $i++) {\n\t\t$_inp_arr = array_shift($inp_arr);\n\t}\n\t*/\n\t$temp_arr = array();\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) $temp_arr[$as_key] = $as_val;\n\t}\n\t\n\t//if (ksort($inp_arr) === false) {\n\t//if (krsort($inp_arr) === false) {\n\tif (krsort($temp_arr) === false) {\n\t\t//print(-1);\n\t\t//return;\n\t}\n\t\n\t$end = $temp_counter;\n\t//foreach ($inp_arr as $as_key => $as_val) {\n\tforeach ($temp_arr as $as_key => $as_val) {\n\t\t//if ($as_val == 0) print(\"count err\");\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter--;\n\t\t\n\t\tif ($temp_counter == 0) break;\n\t}\n\t\t\n\tprintf(\"%d\", $temp_point);\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 $_\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/*\t\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}\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": "nextInt();\n\t$inp_arr1 = array();\n\t$inp_arr2 = array();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_p = $Token->nextInt();\n\t\t$inp_c = $Token->nextInt();\n\t\tif ($inp_c == 0) $inp_arr1[$inp_p] = $inp_c;\n\t\telse $inp_arr2[$inp_p] = $inp_c;\n\t}\n\tif (arsort($inp_arr2) === false) {\n\t\t//print(-1);\n\t\t//return;\n\t}\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\t$temp = 1;\n\t//$c = 0;\n\tforeach ($inp_arr2 as $as_key => $as_val) {\n\t\t$temp_point += $as_key;\n\t\t$temp_counter = $temp_counter - 1 + $as_val;\n\t\tif ($temp_counter == 0) break;\n\t}\n\tif (krsort($inp_arr1) === false) {\n\t\t//print(-1);\n\t\t//return;\n\t}\n\tforeach ($inp_arr1 as $as_key => $as_val) {\n\t\t$temp_point += $as_key;\n\t\t$temp_counter--;\n\t\t\n\t\tif ($temp_counter == 0) break;\n\t}\n\t\t\n\tprintf(\"%d\", $temp_point);\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 $_\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/*\t\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}\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": "nextInt();\n\t$inp_arr = array();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_p = $Token->nextInt();\n\t\t$inp_c = $Token->nextInt();\n\t\t$inp_arr[$inp_p] = $inp_c;\n\t}\n\tif (arsort($inp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\t$temp = 1;\n\t$c = 0;\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) break;\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter = $temp_counter - 1 + $as_val;\n\t\t$c++;\n\t}\n\t\n\t/*$len = $c;\n\tfor ($i = 0; $i < $len; $i++) {\n\t\t$_inp_arr = array_shift($inp_arr);\n\t}\n\t*/\n\t$temp_arr = array();\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tif ($as_val == 0) $temp_arr[$as_key] = $as_val;\n\t}\n\t\n\t//if (ksort($inp_arr) === false) {\n\t//if (krsort($inp_arr) === false) {\n\tif (krsort($temp_arr) === false) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\t\n\t$end = $temp_counter;\n\t//foreach ($inp_arr as $as_key => $as_val) {\n\tforeach ($temp_arr as $as_key => $as_val) {\n\t\t//if ($as_val == 0) print(\"count err\");\n\t\t\n\t\t$temp_point += $as_key;\n\t\t$temp_counter--;\n\t\tprintf(\"%d\", $as_key);\n\t\n\t\t\n\t\tif ($temp_counter == 0) break;\n\t}\n\t\t\n\tprintf(\"%d\", $temp_point);\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 $_\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/*\t\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}\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?>"}], "src_uid": "4abdd16670a796be3a0bff63b9798fed"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": "\n$col = explode(\" \", trim(fgets(STDIN)));\n$arr = explode(\" \", trim(fgets(STDIN)));\n$sum = 0;\n\n\nfor($i=0; $i<$col[1]; $i++){\n \n $l = explode(\" \", trim(fgets(STDIN)));\n \n if ($l[0] == 1) $arr[$l[1] - 1] = $l[2] - $sum;\n if ($l[0] == 2) $sum += $l[1]; \n if ($l[0] == 3) echo ($arr[$l[1]-1] + $sum).\"\\n\";\n \n} \n"}], "src_uid": "48f3ff32a11770f3b168d6e15c0df813"} {"source_code": ""}, {"source_code": " $ad && ($bc % $ad == 0)) {\r\n echo 1;\r\n }\r\n else if ($ad > $bc && ($ad % $bc == 0)) {\r\n echo 1;\r\n }\r\n else {\r\n echo 2;\r\n }\r\n echo \"\\n\";\r\n}\r\nwhile ($T--) {\r\n solve($stdin);\r\n}\r\n"}, {"source_code": ""}], "negative_code": [], "src_uid": "c2a506d58a80a0fb6a16785605b075ca"} {"source_code": "", "positive_code": [{"source_code": "= 1; $i--) {\n\t\t\t\t$c++;\n\t\t\t\t$a .= $i.\" \";\n\t\t\t\tif ($i + $i - 1 == $k) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ($i = $k - 1; $i >= $k / 2; $i--) {\n\t\t\t\t$c++;\n\t\t\t\t$a .= $i.\" \";\n\t\t\t}\n\t\t}\n\t\tfor ($i = $k + 1; $i <= $n; $i++) {\n\t\t\t$c++;\n\t\t\t$a .= $i.\" \";\n\t\t}\n\t\tprint \"$c\\n\";\n\t\tif ($c > 0) {\n\t\t\tprint trim($a).\"\\n\";\n\t\t}\n\t}\n?>"}], "negative_code": [{"source_code": "= 1; $i--) {\n\t\t\tif ($i + $i - 1 != $k) {\n\t\t\t\t$c++;\n\t\t\t\t$a .= $i.\" \";\n\t\t\t} else {\n\t\t\t\t$c++;\n\t\t\t\t$a .= $i.\" \";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor ($i = $k + 1; $i <= $n; $i++) {\n\t\t\t$c++;\n\t\t\t$a .= $i.\" \";\n\t\t}\n\t\tprint \"$c\\n\";\n\t\tif ($c > 0) {\n\t\t\tprint trim($a).\"\\n\";\n\t\t}\n\t}\n?>"}, {"source_code": "= $k) {\n\t\t\t$c--;\n\t\t}\n\t\tfor ($i = $k + 1; $i <= $n; $i++) {\n\t\t\t$c++;\n\t\t\t$a .= $i.\" \";\n\t\t}\n\t\tprint \"$c\\n\";\n\t\tif ($c > 0) {\n\t\t\tprint trim($a).\"\\n\";\n\t\t}\n\t}\n?>"}], "src_uid": "d08e39db62215d7817113aaa384e3f59"} {"source_code": "=1){\n $r++;\n }\n $z=0;\n }\n}\n\necho $r;\n\n\n", "positive_code": [{"source_code": " 1)\n {\n $e++;\n }\n}\nprint count($c) + $e;\n?>"}, {"source_code": " 0)\n\t$op--;\necho $op;\n?>"}], "negative_code": [], "src_uid": "0fbc306d919d7ffc3cb02239cb9c2ab0"} {"source_code": " 0))\n {\n $h--;\n $i = 0;\n }\n if($i == $c)\n {\n $f++;\n $g .= ($x + 1) . \" \";\n $i = 0;\n }\n }\n else\n {\n $i = 0;\n }\n}\nprint $f . \"\\n\";\nprint $g;\n?>", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "d50bb59298e109b4ac5f808d24fef5a1"} {"source_code": "", "positive_code": [{"source_code": " 0);\r\n}\r\nfunction bc1($x, $e, $y = null)\r\n{\r\n is_null($y) && list($e, $y) = explode(' ', trim($e));\r\n '+' == $e && $ans = bcadd($x, $y);\r\n '-' == $e && $ans = bcsub($x, $y);\r\n '*' == $e && $ans = bcmul($x, $y);\r\n '/' == $e && $ans = bcdiv($x, $y);\r\n '%' == $e && $ans = bcmod($x, $y);\r\n\r\n return $ans;\r\n}\r\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " ($c / 2))\n {\n $e = $c - ($d - $b[$x - 1]);\n $f = $c - ($c - $d);\n if($e >= $f)\n {\n print $x . \" \" . ($a - $x);\n }\n else\n {\n print ($x - 1) . \" \" . ($a - $x + 1);\n }\n break;\n }\n elseif($d == ($c / 2))\n {\n print $x . \" \" . ($a - $x);\n break;\n }\n}\n?>", "positive_code": [{"source_code": "= $half) {\n\t\t\t$pos = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $pos; $i++) {\n\t\t$alice += (int)$t[$i];\n\t}\n\tif ($alice <= array_sum($t) - $alice - $t[$pos]) {\n\t\t$num = $pos + 1;\n\t} else {\n\t\t$num = $pos;\n\t}\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": " $arr[$b] )\n\t\t{\n\t\t\t$arr[$a]-= $arr[$b];\n\t\t\t$arr[$b] = 0;\n\t\t\t$b-= 1;\n\t\t\t$sol[1]+= 1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr[$a] = $arr[$b] = 0;\n\t\t\t$a+=1;\n\t\t\t$b-=1;\n\t\t\t$sol[0]+= 1;\n\t\t\t$sol[1]+= 1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telseif ( $a > $b )\n\t\t\t\tbreak;\n\t\t}\n\t}\n\techo $sol[0].' '.$sol[1];\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "= $c)\n {\n break;\n }\n}\n$f = 0;\n$g = array();\nfor($x = $a; $x >= 1; $x--)\n{\n $f += $b[$x];\n array_push($g, $f);\n if($f >= $c)\n {\n break;\n }\n}\n$h = count($e);\n$i = count($g);\nif(($h == 1) || ($i == 1))\n{\n if($a == 1)\n {\n $h = 1;\n $i = 0;\n }\n elseif(($e[count($e) - 1]) < ($g[count($g) - 1]))\n {\n $i--;\n }\n elseif(($e[count($e) - 1]) > ($g[count($g) - 1]))\n {\n $h--;\n }\n}\nelse\n{\n if($a == 1)\n {\n $h = 1;\n $i = 0;\n }\n elseif((($e[count($e) - 1]) == ($g[count($g) - 1])) && ($a % 2 == 0) && ($d == $f) && (array_sum($e) == array_sum($g)))\n {\n $i;\n }\n elseif(($e[count($e) - 2]) == ($g[count($g) - 2]))\n {\n $i--;\n }\n elseif(($e[count($e) - 2]) < ($g[count($g) - 2]))\n {\n $i--;\n }\n elseif(($e[count($e) - 2]) > ($g[count($g) - 2]))\n {\n $h--;\n }\n}\nprint $h . \" \" . $i;\n?>"}, {"source_code": "= $c)\n {\n break;\n }\n}\n$f = 0;\n$g = array();\nfor($x = $a; $x >= 1; $x--)\n{\n $f += $b[$x];\n array_push($g, $f);\n if($f >= $c)\n {\n break;\n }\n}\n$h = count($e);\n$i = count($g);\nif(($e[count($e) - 2]) == ($g[count($g) - 2]))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) < ($g[count($g) - 2]))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) > ($g[count($g) - 2]))\n{\n $h--;\n}\nprint $h . \" \" . $i;\n?>"}, {"source_code": "= $c)\n {\n break;\n }\n}\n$f = 0;\n$g = array();\nfor($x = $a; $x >= 1; $x--)\n{\n $f += $b[$x];\n array_push($g, $f);\n if($f >= $c)\n {\n break;\n }\n}\n$h = count($e);\n$i = count($g);\nif($a == 1)\n{\n $h = 1;\n $i = 0;\n}\nelseif((($e[count($e) - 2]) == ($g[count($g) - 2])) && (count($e) != count($g)))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) < ($g[count($g) - 2]))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) > ($g[count($g) - 2]))\n{\n $h--;\n}\nprint $h . \" \" . $i;\n?>"}, {"source_code": "= $c)\n {\n break;\n }\n}\n$f = 0;\n$g = array();\nfor($x = $a; $x >= 1; $x--)\n{\n $f += $b[$x];\n array_push($g, $f);\n if($f >= $c)\n {\n break;\n }\n}\n$h = count($e);\n$i = count($g);\nif((($e[count($e) - 2]) == ($g[count($g) - 2])) && (count($e) != count($g)))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) < ($g[count($g) - 2]))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) > ($g[count($g) - 2]))\n{\n $h--;\n}\nprint $h . \" \" . $i;\n?>"}, {"source_code": "= $c)\n {\n break;\n }\n}\n$f = 0;\n$g = array();\nfor($x = $a; $x >= 1; $x--)\n{\n $f += $b[$x];\n array_push($g, $f);\n if($f >= $c)\n {\n break;\n }\n}\n$h = count($e);\n$i = count($g);\nif($a == 1)\n{\n $h = 1;\n $i = 0;\n}\nelseif(($e[count($e) - 2]) == ($g[count($g) - 2]) && ($a % 2 != 0))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) < ($g[count($g) - 2]))\n{\n $i--;\n}\nelseif(($e[count($e) - 2]) > ($g[count($g) - 2]))\n{\n $h--;\n}\nprint $h . \" \" . $i;\n?>"}, {"source_code": "= $c)\n {\n break;\n }\n}\n$f = 0;\n$g = array();\nfor($x = $a; $x >= 1; $x--)\n{\n $f += $b[$x];\n array_push($g, $f);\n if($f >= $c)\n {\n break;\n }\n}\n$h = count($e);\n$i = count($g);\nif(($h == 1) || ($i == 1))\n{\n if($a == 1)\n {\n $h = 1;\n $i = 0;\n }\n elseif(($e[count($e) - 1]) < ($g[count($g) - 1]))\n {\n $i--;\n }\n elseif(($e[count($e) - 1]) > ($g[count($g) - 1]))\n {\n $h--;\n }\n}\nelse\n{\n if($a == 1)\n {\n $h = 1;\n $i = 0;\n }\n elseif((($e[count($e) - 2]) == ($g[count($g) - 2])) && ($h != $i))\n {\n $i--;\n }\n elseif(($e[count($e) - 2]) < ($g[count($g) - 2]))\n {\n $i--;\n }\n elseif(($e[count($e) - 2]) > ($g[count($g) - 2]))\n {\n $h--;\n }\n}\nprint $h . \" \" . $i;\n?>"}, {"source_code": "= $c)\n {\n break;\n }\n}\n$f = 0;\n$g = array();\nfor($x = $a; $x >= 1; $x--)\n{\n $f += $b[$x];\n array_push($g, $f);\n if($f >= $c)\n {\n break;\n }\n}\n$h = count($e);\n$i = count($g);\nif(($h == 1) || ($i == 1))\n{\n if($a == 1)\n {\n $h = 1;\n $i = 0;\n }\n elseif(($e[count($e) - 1]) < ($g[count($g) - 1]))\n {\n $i--;\n }\n elseif(($e[count($e) - 1]) > ($g[count($g) - 1]))\n {\n $h--;\n }\n}\nelse\n{\n if($a == 1)\n {\n $h = 1;\n $i = 0;\n }\n elseif((($e[count($e) - 2]) == ($g[count($g) - 2])) && ($h == $i) && ($a % 2 != 0))\n {\n $i--;\n }\n elseif(($e[count($e) - 2]) < ($g[count($g) - 2]))\n {\n $i--;\n }\n elseif(($e[count($e) - 2]) > ($g[count($g) - 2]))\n {\n $h--;\n }\n}\nprint $h . \" \" . $i;\n?>"}, {"source_code": " $half) {\n\t\t\t$num = $i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tprint($num. \" \". $n - $num);\n}\n?>"}, {"source_code": "= $half) {\n\t\t\t$pos = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $pos; $i++) {\n\t\t$alice += (int)$t[$i];\n\t}\n\tif ($alice < array_sum($t) - $alice - $t[$pos]) {\n\t\t$num = $pos + 2;\n\t} else {\n\t\t$num = $pos + 1;\n\t}\n\t\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": "= $half) {\n\t\t\t$pos = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $pos; $i++) {\n\t\t$alice += (int)$t[$i];\n\t}\n\tif ($alice < array_sum($t) - $alice - $t[$pos]) {\n\t\t$num = $pos;\n\t} else {\n\t\t$num = $pos-1;\n\t}\n\t\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": ""}, {"source_code": "= $half) {\n\t\t\t$pos = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $pos; $i++) {\n\t\t$alice += (int)$t[$i];\n\t}\n\tif ($alice > array_sum($t) - $alice - $t[$pos]) {\n\t\t$num = $pos + 1;\n\t} else {\n\t\t$num = $pos;\n\t}\n\t\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": "= $half) {\n\t\t\t$pos = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $pos; $i++) {\n\t\t$alice += (int)$t[$i];\n\t}\n\tif ($alice < array_sum($t) - $alice - $t[$pos]) {\n\t\t$num = $pos + 1;\n\t} else {\n\t\t$num = $pos;\n\t}\n\t\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": "= $half) {\n\t\t\t$pos = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $pos; $i++) {\n\t\t$alice += (int)$t[$i];\n\t}\n\tif ($alice < array_sum($t) - $alice - $t[$pos]) {\n\t\t$num = $pos + 1;\n\t} else {\n\t\t$num = $pos;\n\t}\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": " $half) {\n\t\t\t$num = $i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": " $half) {\n\t\t\t$num = $i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tprintf($num. \" \". $n - $num);\n}\n?>"}, {"source_code": "= $half) {\n\t\t\t$pos = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $pos; $i++) {\n\t\t$alice += (int)$t[$i];\n\t}\n\tif ($alice < array_sum($t) - $alice - $t[$pos]) {\n\t\t$num = $pos + 1;\n\t} else {\n\t\t$num = $pos;\n\t}\n\tprint($num. \" \". ($n - $num));\n}\n?>"}, {"source_code": " $arr[$b] )\n\t\t{\n\t\t\t$arr[$a]-= $arr[$b--];\n\t\t\t$sol[1]+= 1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sol[0]+= 1;\n\t\t\t$sol[1]+= 1;\n\t\t\t$arr[$a] = $arr[$b] = 0;\n\t\t\t$a+=1;\n\t\t\t$b-=1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telseif ( $a > $b )\n\t\t\t\tbreak;\n\t\t}\n\t}\n\techo $sol[0].' '.$sol[1];\n?>"}, {"source_code": " $arr[$b] )\n\t\t{\n\t\t\t$arr[$a]-= $arr[$b];\n\t\t\t$arr[$b] = 0;\n\t\t\t$b-= 1;\n\t\t\t$sol[1]+= 1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr[$a] = $arr[$b] = 0;\n\t\t\t$a+=1;\n\t\t\t$b-=1;\n\t\t\t$sol[0]+= 1;\n\t\t\t$sol[1]+= 1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telseif ( $a > $b )\n\t\t\t\tbreak;\n\t\t}\n\t}\n\techo $sol[0].' '.$sol[1];\n?>"}, {"source_code": " $arr[$b] )\n\t\t{\n\t\t\t$arr[$a]-= $arr[$b];\n\t\t\t$arr[$b] = 0;\n\t\t\t$b-= 1;\n\t\t\t$sol[1]+= 1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr[$a] = $arr[$b] = 0;\n\t\t\t$a+=1;\n\t\t\t$b-=1;\n\t\t\t$sol[0]+= 1;\n\t\t\t$sol[1]+= 1;\n\t\t\tif ( $a == $b )\n\t\t\t{\n\t\t\t\t//$sol[0]+= 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telseif ( $a > $b )\n\t\t\t\tbreak;\n\t\t}\n\t}\n\techo $sol[0].' '.$sol[1];\n?>"}], "src_uid": "8f0172f742b058f5905c0a02d79000dc"} {"source_code": " $urls) {\n\t$urls = array_keys($urls);\n\tsort($urls);\n\t$urlKey = implode('#', $urls);\n\tif (empty($hostsMap[$urlKey])) {\n\t\t$hostsMap[$urlKey] = array();\n\t}\n\t$hostsMap[$urlKey][] = $host;\n}\nunset($map);\n\nforeach ($hostsMap as $k => $hosts) {\n\tif (count($hosts) < 2) {\n\t\tunset($hostsMap[$k]);\n\t}\n}\necho count($hostsMap) . \"\\n\";\nforeach ($hostsMap as $hosts) {\n\tforeach ($hosts as $host) {\n\t\techo 'http://' . $host . ' ';\n\t}\n\techo \"\\n\";\n}", "positive_code": [{"source_code": "$b)\n {\n $x = array_unique($b); sort($x);\n $groups[md5(implode(\"|\", $x), true)][] = $a;\n }\n $n = 0;\n foreach($groups as $a)\n {\n if (count($a) > 1) $n ++;\n }\n echo $n.\"\\n\";\n foreach($groups as $a)\n {\n if (count($a) > 1) echo implode(\" \", $a).\"\\n\";\n }\n\n?>"}, {"source_code": " $paths) {\n\t$separated[$domain] = array_unique($paths);\n\tsort($separated[$domain]);\n}\n\nforeach ($separated as $domain => $paths) {\n\t$paths = implode('#', $paths);\n\t$joined[$paths][] = $domain;\n}\n\nforeach ($joined as $paths => $domains) {\n\tif (count($domains) > 1) {\n\t\t$ans[] = $domains;\n\t}\n}\n\necho count($ans) . \"\\n\";\n\nforeach ($ans as $domains) {\n\techo implode(' ', $domains) . \"\\n\";\n}"}, {"source_code": " $value) {\n\tsort($value);\n\t\n\t$vlen = count($value);\n\t$array = array($value[0]); $size = 1;\n\t\n\tfor ($i = 1; $i < $vlen; $i++) {\n\t\tif ($array[$size - 1] != $value[$i])\n\t\t\t$array[$size++] = $value[$i];\n\t}\n\t\n\t$fullpath = implode('#', $array) . '#';\n\t\n\tif (!isset($groups[$fullpath]))\n\t\t$groups[$fullpath] = array();\n\t\n\tarray_push($groups[$fullpath], $key);\n}\n\nforeach ($groups as $value) {\n\tif (count($value) > 1)\n\t\t$m++;\n}\n\nprint($m . \"\\n\");\n\nforeach ($groups as $key => $value) {\n\t$len = count($value);\n\tif ($len > 1) {\n\t\tfor ($i = 0; $i < $len; $i++) {\n\t\t\tprint('http://' . $value[$i] . ' ');\n\t\t}\n\t\tprint(\"\\n\");\n\t}\n}\n?>"}], "negative_code": [{"source_code": "$b)\n {\n $x = array_unique($b); sort($x);\n $groups[md5(implode(\"|\", $x), true)][] = $a;\n }\n $n = 0;\n foreach($groups as $a)\n {\n if (count($a) > 1) $n ++;\n }\n echo $n.\"\\n\";\n foreach($groups as $a)\n {\n if (count($a) > 1) echo implode(\" \", $a).\"\\n\";\n }\n\n?>"}, {"source_code": " $paths) {\n\t$separated[$domain] = array_unique($paths);\n\tsort($separated[$domain]);\n}\n\nforeach ($separated as $domain => $paths) {\n\t$paths = implode('', $paths);\n\t$joined[$paths][] = $domain;\n}\n\nforeach ($joined as $paths => $domains) {\n\tif (count($domains) > 1) {\n\t\t$ans[] = $domains;\n\t}\n}\n\necho count($ans) . \"\\n\";\n\nforeach ($ans as $domains) {\n\techo implode(' ', $domains) . \"\\n\";\n}\n"}], "src_uid": "9b35f7df9e21162858a8fac8ee2837a4"} {"source_code": "=$m) if (abs($a[$i]-$a[$i-$m])==1||abs($a[$i]-$a[$i-$m])==$m) return true;\n return 0;\n }\n\n foreach(range(1, $n*$m) as $temp) $a[]=$temp;\n $ok=0;\n while (getMillisecond()-$stime < 1000) {\n shuffle($a);\n $f=0;\n foreach(range(0, $n*$m-1) as $i){\n $cnt=0;\n while (check($i) && $cnt<=100) {\n if ($i < $n*$m-1) swap($a[$i], $a[rand()%($n*$m-$i-1)+$i+1]);\n else $cnt=1e9;\n $cnt++;\n }\n if ($cnt>100) {\n $f=1;\n break;\n }\n }\n if($f) continue;\n $ok=1;\n echo \"YES\\n\";\n foreach(range(1, $n) as $i){\n foreach (range(0, $m-1) as $j) {\n echo $a[($i-1)*$m+$j];\n echo \" \";\n }\n echo \"\\n\";\n }\n break;\n }\n if (!$ok) echo \"NO\\n\";\n return 0;\n", "positive_code": [{"source_code": " \n=$m) if (abs($a[$i]-$a[$i-$m])==1||abs($a[$i]-$a[$i-$m])==$m) return true;\n return 0;\n }\n\n foreach(range(1, $n*$m) as $temp) $a[]=$temp;\n $ok=0;\n while (microtime(true)-$stime < 1) {\n shuffle($a);\n $f=0;\n foreach(range(0, $n*$m-1) as $i){\n $cnt=0;\n while (check($i)&&$cnt<=100) {\n if ($i < $n*$m-1) swap($a[$i], $a[rand()%($n*$m-$i-1)+$i+1]);\n else $cnt=1e9;\n $cnt++;\n }\n if ($cnt>100) {\n $f=1;\n break;\n }\n }\n if($f) continue;\n $ok=1;\n echo \"YES\\n\";\n foreach(range(1, $n) as $i){\n foreach (range(0, $m-1) as $j) {\n echo $a[($i-1)*$m+$j];\n echo \" \";\n }\n echo \"\\n\";\n }\n break;\n }\n if (!$ok) echo \"NO\\n\";\n return 0;"}, {"source_code": "=$m) if (abs($a[$i]-$a[$i-$m])==1||abs($a[$i]-$a[$i-$m])==$m) return true;\n return 0;\n }\n\n foreach(range(1, $n*$m) as $temp) $a[]=$temp;\n $ok=0;\n while (microtime(true)-$stime < 1) {\n shuffle($a);\n $f=0;\n foreach(range(0, $n*$m-1) as $i){\n $cnt=0;\n while (check($i)&&$cnt<=100) {\n if ($i < $n*$m-1) swap($a[$i], $a[rand()%($n*$m-$i-1)+$i+1]);\n else $cnt=1e9;\n $cnt++;\n }\n if ($cnt>100) {\n $f=1;\n break;\n }\n }\n if($f) continue;\n $ok=1;\n echo \"YES\\n\";\n foreach(range(1, $n) as $i){\n foreach (range(0, $m-1) as $j) {\n echo $a[($i-1)*$m+$j];\n echo \" \";\n }\n echo \"\\n\";\n }\n break;\n }\n if (!$ok) echo \"NO\\n\";\n return 0;\n"}], "negative_code": [], "src_uid": "6e67ca1033b98118b5065779e59a1c98"} {"source_code": "", "positive_code": [{"source_code": " $x) {\n $temp1 = $y;\n $y = $x;\n $x = $temp1;\n }\n\n if($x == 0 && $y == 0) return 1;\n if ($x == 0) return $y;\n if ($y == 0) return $x;\n if ($x < 0) $x = -$x;\n if ($y < 0) $y = -$y;\n if ($x == $y) return $x;\n while($y > 0) {\n $temp2 = $y;\n $y = $x % $y;\n $x = $temp2;\n }\n return $x;\n}\n\nfunction lcm($x, $y) {\n return ($x * $y)/gcd($x, $y);\n}\n\nfunction primeCheck($number){ \n if ($number == 1) \n return 0; \n for ($i = 2; $i <= $number/2; $i++){ \n if ($number % $i == 0) \n return 0; \n } \n return 1; \n} \n\n$t = (int)readline();\n$input = array();\nfor($k = 0; $k < $t; $k++) {\n $input[] = explode(' ',readline());\n}\nforeach($input as $n) {\n $out = array(-1,-1);\n \n if ($n[0] * 2 <= $n[1]) $out = array($n[0], $n[0]*2);\n echo $out[0] . ' ' . $out[1] . \"\\n\";\n}"}], "negative_code": [{"source_code": " $x) {\n $temp1 = $y;\n $y = $x;\n $x = $temp1;\n }\n\n if($x == 0 && $y == 0) return 1;\n if ($x == 0) return $y;\n if ($y == 0) return $x;\n if ($x < 0) $x = -$x;\n if ($y < 0) $y = -$y;\n if ($x == $y) return $x;\n while($y > 0) {\n $temp2 = $y;\n $y = $x % $y;\n $x = $temp2;\n }\n return $x;\n}\n\nfunction lcm($x, $y) {\n return ($x * $y)/gcd($x, $y);\n}\n\nfunction primeCheck($number){ \n if ($number == 1) \n return 0; \n for ($i = 2; $i <= $number/2; $i++){ \n if ($number % $i == 0) \n return 0; \n } \n return 1; \n} \n\n$t = (int)readline();\n$input = array();\nfor($k = 0; $k < $t; $k++) {\n $input[] = explode(' ',readline());\n}\nforeach($input as $n) {\n $out = array(-1,-1);\n $break = false;\n for($i = $n[0]; $i < $n[1]; $i++) {\n if(($i % 2) != 0 && $i+1 != $n[1] && $i != 1) $i++;\n for($j = $i+1; $j <= $n[1]; $j++) {\n if(lcm($i, $j) >= $n[0] && lcm($i, $j) <= $n[1]) {\n $out = array($i, $j);\n $break = true;\n break;\n }\n } \n if($break) break;\n }\n echo $out[0] . ' ' . $out[1] . \"\\n\";\n}"}, {"source_code": " $x) {\n $temp1 = $y;\n $y = $x;\n $x = $temp1;\n }\n\n if($x == 0 && $y == 0) return 1;\n if ($x == 0) return $y;\n if ($y == 0) return $x;\n if ($x < 0) $x = -$x;\n if ($y < 0) $y = -$y;\n if ($x == $y) return $x;\n while($y > 0) {\n $temp2 = $y;\n $y = $x % $y;\n $x = $temp2;\n }\n return $x;\n}\n\nfunction lcm($x, $y) {\n return ($x * $y)/gcd($x, $y);\n}\n\nfunction primeCheck($number){ \n if ($number == 1) \n return 0; \n for ($i = 2; $i <= $number/2; $i++){ \n if ($number % $i == 0) \n return 0; \n } \n return 1; \n} \n\n$t = (int)readline();\n$input = array();\nfor($k = 0; $k < $t; $k++) {\n $input[] = explode(' ',readline());\n}\nforeach($input as $n) {\n $out = array(-1,-1);\n $break = false;\n for($i = $n[0]; $i < $n[1]; $i++) {\n if(($i % 2) != 0 && $i+1 != $n[1]) $i++;\n for($j = $i+1; $j <= $n[1]; $j++) {\n if(lcm($i, $j) >= $n[0] && lcm($i, $j) <= $n[1]) {\n $out = array($i, $j);\n $break = true;\n break;\n }\n } \n if($break) break;\n }\n echo $out[0] . ' ' . $out[1] . \"\\n\";\n}"}, {"source_code": " $x) {\n $temp1 = $y;\n $y = $x;\n $x = $temp1;\n }\n\n if($x == 0 && $y == 0) return 1;\n if ($x == 0) return $y;\n if ($y == 0) return $x;\n if ($x < 0) $x = -$x;\n if ($y < 0) $y = -$y;\n if ($x == $y) return $x;\n while($y > 0) {\n $temp2 = $y;\n $y = $x % $y;\n $x = $temp2;\n }\n return $x;\n}\n\nfunction lcm($x, $y) {\n return ($x * $y)/gcd($x, $y);\n}\n\nfunction primeCheck($number){ \n if ($number == 1) \n return 0; \n for ($i = 2; $i <= $number/2; $i++){ \n if ($number % $i == 0) \n return 0; \n } \n return 1; \n} \n\n$t = (int)readline();\n$input = array();\nfor($k = 0; $k < $t; $k++) {\n $input[] = explode(' ',readline());\n}\nforeach($input as $n) {\n $out = array(-1,-1);\n $break = false;\n for($i = $n[0]; $i < $n[1]; $i++) {\n if(($i % 2) != 0) $i++;\n for($j = $i+1; $j <= $n[1]; $j++) {\n if(lcm($i, $j) >= $n[0] && lcm($i, $j) <= $n[1]) {\n $out = array($i, $j);\n $break = true;\n break;\n }\n } \n if($break) break;\n }\n echo $out[0] . ' ' . $out[1] . \"\\n\";\n}"}, {"source_code": " $x) {\n $temp1 = $y;\n $y = $x;\n $x = $temp1;\n }\n\n if($x == 0 && $y == 0) return 1;\n if ($x == 0) return $y;\n if ($y == 0) return $x;\n if ($x < 0) $x = -$x;\n if ($y < 0) $y = -$y;\n if ($x == $y) return $x;\n while($y > 0) {\n $temp2 = $y;\n $y = $x % $y;\n $x = $temp2;\n }\n return $x;\n}\n\nfunction lcm($x, $y) {\n return ($x * $y)/gcd($x, $y);\n}\n\n$t = (int)readline();\n$input = array();\nfor($k = 0; $k < $t; $k++) {\n $input[] = explode(' ',readline());\n}\nprint_r($input);\nforeach($input as $n) {\n $out = array(-1,-1);\n $break = false;\n for($i = (int)$n[0]; $i < (int)$n[1]; $i++) {\n for($j = $i+1; $j <= (int)$n[1]; $j++) {\n if(lcm($i, $j) >= (int)$n[0] && lcm($i, $j) <= (int)$n[1]) {\n $out = array($i, $j);\n $break = true;\n break;\n }\n } \n if($break) break;\n }\n echo $out[0] . ' ' . $out[1] . \"\\n\";\n}"}], "src_uid": "e8ba3fb95800806465386ecbfbe924e9"} {"source_code": "\n"}, {"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 '';\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 *****************************************************/\nlist($n, $m) = explode(' ', g());\n\n$flag = true;\n$temp = -1;\nfor ($i = 0; $i < $n; $i++) {\n $line = g();\n $array = str_split($line);\n $sum = array_sum($array);\n\n if($sum != substr($line, 0, 1) * $m || $temp == $sum) {\n $flag = false;\n }\n\n $temp = $sum;\n}\n\necho $flag ? 'YES' : 'NO';\n\n?>"}, {"source_code": ""}, {"source_code": " 0) ? print \"NO\" : print \"YES\";\n?>"}, {"source_code": " 0)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>"}, {"source_code": " 0)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>"}, {"source_code": "\n"}, {"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": ""}], "src_uid": "80d3da5aba371f4d572ea928025c5bbd"} {"source_code": " $n[$i]) {\r\n $ans = $n[$i];\r\n }\r\n }\r\n } \r\n IO::pr($ans);\r\n \r\n }\r\n \r\n \r\n \r\n \r\n \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 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 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 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 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 "}], "negative_code": [], "src_uid": "adf024899fb2a684427463733358566a"} {"source_code": " 3) {\n $unrecoverableFlag = true;\n } \n } //end of input taking and general statistics part ..\n \n $count = count($stat);\n \n if($unrecoverableFlag){\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n \n if($count == 2){\n if($line == 2){\n //very special case ..\n $sorted = array_keys($stat);\n sort($sorted);\n $cupOneValue = $sorted[0];\n $cupTwoValue = $sorted[1];\n \n if( $stat[$cupOneValue][1] == 1 && $stat[$cupTwoValue][1] == 1){\n \n $diff = $cupTwoValue - $cupOneValue;\n if($diff % 2 == 1){\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }else{\n $volum = $diff / 2;\n \n echo $volum . ' ml. from cup #' . $stat[$cupOneValue][0] . \n ' to cup #' . $stat[$cupTwoValue][0] . '.' . PHP_EOL;\n }\n \n }else{\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n }else{\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n }\n \n \n \n if($count == 1) {\n echo 'Exemplary pages.' . PHP_EOL;\n }\n \n if($count == 3){\n \n $sorted = array_keys($stat);\n \n sort($sorted);\n \n $cupOneValue = $sorted[0];\n $cupTwoValue = $sorted[2];\n \n if( $stat[$cupOneValue][1] == 1 && $stat[$cupTwoValue][1] == 1){\n \n $volum = ($cupTwoValue - $cupOneValue) / 2;\n \n if($volum == ($sorted[1] - $cupOneValue)){\n echo $volum . ' ml. from cup #' . $stat[$cupOneValue][0] . \n ' to cup #' . $stat[$cupTwoValue][0] . '.' . PHP_EOL;\n }else{\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n \n }else{\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n }\n}", "positive_code": [{"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "= 3)\n{\n $b2 = $b;\n rsort($b);\n if($b[0] == $b[$a - 1])\n {\n print \"Exemplary pages.\";\n }\n else\n {\n $d = array_slice($b, 0, 2);\n array_push($d, $b[$a - 1]);\n $e = array_slice($b, 2);\n unset($e[count($e) - 1]);\n $f = $d[0] - $d[1];\n $g = $d[1] - $d[2];\n if(($f == $g) && (($e[0] == $e[count($e) - 1])) && (($e == FALSE) || ($e[0] == $d[1])))\n {\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == min($b))\n {\n $h = $x + 1;\n break;\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == max($b))\n {\n $i = $x + 1;\n break;\n }\n }\n print $f . \" ml. from cup #\" . $h . \" to cup #\" . $i . \".\";\n }\n else\n {\n print \"Unrecoverable configuration.\";\n }\n }\n}\n?>"}, {"source_code": " $value) {\nif(empty($value)){\nunset($text[$key]);\n}\n}\n$cups = array_map('intval', $text);\n$sum = array_sum($cups);\nif(($sum%$total) !=0)\n{\necho \"Unrecoverable configuration.\";\nexit;\n} else {\n$tmp = $sum/$total;\n$diff = array();\nforeach($cups as $key => $value) {\nif ($tmp != $value){\n$diff[$key]=$value;\n}\n}\n\nif (empty($diff)) {\necho \"Exemplary pages.\";\nexit;\n\n}\nif (count($diff)!=2) {\necho \"Unrecoverable configuration.\";\nexit;\n}\n$max = 0;\n$min = 0;\n$minkey = 0;\n$maxkey = 0;\n$first =true;\nforeach($diff as $key => $value){\nif ($first) {\n$max = $value;\n$maxkey = $key;\n$min = $value;\n$minkey = $key;\n}\nif ($value>$max) {\n$min = $max;\n$minkey = $maxkey;\n$max = $value;\n$maxkey = $key;\n} else {\n$min = $value;\n$minkey = $key;\n}\n$first = false;\n}\n$ml = ($max-$min)/2;\necho \"{$ml} ml. from cup #{$minkey} to cup #{$maxkey}.\";\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": "= 3)\n{\n $b2 = $b;\n rsort($b);\n if($b[0] == $b[$a - 1])\n {\n print \"Exemplary pages.\";\n }\n else\n {\n $d = array_slice($b, 0, 2);\n array_push($d, $b[$a - 1]);\n $e = array_slice($b, 2);\n unset($e[count($e) - 1]);\n $f = $d[0] - $d[1];\n $g = $d[1] - $d[2];\n if(($f == $g) && ($e[0] == $e[count($e) - 1]))\n {\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == min($b))\n {\n $h = $x + 1;\n break;\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == max($b))\n {\n $i = $x + 1;\n break;\n }\n }\n print $f . \" ml. from cup #\" . $h . \" to cup #\" . $i . \".\";\n }\n else\n {\n print \"Unrecoverable configuration.\";\n }\n }\n}\n?>"}, {"source_code": "= 3)\n{\n $b2 = $b;\n rsort($b);\n if($b[0] == $b[$a - 1])\n {\n print \"Exemplary pages.\";\n }\n else\n {\n $d = array_slice($b, 0, 2);\n array_push($d, $b[$a - 1]);\n $e = array_slice($b, 2);\n unset($e[count($e) - 1]);\n $f = $d[0] - $d[1];\n $g = $d[1] - $d[2];\n if(($f == $g) && (($e[0] == $e[count($e) - 1])) && ($e[0] == $d[1]))\n {\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == min($b))\n {\n $h = $x + 1;\n break;\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == max($b))\n {\n $i = $x + 1;\n break;\n }\n }\n print $f . \" ml. from cup #\" . $h . \" to cup #\" . $i . \".\";\n }\n else\n {\n print \"Unrecoverable configuration.\";\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 3)\n{\n print \"Unrecoverable configuration.\";\n}\n?>"}, {"source_code": "= 3)\n{\n $b2 = $b;\n rsort($b);\n if($b[0] == $b[$a - 1])\n {\n print \"Exemplary pages.\";\n }\n else\n {\n $d = array_slice($b, 0, 2);\n array_push($d, $b[$a - 1]);\n $e = array_slice($b, 2);\n unset($e[count($e) - 1]);\n $f = $d[0] - $d[1];\n $g = $d[1] - $d[2];\n if(($f == $g) && ($e[0] == $e[count($e) - 1]))\n {\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == min($b))\n {\n $h = $x + 1;\n break;\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b2[$x] == max($b))\n {\n $i = $x + 1;\n break;\n }\n }\n print $f . \" ml. from cup #\" . $h . \" to cup #\" . $i . \".\";\n }\n else\n {\n print \"Unrecoverable configuration.\";\n }\n }\n}\n?>"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": " $value) {\nif ($tmp != $value){\n$diff[$key]=$value;\n}\n}\nif (empty($diff)) {\necho \"Exemplary pages.\";\nexit;\n}\nsort($diff);\n$max = 0;\n$min = 0;\nforeach($diff as $key => $value){\nif($value>$max) {\n$max = $value;\n$maxkey = $key;\n} else {\n$min = $value;\n$minkey = $key;\n}\n}\n$ml = ($max-$min)/2;\necho \"{$ml} ml. from cup #{$minkey} to cup #{$maxkey}.\";\n}\n?>"}, {"source_code": " $value) {\nif(empty($value)){\nunset($text[$key]);\n}\n}\n$cups = array_map('intval', $text);\n$sum = array_sum($cups);\nif(($sum%$total) !=0)\n{\necho \"Unrecoverable configuration.\";\nexit;\n} else {\n$tmp = $sum/$total;\n$diff = array();\nforeach($cups as $key => $value) {\nif ($tmp != $value){\n$diff[$key]=$value;\n}\n}\n\nif (empty($diff)) {\necho \"Exemplary pages.\";\nexit;\n\n}\n$max = 0;\n$min = 0;\n$minkey = 0;\n$maxkey = 0;\n$first =true;\nforeach($diff as $key => $value){\nif ($first) {\n$max = $value;\n$maxkey = $key;\n$min = $value;\n$minkey = $key;\n}\nif ($value>$max) {\n$min = $max;\n$minkey = $maxkey;\n$max = $value;\n$maxkey = $key;\n} else {\n$min = $value;\n$minkey = $key;\n}\n$first = false;\n}\n$ml = ($max-$min)/2;\necho \"{$ml} ml. from cup #{$minkey} to cup #{$maxkey}.\";\n}\n?>"}, {"source_code": " 3) {\n $unrecoverableFlag = true;\n } \n } //end of input taking and general statistics part ..\n \n $count = count($stat);\n \n if($unrecoverableFlag){\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n \n if($count == 2){\n if($line == 2){\n //very special case ..\n $sorted = array_keys($stat);\n sort($sorted);\n $cupOneValue = $sorted[0];\n $cupTwoValue = $sorted[1];\n \n if( $stat[$cupOneValue][1] == 1 && $stat[$cupTwoValue][1] == 1){\n \n $diff = $cupTwoValue - $cupOneValue;\n if($diff % 2 == 1){\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }else{\n $volum = $diff / 2;\n \n echo $volum . ' ml. from cup #' . $stat[$cupOneValue][0] . \n ' to cup #' . $stat[$cupTwoValue][0] . '.' . PHP_EOL;\n }\n \n }else{\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n }else{\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n }\n \n \n \n if($count == 1) {\n echo 'Exemplary pages.' . PHP_EOL;\n }\n \n if($count == 3){\n \n $sorted = array_keys($stat);\n \n sort($sorted);\n \n $cupOneValue = $sorted[0];\n $cupTwoValue = $sorted[2];\n \n if( $stat[$cupOneValue][1] == 1 && $stat[$cupTwoValue][1] == 1){\n \n $diff = $cupTwoValue - $cupOneValue;\n \n if($diff % 2 == 1){\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }else{\n $volum = $diff / 2;\n \n echo $volum . ' ml. from cup #' . $stat[$cupOneValue][0] . \n ' to cup #' . $stat[$cupTwoValue][0] . '.' . PHP_EOL;\n }\n \n }else{\n echo 'Unrecoverable configuration.' . PHP_EOL;\n }\n }\n}"}], "src_uid": "7bfc0927ea7abcef661263e978612cc5"} {"source_code": "Scan();\n\t$inp_arr1 = str_split($inp_s);\n\t$inp_k = $Scanner->Scan();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$inp_pair = $Scanner->Scan();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\n\t\t$temp_c_lelfc = 0;\n\t\t$temp_c_rightc = 0;\n\t\t$temp_flag = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} else {\n\t\t\t\t$temp_flag = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (($temp_c_lelfc !== 0 && $temp_flag === 1) || ($temp_c_rightc !== 0 && $temp_flag === 1)|| $j === $len - 1) {\n\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t}\n\t\t\t\t$temp_c_lelfc = 0;\n\t\t\t\t$temp_c_rightc = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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\t/*if(!is_file($opend) && !is_link($opend)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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)){\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?>", "positive_code": [{"source_code": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t//$temp_c = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\t$temp_c_lelfc = 0;\n\t\t\t$temp_c_rightc = 0;\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$j++;\n\t\t\t\twhile ($j < $len && (($inp_arr1[$j] === $inp_leftc || $inp_arr1[$j] === $inp_right))) {\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_leftc) $temp_c_lelfc++;\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_right) $temp_c_rightc++;\n\t\t\t\t\t$j++;\t\n\t\t\t\t}\n\t\t\t\tif ($temp_c_rightc === 0) continue;\n\t\t\t\telse $temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$j++;\n\t\t\t\twhile ($j < $len && (($inp_arr1[$j] === $inp_leftc || $inp_arr1[$j] === $inp_right))) {\t\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_leftc) $temp_c_lelfc++;\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_right) $temp_c_rightc++;\n\t\t\t\t\t$j++;\t\n\t\t\t\t}\n\t\t\t\tif ($temp_c_lelfc === 0) continue;\n\t\t\t\telse $temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t//$temp_c = 0;\n\t\t$temp_c_lelfc = 0;\n\t\t$temp_c_rightc = 0;\n\t\t$temp_flag = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} else {\n\t\t\t\t$temp_flag = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (($temp_c_lelfc !== 0 && $temp_flag === 1) || ($temp_c_rightc !== 0 && $temp_flag === 1)|| $j === $len - 1) {\n\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t}\n\t\t\t\t//$temp_flag = 0;\n\t\t\t\t$temp_c_lelfc = 0;\n\t\t\t\t$temp_c_rightc = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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": ""}], "negative_code": [{"source_code": "nextToken();\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t\n\t$inp_arr1 = str_split($inp_s);\n\t$temp_counter = 1;\n\t$temp_point = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$c = 0;\n\t\t$len = count($inp_arr1);\n\t\tfor ($i = 0; $i < $len; $i++) {\n\t\t\tif ($inp_arr1[i] = $inp_arr2[0] && $inp_arr1[i + 1] = $inp_arr2[1]) {\n\t\t\t\t$c++;\n\t\t\t\t$i = $i + 2;\n\t\t\t}\n\t\t\tif ($inp_arr1[i + 1] = $inp_arr2[0] && $inp_arr1[i] = $inp_arr2[1]) {\n\t\t\t\t$c++;\n\t\t\t\t$i = $i + 2;\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\tprintf(\"%d\", $c);\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 $_\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/*\t\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}\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t//$temp_c = 0;\n\t\t$temp_flag = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\t$temp_c_lelfc = 0;\n\t\t\t$temp_c_rightc = 0;\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} else {\n\t\t\t\tif ($temp_flag == 1) {\n\t\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$temp_flag = 0;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t//$temp_c = 0;\n\t\t$temp_c_lelfc = 0;\n\t\t$temp_c_rightc = 0;\n\t\t$temp_flag = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} else {\n\t\t\t\t$temp_flag = 1;\n\t\t\t}\n\t\t\tif (($temp_c_lelfc !== 0 && $temp_flag === 1) || ($temp_c_rightc !== 0 && $temp_flag === 1)|| $i === $inp_k - 1) {\n\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t}\n\t\t\t\t//$temp_flag = 0;\n\t\t\t\t$temp_c_lelfc = 0;\n\t\t\t\t$temp_c_rightc = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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_arr1 = str_split($inp_s);\n\t$inp_k = (int)$Scanner->Scan();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$inp_pair = $Scanner->Scan();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t//$temp_c = 0;\n\t\t$temp_c_lelfc = 0;\n\t\t$temp_c_rightc = 0;\n\t\t$temp_flag = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} else {\n\t\t\t\t$temp_flag = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (($temp_c_lelfc !== 0 && $temp_flag === 1) || ($temp_c_rightc !== 0 && $temp_flag === 1)|| $j === $len - 1) {\n\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t}\n\t\t\t\t//$temp_flag = 0;\n\t\t\t\t$temp_c_lelfc = 0;\n\t\t\t\t$temp_c_rightc = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\n\n//error_reporting(0);\n//$Scanner = new Scanner(\"php://stdin\");\n//ref \"1230942 laurenceHR\"\nclass Scanner{\n\tprivate $Stream;\n\tprivate $Scanners = array();\n\tprivate $LineId_From_ScanIds= array();\n\tprivate $LinesScanners = array();\n\tprivate $LastScanId_Of_LineIds = array();\n\tprivate $scan_number = 0;\n\tprivate $scanline_number = 0;\n\t\n\tpublic function __construct($opened){\n\t\t$this->Stream = fopen($opened, '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//$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\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->LineId_From_ScanIds[$temp_x] = $temp_y;\n\t\t\t\t$temp_x++;\n\t\t\t}\n\t\t\t$this->LastScanId_Of_LineIds[$temp_y] = $temp_x - 1;\n\t\t\t$temp_y++;\n\t\t}\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->LineId_From_ScanIds[$x] === false || $this->LastScanId_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$this->scan_number = $x++;\n\t\t$this->scanline_number = $this->LineId_From_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->LineId_From_ScanIds[$x] === false || $this->LastScanId_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->LastScanId_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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$len = count($inp_arr1);\n\t\t//for ($i = 0; $i < $len; $i++) {\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\t//if ($inp_arr1[i] = $inp_arr2[0] && $inp_arr1[i + 1] = $inp_arr2[1]) {\n\t\t\tif ($inp_arr1[$j] === $inp_arr2[0] && $inp_arr1[$j + 1] === $inp_arr2[1]) {\n\t\t\t\t$c++;\n\t\t\t\t//$i = $i + 2;\n\t\t\t\t$j = $j + 2;\n\t\t\t//} elseif ($inp_arr1[$j + 1] = $inp_arr2[0] && $inp_arr1[$j] = $inp_arr2[1]) {\n\t} elseif ($inp_arr1[$j + 1] === $inp_arr2[0] && $inp_arr1[$j] === $inp_arr2[1]) {\n\t\t\t\t$c++;\n\t\t\t\t//$i = $i + 2;\n\t\t\t\t$j = $j + 2;\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\tprintf(\"%d\", $c);\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 $_\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/*\t\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}\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_arr1 = str_split($inp_s);\n\t$inp_k = $Scanner->Scan();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$inp_pair = $Scanner->Scan();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\n\t\t$temp_c_lelfc = 0;\n\t\t$temp_c_rightc = 0;\n\t\t$temp_flag = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} else {\n\t\t\t\t$temp_flag = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (($temp_c_lelfc !== 0 && $temp_flag === 1) || ($temp_c_rightc !== 0 && $temp_flag === 1)|| $j === $len - 1) {\n\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t}\n\t\t\t\t$temp_c_lelfc = 0;\n\t\t\t\t$temp_c_rightc = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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)){\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t//$temp_c = 0;\n\t\t$temp_flag1 = 0;\n\t\t$temp_flag2 = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag1 = 1;\n\t\t\t\t$temp_flag2 = 0;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag1 = 1;\n\t\t\t\t$temp_flag2 = 0;\n\t\t\t} else {\n\t\t\t\t$temp_flag2 = 1;\n\t\t\t}\n\t\t\tif (($temp_flag1 === 1 && $temp_flag2 = 1 || $i === $inp_k - 1)) {\n\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t}\n\t\t\t\t$temp_flag1 = 0;\n\t\t\t\t$temp_flag2 = 0;\n\t\t\t\t$temp_c_lelfc = 0;\n\t\t\t\t$temp_c_rightc = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$len = count($inp_arr1);\n\t\t//for ($i = 0; $i < $len; $i++) {\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\t//if ($inp_arr1[i] = $inp_arr2[0] && $inp_arr1[i + 1] = $inp_arr2[1]) {\n\t\t\tif ($inp_arr1[$j] === $inp_arr2[0] && $inp_arr1[$j + 1] === $inp_arr2[1]) {\n\t\t\t\t$c++;\n\t\t\t\t//$i = $i + 2;\n\t\t\t\t$j = $j + 2;\n\t\t\t//} elseif ($inp_arr1[$j + 1] = $inp_arr2[0] && $inp_arr1[$j] = $inp_arr2[1]) {\n\t\t\t\n\t} elseif ($inp_arr1[$j + 1] === $inp_arr2[0] && $inp_arr1[$j] === $inp_arr2[1]) {\n\t\t\t\t$c++;\n\t\t\t\t//$i = $i + 2;\n\t\t\t\t$j = $j + 2;\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\tprintf(\"%d\", $c);\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 $_\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/*\t\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}\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t$temp_c_lelfc = 0;\n\t\t$temp_c_rightc = 0;\n\t\t$temp_c = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\twhile ($j < $len && (($inp_arr1[$j] === $inp_leftc || $inp_arr1[$j] === $inp_right))) {\n\t\t\t\t\t$j++;\t\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_leftc) $temp_c_lelfc++;\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_right) $temp_c_rightc++;\t\n\t\t\t\t}\n\t\t\t\tif ($temp_c_rightc === 0) continue;\n\t\t\t\telse $temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\twhile ($j < $len && (($inp_arr1[$j] === $inp_leftc || $inp_arr1[$j] === $inp_right))) {\n\t\t\t\t\t$j++;\t\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_leftc) $temp_c_lelfc++;\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_right) $temp_c_rightc++;\t\n\t\t\t\t}\n\t\t\t\tif ($temp_c_lelfc === 0) continue;\n\t\t\t\telse $temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t$temp_c = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\t$temp_c_lelfc = 0;\n\t\t\t$temp_c_rightc = 0;\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\twhile ($j < $len && (($inp_arr1[$j] === $inp_leftc || $inp_arr1[$j] === $inp_right))) {\n\t\t\t\t\t$j++;\t\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_leftc) $temp_c_lelfc++;\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_right) $temp_c_rightc++;\t\n\t\t\t\t}\n\t\t\t\tif ($temp_c_rightc === 0) continue;\n\t\t\t\telse $temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\twhile ($j < $len && (($inp_arr1[$j] === $inp_leftc || $inp_arr1[$j] === $inp_right))) {\n\t\t\t\t\t$j++;\t\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_leftc) $temp_c_lelfc++;\n\t\t\t\t\tif ($inp_arr1[$j] === $inp_right) $temp_c_rightc++;\t\n\t\t\t\t}\n\t\t\t\tif ($temp_c_lelfc === 0) continue;\n\t\t\t\telse $temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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": "nextToken();\n\t$inp_arr1 = str_split($inp_s);\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_k = $Token->nextInt();\n\t$c = 0;\n\t$temp_c = 0;\n\tfor ($i = 0; $i < $inp_k; $i++) {\n\t\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t\t$inp_pair = $Token->nextToken();\n\t\t$inp_arr2 = str_split($inp_pair);\n\t\t$inp_leftc = $inp_arr2[0];\n\t\t$inp_right = $inp_arr2[1];\n\t\t$len = count($inp_arr1);\n\t\t\n\t\t//$temp_c = 0;\n\t\t$temp_c_lelfc = 0;\n\t\t$temp_c_rightc = 0;\n\t\t$temp_flag = 0;\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($inp_arr1[$j] === $inp_leftc) {\n\t\t\t\t$temp_c_lelfc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} elseif ($inp_arr1[$j] === $inp_right) {\n\t\t\t\t$temp_c_rightc++;\n\t\t\t\t$temp_flag = 0;\n\t\t\t} else {\n\t\t\t\t$temp_flag = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (($temp_c_lelfc !== 0 && $temp_flag === 1) || ($temp_c_rightc !== 0 && $temp_flag === 1)|| $i === $len - 1) {\n\t\t\t\tif ($temp_c_lelfc !== 0 && $temp_c_rightc !== 0) {\n\t\t\t\t\t$temp_c += min($temp_c_lelfc, $temp_c_rightc);\n\t\t\t\t}\n\t\t\t\t//$temp_flag = 0;\n\t\t\t\t$temp_c_lelfc = 0;\n\t\t\t\t$temp_c_rightc = 0;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tprintf(\"%d\", $temp_c);\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 $_\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/*\t\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}\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": ""}], "src_uid": "da2b3450a3ca05a60ea4de6bab9291e9"} {"source_code": "", "positive_code": [{"source_code": "\n"}, {"source_code": "$n-$k;$i--) echo $i . \" \";\nfor($i=1;$i<=$n-$k;$i++) echo $i . \" \";\n?>"}, {"source_code": "= 1; $i--)\n{\n echo $i.\" \";\n}\nfor($i = $k+2; $i<=$n;$i++)\n{\n echo $i.\" \";\n}\n}\nelse\n{for($i = 1; $i<=$n;$i++)\n{\n echo $i.\" \";\n}\n}"}], "negative_code": [{"source_code": ""}, {"source_code": "= 1; $i--)\n{\n echo $i;\n}\nfor($i = $k+2; $i<=$n;$i++)\n{\n echo $i;\n}\n}\nelse\n{for($i = 1; $i<=$n;$i++)\n{\n echo $i;\n}\n}"}], "src_uid": "75cc5b55c51217966cbdd639a68f0724"} {"source_code": " 0)\n {\n $n = $e * $b; // \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c\n array_push($p, $n);\n if($l[$x] - $e - $f > 0)\n {\n $r = $f * $c; // \u0441\u043a\u0440\u0438\u043d\u0441\u0435\u0439\u0432\u0435\u0440\n array_push($s, $r);\n $t = ($l[$x] - $e - $f) * $d; // \u0441\u043f\u044f\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043c\n array_push($u, $t);\n }\n else\n { \n $r = ($l[$x] - $e) * $c; // \u0441\u043a\u0440\u0438\u043d\u0441\u0435\u0439\u0432\u0435\u0440\n array_push($s, $r);\n }\n }\n else\n {\n $n = $l[$x] * $b; // \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c\n array_push($p, $n);\n }\n}\n$v = array_sum($p);\n$q = array_sum($s);\n$w = array_sum($u);\nprint $o + $v + $q + $w;\n?>", "positive_code": [{"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 '';\n}\n\n$stdin = @fopen('data.txt', 'r');\nif (!$stdin) {\n $stdin = fopen('php://stdin', 'r');\n}\n\nfunction g() {\n global $stdin;\n return trim(fgets($stdin));\n}\n\n/****************************************************** Solving block *****************************************************/\nlist($n, $p1, $p2, $p3, $t1, $t2) = explode(' ', g());\n\nfunction standby($interval, $p1, $p2, $p3, $t1, $t2) {\n if($interval <= $t1) {\n return $interval * $p1;\n } else if($interval <= $t2 + $t1) {\n return $t1 * $p1 + ($interval - $t1) * $p2;\n } else {\n return $t1 * $p1 + $t2 * $p2 + ($interval - $t2 - $t1) * $p3;\n }\n}\n\n$count = 0;\n$start = 0;\nfor($i = 0; $i < $n; $i++) {\n list($l, $r) = explode(' ', g());\n\n $count += ($i == 0 ? 0 : standby($l - $start, $p1, $p2, $p3, $t1, $t2)) + ($r - $l) * $p1;\n\n $start = $r;\n}\n\necho $count;\n?>"}], "negative_code": [{"source_code": " 0)\n {\n $n = $e * $b; // \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c\n array_push($p, $n);\n if($l[$x] - $e - $f > 0)\n {\n $r = $f * $c; // \u0441\u043a\u0440\u0438\u043d\u0441\u0435\u0439\u0432\u0435\u0440\n array_push($s, $r);\n $t = ($l[$x] - $e - $f) * $d; // \u0441\u043f\u044f\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043c\n array_push($u, $t);\n }\n else\n { \n $r = $f * $c; // \u0441\u043a\u0440\u0438\u043d\u0441\u0435\u0439\u0432\u0435\u0440\n array_push($s, $r);\n }\n }\n else\n {\n $n = $l[$x] * $b; // \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c\n array_push($p, $n);\n }\n}\n$v = array_sum($p);\n$q = array_sum($s);\n$w = array_sum($u);\nprint $o + $v + $q + $w;\n?>"}, {"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 '';\n}\n\n$stdin = @fopen('data.txt', 'r');\nif (!$stdin) {\n $stdin = fopen('php://stdin', 'r');\n}\n\nfunction g() {\n global $stdin;\n return trim(fgets($stdin));\n}\n\n/****************************************************** Solving block *****************************************************/\nlist($n, $p1, $p2, $p3, $t1, $t2) = explode(' ', g());\n\nfunction standby($interval, $p1, $p2, $p3, $t1, $t2) {\n if($interval <= $t1) {\n return $interval * $p1;\n } else if($interval <= $t2) {\n return $t1 * $p1 + ($interval - $t1) * $p2;\n } else {\n return $t1 * $p1 + ($t2 - $t1) * $p2 + ($interval - $t2) * $p3;\n }\n}\n\n$count = 0;\n$start = 0;\nfor($i = 0; $i < $n; $i++) {\n list($l, $r) = explode(' ', g());\n\n $count += ($i == 0 ? 0 : standby($l - $start, $p1, $p2, $p3, $t1, $t2)) + ($r - $l) * $p1;\n\n $start = $r;\n}\n\necho $count;\n?>"}], "src_uid": "7ed9265b56ef6244f95a7a663f7860dd"} {"source_code": ""}, {"source_code": "\n\n\n"}, {"source_code": "= 5) {\n $data = range(1, $size);\n $result = array();\n\n $head = array();\n $tail = array();\n\n $i = 1;\n foreach($data as $elem) {\n if($i % 2 == 0) {\n $head[] = $elem;\n } else {\n $tail[] = $elem;\n }\n $i++;\n }\n $result = array_merge($head, $tail);\n} else {\n if($size == 1 || $size == 2) {\n $result = array(1);\n } else {\n $result = range(1, $size);\n if($size == 4) {\n $result = array(2, 4, 1, 3);\n } elseif ($size == 3) {\n $result = array(1, 3);\n }\n\n }\n}\necho count($result) . \"\\n\";\narray_map(function($e) {echo $e . \" \";}, $result);"}, {"source_code": "0) { $m[$i]=$a; $a++; } else { $m[$i]=$b; $b--; }\n}\nif (abs($m[$n-1]-$m[$n-2])<2) \n{\n $t=$m[$n-1];\n $m[$n-1]=$m[0];\n $m[0]=$t;\n}\n\nif ($n==1) { echo '1'.\"\\n\".'1';}\nif ($n==2) { echo '1'.\"\\n\".'1';}\nif ($n==3) { echo '2'.\"\\n\".'1 3';}\nif ($n==4) { echo '4'.\"\\n\".'3 1 4 2';}\nif ($n==5) { echo '5'.\"\\n\".'1 4 2 5 3';}\nif ($n>5) \n{\n echo $n.\"\\n\";\n for ($i=0;$i<$n;$i++)\n {\n if ($i!=$n-1) {echo $m[$i].' ';} else {echo $m[$i];}\n }\n}\n\n$stdout=fopen('php://stdout','w');\n//fwrite($stdout,\"\\n\");\nfclose($stdout);\n\n?>"}, {"source_code": ""}, {"source_code": "fscanf(STDIN, \"%d\", $size); // \u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0438\u0437 STDIN\n\n$data = [];\n\nif($size >= 5) {\n $data = range(1, $size);\n $result = [];\n\n $head = [];\n $tail = [];\n\n $i = 1;\n foreach($data as $elem) {\n if($i % 2 == 0) {\n $head[] = $elem;\n } else {\n $tail[] = $elem;\n }\n $i++;\n }\n $result = array_merge($head, $tail);\n} else {\n if($size == 1 || $size == 2) {\n $result = [1];\n } else {\n $result = range(1, $size);\n if($size == 4) {\n $result = [4, 1, 3];\n } elseif ($size == 3) {\n $result = [1, 3];\n }\n }\n}\necho count($result) . \"\\n\";\narray_map(function($e) {echo $e . \" \";}, $result);\n~\n~\n~"}, {"source_code": "fscanf(STDIN, \"%d\", $size); // \u0447\u0438\u0442\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0438\u0437 STDIN\n\n$data = [];\n\nif($size >= 5) {\n $data = range(1, $size);\n $result = [];\n\n $head = [];\n $tail = [];\n\n $i = 1;\n foreach($data as $elem) {\n if($i % 2 == 0) {\n $head[] = $elem;\n } else {\n $tail[] = $elem;\n }\n $i++;\n }\n $result = array_merge($head, $tail);\n} else {\n if($size == 1) {\n $result = [1];\n } else {\n $result = range(1, $size);\n if($size == 4) {\n $result = [4, 1, 3];\n } elseif ($size == 3 || $size == 2) {\n $result = [1, 3];\n }\n\n }\n}\necho count($result) . \"\\n\";\narray_map(function($e) {echo $e . \" \";}, $result);"}, {"source_code": "= 5) {\n $data = range(1, $size);\n $result = array();\n\n $head = array();\n $tail = array();\n\n $i = 1;\n foreach($data as $elem) {\n if($i % 2 == 0) {\n $head[] = $elem;\n } else {\n $tail[] = $elem;\n }\n $i++;\n }\n $result = array_merge($head, $tail);\n} else {\n if($size == 1 || $size == 2) {\n $result = array(1);\n } else {\n $result = range(1, $size);\n if($size == 4) {\n $result = array(4, 1, 3);\n } elseif ($size == 3) {\n $result = array(1, 3);\n }\n\n }\n}\necho count($result) . \"\\n\";\narray_map(function($e) {echo $e . \" \";}, $result);"}, {"source_code": "= 5) {\n $data = range(1, $size);\n $result = array();\n\n $head = array();\n $tail = array();\n\n $i = 1;\n foreach($data as $elem) {\n if($i % 2 == 0) {\n $head[] = $elem;\n } else {\n $tail[] = $elem;\n }\n $i++;\n }\n $result = array_merge($head, $tail);\n} else {\n if($size == 1) {\n $result = array(1);\n } else {\n $result = range(1, $size);\n if($size == 4) {\n $result = array(4, 1, 3);\n } elseif ($size == 3 || $size == 2) {\n $result = array(1, 3);\n }\n\n }\n}\necho count($result) . \"\\n\";\narray_map(function($e) {echo $e . \" \";}, $result);"}, {"source_code": "0) { $m[$i]=$a; $a++; } else { $m[$i]=$b; $b--; }\n}\nif (abs($m[$n-1]-$m[$n-2])<2) \n{\n $t=$m[$n-1];\n $m[$n-1]=$m[1];\n $m[1]=$t;\n}\n\nif ($n==1) { echo '1'.\"\\n\".'1';}\nif ($n==2) { echo '1'.\"\\n\".'1';}\nif ($n==3) { echo '2'.\"\\n\".'1 3';}\nif ($n==4) { echo '3'.\"\\n\".'1 4 2';}\nif ($n==5) { echo '5'.\"\\n\".'1 4 2 5 3';}\nif ($n>5) \n{\n echo $n.\"\\n\";\n for ($i=0;$i<$n;$i++)\n {\n if ($i!=$n-1) {echo $m[$i].' ';} else {echo $m[$i];}\n }\n}\n\n$stdout=fopen('php://stdout','w');\n//fwrite($stdout,\"\\n\");\nfclose($stdout);\n\n?>"}, {"source_code": "0) { $m[$i]=$a; $a++; } else { $m[$i]=$b; $b--; }\n}\nif (abs($m[$n-1]-$m[$n-2])<2) \n{\n $t=$m[$n-1];\n $m[$n-1]=$m[1];\n $m[1]=$t;\n}\n\nif ($n==1) { echo '1'.\"\\n\".'1';}\nif ($n==2) { echo '1'.\"\\n\".'1';}\nif ($n==3) { echo '2'.\"\\n\".'1 3';}\nif ($n==4) { echo '3'.\"\\n\".'1 4 2';}\nif ($n==5) { echo '5'.\"\\n\".'1 4 2 5 3';}\nif ($n>5) \n{\n echo $n.\"\\n\";\n for ($i=0;$i<$n;$i++)\n {\n echo $m[$i].' ';\n }\n}\n\n$stdout=fopen('php://stdout','w');\n//fwrite($stdout,\"\\n\");\nfclose($stdout);\n\n?>"}, {"source_code": "0) { $m[$i]=$a; $a++; } else { $m[$i]=$b; $b--; }\n}\nif (abs($m[$n-1]-$m[$n-2])<2) \n{\n $t=$m[$n-1];\n $m[$n-1]=$m[0];\n $m[0]=$t;\n}\n\nif ($n==1) { echo '1'.\"\\n\".'1';}\nif ($n==2) { echo '1'.\"\\n\".'1';}\nif ($n==3) { echo '2'.\"\\n\".'1 3';}\nif ($n==4) { echo '3'.\"\\n\".'1 4 2';}\nif ($n==5) { echo '5'.\"\\n\".'1 4 2 5 3';}\nif ($n>5) \n{\n echo $n.\"\\n\";\n for ($i=0;$i<$n;$i++)\n {\n if ($i!=$n-1) {echo $m[$i].' ';} else {echo $m[$i];}\n }\n}\n\n$stdout=fopen('php://stdout','w');\n//fwrite($stdout,\"\\n\");\nfclose($stdout);\n\n?>"}], "src_uid": "a52ceb8a894809b570cbb74dc5ef76e1"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $value){\n $score = calculateScore($key+1, $value, $inputFail[$key], $inputTime[$key]);\n $finalScore += $score;\n}\n$finalScore = $finalScore + $inputExtraScore[0] * 100;\n$finalScore = $finalScore - $inputExtraScore[1] * 50;\necho \"$finalScore\";\n\nfunction calculateScore ($num, $defaultScore, $failNum, $time){\n $score = (1-($time/250.0))*$defaultScore - 50.0*$failNum;\n return max((0.3*$defaultScore), $score);\n}\n?>"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$a = trim(fgets(STDIN));\n$b = trim(fgets(STDIN));\n$c = trim(fgets(STDIN));\n\n$a = explode(\" \",$a);\n$b = explode(\" \",$b);\n$c = explode(\" \",$c);\n\n$inputTime = $a;\n$inputFail = $b; \n$inputExtraScore = $c;\n$defaultScore = [500.0, 1000.0, 1500.0, 2000.0, 2500.0]; \n$finalScore = 0.0;\n\nforeach($defaultScore as $key => $value){\n $score = calculateScore($key+1, $value, $inputFail[$key], $inputTime[$key]);\n $finalScore += $score;\n}\n$finalScore = $finalScore + $inputExtraScore[0] * 100;\n$finalScore = $finalScore - $inputExtraScore[1] * 50;\necho \"$finalScore\";\n\nfunction calculateScore ($num, $defaultScore, $failNum, $time){\n $score = (1-($time/250.0))*$defaultScore - 50.0*$failNum;\n return max((0.3*$defaultScore), $score);\n}\n"}], "src_uid": "636a30a2b0038ee1731325a5fc2df73a"} {"source_code": "= 0; $i--) {\r\n if(isset($tt[$a[$i]])) {\r\n $ans = $i + 1;\r\n break;\r\n }\r\n $tt[$a[$i]] = 1;\r\n \r\n \r\n }\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": "= 0; $i--) {\r\n if (isset($b[$a[$i]])) break;\r\n $b[$a[$i]] = true;\r\n }\r\n echo count($a) - count($b), \"\\n\";\r\n}"}], "negative_code": [], "src_uid": "4aaa33f77fe1c89ae477bd5cfa04f0bf"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "6422a70e686c34b4b9b6b5797712998e"} {"source_code": " 1) \n $res = ceil($left/2) ; \n \n else\n if ($right > 1 && $left == 1)\n $res = ceil($right/2) ; \n else\n if ($left % 2 == 0)\n {\n $res = ($left/2) * $right;\n }\n else\n {\n $res = (($left -1)/2) * $right + ceil($right/2);\n }\n \n echo $res. \"\\n\";\n}\n\n \n \nfclose($fh);\n \n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "19df5f3b8b31b763162c5331c1499529"} {"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$str = readString($stream);\n\n\t$preg = '![a-z]{1,10}(?[0-9.]+)!i';\n\tif (preg_match_all($preg, $str, $res)) {\n\t\t$sum = 0;\n\t\tforeach ($res['price'] as $price) {\n\t\t\t$parts = explode('.', $price);\n\t\t\t$lastPart = $parts[count($parts) - 1];\n\t\t\tif (strlen($lastPart) == 2) {\n\t\t\t\t$kop = array_pop($parts);\n\t\t\t\t$rub = intval(implode('', $parts));\n\t\t\t\t$add = $rub + $kop / 100;\n\n\t\t\t\t$sum+=$add;\n\t\t\t} else {\n\t\t\t\t$rub = intval(implode('', $parts));\n\t\t\t\t$add = $rub;\n\t\t\t\t$sum+=$add;\n\t\t\t}\n\t\t}\n\t\t$signs = 0;\n\t\tif (floor($sum) != $sum)\n\t\t\t$signs = 2;\n\t\techo number_format($sum, $signs, '.', '.');\n\t} else {\n\t\techo 'invalid';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": "= 3 && substr($price, -3, 1) == '.') {\n $ans += str_replace(\".\", \"\", $price) / 100;\n } else {\n $ans += str_replace(\".\", \"\", $price);\n }\n}\n$t = str_replace(\",\", \".\", number_format($ans, 2));\nif (substr($t, -3, 3) == \".00\") {\n echo substr($t, 0, strlen($t) - 3);\n} else {\n echo $t;\n}"}, {"source_code": "= 0; $y--)\n {\n if(($d[$y] == \".\") && ($f == 0))\n {\n $f = 1;\n }\n elseif(($d[$y] == \".\") && ($f == 1))\n {\n unset($d[$y]);\n }\n }\n $g = implode($d);\n $b[$x] = $g;\n}\nfor($x = 0; $x < count($b); $x++)\n{\n $h = str_split($b[$x]);\n if($h[count($h) - 4] == \".\")\n {\n unset($h[count($h) - 4]);\n }\n $i = implode($h);\n $b[$x] = $i;\n}\n$j = strval(array_sum($b));\nif(($j[strlen($j) - 1] == 0) && ($j[strlen($j) - 2] == 0) && ($j[strlen($j) - 3] == \".\"))\n{\n $j = substr($j, 0, strlen($j) - 3);\n}\nif($j[strlen($j) - 2] == \".\")\n{\n $j .= \"0\";\n}\nif($j[strlen($j) - 3] == \".\")\n{\n $k = substr($j, 0, strlen($j) - 3);\n $l = substr($j, strlen($j) - 3);\n $m = array();\n $n = \"\";\n $o = 1;\n for($x = strlen($k) - 1; $x >= 0; $x--)\n {\n $n .= $k[$x];\n $p = $o % 3;\n $o++;\n if(($p == 0) || ($x == 0))\n {\n $n = strrev($n);\n array_push($m, $n);\n $n = \"\";\n }\n }\n $m = array_reverse($m);\n $m = implode(\".\", $m);\n print $m . $l;\n}\nelse\n{\n $k = $j;\n $m = array();\n $n = \"\";\n $o = 1;\n for($x = strlen($k) - 1; $x >= 0; $x--)\n {\n $n .= $k[$x];\n $p = $o % 3;\n $o++;\n if(($p == 0) || ($x == 0))\n {\n $n = strrev($n);\n array_push($m, $n);\n $n = \"\";\n }\n }\n $m = array_reverse($m);\n $m = implode(\".\", $m);\n print $m;\n}\n?>"}, {"source_code": "= 100){\n $nsum = floor($koope/100);\n $koope = $koope % 100;\n}\n$sum += $nsum;\n\nif($koope == 0){\n echo number_format($sum, 0, ',', '.');\n}else{\n if($koope < 10){\n $koope = '.0'.$koope;\n}else{\n\t$koope = '.'.$koope;\n}\n echo number_format($sum, 0, ',', '.').$koope; \n}\n\n\n"}, {"source_code": "= 3 && substr($price, -3, 1) == '.') {\n $ans += str_replace(\".\", \"\", $price) / 100;\n } else {\n $ans += str_replace(\".\", \"\", $price);\n }\n}\n$t = str_replace(\",\", \".\", number_format($ans, 2));\nif (substr($t, -3, 3) == \".00\") {\n echo substr($t, 0, strlen($t) - 3);\n} else {\n echo $t;\n}"}], "negative_code": [{"source_code": "= 0; $y--)\n {\n if(($d[$y] == \".\") && ($f == 0))\n {\n $f = 1;\n }\n elseif(($d[$y] == \".\") && ($f == 1))\n {\n unset($d[$y]);\n }\n }\n $g = implode($d);\n $b[$x] = $g;\n}\nfor($x = 0; $x < count($b); $x++)\n{\n $h = str_split($b[$x]);\n if($h[count($h) - 4] == \".\")\n {\n unset($h[count($h) - 4]);\n }\n $i = implode($h);\n $b[$x] = $i;\n}\n$j = strval(array_sum($b));\nif(($j[strlen($j) - 1] == 0) && ($j[strlen($j) - 2] == 0) && ($j[strlen($j) - 3] == \".\"))\n{\n $j = substr($j, 0, strlen($j) - 3);\n}\nif($j[strlen($j) - 3] == \".\")\n{\n $k = substr($j, 0, strlen($j) - 3);\n $l = substr($j, strlen($j) - 3);\n $m = array();\n $n = \"\";\n $o = 1;\n for($x = strlen($k) - 1; $x >= 0; $x--)\n {\n $n .= $k[$x];\n $p = $o % 3;\n $o++;\n if(($p == 0) || ($x == 0))\n {\n $n = strrev($n);\n array_push($m, $n);\n $n = \"\";\n }\n }\n $m = array_reverse($m);\n $m = implode(\".\", $m);\n print $m . $l;\n}\nelse\n{\n $k = $j;\n $m = array();\n $n = \"\";\n $o = 1;\n for($x = strlen($k) - 1; $x >= 0; $x--)\n {\n $n .= $k[$x];\n $p = $o % 3;\n $o++;\n if(($p == 0) || ($x == 0))\n {\n $n = strrev($n);\n array_push($m, $n);\n $n = \"\";\n }\n }\n $m = array_reverse($m);\n $m = implode(\".\", $m);\n print $m;\n}\n?>"}, {"source_code": "> 100){\n $nsum = floor($koope/100);\n $koope = $koope % 100;\n}\n$sum += $nsum;\nif($koope < 10){\n $koope = '.0'.$koope;\n}else if($koope == 0){\n\t$koope = '';\n}else{\n\t$koope = '.'.$koope;\n}\necho number_format($sum, 0, ',', '.').$koope;"}, {"source_code": "> 100){\n $nsum = floor($koope/100);\n $koope = $koope % 100;\n}\n$sum += $nsum;\nif($koope < 10){\n $koope = '0'.$koope;\n}\necho number_format($sum, 0, ',', '.').'.'.$koope;"}, {"source_code": "= 3 && substr($price, -3, 1) == '.') {\n $ans += str_replace(\".\", \"\", $price) / 100;\n } else {\n $ans += str_replace(\".\", \"\", $price);\n }\n}\necho str_replace(\",\", \".\", number_format($ans, 2));"}, {"source_code": "= 3 && substr($price, -3, 1) == '.') {\n $ans += str_replace(\".\", \"\", $price) / 100;\n } else {\n $ans += str_replace(\".\", \"\", $price);\n }\n}\necho str_replace(\",\", \".\", number_format($ans, 2));"}, {"source_code": "= 3 && substr($price, -3, 1) == '.') {\n $ans += str_replace(\".\", \"\", $price) / 100;\n } else {\n $ans += str_replace(\".\", \"\", $price);\n }\n}\necho str_replace(\",\", \".\", number_format($ans, 2));\n"}, {"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$str = readString($stream);\n\n\t$preg = '![a-z]{1,10}(?[0-9.]+)!i';\n\tif (preg_match_all($preg, $str, $res)) {\n\t\t$sum = 0;\n\t\tforeach ($res['price'] as $price) {\n\t\t\t$parts = explode('.', $price);\n\t\t\t$lastPart = $parts[count($parts) - 1];\n\t\t\tif (strlen($lastPart) == 2) {\n\t\t\t\t$kop = array_pop($parts);\n\t\t\t\t$rub = intval(implode('', $parts));\n\t\t\t\t$add = $rub + $kop / 100;\n\n\t\t\t\t$sum+=$add;\n\t\t\t} else {\n\t\t\t\t$rub = intval(implode('', $parts));\n\t\t\t\t$add = $rub;\n\t\t\t\t$sum+=$add;\n\t\t\t}\n\t\t}\n\t\techo number_format($sum, 2, '.', '.');\n\t} else {\n\t\techo 'invalid';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "src_uid": "8da703549a3002bf9131d6929ec026a2"} {"source_code": " $second) {\r\n\t\tfprintf($cout, \"2\\n\");\r\n\t} else {\r\n\t\tfprintf($cout, \"1\\n\");\r\n\t}\r\n} ?>", "positive_code": [{"source_code": "$item) {\n if($item == '..') {\n unset($ppath[$key]);\n unset($ppath[$key-1]);\n $ppath = array_values($ppath);\n return calc_path(implode('/', $ppath));\n }\n }\n\n return implode('/', $ppath).'/';\n }\n\n\t$handle = fopen (\"php://stdin\",\"r\");\n\t$n = trim(fgets($handle));\n\n\t$pwd_path = \"/\";\n\n\tfor($i = 0; $i < $n; $i++) {\n\t\t$cmd = trim(fgets($handle));\n\t\tif($cmd == \"pwd\") echo $pwd_path.\"\\n\";\n\t\telse {\n\t\t\t$path = explode(' ', $cmd);\n\t\t\tif($path[1][0] == '/') {\n $pwd_path = calc_path($path[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t $pwd_path = calc_path($pwd_path.$path[1]);\n\t\t\t}\n\t\t}\n\t}\n\n\tfclose($handle);\n?>\n", "positive_code": [{"source_code": " $dir)\n if ($dir == '..') $now = preg_replace('/[A-z]+\\/$/', '', $now);\n elseif ($dir != null) $now .= $dir.'/';\n}\n?>"}, {"source_code": " $dir)\n\t\tif ($dir == '..') $now = preg_replace('/[A-z]+\\/$/', '', $now);\n\t\telseif ($dir != null) $now .= $dir.'/';\n}"}, {"source_code": " 0)\n\t\t\t$echo .= '/';\n\t\t$echo .= \"\\n\";\n\t}elseif($s[$i][0] == 'cd'){\n\t\t$d = explode('/', $s[$i][1]);\n\t\tfor($j = 0;$j < count($d);$j++){\n\t\t\tif($j == 0 && $d[$j] == false){\n\t\t\t\t$dir = array();\n\t\t\t}elseif($d[$j] == '..'){\n\t\t\t\tunset($dir[count($dir)-1]);\n\t\t\t}elseif($d[$j] != '.' && $d[$j] != false){\n\t\t\t\t$dir[count($dir)] = $d[$j];\n\t\t\t}\n\t\t}\n\t}\n}\necho $echo;\n?>\n"}, {"source_code": ""}, {"source_code": "$valueP) echo $valueP.\"/\"; \n echo \"\\n\";\n \n// print_r($p);\n return 1;\n}\n\n$p = array(\"\");\n\nwhile ($inputLine = fgets($stdin))\n{\n $command = trim($inputLine);\n if ($command=='pwd') \n {\n pwd(); \n continue; \n }\n \n $commands = explode(\"/\",substr($command,3));\n foreach ($commands as $kc=>$vc)\n {\n if ($vc=='')\n {\n unset($p);\n $p = array(\"\"); \n continue;\n }\n\n if ($vc=='..')\n {\n unset($p[count($p)-1]);\n continue;\n }\n \n $p[count($p)] = $vc; \n }\n}\n\n?>"}, {"source_code": " 0 ? '/' : '').\"\\r\\n\";\n\t\t}\n\t\tif ($cmd == 'cd') {\n\t\t\tif ((substr($path, 0, 1)) == '/') {\n\t\t\t\t$curPath = array();\n\t\t\t}\n\t\t\t$path = trim($path, '/');\n\t\t\t$folders = explode('/', $path);\n\t\t\tforeach($folders as $folder) {\n\t\t\t\tif ($folder == '..') {\n\t\t\t\t\tarray_pop($curPath);\n\t\t\t\t} else {\n\t\t\t\t\t$curPath[] = $folder;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tforeach($result as $line) {\n\t\techo $line;\n\t}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\";\n //var_dump($elems);\n //echo\"
\";echo\"
\";\n\n foreach($elems as $elem) {\n //echo $elem;\n if($elem != \"..\") {\n array_push($lastPath, $elem);\n }\n else {\n if(count($lastPath) > 0)\n array_pop($lastPath);\n }\n }\n //echo \"
\";\n\n }\n if(substr($line, 0, 3) == \"pwd\") {\n if(count($lastPath) == 0) echo \"/\";\n else {\n foreach($lastPath as $v) {\n if($v != \"\")\n echo \"/\".$v;\n }\n echo \"/\";\n }\n\n echo PHP_EOL;\n\n }\n}\n\n\n\n\n\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 array_push($absolutePathArray, $step);\n }\n }\n }\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\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 = trim($sCommand);\n return $sCommand;\n }\n}"}, {"source_code": " $n_limit ? $n_limit : $n;\n\n$count = 0; \nforeach( $arr_lines as $line ){\n\tif( $count++ < 1)\n\t\tcontinue;\n\t\n\n\t$command = trim( $line );\n\tif( strlen($command) < 1 )\n\t\tcontinue;\n\t\n\t$arr_commands []= $command;\n} \t\n\n//echo \"
\";\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\nfor ($l=1; $l\";\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": ""}, {"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": " 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": ""}, {"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": ""}], "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; $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": " '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": "= 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": ""}, {"source_code": ""}], "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": "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": "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": "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": " $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": "$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": "$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": "$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": " $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": " $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": ""}, {"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": ""}, {"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": ""}, {"source_code": ""}, {"source_code": "$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": " $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": ""}, {"source_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) && ($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; $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": " 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": "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": " 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": "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": "=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": " 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": " 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": " 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": " 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\t 100) $roomsCnt = 100;\n\t\t$living = $_REQUEST[\"living\"];\n\t\t$maxLiving = $_REQUEST[\"maxLiving\"];\n\t\t?>\n\t\t\n\t\t 0) ? $roomsCnt : 1;?>\" name=\"roomsCnt\"/>
\n\t\t 0):?>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\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\n\t\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\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\u0423\u0436\u0435 \u0436\u0438\u0432\u0443\u0442\u041c\u0430\u043a\u0441 \u0436\u0438\u0432\u0443\u0449\u0438\u0445
]\" value=\"\"/>]\" value=\"\"/>
\n\t\t\n\t\t 0) $submit = \"\u0420\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c\";\n\t\telse $submit = \"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b\";\n\t\t?>\n\t\t\"/>\n\t
\n\t\n\t
\n\t\t

\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:

\n\t\t\n\t
\n\t\n\t\n"}, {"source_code": " 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": " 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
\";\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": ""}], "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;$iScan();\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": "$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": "$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": "$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": "$id) {\n\n if ($id > 2 ) die(\"-1\");\n if ($id == 2) $c++;\n}\n\n?>"}, {"source_code": " 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": "\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": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $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": ""}], "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": "/',$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": " 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": "$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": "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": "$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": "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": "", "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": " $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 $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 $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 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 $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 $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 $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 $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 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": " 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": " 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": " $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": " $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": " $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": "", "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": ""}, {"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?>"}, {"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": "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": "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": "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": "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": "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": "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": "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": " $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": "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": "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": "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": "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": "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 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": "$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": "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": "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": ""}, {"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": " $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": " $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 $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 $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": " $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 $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 $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": "\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": "\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": ""}, {"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": "=$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": ""}], "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": " $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": " $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;$i47 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;$i47 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;$i47 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;$i47 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;$i47 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;$i47 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;$i47 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;$i47 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;$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": " 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;$i47 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;$i47 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;$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": "[[: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;$j26){\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;$i47 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;$i47 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;$i47 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;$i47 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;$j26){\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": " $k) return false;\n }\n\n return $need <= $k;\n}", "positive_code": [{"source_code": "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": " $k) return false;\n }\n\n return $need <= $k;\n}"}], "src_uid": "02bb7502135afa0f3bb26527427ba9e3"} {"source_code": " $t) ? $ti : $t+1 : 0;\n $fcount++;\n }\n}\n\nprint $t;", "positive_code": [{"source_code": " $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": " $t) ? $ti : $t+1;\n $fcount++;\n }\n}\n\nprint $t;"}, {"source_code": "= $len; $i++) {\n if ($str[$i] == \"F\") {\n $t = (($i - $fcount) > t) ? $i - $fcount : $t++;\n $fcount++;\n }\n}\n\nprint $t;"}, {"source_code": " t) ? $i - $fcount : $t++;\n\t\t$fcount++;\n\t}\n}\n\nprint $t;"}, {"source_code": "= $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": " $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": ""}, {"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": "=2400&&$after>2400){\n\t\t$answ=\"YES\";\n\t}\n\t\n}\n\necho $answ;\n"}, {"source_code": "=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 '
';\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": ""}, {"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": ""}, {"source_code": ""}], "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": "1 ? 0 : 1));\n ?>"}, {"source_code": "1 ? 0 : 1));\n ?>"}, {"source_code": " 1) print 0;\n else print substr_count($data, 'A');\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": " 1){\n \tprint 1;\n }else print substr_count($data, 'A');\n ?>"}, {"source_code": ""}, {"source_code": "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": ""}, {"source_code": ""}, {"source_code": " 1){\n \tprint $a - 1;\n }else print substr_count($data, 'A');\n ?>"}, {"source_code": "0) print $sc;\n else print substr_count($data, 'A');\n ?>"}, {"source_code": ""}], "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": "\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": "\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": "", "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": "\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": ""}, {"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": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 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": ""}, {"source_code": " 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": ""}, {"source_code": ""}], "src_uid": "c7d8c71a1f7e6c7364cce5bddd488a2f"} {"source_code": "$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": "$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": "$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": "=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": ""}, {"source_code": "=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//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": "';\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//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": "';\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": "$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//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": "=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//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//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//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": "9){\n $str=(string)$sum;\n $sum=0;\n for($i=0; $i"}, {"source_code": "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": ""}, {"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": ""}], "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;$i1)?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": "", "positive_code": [{"source_code": ""}, {"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": ""}], "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": ""}], "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": ""}, {"source_code": ""}], "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "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": "=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": "= $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": " 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": "=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": ""}, {"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": "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": " 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": ""}, {"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": "$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": "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": "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": "$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": "", "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": "$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": "=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": "\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": " $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": " $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": " $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": " $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": " $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": "\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": ""}], "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": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "';print_r($var);echo '
';} \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"}], "src_uid": "8ea24f3339b2ec67a769243dc68a47b2"} {"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 '';\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 *****************************************************/\nlist($n, $d) = explode(' ', g());\n$b = explode(' ', g());\n\n$a = 0;\n$cnt = 0;\n\nforeach($b as $item) {\n $inc = 0;\n if($a > $item) {\n $inc += ceil(($a - $item) / $d);\n\n if($item + $d * $inc == $a) {\n $inc++;\n }\n } else if($a == $item) {\n $inc++;\n }\n\n $cnt += $inc;\n $a = $item + $d * $inc;\n}\n\necho $cnt;\n?>", "positive_code": [{"source_code": ""}, {"source_code": " 1)\n {\n $g = floor(($c[$d] - $c[$e]) / $b) + 1;\n $c[$e] = $c[$e] + ($g * $b);\n $d++;\n $e++;\n $f += $g;\n }\n}\nprint $f;\n?>"}, {"source_code": ""}, {"source_code": "= $nxt){\n\t\t$new_tries = floor(($cur - $nxt) / $inc) + 1;\n\t\t$tries += $new_tries;\n\t\t$sequence[$i+1]= $nxt + $new_tries * $inc;\n\t}\n}\necho $tries;"}], "negative_code": [{"source_code": " 1)\n {\n $g = floor($c[$d] / $b) + 1;\n $h = substr($c, $e, 1) * $g;\n $c = substr($c, 0, $e) . $h . substr($c, $e + 1);\n $d++;\n $e++;\n $f += $g;\n $f--;\n }\n}\nprint $f;\n?>"}, {"source_code": "= $nxt){\n\t\t$new_tries = ceil(($cur - $nxt) / $inc) + $inc;\n\t\t$tries += $new_tries;\n\t\t$sequence[$i+1]= $nxt + $new_tries * $inc;\n\t}\n}\necho $tries;"}, {"source_code": "\";\n\t\t\t$input_2[$i] = $input_2[$i]+ $tmp*$delta;\n\t\t\t$res = $res + $tmp;\n\t\t}\t\t\n\t}\n\techo $res.\" End \";\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "0c5ae761b046c021a25b706644f0d3cd"} {"source_code": " $v)\n{\n\tif($s > $k)\n\t{\n\t\t$s += $v;\n\t} else {\n\t\t$result = false;\n\t\tbreak;\n\t}\n}\necho ($result) ? 'YES' : 'NO';\nfclose($fp);\n?>", "positive_code": [{"source_code": "$v){\n if ($s <= $v[0]){\n echo \"NO\" . PHP_EOL;\n exit();\n }\n $s+=$v[1];\n}\n\necho \"YES\" . PHP_EOL;\n//fclose($fp);\n\nfunction cmp($a, $b){\n if ($a[0] > $b[0]) return 1;\n if ($a[0] < $b[0]) return -1;\n if ($a[1] > $b[1]) return -1;\n if($a[0] > $b[0]) return 1;\n return 0;\n}\n"}, {"source_code": "$powerArray[$i][0])$power+=$powerArray[$i][1];\n else $alive=false;\n}\nif ($alive)echo \"YES\";\nelse echo \"NO\";\n"}, {"source_code": ""}, {"source_code": " $v)\n{\n\tif($s > $k)\n\t{\n\t\t$s += $v;\n\t} else {\n\t\t$result = false;\n\t\tbreak;\n\t}\n}\necho ($result) ? 'YES' : 'NO';\nfclose($fp);\n\n\n?>"}, {"source_code": " $v)\n{\n\tif($s > $k)\n\t{\n\t\t$s += $v;\n\t} else {\n\t\t$result = false;\n\t\tbreak;\n\t}\n}\necho ($result) ? 'YES' : 'NO';\nfclose($fp);\n\n?>"}, {"source_code": " $i) {\n if ($power > $i) {\n $power+= $levels[$j];\n } else {\n print 'NO';\n die();\n }\n}\n\nprint 'YES';"}, {"source_code": "=$b[0])\n return 1;\n else return -1;\n});\n\n\nfor($i=0;$i<$n;$i++){\n list($a,$b) = $r[$i];\n\n $a = $r[$i][0];\n $b = $r[$i][1];\n\n if ($s>$a){\n $s = $s+$b;\n }\n if ($s<=$a){\n echo \"NO\";\n exit;\n }\n}\n\necho \"YES\";"}, {"source_code": " $a[$j][0]) {\n\t\t\t$t = $a[$i];\n\t\t\t$a[$i] = $a[$j];\n\t\t\t$a[$j] = $t;\n\t\t}\n$ok = 1;\nfor($i=0;$i<$n;$i++) {\n\tif($s <= $a[$i][0]) { $ok = 0; break; }\n\t$s += $a[$i][1];\n}\nif($ok == 1) echo \"YES\" ; else echo \"NO\";\n?>"}, {"source_code": ""}, {"source_code": " $arr[$i][0]) {\n $s += $arr[$i][1];\n } else {\n $out = \"NO\";\n break;\n }\n}\n\necho $out;\n\n?>"}, {"source_code": "\n\n $a[$j][0]) swap($a[$i], $a[$j]);\n\t}\n}\n\nfor ($i = 0; $i < $n; $i ++) {\n\tif ($s <= $a[$i][0]) {\n\t\tprintf(\"NO\");\n\t\texit;\n\t}\n\t$s += $a[$i][1];\n}\n\nprintf(\"YES\");\n\nfunction swap(&$a, &$b) {\n\t$t = $a;\n\t$a = $b;\n\t$b = $t;\n}\n\n?>"}, {"source_code": " $ds, 'bo' => $bo);\n}\n//print_r($da);\nforeach ($da as $key => $row) {\n $ds1[$key] = $row['ds'];\n $bo1[$key] = $row['bo'];\n}\n\narray_multisort($ds1, SORT_ASC, $bo1, SORT_ASC, $da);\n//print_r($da);\n$res = 'YES';\nforeach ($da as $key => $row) {\n //print_r($row);\n if ($s <= $row['ds'])\n $res = 'NO';\n if ($res == 'YES')\n $s = $s + $row['bo'];\n}\necho \"$res\\n\";\n?>"}, {"source_code": " $value) {\n if ($value >= $s) {\n $echome = \"NO\";\n break;\n } else {\n $s += $y[$key];\n unset($x[$key]);\n }\n}\n\necho $echome;\n?>"}, {"source_code": " $c[$x])\n {\n $j++;\n $a += $d[$g[$x]];\n }\n}\nif($i == $j)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": "in();\n\t$N = (int)$Input->in();\n\t\n\tfor ($i = 0; $i < $N; $i++)\n\t{\n\t\t//$X[(int)$Input->in()] = (int)$Input->in();\n\t\t$X[] = (int)$Input->in();\n\t\t$Y[] = (int)$Input->in();\n\t}\n\n\tasort($X);\n\n\t$flag = 0;\n\n\tforeach ($X as $key => $x)\n\t{\n\t\tif ($x >= $S)\n\t\t{\n\t\t\t$flag = 1;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t$S += $Y[$key];\n\t\t}\n\t}\n\n\tif ($flag === 1) print(\"NO\");\n\telse print(\"YES\");\n\n\t$Input->close();\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": "$dr[$i][0]) {$a+=$dr[$i][1]; unset($dr[$i]);}\n}\n\nsort ($dr);\n\nfor ($i=0;$i<$b;++$i){\nif ($a>$dr[$i][0]) {\n$a+=$dr[$i][1];\nunset($dr[$i]); \n}else die(\"NO\");\n}\n\n die(\"YES\");"}, {"source_code": " $arr1[$j]){\n swap($arr1[$j - 1],$arr1[$j]);\n swap($arr2[$j - 1],$arr2[$j]);\n }\n }\n }\n for ($i = 0; $i < $n; $i++){\n if ($arr1[$i] < $s){\n $s = $s + $arr2[$i];\n }\n else {\n echo \"NO\";\n $r = 1;\n break;\n }\n }\n if ($r == 0){\n echo \"YES\";\n }"}], "negative_code": [{"source_code": " $c[$x])\n {\n $j++;\n $a += $h[$x];\n }\n}\nif($i == $j)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " $c)\n {\n $e++;\n $a += $d;\n }\n}\nif($e == $f)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": "in();\n\t$N = (int)$Input->in();\n\t\n\tfor ($i = 0; $i < $N; $i++)\n\t{\n\t\t$X[(int)$Input->in()] = (int)$Input->in();\n\t}\n\n\tksort($X);\n\n\t$flag = 0;\n\n\tforeach ($X as $x => $y)\n\t{\n\t\tif ($x >= $S)\n\t\t{\n\t\t\t$flag = 1;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t$S += $y;\n\t\t}\n\t}\n\n\tif ($flag === 1) print(\"NO\");\n\telse print(\"YES\");\n\n\t$Input->close();\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": "$drakoPower)$power+=$drakoBonus;\n else $alive=false;\n}\nif ($alive)echo \"YES\";\nelse echo \"NO\";"}, {"source_code": "$powerArray[$i][0])$power+=$powerArray[$i][1];\n else $alive=false;\n}\nif ($alive)echo \"YES\";\necho \"NO\";\n"}, {"source_code": " $max)break;\n else\n {\n if ($power > $powerArray[$i][0])\n {\n $power+=$powerArray[$i][1];\n }\n else\n {\n $alive = false;\n break;\n }\n }\n}\nif ($alive)echo \"YES\";\nelse echo \"NO\";"}, {"source_code": "$b[0])\n return 1;\n else return -1;\n});\n\n\nfor($i=0;$i<$n;$i++){\n list($a,$b) = $r[$i];\n\n $a = $r[$i][0];\n $b = $r[$i][1];\n\n if ($s>=$a){\n $s = $s+$b;\n }\n if ($s<$a){\n echo \"NO\";\n exit;\n }\n}\n\necho \"YES\";"}, {"source_code": "=$a){\n $s = $s+$b;\n }\n if ($s<$a){\n echo \"NO\";\n exit;\n }\n}\n\necho \"YES\";"}, {"source_code": " $a[$j][0]) {\n\t\t\t$t = $a[$i];\n\t\t\t$a[$i] = $a[$j];\n\t\t\t$a[$j] = $t;\n\t\t}\n$ok = 1;\nfor($i=0;$i<$n;$i++) {\n\tif($s < $a[$i][0]) { $ok = 0; break; }\n\t$s += $a[$i][1];\n}\nif($ok == 1) echo \"YES\" ; else echo \"NO\";\n?>"}, {"source_code": ""}, {"source_code": " $value){\n if($s < $key){\n echo \"NO\"; \n exit;\n }\n else $s += $value;\n}\n\necho \"YES\";"}, {"source_code": " $value){\n if($s <= $key){\n echo \"NO\"; \n exit;\n }\n else $s += $value;\n}\n\necho \"YES\";\n"}, {"source_code": " $value){\n if($s < $key){\n echo \"NO\"; \n exit;\n }\n else $s = $value;\n}\n\necho \"YES\";"}, {"source_code": "\n\n $a[$j][0]) swap($a[$i], $a[$j]);\n\t}\n}\n\nfor ($i = 0; $i < $n; $i ++) {\n\tif ($s < $a[$i][0]) {\n\t\tprintf(\"NO\");\n\t\texit;\n\t}\n\t$s += $a[$i][1];\n}\n\nprintf(\"YES\");\n\nfunction swap(&$a, &$b) {\n\t$t = $a;\n\t$a = $b;\n\t$b = $t;\n}\n\n?>"}], "src_uid": "98f5b6aac08f48f95b2a8ce0738de657"} {"source_code": " $f)\n {\n break;\n }\n }\n else\n {\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n $h = array_unique($d);\n if(count($h) == 1)\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?>"}], "negative_code": [], "src_uid": "08783e3dff3f3b7eb586931f9d0cd457"} {"source_code": " 0\n && $j > 0\n && ($i < ($h - 1))\n && ($j < ($w - 1))\n && $chars[$i-1][$j - 1] === '.'\n && $chars[$i-1][$j] === '*'\n && $chars[$i-1][$j + 1] === '.'\n && $chars[$i][$j - 1] === '*'\n && $chars[$i][$j + 1] === '*'\n && $chars[$i + 1][$j - 1] === '.'\n && $chars[$i + 1][$j] === '*'\n && $chars[$i + 1][$j + 1] === '.'\n ) {\n $centers[] = [$i, $j];\n }\n }\n }\n}\n\nif (count($centers) === 1) {\n [$ci, $cj] = $centers[0];\n $valid = true;\n $chars[$ci][$cj] = '.';\n for ($i = $ci - 1, $check = false, $length = 0; $i >= 0; $i--) {\n if (check($chars, $length, $check, $valid, $i, $cj) === false) {\n break;\n }\n }\n $valid = $valid && $length > 0;\n if ($valid) {\n for ($i = $ci + 1, $check = false, $length = 0; $i < $h; $i++) {\n if (check($chars, $length, $check, $valid, $i, $cj) === false) {\n break;\n }\n }\n $valid = $valid && $length > 0;\n }\n if ($valid) {\n for ($j = $cj - 1, $check = false, $length = 0; $j >=0; $j--) {\n if (check($chars, $length, $check, $valid, $ci, $j) === false) {\n break;\n }\n }\n $valid = $valid && $length > 0;\n }\n if ($valid) {\n for ($j = $cj + 1, $check = false, $length = 0; $j < $w; $j++) {\n if (check($chars, $length, $check, $valid, $ci, $j) === false) {\n break;\n }\n }\n $valid = $valid && $length > 0;\n }\n $result = $valid === true && strpos(implode('', $chars), '*') === false ? 'YES' : 'NO';\n}\n\necho $result;\n", "positive_code": [{"source_code": ""}, {"source_code": " 0\n && $j > 0\n && ($i < ($h - 1))\n && ($j < ($w - 1))\n && $chars[$i-1][$j - 1] === '.'\n && $chars[$i-1][$j] === '*'\n && $chars[$i-1][$j + 1] === '.'\n && $chars[$i][$j - 1] === '*'\n && $chars[$i][$j + 1] === '*'\n && $chars[$i + 1][$j - 1] === '.'\n && $chars[$i + 1][$j] === '*'\n && $chars[$i + 1][$j + 1] === '.'\n ) {\n $centers[] = [$i, $j];\n }\n $allI[] = $i;\n $allJ[] = $j;\n $stars[] = [$i, $j];\n }\n }\n}\nif (count($centers) === 1) {\n [$ci, $cj] = $centers[0];\n $valid = true;\n foreach ($stars as $star) {\n if ($star[0] !== $ci && $star[1] !== $cj) {\n $valid = false;\n }\n }\n if ($valid) {\n $allI = array_unique($allI);\n $allJ = array_unique($allJ);\n sort($allI);\n sort($allJ);\n $lengthI = count($allI);\n $lengthJ = count($allJ);\n for ($i = 1; $i < $lengthI; $i++) {\n if ($allI[$i - 1] !== ($allI[$i] - 1)) {\n $valid = false;\n break;\n }\n }\n }\n if ($valid) {\n for ($j = 1; $j < $lengthJ; $j++) {\n if ($allJ[$j - 1] !== ($allJ[$j] - 1)) {\n $valid = false;\n break;\n }\n }\n }\n if ($valid) {\n $result = 'YES';\n }\n}\necho $result;\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 0\n && $j > 0\n && ($i < ($h - 1))\n && ($j < ($w - 1))\n && $chars[$i-1][$j - 1] === '.'\n && $chars[$i-1][$j] === '*'\n && $chars[$i-1][$j + 1] === '.'\n && $chars[$i][$j - 1] === '*'\n && $chars[$i][$j + 1] === '*'\n && $chars[$i + 1][$j - 1] === '.'\n && $chars[$i + 1][$j] === '*'\n && $chars[$i + 1][$j + 1] === '.'\n ) {\n $centers++;\n }\n $allI[] = $i;\n $allJ[] = $j;\n }\n }\n}\nif ($centers === 1) {\n $valid = true;\n $allI = array_unique($allI);\n $allJ = array_unique($allJ);\n sort($allI);\n sort($allJ);\n $lengthI = count($allI);\n $lengthJ = count($allJ);\n for ($i = 1; $i < $lengthI; $i++) {\n if ($allI[$i - 1] !== ($allI[$i] - 1)) {\n $valid = false;\n break;\n }\n }\n if ($valid) {\n for ($j = 1; $j < $lengthJ; $j++) {\n if ($allJ[$j - 1] !== ($allJ[$j] - 1)) {\n $valid = false;\n break;\n }\n }\n }\n if ($valid) {\n $result = 'YES';\n }\n}\necho $result;\n"}, {"source_code": " 0\n && $j > 0\n && ($i < ($h - 1))\n && ($j < ($w - 1))\n && $chars[$i-1][$j - 1] === '.'\n && $chars[$i-1][$j] === '*'\n && $chars[$i-1][$j + 1] === '.'\n && $chars[$i][$j - 1] === '*'\n && $chars[$i][$j + 1] === '*'\n && $chars[$i + 1][$j - 1] === '.'\n && $chars[$i + 1][$j] === '*'\n && $chars[$i + 1][$j + 1] === '.'\n ) {\n $centers[] = $point;\n } else {\n $stars[] = $point;\n }\n }\n }\n}\nif (count($centers) === 1) {\n $valid = true;\n [$ci, $cj] = $centers[0];\n foreach ($stars as $star) {\n [$i, $j] = $star;\n if ($i !== $ci && $j !== $cj) {\n $valid = false;\n }\n }\n if ($valid) {\n $result = 'YES';\n }\n}\necho $result;\n"}], "src_uid": "6405161be280fea943201fa00ef6f448"} {"source_code": "", "positive_code": [{"source_code": " 2) || ($b/$a > 2)){\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n//$array = [4,2,10,1];\r\n//$array = [1,3];\r\n//$array = [6,1];\r\n//$array = [1,4,2];\r\n//$array = [1,2,3,4,3];\r\n//$array = [4,31,25,50,30,20,34,46,42,16,15,16];\r\n\r\n$t = readline();\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n $length = readline();\r\n $numbers = readline();\r\n $numbers = explode(' ', $numbers);\r\n echo compactArray($length, $numbers) . PHP_EOL;\r\n}\r\n\r\nfunction compactArray(int $length, array $array)\r\n{\r\n $counter = 0;\r\n\r\n for ($i = 0; $i < count($array) - 1; $i++) {\r\n if (!isDense($array[$i], $array[$i + 1])) {\r\n if ($array[$i + 1] > $array[$i])\r\n array_splice($array, $i + 1, 0, ceil($array[$i] * 2));\r\n else\r\n array_splice($array, $i + 1, 0, ceil($array[$i + 1] * 2));\r\n $i--;\r\n $counter++;\r\n }\r\n }\r\n\r\n /*for ($i = 0; $i < count($array); $i++) {\r\n echo $array[$i] . \" \";\r\n }*/\r\n\r\n return $counter;\r\n}"}, {"source_code": " 2) {\r\n $result += floor(log(($max - 1) / $min, 2));\r\n }\r\n }\r\n\r\n return $result;\r\n}\r\n\r\n$t = readline();\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n $length = readline();\r\n $numbers = readline();\r\n $numbers = explode(' ', $numbers);\r\n echo compactArray($length, $numbers) . PHP_EOL;\r\n}"}, {"source_code": "= $number2) {\r\n return $number1;\r\n }\r\n \r\n return $number2;\r\n}\r\n\r\nfunction getMin($number1, $number2)\r\n{\r\n if ($number1 < $number2) {\r\n return $number1;\r\n }\r\n \r\n return $number2;\r\n}\r\n\r\nfunction getIterations($number1, $number2) \r\n{\r\n $max = getMax($number1, $number2);\r\n $min = getMin($number1, $number2);\r\n \r\n \r\n $iterationsCount = 0;\r\n \r\n while($max/$min > 2) {\r\n $min *= 2;\r\n \r\n $iterationsCount ++;\r\n }\r\n \r\n return $iterationsCount;\r\n}\r\n\r\nfor ($i=0; $i<$rowsNumber; $i++) {\r\n $n = trim(fgets($file));\r\n \r\n $a = explode(\" \", trim(fgets($file)));\r\n\r\n $insertedNumbers = 0;\r\n for ($y=0; $y<$n-1; $y++) {\r\n $insertedNumbers += getIterations($a[$y], $a[$y+1]);\r\n }\r\n \r\n echo $insertedNumbers.PHP_EOL;\r\n}"}, {"source_code": "= $number2) {\r\n return $number1;\r\n }\r\n \r\n return $number2;\r\n}\r\n\r\nfunction getMin($number1, $number2)\r\n{\r\n if ($number1 < $number2) {\r\n return $number1;\r\n }\r\n \r\n return $number2;\r\n}\r\n\r\nfunction getIterations($number1, $number2) \r\n{\r\n $max = getMax($number1, $number2);\r\n $min = getMin($number1, $number2);\r\n \r\n \r\n $iterationsCount = 0;\r\n \r\n while($max/$min > 2) {\r\n $min *= 2;\r\n \r\n $iterationsCount ++;\r\n }\r\n \r\n return $iterationsCount;\r\n}\r\n\r\nfor ($i=0; $i<$rowsNumber; $i++) {\r\n $n = trim(fgets($file));\r\n \r\n $a = explode(\" \", trim(fgets($file)));\r\n\r\n $insertedNumbers = 0;\r\n for ($y=0; $y<$n-1; $y++) {\r\n $insertedNumbers += getIterations($a[$y], $a[$y+1]);\r\n }\r\n \r\n echo $insertedNumbers.PHP_EOL;\r\n}\r\n"}, {"source_code": " 2) {\r\n $min = $min * 2;\r\n $b = $max / $min;\r\n $m++;\r\n }\r\n }\r\n echo $m.PHP_EOL;\r\n}"}, {"source_code": " 2)\n\t\t\treturn $c-1;\n}\n$itr = 0;\nforeach($testCases as $j){\t\n\t$dense = false;\n\t$minDenseNum = 0;\n\twhile(!$dense){\n\t$dense = true;\n\tfor($k = 1; $k < count($j) - 1; $k++){\n\t\t$tmp1 = max((int)$j[$k],(int)$j[$k + 1]);\n\t\t$tmp2 = min((int)$j[$k],(int)$j[$k + 1]);\n\t\t$tmp3 = biggerButLessThanDouble($tmp2);\n\t\tif(($tmp1/$tmp2) > 2){\n\t\t\t$dense = false;\n\t\t\tarray_splice($j, $k + 1, 0, $tmp3);\n\t\t\t$minDenseNum = $minDenseNum + 1;\n\t\t}\n\t}\n\t}\n\t$j[0] = $minDenseNum;\n\t$testCases[$itr] = $j;\n\t$itr = $itr + 1;\n}\n\n/*Affichage*/\nforeach($testCases as $j)\n\techo \"{$j[0]}\\n\";\n?>\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 $a = IO::arr();\r\n $res = 0;\r\n\r\n\r\n foreach ($a as $k => $v) {\r\n if (isset($a[$k+1])) {\r\n $max = max([$a[$k], $a[$k+1]]);\r\n $min = min([$a[$k], $a[$k+1]]);\r\n while ($max / $min > 2) {\r\n $res += 1;\r\n $min *= 2;\r\n }\r\n }\r\n }\r\n IO::line($res);\r\n}\r\n"}, {"source_code": " 2) {\r\n $min = $min * 2;\r\n $b = $max / $min;\r\n $m++;\r\n }\r\n }\r\n echo $m.PHP_EOL;\r\n}\r\n "}], "src_uid": "a544dd9fd96379f66a960de6f973dd50"} {"source_code": "= 2 && $c1 % 2 == 0)\r\n echo \"YES\\n\";\r\n else\r\n echo \"NO\\n\";\r\n } else {\r\n if ($c1 % 2)\r\n echo \"NO\\n\";\r\n else\r\n echo \"YES\\n\";\r\n }\r\n}\r\n", "positive_code": [{"source_code": " 1) ? 'YES' : 'NO'), PHP_EOL;\r\n } else {\r\n echo (0 === $cnt1 % 2 ? 'YES' : 'NO'), PHP_EOL;\r\n }\r\n}\r\n"}, {"source_code": "= 2)\r\n\t\t\t\t\t\t\t$result = \"yes\\r\\n\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$result = \"no\\r\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = \"yes\\r\\n\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif($count_2 % 2 == 0)\r\n\t\t\t\t\t$result = \"yes\\r\\n\";\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = \"no\\r\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = \"no\\r\\n\";\r\n\t\t\r\n\t\techo $result;\r\n\t}\r\n\t\r\n?>"}, {"source_code": " $value)\r\n\t{\r\n\t\tif($value == 1)\r\n\t\t\t$answer['one']++;\r\n\t\telse if($value == 2)\r\n\t\t\t$answer['two']++;\r\n\t}\r\n\treturn $answer;\r\n}\r\n\r\n$arr = array();\r\n$t = readline();\r\nfor($i=0;$i<$t;$i++)\r\n{\r\n\t$n = readline();\r\n\t$candy_str = readline();\r\n\t$candy = explode(\" \", $candy_str);\r\n\t$candy_count = calcCandy($candy);\r\n\tif($candy_count['two'] % 2 != 0)\r\n\t{\r\n\t\tif($candy_count['one'] >= 2)\r\n\t\t{\r\n\t\t\t$candy_count['one'] -= 2;\r\n\t\t\tif($candy_count['one'] % 2 == 0)\r\n\t\t\t\tarray_push($arr, \"YES\\r\\n\");\r\n\t\t\telse\r\n\t\t\t\tarray_push($arr, \"NO\\r\\n\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tarray_push($arr, \"NO\\r\\n\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif($candy_count['one'] % 2 == 0)\r\n\t\t\tarray_push($arr, \"YES\\r\\n\");\r\n\t\telse\r\n\t\t\tarray_push($arr, \"NO\\r\\n\");\r\n\t}\r\n}\r\nforeach($arr as $key => $value)\r\n\tprint($value);\r\n\r\n$end = readline();\r\n?>"}], "negative_code": [{"source_code": "= 2 && $c1 % 2)\r\n echo \"YES\\n\";\r\n else\r\n echo \"NO\\n\";\r\n } else {\r\n if ($c1 % 2)\r\n echo \"NO\\n\";\r\n else\r\n echo \"YES\\n\";\r\n }\r\n}\r\n"}, {"source_code": "= $string) break;\n\t\t\t// $output = $alphas[rand(0,$character-1)].$output;\n\t\t\t$output = $alphas[$j].$output;\n\t\t\t$i++;\n\t\t}\n\t}\n echo $output;\n echo \"\\n\";\n\t$finsh++;\n}\n\n// echo $input;\n\n\n?>", "positive_code": [{"source_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\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\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$tc = $ir->readInt();\n$alphabet = 'abcdefghijklmnopqrstuvwxyz';\nfor ($i=1; $i<=$tc; $i++) {\n\tlist($n, $k) = $ir->readArrayOfInt(2);\n\t$d = intval($n/$k)+1;\n\t\n\techo substr(str_repeat(substr($alphabet,0,$k), $d), 0, $n).\"\\n\";\n}\n"}, {"source_code": " 0; $c--) {\n list($n, $k) = explode(' ', trim(fgets(STDIN)));\n for (; $n > 0;) {\n $a = 'a';\n for ($j = $k; $j > 0 && $n > 0; $j--,$n--) {\n echo $a;\n $a++;\n\n }\n }\n echo PHP_EOL;\n}"}, {"source_code": ""}, {"source_code": "= $string) break;\n\t\t\t$output = $alphas[rand(0,$character-1)].$output;\n\t\t\t$i++;\n\t\t}\n\t}\n echo $output;\n echo \"\\n\";\n\t$finsh++;\n}\n\n// echo $input;\n\n\n?>"}, {"source_code": "= $string) break;\n\t\t\t$output = $alphas[rand(0,$character-1)].$output;\n\t\t\t$i++;\n\t\t}\n\t}\n echo $output;\n // echo \"\\n\";\n\t$finsh++;\n}\n\n// echo $input;\n\n\n?>"}, {"source_code": " 0; $c--) {\n list($n, $k) = explode(' ', trim(fgets(STDIN)));\n for (; $n > 0;) {\n $a = 'a';\n for ($j = $k; $j > 0; $j--) {\n echo $a;\n $a++;\n $n--;\n }\n }\n echo PHP_EOL;\n}"}, {"source_code": " $n*$n ) || ( (1 == $k % 2 ) && ($k > ($n*($n-1)+1)) ) )\nif ( $k > $n*$n )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n\treturn;\n}\nelse\n{\n\tfor ($row = 0; $row < $n; $row++)\n\t{\n\t if ($k > 0)\n\t {\n\t $matrix[$row][$row] = 1;\n\t $k--;\n\t }\n\t for ($col = $row + 1; $col < $n; $col++)\n\t {\n\t if ($k > 1)\n\t {\n\t $matrix[$row][$col] = 1;\n\t $matrix[$col][$row] = 1;\n\t $k -= 2;\n\t }\n\t }\n\t}\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($row=0; $row < $n; $row++)\n\t{ \n\t\tfor ($col=0; $col < $n; $col++)\n\t\t{ \n\t\t\techo \"{$matrix[$row][$col]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\t\n}\n\n?>", "positive_code": [{"source_code": " $c)\n{\n print \"-1\";\n}\nelse\n{\n $d = array();\n for($x = 0; $x < $a; $x++)\n {\n $e = array_fill(0, $a, 0);\n $d[$x] = $e;\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $b--;\n $d[$x][$x] = 1;\n break;\n }\n elseif($b == 2)\n {\n $b -= 2;\n $d[$x][$x] = 1;\n $d[$x + 1][$x + 1] = 1;\n break;\n }\n elseif($b > 2)\n {\n $b--;\n $d[$x][$x] = 1;\n $f = ($a - $x - 1) * 2;\n if($b >= $f)\n {\n $b -= $f;\n for($y = $x + 1; $y < $a; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x + 1; $y < $a; $y++)\n {\n $d[$y][$x] = 1;\n }\n }\n else\n {\n $g = $b % 2;\n if($g == 0)\n {\n $h = $b / 2;\n $b -= $f;\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$y][$x] = 1;\n }\n }\n else\n {\n $h = ($b - 1) / 2;\n $b = 0;\n for($y = $x; $y < $x + $h + 1; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x; $y < $x + $h + 1; $y++)\n {\n $d[$y][$x] = 1;\n }\n $d[$x + 1][$x + 1] = 1;\n }\n }\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n print implode(\" \", $d[$x]) . \"\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": " $c)\n{\n print \"-1\";\n}\nelse\n{\n $d = array();\n for($x = 0; $x < $a; $x++)\n {\n $e = array_fill(0, $a, 0);\n $d[$x] = $e;\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $b--;\n $d[$x][$x] = 1;\n break;\n }\n elseif($b == 2)\n {\n $b -= 2;\n $d[$x][$x] = 1;\n $d[$x + 1][$x + 1] = 1;\n break;\n }\n elseif($b > 2)\n {\n $b--;\n $d[$x][$x] = 1;\n $f = ($a - $x - 1) * 2;\n if($b >= $f)\n {\n $b -= $f;\n for($y = $x + 1; $y < $a; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x + 1; $y < $a; $y++)\n {\n $d[$y][$x] = 1;\n }\n }\n else\n {\n $g = $b % 2;\n if($g == 0)\n {\n $b -= $f;\n $h = $b / 2;\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$y][$x] = 1;\n }\n }\n else\n {\n $b -= $f;\n $h = ($b - 1) / 2;\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$y][$x] = 1;\n }\n $d[$x + 1][0] = 1;\n }\n }\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n print implode(\" \", $d[$x]) . \"\\n\";\n }\n}\n?>"}, {"source_code": " ($n*($n-1)+1) )\nif ( $k > $n*$n )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n}\nelse\n{\n\t$i = 0;\n\twhile ($i < $k && $i < $n)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\t$k = $k - $i;\n\t$i = 0;\n\twhile ($i < $k && $i < $n-1)\n\t{\n\t\t$matrix[$i][$i] = 0;\n\t\t$matrix[$i+1][$i] = 1;\n\t\t$matrix[$i][$i+1] = 1;\n\t\t$i=$i+1;\n\t}\n\n\t$k = $k - $i;\n\t$i = 0;\n\twhile ($i < $k && $i < $n-1)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\t$aux = 0;\n\twhile (0 < $k && $aux < $n)\n\t{\n\t\t$k = $k - $i + $aux;\n\t\t$aux++;\n\t\t$i = $aux;\n\t\twhile ($i < $k+$aux && $i < $n-$aux)\n\t\t{\n\t\t\t$matrix[$i][$i] = 0;\n\t\t\t$matrix[$i+$aux][$i-$aux] = 1;\n\t\t\t$matrix[$i-$aux][$i+$aux] = 1;\n\t\t\t$i++;\n\t\t}\n\n\t\t$k = $k - $i + $aux;\n\t\t$i = $aux;\n\t\twhile ($i < $k+$aux && $i < $n-$aux)\n\t\t{\n\t\t\t$matrix[$i][$i] = 1;\n\t\t\t$i++;\n\t\t}\n\t}\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t\n}\n"}, {"source_code": " $n && 1 == $k %2) || ($k > $n*$n) )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n}\nelse\n{\n\tif ($k > $n && 0 == $k %2)\n\t{\n\t\t$i = 0;\n\t\twhile ($i < $n && $i < $k)\n\t\t{\n\t\t\t$matrix[$i][$i] = 1;\n\t\t\t$i++;\n\t\t}\n\n\t\twhile ($i < $k)\n\t\t{\n\t\t\t$matrix[$i-$n][$i-$n] = 0;\n\t\t\t$matrix[$i-$n+1][$i-$n] = 1;\n\t\t\t$matrix[$i-$n][$i-$n+1] = 1;\n\t\t\t$i=$i+1;\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor ($j=0; $j < $k; $j++)\n\t\t{ \n\t\t\t$matrix[$j][$j] = 1;\n\t\t}\n\t}\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t\n}\n\n?>\n\n"}, {"source_code": " $n*$n) )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n}\nelse\n{\n\n\t$i = 0;\n\twhile ($i < $n && $i < $k)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\twhile ($i < $k && $i-$n < $n-1)\n\t{\n\t\t$matrix[$i-$n][$i-$n] = 0;\n\t\t$matrix[$i-$n+1][$i-$n] = 1;\n\t\t$matrix[$i-$n][$i-$n+1] = 1;\n\t\t$i=$i+1;\n\t}\n\n\n\t$k = $k - $i;\n\t$i = 0;\n\twhile ($i < $n-1 && $i < $k)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\t$k = $k - $i;\n\t$i = 1;\n\twhile ($i < $k+1 && $i-$n < $n-1)\n\t{\n\t\t$matrix[$i][$i] = 0;\n\t\t$matrix[$i+1][$i-1] = 1;\n\t\t$matrix[$i-1][$i+1] = 1;\n\t\t$i=$i+1;\n\t}\n\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t\n}\n\n?>\n"}, {"source_code": " $n*$n) )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n}\nelse\n{\n\n\t$i = 0;\n\twhile ($i < $n && $i < $k)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\twhile ($i < $k && $i-$n < $n-1)\n\t{\n\t\t$matrix[$i-$n][$i-$n] = 0;\n\t\t$matrix[$i-$n+1][$i-$n] = 1;\n\t\t$matrix[$i-$n][$i-$n+1] = 1;\n\t\t$i=$i+1;\n\t}\n\n\t$k = $k - $i;\n\t$i = 0;\n\twhile ($i < $n && $i < $k)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t\n}\n\n?>"}, {"source_code": " $n && 1 == $k %2) || ($k > $n*$n) )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n}\nelse\n{\n\tif ($k > $n && 0 == $k %2)\n\t{\n\t\t$i = 0;\n\t\twhile ($i < $n && $i < $k)\n\t\t{\n\t\t\t$matrix[$i][$i] = 1;\n\t\t\t$i++;\n\t\t}\n\n\t\twhile ($i < $k)\n\t\t{\n\t\t\t$matrix[$i-$n+1][$i-$n] = 1;\n\t\t\t$matrix[$i-$n][$i-$n+1] = 1;\n\t\t\t$i=$i+2;\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor ($j=0; $j < $k; $j++)\n\t\t{ \n\t\t\t$matrix[$j][$j] = 1;\n\t\t}\n\t}\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t\n}\n\n?>\n"}, {"source_code": " ($n*($n-1)+1) )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n}\nelse\n{\n\t$i = 0;\n\twhile ($i < $k && $i < $n)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\t$k = $k - $i;\n\t$i = 0;\n\twhile ($i < $k && $i < $n-1)\n\t{\n\t\t$matrix[$i][$i] = 0;\n\t\t$matrix[$i+1][$i] = 1;\n\t\t$matrix[$i][$i+1] = 1;\n\t\t$i=$i+1;\n\t}\n\n\t$k = $k - $i;\n\t$i = 0;\n\twhile ($i < $k && $i < $n-1)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\t$aux = 0;\n\twhile (0 < $k && $aux < $n)\n\t{\n\t\t$k = $k - $i + $aux;\n\t\t$aux++;\n\t\t$i = $aux;\n\t\twhile ($i < $k+$aux && $i < $n-$aux)\n\t\t{\n\t\t\t$matrix[$i][$i] = 0;\n\t\t\t$matrix[$i+$aux][$i-$aux] = 1;\n\t\t\t$matrix[$i-$aux][$i+$aux] = 1;\n\t\t\t$i++;\n\t\t}\n\n\t\t$k = $k - $i + $aux;\n\t\t$i = $aux;\n\t\twhile ($i < $k+$aux && $i < $n-$aux)\n\t\t{\n\t\t\t$matrix[$i][$i] = 1;\n\t\t\t$i++;\n\t\t}\n\t}\n\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t\n}\n\n?>\n"}, {"source_code": " $n)\n{\n\techo -1;\n}\nelse\n{\n\tfor ($j=0; $j < $k; $j++)\n\t{ \n\t\t$matrix[$j][$j] = 1;\n\t}\n\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n}\n\n?>"}, {"source_code": " $n && ( (1 == $n %2 && 0 == $k %2) || (0 == $n %2 && 1 == $k %2) ) )\n{\n\techo -1;\n}\nelse\n{\n\n\tfor ($j=0; $j < $k; $j++)\n\t{ \n\t\t$matrix[$j][$j] = 1;\n\t}\n\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n}\n\n?>\n"}, {"source_code": " $n*$n) )\n{\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\techo -1;\n}\nelse\n{\n\n\t$i = 0;\n\twhile ($i < $n && $i < $k)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\twhile ($i < $k && $i-$n < $n-1)\n\t{\n\t\t$matrix[$i-$n][$i-$n] = 0;\n\t\t$matrix[$i-$n+1][$i-$n] = 1;\n\t\t$matrix[$i-$n][$i-$n+1] = 1;\n\t\t$i=$i+1;\n\t}\n\n\n\t$k = $k - $i;\n\t$i = 0;\n\twhile ($i < $n-1 && $i < $k)\n\t{\n\t\t$matrix[$i][$i] = 1;\n\t\t$i++;\n\t}\n\n\n\t// Output\n\t// If the answer exists then output resulting matrix. Otherwise output -1.\n\tfor ($i=0; $i < $n; $i++)\n\t{ \n\t\tfor ($j=0; $j < $n; $j++)\n\t\t{ \n\t\t\techo \"{$matrix[$i][$j]} \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n\n\t\n}\n\n?>"}, {"source_code": " $c)\n{\n print \"-1\";\n}\nelse\n{\n $d = array();\n for($x = 0; $x < $a; $x++)\n {\n $e = array_fill(0, $a, 0);\n $d[$x] = $e;\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b == 0)\n {\n break;\n }\n elseif($b == 1)\n {\n $b--;\n $d[$x][$x] = 1;\n break;\n }\n elseif($b == 2)\n {\n $b -= 2;\n $d[$x][$x] = 1;\n $d[$x + 1][$x + 1] = 1;\n break;\n }\n elseif($b > 2)\n {\n $b--;\n $d[$x][$x] = 1;\n $f = ($a - $x - 1) * 2;\n if($b >= $f)\n {\n $b -= $f;\n for($y = $x + 1; $y < $a; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x + 1; $y < $a; $y++)\n {\n $d[$y][$x] = 1;\n }\n }\n else\n {\n $g = $b % 2;\n if($g == 0)\n {\n $h = $b / 2;\n $b -= $f;\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x + 1; $y < $x + $h + 1; $y++)\n {\n $d[$y][$x] = 1;\n }\n }\n else\n {\n $h = ($b - 1) / 2;\n $b = 0;\n for($y = $x; $y < $x + $h + 1; $y++)\n {\n $d[$x][$y] = 1;\n }\n for($y = $x; $y < $x + $h + 1; $y++)\n {\n $d[$y][$x] = 1;\n }\n $d[$x + 1][$y - 1] = 1;\n }\n }\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n print implode(\" \", $d[$x]) . \"\\n\";\n }\n}\n?>"}], "src_uid": "d5a328cfa1e4d26ff007813ad02991ac"} {"source_code": " $e)\n {\n $f = $b[$x] - $e;\n $b[$x] = $e;\n $b[$x + 1] += $f;\n }\n}\n$g = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] == $e)\n {\n $g++;\n }\n}\nprint $g;\n?>", "positive_code": [{"source_code": "\n\n\n"}], "negative_code": [{"source_code": " $n) print $n; else print $k;\n"}], "src_uid": "71cead8cf45126902c518c9ce6e5e186"} {"source_code": " $h[$j + 1]) { $m = 1; break; }\r\n }\r\n \r\n if ($n - 1 > $h[$n - 1]) { $m = 1; }\r\n \r\n if ($m == 0) { echo 'YES'.PHP_EOL; }\r\n else { echo 'NO'.PHP_EOL; }\r\n} \r\n\r\n?>\r\n", "positive_code": [{"source_code": "= $i) {\r\n $iTemp = $aList[$i] - $i;\r\n $aList[$i] = $i;\r\n $aList[$i + 1] += $iTemp;\r\n }\r\n }\r\n //echo implode(\" \", $aList). \"\\n\";\r\n for ($i = 0; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] >= $aList[$i + 1]) {\r\n $bFlag = false;\r\n break;\r\n }\r\n }\r\n\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n\r\n}\r\n"}, {"source_code": " $j)\r\n {\r\n $x[$j + 1] += ($x[$j]-$j);\r\n $x[$j] = $j;\r\n if($j == (sizeof($x) - 2))\r\n {\r\n $sum = ($x[$j + 1]-$j);\r\n }\r\n }\r\n\r\n }\r\n for ($j = 0; $j < sizeof($x) -1; $j++) {\r\n\r\n if($x[$j] >= $x[$j+1])\r\n {\r\n $flag= true;\r\n break;\r\n }\r\n }\r\n echo ($flag == true) ? 'No' : 'Yes';\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": ""}, {"source_code": " $y)\r\n {\r\n $c[$y + 1] += $c[$y] - $y;\r\n $c[$y] = $y;\r\n }\r\n }\r\n $d = 0;\r\n for($y = 0; $y < $b - 1; $y++)\r\n {\r\n if($c[$y] >= $c[$y + 1])\r\n {\r\n $d = 1;\r\n break;\r\n }\r\n }\r\n if($d == 0)\r\n {\r\n print \"YES\\n\";\r\n }\r\n else\r\n {\r\n print \"NO\\n\";\r\n }\r\n}\r\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 0) {\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": "= 0) {\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": "= 0) {\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": "= 0) {\r\n echo 'YES' . \"\\n\";\r\n } else {\r\n echo 'NO' . \"\\n\";\r\n }\r\n }\r\n \r\n?>"}, {"source_code": "= 0) {\r\n echo 'YES' . \"\\n\";\r\n } else {\r\n echo 'NO' . \"\\n\";\r\n }\r\n }\r\n }\r\n \r\n?>"}, {"source_code": "= $h[$j+1]) {\r\n echo 'NO' . \"\\n\";\r\n $b = false;\r\n break;\r\n }\r\n }\r\n if (array_sum($h) < (($n*($n+1)/2) - $n)) {\r\n echo 'NO' . \"\\n\";\r\n $b = false;\r\n } \r\n \r\n if ($b) {\r\n echo 'YES' . \"\\n\";\r\n }\r\n }\r\n }\r\n \r\n?>"}, {"source_code": "= (($n*($n+1)/2) - $n)) {\r\n echo 'YES' . \"\\n\";\r\n } else {\r\n echo 'NO' . \"\\n\";\r\n }\r\n }\r\n }\r\n \r\n?>"}, {"source_code": "= (($n*($n+1)/2) - $n)) {\r\n echo 'YES' . \"\\n\";\r\n } else {\r\n echo 'NO' . \"\\n\";\r\n }\r\n }\r\n \r\n?>"}, {"source_code": "= $i - 1) {\r\n $iTemp = $aList[$i] - $i;\r\n $aList[$i] = $i;\r\n $aList[$i + 1] += $iTemp;\r\n }\r\n }\r\n //echo implode(\" \", $aList). \"\\n\";\r\n for ($i = 0; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] >= $aList[$i + 1]) {\r\n $bFlag = false;\r\n break;\r\n }\r\n }\r\n\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n\r\n}\r\n"}, {"source_code": "= $i) {\r\n $iTemp = $aList[$i] - $i;\r\n $aList[$i] = $i;\r\n $aList[$i + 1] = bcadd($aList[$i + 1], $iTemp);\r\n }\r\n }\r\n for ($i = 0; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] >= $aList[$i + 1]) {\r\n $bFlag = false;\r\n break;\r\n }\r\n }\r\n if (count($aList) == 1) {\r\n echo \"NO\\n\";\r\n } else {\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n\r\n}\r\n"}, {"source_code": "= $i) {\r\n $iTemp = $aList[$i] - $i;\r\n $aList[$i] = $i;\r\n $aList[$i + 1] += $iTemp;\r\n }\r\n }\r\n for ($i = 0; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] >= $aList[$i + 1]) {\r\n $bFlag = false;\r\n break;\r\n }\r\n }\r\n if (count($aList) == 1) {\r\n echo \"NO\\n\";\r\n } else {\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n\r\n}\r\n"}, {"source_code": "= $i) {\r\n $iTemp = $aList[$i] - $i;\r\n $aList[$i] = $i;\r\n $aList[$i + 1] += $iTemp;\r\n }\r\n }\r\n for ($i = 0; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] >= $aList[$i + 1]) {\r\n $bFlag = false;\r\n break;\r\n }\r\n }\r\n if (array_sum($aList) == 0) {\r\n echo \"NO\\n\";\r\n } else {\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n }\r\n \r\n}\r\n"}, {"source_code": "= $i) {\r\n $iTemp = $aList[$i] - $i;\r\n $aList[$i] = $i;\r\n $aList[$i + 1] += $iTemp;\r\n } else {\r\n break;\r\n }\r\n }\r\n if ($bFlag) {\r\n for ($i = 0; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] >= $aList[$i + 1]) {\r\n $bFlag = false;\r\n break;\r\n }\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n}\r\n"}, {"source_code": "= $i) {\r\n $iTemp = $aList[$i] - $i;\r\n $aList[$i] = $i;\r\n $aList[$i + 1] += $iTemp;\r\n }\r\n }\r\n for ($i = 0; $i < count($aList) - 1; $i++) {\r\n if ($aList[$i] >= $aList[$i + 1]) {\r\n $bFlag = false;\r\n break;\r\n }\r\n }\r\n if ($bFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n}\r\n"}, {"source_code": "= 1) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n}\r\n"}, {"source_code": "= $j) {\r\n $sum = $x[$j] - $j;\r\n }else {\r\n if($x[$j] + $sum >= $j)\r\n {\r\n $sum = $sum - $j;\r\n }else {\r\n $flag = true;\r\n break;\r\n }\r\n }\r\n }\r\n echo ($flag == true) ? 'No': 'Yes';\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": "= $numberSum)? 'Yes' : 'No';\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": "= ($numberSum - 2)) ? 'Yes' : 'No';\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": "= floor($numberSum/2)) ? 'Yes' : 'No';\r\n echo \"\\n\";\r\n}\r\n"}, {"source_code": "= floor($numberSum/2)) ? 'Yes' : 'No';\r\n}\r\n"}, {"source_code": " $h[$j + 1]) { $m = 1; break; }\r\n }\r\n \r\n if ($n - 1 > $h[$n - 1]) { $m = 1; }\r\n \r\n if ($m == 0) { echo 'YES'.PHP_EOL; }\r\n else { echo 'NO'.PHP_EOL; }\r\n} \r\n\r\n?>"}, {"source_code": "= $h[$j + 1]) {\r\n if ($h[$j] >= $j) {\r\n $k = $h[$j] - ($h[$j] - $j);\r\n $h[$j + 1] = $h[$j + 1] + ($h[$j] - $j); \r\n if ($j > $h[$j + 1]) { $m = 1; break; }\r\n } else { $m = 1; break; }\r\n } \r\n }\r\n if ($n - 1 > $h[$n - 1]) { $m = 1; }\r\n \r\n if ($m == 0) { echo 'YES'.PHP_EOL; }\r\n else { echo 'NO'.PHP_EOL; }\r\n} \r\n\r\n?>"}, {"source_code": "= $h[$j + 1]) {\r\n if ($h[$j] >= $j) {\r\n $k = $h[$j] - ($h[$j] - $j);\r\n $h[$j + 1] = $h[$j + 1] + ($h[$j] - $j); \r\n if ($k >= $h[$j + 1]) { echo 'NO'.PHP_EOL; $m = 1; break; }\r\n } else { echo 'NO'.PHP_EOL; $m = 1; break; }\r\n } \r\n }\r\n \r\n if ($m == 0) { echo 'YES'.PHP_EOL; }\r\n} \r\n\r\n?>\r\n"}, {"source_code": "= $h[$j + 1]) {\r\n if ($h[$j] >= $j) {\r\n $k = $h[$j] - ($h[$j] - $j);\r\n $h[$j + 1] = $h[$j + 1] + ($h[$j] - $j); \r\n if ($k <= $h[$j + 1]) { echo 'NO'.PHP_EOL; $m = 1; break; }\r\n } else { echo 'NO'.PHP_EOL; $m = 1; break; }\r\n } \r\n }\r\n \r\n if ($m == 0) { echo 'YES'.PHP_EOL; }\r\n} \r\n\r\n?>"}, {"source_code": "= $h[$j + 1]) {\r\n if ($h[$j] >= $j) {\r\n $k = $h[$j] - ($h[$j] - $j);\r\n $h[$j + 1] = $h[$j + 1] + ($h[$j] - $j); \r\n if ($k != $j) { echo 'NO'.PHP_EOL; $m = 1; break; }\r\n } else { echo 'NO'.PHP_EOL; $m = 1; break; }\r\n } \r\n }\r\n \r\n if ($m == 0) { echo 'YES'.PHP_EOL; }\r\n} \r\n\r\n?>"}, {"source_code": "= $n * ($n - 1) / 2 ? 'YES' : 'NO').PHP_EOL;\r\n}\r\n"}, {"source_code": "= $f)\r\n {\r\n print \"YES\\n\";\r\n }\r\n else\r\n {\r\n print \"NO\\n\";\r\n }\r\n}\r\n?>"}], "src_uid": "7a8c4ba98a77097faff625b94889b365"} {"source_code": " $m ? $total - $m : 0;\r\n IO::pr($ans);\r\n \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 "}, {"source_code": "= $walk[$i]) {\r\n $x = $x - $walk[$i];\r\n } elseif ($x < $walk[$i]) {\r\n\r\n $n += $walk[$i] - $x;\r\n $x = 0;\r\n } else {\r\n $n += $walk[$i];\r\n }\r\n }\r\n array_push($array, $n);\r\n}\r\nforeach ($array as $key => $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": "= $walk[$i]) {\r\n $x = $x - $walk[$i];\r\n } elseif ($x < $walk[$i]) {\r\n\r\n $n += $walk[$i] - $x;\r\n $x = 0;\r\n } else {\r\n $n += $walk[$i];\r\n }\r\n }\r\n array_push($array, $n);\r\n}\r\nforeach ($array as $key => $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": "= $walk[$i]) {\r\n $x = $x - $walk[$i];\r\n } elseif ($x < $walk[$i]) {\r\n\r\n $n += $walk[$i] - $x;\r\n $x = 0;\r\n } else {\r\n $n += $walk[$i];\r\n }\r\n }\r\n array_push($array, $n);\r\n}\r\nforeach ($array as $key => $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": "= $walk[$i]) {\r\n $x = $x - $walk[$i];\r\n } elseif ($x < $walk[$i]) {\r\n\r\n $n += $walk[$i] - $x;\r\n $x = 0;\r\n } else {\r\n $n += $walk[$i];\r\n }\r\n }\r\n array_push($array, $n);\r\n}\r\nforeach ($array as $key => $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": "= $walk[$i]) {\r\n $x = $x - $walk[$i];\r\n } elseif ($x < $walk[$i]) {\r\n\r\n $n += $walk[$i] - $x;\r\n $x = 0;\r\n } else {\r\n $n += $walk[$i];\r\n }\r\n }\r\n array_push($array, $t);\r\n}\r\nforeach ($array as $key => $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": "= $walk[$i]) {\r\n $x = $x - $walk[$i];\r\n } elseif ($x < $walk[$i]) {\r\n\r\n $n += $walk[$i] - $x;\r\n $x = 0;\r\n } else {\r\n $n += $walk[$i];\r\n }\r\n }\r\n echo $n;\r\n}\r\n\r\n$end = readline();\r\n\r\n?>"}, {"source_code": "= $walk[$i]) {\r\n $x = $x - $walk[$i];\r\n } elseif ($x < $walk[$i]) {\r\n\r\n $t += $walk[$i] - $x;\r\n $x = 0;\r\n } else {\r\n $t += $walk[$i];\r\n }\r\n }\r\n echo $t;\r\n}\r\n\r\n$end = readline();\r\n?>"}], "src_uid": "7276d7e3a4b594dc64c1ba56fb1a3628"} {"source_code": "= 1; $x--)\n{\n $c[$d] = $x;\n $d++;\n}\nprint implode(\" \", $c);\n?>", "positive_code": [{"source_code": "= 0; $i--)\n\tprintf(\"%d \",$down[$i]);\n\n?>"}], "negative_code": [{"source_code": "= 0; $i--)\n\tprintf(\"%d \",$down[$i]);\n?>"}, {"source_code": " $b){\n\t\t\t$down[] = $i;\n\t\t}else{\n\t\t\t$up[] = $i;\n\t\t}\n\t}else{\n\t\tif ($a > $b){\n\t\t\t$up[] = $i;\n\t\t}else{\n\t\t\t$down[] = $i;\n\t\t}\n\t}\n}\nfor ($i = 0; $i < count($up); $i++)\n\tprintf(\"%d \",$up[$i]);\nfor ($i = count($down)-1; $i >= 0; $i--)\n\tprintf(\"%d \",$down[$i]);\n\n?>"}], "src_uid": "add2285f3f710eb41185d6a83e44b37a"} {"source_code": " 0) {\r\n $ans += $a[$i];\r\n $z = 1;\r\n } else {\r\n if($z > 0) {\r\n $ans += 1; \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}"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " $b){\n\t\t$sum = ($a+$b)*(floor($s/2) == 0 ? 1 : floor($s/2));\n\t}else{\n\t\t$sum = $a*$s;\n\t}*/\n\t\n\tif($b/$a > 2){\n\t\t$sum = $a*$s; \n\t}else{\n\t\tif($b/$a >= 1){\n\t\t\t$sum = ($a+$b)*(floor($s/2) == 0 ? 1 : floor($s/2));\n\t\t}else{\n\t\t\t$sum = $b*floor($s/2) + ($s - floor($s/2) == 0 ? 0 : $a);\n\t\t}\n\t}\n\t\n\t$ans .= $sum.\"\\n\";\n}\n\nfwrite(STDOUT, $ans);\n\n?>"}, {"source_code": " $b){\n\t\t$sum = ($a+$b)*(floor($s/2) == 0 ? 1 : floor($s/2));\n\t}else{\n\t\t$sum = $a*$s;\n\t}*/\n\t\n\tif($b/$a > 2){\n\t\t$sum = bcmul($a, $s); \n\t}else{\n\t\tif($b/$a >= 1){\n\t\t\t$sum = bcmul(($a+$b), (bcdiv($s, 2, 0) == 0 ? 1 : bcdiv($s, 2, 0)));\n\t\t}else{\n\t\t\t$sum = bcadd(bcmul($b, bcdiv($s, 2, 0)), ($s - bcdiv($s, 2, 0) == 0 ? 0 : $a));\n\t\t}\n\t}\n\t\n\t$ans .= $sum.\"\\n\";\n}\n\nfwrite(STDOUT, $ans);\n\n?>"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "beab56c5f7d2996d447320a62b0963c2"} {"source_code": "", "positive_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 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$a = $ir->readArrayOfInt($n, 1);\n\n$cnt = 0;\nfor ($i=2; $i<$n; $i++) {\n\tif ($a[$i]==0 && $a[$i-1] && $a[$i+1]) {\n\t\t$a[$i+1] = 0;\n\t\t$cnt ++;\n\t}\n}\n\necho $cnt;\n"}], "negative_code": [], "src_uid": "ea62b6f68d25fb17aba8932af8377db0"} {"source_code": " $i)\n {\n if($g == $c - 1)\n {\n $j = 1;\n break;\n }\n else\n {\n $g++;\n $i += $d[$g];\n }\n }\n }\n elseif($g == $c - 1)\n {\n if($h < $i)\n {\n $f++;\n $h += $b[$f];\n }\n elseif($h == $i)\n {\n if($f == $a - 1)\n {\n $e++;\n }\n else\n {\n $j = 1;\n }\n break;\n }\n elseif($h > $i)\n {\n if($f == $a - 1)\n {\n $j = 1;\n break;\n }\n else\n {\n $j = 1;\n break;\n }\n }\n }\n else\n {\n if($h < $i)\n {\n $f++;\n $h += $b[$f];\n }\n elseif($h == $i)\n {\n $e++;\n $f++;\n $g++;\n $h = $b[$f];\n $i = $d[$g];\n }\n elseif($h > $i)\n {\n $g++;\n $i += $d[$g];\n }\n }\n}\nif($j == 0)\n{\n print $e;\n}\nelse\n{\n print \"-1\";\n}\n?>", "positive_code": [{"source_code": " $i)\n {\n if($g == $c - 1)\n {\n $j = 1;\n break;\n }\n else\n {\n $g++;\n $i += $d[$g];\n }\n }\n }\n elseif($g == $c - 1)\n {\n if($h < $i)\n {\n if($f == $a - 1)\n {\n $j = 1;\n break;\n }\n else\n {\n $f++;\n $h += $b[$f];\n }\n }\n elseif($h == $i)\n {\n if($f == $a - 1)\n {\n $e++;\n }\n else\n {\n $j = 1;\n }\n break;\n }\n elseif($h > $i)\n {\n $j = 1;\n break;\n }\n }\n else\n {\n if($h < $i)\n {\n $f++;\n $h += $b[$f];\n }\n elseif($h == $i)\n {\n $e++;\n $f++;\n $g++;\n $h = $b[$f];\n $i = $d[$g];\n }\n elseif($h > $i)\n {\n $g++;\n $i += $d[$g];\n }\n }\n}\nif($j == 0)\n{\n print $e;\n}\nelse\n{\n print \"-1\";\n}\n?>"}], "negative_code": [{"source_code": " $i)\n {\n $g++;\n $i += $d[$g];\n }\n }\n elseif($g == $c - 1)\n {\n if($h < $i)\n {\n $f++;\n $h += $b[$f];\n }\n elseif($h == $i)\n {\n $e++;\n break;\n }\n elseif($h > $i)\n {\n $j = 1;\n break;\n }\n }\n else\n {\n if($h < $i)\n {\n $f++;\n $h += $b[$f];\n }\n elseif($h == $i)\n {\n $e++;\n $f++;\n $g++;\n $h = $b[$f];\n $i = $d[$g];\n }\n elseif($h > $i)\n {\n $g++;\n $i += $d[$g];\n }\n }\n}\nif($j == 0)\n{\n print $e;\n}\nelse\n{\n print \"-1\";\n}\n?>"}], "src_uid": "8c36ab13ca1a4155cf97d0803aba11a3"} {"source_code": " 0,\n\t\t'right' => 0,\n\t\t'up' => 0,\n\t\t'down' => 0,\n\t);\n\n\tfor($j=0; $j<$col; $j++)\n\t\tif ($i != $j) {\n\t\t\t$x_s = $data[$j][0];\n\t\t\t$y_s = $data[$j][1];\n\n\t\t\tif ($x > $x_s and $y == $y_s) $tochka['right']++;\n\t\t\telseif ($x < $x_s and $y == $y_s) $tochka['left']++;\n\t\t\telseif ($x == $x_s and $y > $y_s) $tochka['up']++;\n\t\t\telseif ($x == $x_s and $y < $y_s) $tochka['down']++;\n\t\t}\n\n\tif ($tochka['right'] and $tochka['left'] and $tochka['up'] and $tochka['down']) $result++;\n}\n\nprint $result;", "positive_code": [{"source_code": "$y[$i]) { $tmp++; break; }\n\tfor($j=0;$j<$n;$j++) if($x[$j]<$x[$i] && $y[$j]==$y[$i]) { $tmp++; break; }\n\tfor($j=0;$j<$n;$j++) if($x[$j]>$x[$i] && $y[$j]==$y[$i]) { $tmp++; break; }\n\t#echo \" \" . $tmp . \"\\n\";\n\tif($tmp == 4) $ans ++;\n}\necho $ans;\n\n?>"}, {"source_code": " (int)$coords[0] , \"y\" => (int)$coords[1]);\n}\n\n$result = 0;\nfor($i = 0 ; $i < count($list) ; $i++)\n{\n $flagTop = false;\n $flagRight = false;\n $flagBottom = false;\n $flagLeft = false;\n for($j = 0 ; $j < count($list) ; $j++)\n {\n if($i != $j)\n {\n if($list[$i][\"x\"] < $list[$j][\"x\"] && $list[$i][\"y\"] == $list[$j][\"y\"])\n {\n $flagRight = true;\n }\n if($list[$i][\"x\"] > $list[$j][\"x\"] && $list[$i][\"y\"] == $list[$j][\"y\"])\n {\n $flagLeft = true;\n }\n if($list[$i][\"x\"] == $list[$j][\"x\"] && $list[$i][\"y\"] > $list[$j][\"y\"])\n {\n $flagBottom = true;\n }\n if($list[$i][\"x\"] == $list[$j][\"x\"] && $list[$i][\"y\"] < $list[$j][\"y\"])\n {\n $flagTop = true;\n }\n }\n if($flagTop && $flagRight && $flagBottom && $flagLeft)\n {\n $result++;\n break;\n }\n }\n}\necho $result;\n?>"}, {"source_code": " $mas[$j][0] and $mas[$i][1] == $mas[$j][1])\n $right = true;\n if ($mas[$i][0] < $mas[$j][0] and $mas[$i][1] == $mas[$j][1])\n $left = true;\n if ($mas[$i][0] == $mas[$j][0] and $mas[$i][1] > $mas[$j][1])\n $top = true;\n if ($mas[$i][0] == $mas[$j][0] and $mas[$i][1] < $mas[$j][1])\n $down = true;\n if ($right === true && $left === true && $top === true && $down === true)\n {\n $k++;\n break;\n }\n }\n $right = $left = $top = $down = false;\n}\necho $k;\n\n\n?>"}, {"source_code": "$point1) {\n $l = false;\n $r = false;\n $t = false;\n $d = false;\n foreach($points as $j=>$point2) {\n if($point2[0] > $point1[0] && $point2[1] == $point1[1]) {\n $l = true;\n }\n if($point2[0] < $point1[0] && $point2[1] == $point1[1]) {\n $r = true;\n }\n if($point2[0] == $point1[0] && $point2[1] > $point1[1]) {\n $t = true;\n }\n if($point2[0] == $point1[0] && $point2[1] < $point1[1]) {\n $d = true;\n }\n\n if($l && $r && $t && $d) {\n $result++;\n break;\n }\n }\n}\n\n\n\n\n\necho $result;\n\n//file_put_contents(\"out.txt\", $result);\n?>\n"}, {"source_code": "$p[$i][0]&&$p[$j][1]==$p[$i][1]) $r=true;\n if($p[$j][0]<$p[$i][0]&&$p[$j][1]==$p[$i][1]) $l=true;\n if($p[$j][0]==$p[$i][0]&&$p[$j][1]>$p[$i][1]) $u=true;\n if($p[$j][0]==$p[$i][0]&&$p[$j][1]<$p[$i][1]) $d=true;\n }\n if($u&&$d&&$l&&$r) $res++;\n}\n\nprint $res;\n?>"}, {"source_code": "$a[$j][0][0] && $a[$i][0][1]===$a[$j][0][1]) $a[$i][1][0]=1;\n if($a[$i][0][0]<$a[$j][0][0] && $a[$i][0][1]===$a[$j][0][1]) $a[$i][1][1]=1;\n if($a[$i][0][0]===$a[$j][0][0] && $a[$i][0][1]>$a[$j][0][1]) $a[$i][1][2]=1;\n if($a[$i][0][0]===$a[$j][0][0] && $a[$i][0][1]<$a[$j][0][1]) $a[$i][1][3]=1;\n }\n}\n$sum=0;\nfor($i=0;$i<$n;$i++){\n if(array_search(0,$a[$i][1])===false) $sum++;\n}\necho $sum;"}, {"source_code": " $x && $y1 == $y) {\n $right = true;\n } else if ($x1 < $x && $y1 == $y) {\n $left = true;\n } else if ($x1 == $x && $y1 < $y) {\n $bottom = true;\n } else if ($x1 == $x && $y1 > $y) {\n $top = true;\n }\n \n if ($top && $bottom && $right && $left) {\n $count++;\n break;\n\n }\n \n\n }\n \n}\n\nfputs(STDOUT, $count);\n\n?>"}, {"source_code": " $e[$x])\n {\n $g = 1;\n }\n if($e[$y] < $e[$x])\n {\n $h = 1;\n }\n }\n if($e[$y] == $e[$x])\n {\n if($d[$y] > $d[$x])\n {\n $i = 1;\n }\n if($d[$y] < $d[$x])\n {\n $j = 1;\n }\n }\n }\n if(($g == 1) && ($h == 1) && ($i == 1) && ($j == 1))\n {\n $l++;\n }\n}\nprint $l;\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$inp_arr[$i][] = (int)$Scanner->Scan();\n\t\t$inp_arr[$i][] = (int)$Scanner->Scan();\n\t}\n\t\n\t$POINT = 0;\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$c_left = 0;\n\t\t$c_right = 0;\n\t\t$c_upper = 0;\n\t\t$c_lower = 0;\n\t\tfor ($j = 0; $j < $inp_N; $j++) {\n\t\t\tif ($inp_arr[$i][0] > $inp_arr[$j][0] && $inp_arr[$i][1] === $inp_arr[$j][1]) $c_left++;\n\t\t\telseif ($inp_arr[$i][0] < $inp_arr[$j][0] && $inp_arr[$i][1] === $inp_arr[$j][1]) $c_right++;\n\t\t\telseif ($inp_arr[$i][0] === $inp_arr[$j][0] && $inp_arr[$i][1] < $inp_arr[$j][1]) $c_upper++;\n\t\t\telseif ($inp_arr[$i][0] === $inp_arr[$j][0] && $inp_arr[$i][1] > $inp_arr[$j][1])$c_lower++;\n\t\t\tif ($c_left > 0 && $c_right > 0 && $c_upper > 0 && $c_lower > 0) break;\t\n\t\t}\n\t\tif ($c_left > 0 && $c_right > 0 && $c_upper > 0 && $c_lower > 0) $POINT++;\n\t\t//echo $POINT;\n\t}\t\n\tprint($POINT);\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": " $input[$a][1])) {\n $b = 1;\n }\n if (($to[0] > $input[$a][0]) and ($to[1] == $input[$a][1])) {\n $c = 1;\n }\n if (($to[0] < $input[$a][0]) and ($to[1] == $input[$a][1])) {\n $d = 1;\n }\n }\n if (($q == 1) and ($b == 1) and ($c == 1) and ($d == 1)) {\n $result++;\n }\n}\necho $result;\n?>"}, {"source_code": " $temp[0] && $point[1] == $temp[1])\n {\n $right = TRUE;\n }\n // \u0412\u0435\u0440\u0445\u043d\u0438\u0439 \u0441\u043e\u0441\u0435\u0434\n if ($point[0] == $temp[0] && $point[1] < $temp[1])\n {\n $top = TRUE;\n }\n // \u041d\u0438\u0436\u043d\u0438\u0439 \u0441\u043e\u0441\u0435\u0434\n if ($point[0] == $temp[0] && $point[1] > $temp[1])\n {\n $bottom = TRUE;\n }\n }\n if ($left and $right and $top and $bottom)\n {\n $count_main++;\n }\n }\n fputs(STDOUT, $count_main);\n?>"}], "negative_code": [{"source_code": " $b[$x]) && ($c[$y] == $c[$x]))\n {\n $f++;\n }\n if(($b[$y] < $b[$x]) && ($c[$y] == $c[$x]))\n {\n $g++;\n }\n if(($b[$y] == $b[$x]) && ($c[$y] > $c[$x]))\n {\n $h++;\n }\n if(($b[$y] == $b[$x]) && ($c[$y] < $c[$x]))\n {\n $i++;\n }\n }\n }\n $j = min($f, $g, $h, $i);\n if($j != 0)\n {\n $k = min($f, $g, $h, $i);\n $l += $k;\n }\n $f = 0;\n $g = 0;\n $h = 0;\n $i = 0;\n}\nprint $l;\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$inp_arr[$i][] = (int)$Scanner->Scan();\n\t\t$inp_arr[$i][] = (int)$Scanner->Scan();\n\t}\n\t\n\t$POINT = 0;\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tfor ($j = 0; $j < $inp_N; $j++) {\n\t\t\t$c_left = 0;\n\t\t\t$c_right = 0;\n\t\t\t$c_upper = 0;\n\t\t\t$c_lower = 0;\n\t\t\tif ($inp_arr[$i][0] > $inp_arr[$j][0] && $inp_arr[$i][1] === $inp_arr[$j][1]) $c_left++;\n\t\t\telseif ($inp_arr[$i][0] < $inp_arr[$j][0] && $inp_arr[$i][1] > $inp_arr[$j][1]) $c_right++;\n\t\t\telseif ($inp_arr[$i][0] === $inp_arr[$j][0] && $inp_arr[$i][1] < $inp_arr[$j][1]) $c_upper++;\n\t\t\telseif ($inp_arr[$i][0] === $inp_arr[$j][0] && $inp_arr[$i][1] > $inp_arr[$j][1])$c_lower++;\n\t\t\tif ($c_left > 0 && $c_right > 0 && $c_upper > 0 && $c_lower > 0) break;\n\t\t}\n\t\tif ($c_left > 0 && $c_right > 0 && $c_upper > 0 && $c_lower > 0) $POINT++;\n\t}\t\n\tprintf(\"%d\", $POINT);\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\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$inp_arr[$i][] = (int)$Scanner->Scan();\n\t\t$inp_arr[$i][] = (int)$Scanner->Scan();\n\t}\n\t\n\t$POINT = 0;\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\tfor ($j = 0; $j < $inp_N; $j++) {\n\t\t\t$c_left = 0;\n\t\t\t$c_right = 0;\n\t\t\t$c_upper = 0;\n\t\t\t$c_lower = 0;\n\t\t\tif ($inp_arr[$i][0] > $inp_arr[$j][0] && $inp_arr[$i][1] === $inp_arr[$j][1]) $c_left++;\n\t\t\telseif ($inp_arr[$i][0] < $inp_arr[$j][0] && $inp_arr[$i][1] === $inp_arr[$j][1]) $c_right++;\n\t\t\telseif ($inp_arr[$i][0] === $inp_arr[$j][0] && $inp_arr[$i][1] < $inp_arr[$j][1]) $c_upper++;\n\t\t\telseif ($inp_arr[$i][0] === $inp_arr[$j][0] && $inp_arr[$i][1] > $inp_arr[$j][1])$c_lower++;\n\t\t\tif ($c_left > 0 && $c_right > 0 && $c_upper > 0 && $c_lower > 0) break;\n\t\t}\n\t\tif ($c_left > 0 && $c_right > 0 && $c_upper > 0 && $c_lower > 0) $POINT++;\n\t}\t\n\tprintf(\"%d\", $POINT);\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": " $input[$a][1])) {\n $b = 1;\n }\n if (($to[0] > $input[$a][0]) and ($to[1] == $input[$a][1])) {\n $c = 1;\n }\n if (($to[0] < $input[$a][0]) and ($to[1] == $input[$a][1])) {\n $d = 1;\n }\n }\n if (($q == 1) and ($b == 1) and ($c == 1) and ($d == 1)) {\n $result++;\n }\n}\necho $result;\n?>"}, {"source_code": " $input[$a][1])) {\n $b = 1;\n }\n if (($to[0] > $input[$a][0]) and ($to[1] == $input[$a][1])) {\n $c = 1;\n }\n if (($to[0] < $input[$a][0]) and ($to[1] == $input[$a][1])) {\n $d = 1;\n }\n }\n if (($q == 1) and ($b == 1) and ($c == 1) and ($d == 1)) {\n $result++;\n }\n}\necho $result;\n?>"}, {"source_code": " $input[$i][1])) {\n $b = 1;\n }\n if (($to[0] > $input[$i][0]) and ($to[1] == $input[$i][1])) {\n $c = 1;\n }\n if (($to[0] < $input[$i][0]) and ($to[1] == $input[$i][1])) {\n $d = 1;\n }\n if (($a == 1) and ($b == 1) and ($c == 1) and ($d == 1)) {\n $result++;\n }\n }\n}\necho $result;\n?>"}, {"source_code": " $yy) $lw[$xx] = $yy;\n\t}\n\tif($left[$yy] == -1) $left[$yy] = $right[$yy] = $xx;\n\telse {\n\t\tif($left[$yy] > $xx) $left[$yy] = $xx;\n\t\tif($right[$yy] < $xx) $right[$yy] = $xx;\n\t}\n}\n$ans = 0;\nfor($i=0;$i<$n;$i++) {\n\t$xx = $x[$i];\n\t$yy = $y[$i];\n\tif($high[$xx] > $yy && $low[$xx] < $yy && $left[$yy] < $xx && $right[$yy] > $xx)\n\t\t$ans ++;\n}\necho $ans;\n\n?>"}, {"source_code": " $x && $y1 == $y) {\n $right = true;\n } elseif ($x1 < $x && $y1 == $y) {\n $left = true;\n } elseif ($x1 == $x && $y1 < $y) {\n $bottom = true;\n } elseif ($x1 == $x && $y1 > $y) {\n $top = true;\n }\n \n if ($top && $bottom && $right && $left) {\n $count++;\n $top = false;\n $bottom = false;\n $right = false;\n $left = false;\n break;\n }\n \n\n }\n}\n\nfputs(STDOUT, $count);\n\n?>"}, {"source_code": " $x && $y1 == $y) {\n $right = true;\n } else if ($x1 < $x && $y1 == $y) {\n $left = true;\n } else if ($x1 == $x && $y1 < $y) {\n $bottom = true;\n } else if ($x1 == $x && $y1 > $y) {\n $top = true;\n }\n \n if ($top && $bottom && $right && $left) {\n $count++;\n $top = false;\n $bottom = false;\n $right = false;\n $left = false;\n \n break;\n }\n \n\n }\n \n}\n\nfputs(STDOUT, $count);\n\n?>"}], "src_uid": "594e64eef7acd055d59f37710edda201"} {"source_code": "", "positive_code": [{"source_code": "= $baskets) {\n\t$res .= $str;\n\t$balls -= $baskets;\n}\n$strs = explode(\"\\n\", $str);\nfor ($x = 0; $x < $balls; $x++) {\n\t$res .= $strs[$x] . \"\\n\";\n}\nreturn substr($res, 0, strlen($res) - 1);\n}\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}, {"source_code": "in();\n\t$m = (int)$Input->in();\n\n\t$r = $m % 2;\n\n\tif ($r === 0) {\n\n\t\t$first = intval($m / 2);\n\t\t$basket = $first;\n\t\t$sum = 2 * $first + 1;\n\n\t\tfor ($i = 0; $i < $n; $i++)\n\t\t{\n\t\t\tif ($i % 2 === 0)\n\t\t\t{\n\t\t\t\tprint($basket);\n\n\t\t\t} else {\n\n\t\t\t\tprint($sum - $basket);\n\n\t\t\t\tif ($sum - $basket === $m) $basket = $first;\n\t\t\t\telse $basket -= 1;\n\t\t\t}\n\n\t\t\tif ($i != $n - 1) print(\"\\n\");\n\t\t}\n\n\t} else {\n\n\t\t$first = intval($m / 2) + 1;\n\t\t$basket = $first;\n\t\t$sum = 2 * $first;\n\t\t$flag = 1;\n\t\t\n\t\tfor ($i = 0; $i < $n; $i++)\n\t\t{\n\t\t\tif ($flag === 1)\n\t\t\t{\n\t\t\t\tprint($sum - $basket);\n\n\t\t\t\tif ($sum - $basket === $m) $basket = $first;\n\t\t\t\telse {\n\t\t\t\t\t$basket -= 1;\n\t\t\t\t\t$flag = 0;\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tprint($basket);\n\t\t\t\t$flag = 1;\n\t\t\t}\n\n\t\t\tif ($i != $n - 1) print(\"\\n\");\n\t\t}\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": ""}, {"source_code": "in();\n\t$m = (int)$Input->in();\n\n\t$baskets = array_fill(1, $m, 0);\n\n\tfor ($i = 0; $i < $n; $i++)\n\t{\n\t\t$min_ball = min($baskets);\n\t\t$min_middle = 10E5 + 1;\n\t\t$pos = -1;\n\t\t\n\t\tfor ($j = 1; $j <= $m; $j++)\n\t\t{\n\t\t\tif ($baskets[$j] === $min_ball)\n\t\t\t{\n\t\t\t\tif (abs(intval(($m + 1) / 2)) - $j < $min_middle)\n\t\t\t\t{\n\t\t\t\t\t$pos = $j;\n\t\t\t\t\t$min_middle = abs(intval(($m + 1) / 2)) - $j;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$baskets[$pos]++;\n\n\t\tprint($pos);\n\n\t\tif ($i !== $n -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?>"}, {"source_code": "in();\n\t$m = (int)$Input->in();\n\n\t$r = $m % 2;\n\n\tif ($r === 0) {\n\n\t\t$first = intval($m / 2);\n\t\t$basket = $first;\n\t\t$sum = 2 * $first + 1;\n\n\t\tfor ($i = 0; $i < $n; $i++)\n\t\t{\n\t\t\tif ($i % 2 === 0)\n\t\t\t{\n\t\t\t\tprint($basket);\n\n\t\t\t} else {\n\n\t\t\t\tprint($sum - $basket);\n\n\t\t\t\tif ($sum - $basket === $m) $basket = $first;\n\t\t\t\telse $basket -= 1;\n\t\t\t}\n\n\t\t\tif ($i != $n - 1) print(\"\\n\");\n\t\t}\n\n\t} else {\n\n\t\t$first = intval($m / 2) + 1;\n\t\t$basket = $first;\n\t\t$sum = 2 * $first;\n\n\t\tfor ($i = 0; $i < $n; $i++)\n\t\t{\n\t\t\tif ($i % 2 === 0)\n\t\t\t{\n\t\t\t\tprint($sum - $basket);\n\n\t\t\t\tif ($sum - $basket === $m) $basket = $first;\n\t\t\t\telse $basket -= 1;\n\n\t\t\t} else {\n\n\t\t\t\tprint($basket);\n\t\t\t}\n\n\t\t\tif ($i != $n - 1) print(\"\\n\");\n\t\t}\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\t$m = (int)$Input->in();\n\n\t$baskets = array_fill(1, $m, 0);\n\n\tfor ($i = 0; $i < $n; $i++)\n\t{\n\t\t$min_ball = min($baskets);\n\t\t$min_middle = 10E5 + 1;\n\t\t$pos = -1;\n\t\t\n\t\tfor ($j = 1; $j <= $m; $j++)\n\t\t{\n\t\t\tif ($baskets[$j] === $min_ball)\n\t\t\t{\n\t\t\t\tif (abs(intval(($m + 1) / 2) - $j) < $min_middle)\n\t\t\t\t{\n\t\t\t\t\t$pos = $j;\n\t\t\t\t\t$min_middle = abs(intval(($m + 1) / 2) - $j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$baskets[$pos]++;\n\n\t\tprint($pos);\n\n\t\tif ($i !== $n -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?>"}, {"source_code": "in();\n\t$m = (int)$Input->in();\n\n\t$r = $m % 2;\n\n\tif ($r === 0) {\n\n\t\t$first = intval($m / 2);\n\t\t$basket = $first;\n\t\t$sum = 2 * $first + 1;\n\n\t\tfor ($i = 0; $i < $n; $i++)\n\t\t{\n\t\t\tif ($i % 2 === 0)\n\t\t\t{\n\t\t\t\tprint($basket);\n\n\t\t\t} else {\n\n\t\t\t\tprint($sum - $basket);\n\t\t\t\t$basket -= 1;\n\n\t\t\t\tif ($basket === 0) $basket = $first;\n\t\t\t}\n\n\t\t\tif ($i != $n - 1) print(\"\\n\");\n\t\t}\n\n\t} else {\n\n\t\t$first = intval($m / 2) + 1;\n\t\t$basket = $first;\n\t\t$sum = 2 * $first;\n\n\t\tfor ($i = 0; $i < $n; $i++)\n\t\t{\n\t\t\tif ($i % 2 === 0)\n\t\t\t{\n\t\t\t\tprint($sum - $basket);\n\t\t\t\t$basket -= 1;\n\n\t\t\t\tif ($basket === 0) $basket = $first;\n\n\t\t\t} else {\n\n\t\t\t\tprint($basket);\n\t\t\t}\n\n\t\t\tif ($i != $n - 1) print(\"\\n\");\n\t\t}\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": "= $baskets) {\n\t$res .= $str;\n\t$balls -= $baskets;\n}\n$strs = explode(\"\\n\", $str);\nfor ($x = 0; $x < $balls; $x++) {\n\t$res .= $strs[$x] . \"\\n\";\n}\nreturn substr($res, 0, strlen($res) - 1);\n}\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}], "src_uid": "907893a0a78a7444d26bdd793d9c7499"} {"source_code": "= 0)\n {\n array_push($ans, $numbers[$l], $numbers[$r]) ;\n \n $l -- ;\n $r ++ ;\n }\n \n echo implode(\" \", $ans) . \"\\n\" ;\n }\n?>", "positive_code": [{"source_code": ""}, {"source_code": " 0; $t--){\n $size = intval(fgets(STDIN));\n $array = explode(\" \", trim(fgets(STDIN)));\n sort($array);\n if($size % 2 == 0){\n for($i = $size / 2; $i < $size; $i++){\n\n echo $array[$i].\" \".$array[$size - $i - 1].\" \";\n }\n echo \"\\n\";\n }\n\n else{\n echo $array[floor($size / 2)].\" \";\n for($i = floor($size / 2) + 1; $i < $size; $i++){\n\n echo $array[$i].\" \".$array[$size - $i - 1].\" \";\n }\n echo \"\\n\";\n }\n\n}"}], "negative_code": [{"source_code": "= 0)\n {\n $tmp_a = $ans[$len - 1] - $numbers[$l] ;\n if($tmp_a < 0) $tmp_a = -$tmp_a ;\n }\n if($r < $n)\n {\n $tmp_b = $ans[$len - 1] - $numbers[$r] ;\n if($tmp_b < 0) $tmp_b = -$tmp_b ;\n }\n \n if($tmp_a < $tmp_b)\n {\n array_push($ans, $numbers[$l]) ;\n $l -- ;\n $len ++ ;\n }\n else \n {\n array_push($ans, $numbers[$r]) ;\n $r ++ ;\n $len ++ ;\n }\n }\n \n echo implode(\" \", $ans) . \"\\n\" ;\n }\n?>"}], "src_uid": "3c8bfd3199a9435cfbdee1daaacbd1b3"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "37b34461876af7f2e845417268b55ffa"} {"source_code": "", "positive_code": [{"source_code": "= 0 and $i < $n and $j >= 0 and $j < $m);\n}\n$line = array_map('intval', explode(' ', trim(fgets(STDIN))));\n$r = $line[0];\n$c = $line[1];\n$Grid = [];\nfor($i = 0 ; $i < $r ; $i++)\n $Grid[$i] = trim(fgets(STDIN));\n\nfor($i = 0 ; $i < $r ; $i++) {\n $flag = FALSE;\n for($j = 0 ; $j < $c ; $j++){\n if($Grid[$i][$j] == 'W') {\n if(valid($i + 1, $j, $r, $c)) {\n $flag |= ($Grid[$i + 1][$j] == 'S');\n if($Grid[$i + 1][$j] == '.') {\n $Grid[$i + 1][$j] = 'D';\n }\n }\n\n if(valid($i - 1, $j, $r, $c)) {\n $flag |= ($Grid[$i - 1][$j] == 'S');\n if($Grid[$i - 1][$j] == '.') {\n $Grid[$i - 1][$j] = 'D';\n }\n }\n\n if(valid($i, $j + 1, $r, $c)) {\n $flag |= ($Grid[$i][$j + 1] == 'S');\n if($Grid[$i][$j + 1] == '.') {\n $Grid[$i][$j + 1] = 'D';\n }\n }\n\n if(valid($i, $j - 1, $r, $c)) {\n $flag |= ($Grid[$i][$j - 1] == 'S');\n if($Grid[$i][$j - 1] == '.') {\n $Grid[$i][$j - 1] = 'D';\n }\n }\n }\n }\n if($flag) {\n echo \"No\\n\";\n exit;\n }\n}\necho \"Yes\\n\";\nfor($i = 0 ; $i < $r ; $i++) {\n echo $Grid[$i] . \"\\n\";\n}"}], "negative_code": [{"source_code": ""}, {"source_code": "= 0 and $i < $n and $j >= 0 and $j < $m);\n}\n$line = array_map('intval', explode(' ', trim(fgets(STDIN))));\n$r = $line[0];\n$c = $line[1];\n$Grid = [];\nfor($i = 0 ; $i < $r ; $i++)\n $Grid[$i] = trim(fgets(STDIN));\n\nfor($i = 0 ; $i < $r ; $i++) {\n for($j = 0 ; $j < $c ; $j++){\n if($Grid[$i][$j] == 'W') {\n if(valid($i + 1, $j, $r, $c)) {\n if($Grid[$i + 1][$j] == '.') {\n $Grid[$i + 1][$j] = 'D';\n }\n }\n\n if(valid($i - 1, $j, $r, $c)) {\n if($Grid[$i - 1][$j] == '.') {\n $Grid[$i - 1][$j] = 'D';\n }\n }\n\n if(valid($i, $j + 1, $r, $c)) {\n if($Grid[$i][$j + 1] == '.') {\n $Grid[$i][$j + 1] = 'D';\n }\n }\n\n if(valid($i, $j - 1, $r, $c)) {\n if($Grid[$i][$j - 1] == '.') {\n $Grid[$i][$j - 1] = 'D';\n }\n }\n }\n }\n}\n\nfor($i = 0 ; $i < $r ; $i++) {\n echo $Grid[$i] . \"\\n\";\n}"}], "src_uid": "f55c824d8db327e531499ced6c843102"} {"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$nums = [\r\n 1=> [1, 2, 4, 8, ],\r\n 2=> [16, 32, 64, ],\r\n 3=> [128, 256, 512, ],\r\n 4=> [1024, 2048, 4096, 8192, ],\r\n 5=> [16384, 32768, 65536, ],\r\n 6=> [131072, 262144, 524288, ],\r\n 7=> [1048576, 2097152, 4194304, 8388608, ],\r\n 8=> [16777216, 33554432, 67108864, ],\r\n 9=> [134217728, 268435456, 536870912, ],\r\n 10=> [1073741824, 2147483648, 4294967296, 8589934592, ],\r\n 11=> [17179869184, 34359738368, ],\r\n];\r\n$t = IO::str();\r\n$i = 1;\r\n\r\nwhile ($t--) {\r\n $mx = 0;\r\n $n = IO::str();\r\n $arr = $nums[strlen($n)];\r\n// IO::dd($arr);\r\n\r\n foreach ($arr as $r) {\r\n if ($r > $n) {\r\n break;\r\n } else {\r\n $mx = $r;\r\n }\r\n }\r\n\r\n if (!$mx) {\r\n $arr = $nums[strlen($n) - 1];\r\n foreach ($arr as $r) {\r\n if ($r > $n) {\r\n break;\r\n } else {\r\n $mx = $r;\r\n }\r\n }\r\n }\r\n\r\n $res[] = $mx - 1;\r\n}\r\n\r\nIO::res($res);\r\n\r\n\r\n\r\n\r\n//foreach ($arr as $k => $ar) {\r\n// echo $k . '=> [';\r\n// foreach ($ar as $a) {\r\n// echo $a . ', ';\r\n// }\r\n// echo '],' . \"\\n\";\r\n//}\r\n\r\n//1111101000\r\n//0111110100", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " 3) echo $b + 1;\r\n else echo $b;\r\n echo PHP_EOL;\r\n}\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 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$nums = [\r\n 1=> [1, 2, 4, 8, ],\r\n 2=> [16, 32, 64, ],\r\n 3=> [128, 256, 512, ],\r\n 4=> [1024, 2048, 4096, 8192, ],\r\n 5=> [16384, 32768, 65536, ],\r\n 6=> [131072, 262144, 524288, ],\r\n 7=> [1048576, 2097152, 4194304, 8388608, ],\r\n 8=> [16777216, 33554432, 67108864, ],\r\n 9=> [134217728, 268435456, 536870912, ],\r\n 10=> [1073741824, 2147483648, 4294967296, 8589934592, ],\r\n 11=> [17179869184, 34359738368, ],\r\n];\r\n$t = IO::str();\r\n$i = 1;\r\n\r\nwhile ($t--) {\r\n $mx = 0;\r\n $n = IO::str();\r\n $arr = $nums[strlen($n)];\r\n// IO::dd($arr);\r\n\r\n foreach ($arr as $r) {\r\n if ($r > $n) {\r\n break;\r\n } else {\r\n $mx = $r;\r\n }\r\n }\r\n\r\n if (!$mx) {\r\n $arr = $nums[strlen($n) - 1];\r\n foreach ($arr as $r) {\r\n if ($r > $n) {\r\n break;\r\n } else {\r\n $mx = $r;\r\n }\r\n }\r\n }\r\n\r\n $res[] = $mx - 1 > 0 ? $mx - 1 : 1;\r\n}\r\n\r\nIO::res($res);\r\n\r\n\r\n\r\n\r\n//foreach ($arr as $k => $ar) {\r\n// echo $k . '=> [';\r\n// foreach ($ar as $a) {\r\n// echo $a . ', ';\r\n// }\r\n// echo '],' . \"\\n\";\r\n//}\r\n\r\n//1111101000\r\n//0111110100"}, {"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$nums = [\r\n 1=> [2, 4, 8, ],\r\n 2=> [16, 32, 64, ],\r\n 3=> [128, 256, 512, ],\r\n 4=> [1024, 2048, 4096, 8192, ],\r\n 5=> [16384, 32768, 65536, ],\r\n 6=> [131072, 262144, 524288, ],\r\n 7=> [1048576, 2097152, 4194304, 8388608, ],\r\n 8=> [16777216, 33554432, 67108864, ],\r\n 9=> [134217728, 268435456, 536870912, ],\r\n 10=> [1073741824, 2147483648, 4294967296, 8589934592, ],\r\n 11=> [17179869184, 34359738368, ],\r\n];\r\n$t = IO::str();\r\n$i = 1;\r\n\r\nwhile ($t--) {\r\n $mx = 0;\r\n $n = IO::str();\r\n $arr = $nums[strlen($n)];\r\n// IO::dd($arr);\r\n\r\n foreach ($arr as $r) {\r\n if ($r > $n) {\r\n break;\r\n } else {\r\n $mx = $r;\r\n }\r\n }\r\n\r\n if (!$mx) {\r\n $arr = $nums[strlen($n) - 1];\r\n foreach ($arr as $r) {\r\n if ($r > $n) {\r\n break;\r\n } else {\r\n $mx = $r;\r\n }\r\n }\r\n }\r\n\r\n $res[] = $mx - 1;\r\n}\r\n\r\nIO::res($res);\r\n\r\n\r\n\r\n\r\n//foreach ($arr as $k => $ar) {\r\n// echo $k . '=> [';\r\n// foreach ($ar as $a) {\r\n// echo $a . ', ';\r\n// }\r\n// echo '],' . \"\\n\";\r\n//}\r\n\r\n//1111101000\r\n//0111110100"}], "src_uid": "9b4a8bc76d634935f6a1438e8a93a781"} {"source_code": "in();\n\t$M = (int)$Input->in();\n\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$temp = $Input->in();\n\t\t$len = strlen($temp);\n\t\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($temp[$j] === \"*\") {\n\t\t\t\t$posX[] = $i;\n\t\t\t\t$posY[] = $j;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < count($posX) - 1; $i++) {\n\t\tif ($posX[$i]!== $posX[$i + 1] && $posY[$i] !== $posY[$i + 1] && $flag !== 1) {\n\t\t\t$dia_pos[] = $i;\n\t\t\t$dia_pos[] = $i + 1;\n\t\t\t$flag = 1;\n\t\t}\n\t}\n\t\n\tif (count($dia_pos) !== 2) {\n\t\t$no_dia_pos = 1;\n\t\t$dia_pos[] = 0;\n\t\t$dia_pos[] = 2;\n\t} else {\n\t\t$no_dia_pos = 3 - array_sum($dia_pos);\n\t}\n\t$ans[0] = $posX[$dia_pos[0]] + $posX[$dia_pos[1]] - $posX[$no_dia_pos] + 1;\n\t$ans[1] = $posY[$dia_pos[0]] + $posY[$dia_pos[1]] - $posY[$no_dia_pos] + 1;\n\tprint($ans[0]. \" \". $ans[1]);\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\n\t\t\tif (!feof($this->handle)) $contents = stream_get_contents($this->handle);\n\t\t} else $contents = stream_get_contents(STDIN);\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": ""}, {"source_code": ""}], "negative_code": [{"source_code": "in();\n\t$M = (int)$Input->in();\n\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$temp = $Input->in();\n\t\t$len = strlen($temp);\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($temp[$j] === \"*\") $pos[] = $i. $j;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < count($pos); $i++) {\n\t\tif ($pos[$i][0] !== $pos[$i + 1][0] && $pos[$i][1] !== $pos[$i + 1][1] && $flag !== 1) {\n\t\t\t$dia_pos[] = $i;\n\t\t\t$dia_pos[] = $i + 1;\n\t\t\t$flag = 1;\n\t\t}\n\t}\n\t\n\tif (count($dia_pos) !== 2) {\n\t\t$no_dia_pos = 1;\n\t\t$dia_pos[] = 0;\n\t\t$dia_pos[] = 2;\n\t} else {\n\t\t$no_dia_pos = 3 - array_sum($dia_pos);\n\t}\n\t$ans[0] = $pos[$dia_pos[0]][0] + $pos[$dia_pos[1]][0] - $pos[$no_dia_pos][0] + 1;\n\t$ans[1] = $pos[$dia_pos[0]][1] + $pos[$dia_pos[1]][1] - $pos[$no_dia_pos][1] + 1;\n\tprint($ans[0]. \" \". $ans[1]);\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\n\t\t\tif (!feof($this->handle)) $contents = stream_get_contents($this->handle);\n\t\t} else $contents = stream_get_contents(STDIN);\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$M = (int)$Input->in();\n\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$temp = $Input->in();\n\t\t$len = strlen($temp);\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($temp[$j] === \"*\") $pos[] = $i. $j;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < count($pos); $i++) {\n\t\tif ($pos[$i][0] !== $pos[$i + 1][0] && $pos[$i][1] !== $posos[$i + 1][1] && $flag !== 1) {\n\t\t\t$dia_pos[] = $i;\n\t\t\t$dia_pos[] = $i + 1;\n\t\t\t$flag = 1;\n\t\t}\n\t}\n\t\n\tif (count($dia_pos) !== 2) {\n\t\t$no_dia_pos = 1;\n\t\t$dia_pos[] = 0;\n\t\t$dia_pos[] = 2;\n\t} else {\n\t\t$no_dia_pos = 3 - array_sum($dia_pos);\n\t}\n\t$ans[0] = $pos[$dia_pos[0]][0] + $pos[$dia_pos[1]][0] - $pos[$no_dia_pos][0] + 1;\n\t$ans[1] = $pos[$dia_pos[0]][1] + $pos[$dia_pos[1]][1] - $pos[$no_dia_pos][1] + 1;\n\tprint(implode($ans). \" \");\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\n\t\t\tif (!feof($this->handle)) $contents = stream_get_contents($this->handle);\n\t\t} else $contents = stream_get_contents(STDIN);\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$M = (int)$Input->in();\n\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$temp = $Input->in();\n\t\t$len = strlen($temp);\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($temp[$j] === \"*\") $pos[] = $i. $j;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < count($pos); $i++) {\n\t\tif ($pos[$i][0] !== $pos[$i + 1][0] && $pos[$i][1] !== $posos[$i + 1][1] && $flag !== 1) {\n\t\t\t$dia_pos[] = $i;\n\t\t\t$dia_pos[] = $i + 1;\n\t\t\t$flag = 1;\n\t\t}\n\t}\n\t\n\tif (count($dia_pos) !== 2) {\n\t\t$no_dia_pos = 1;\n\t\t$dia_pos[] = 0;\n\t\t$dia_pos[] = 2;\n\t} else {\n\t\t$no_dia_pos = 3 - array_sum($dia_pos);\n\t}\n\t$ans[0] = $pos[$dia_pos[0]][0] + $pos[$dia_pos[1]][0] - $pos[$no_dia_pos][0] + 1;\n\t$ans[1] = $pos[$dia_pos[0]][1] + $pos[$dia_pos[1]][1] - $pos[$no_dia_pos][1] + 1;\n\tprint($ans[0]. \" \". $ans[1]);\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\n\t\t\tif (!feof($this->handle)) $contents = stream_get_contents($this->handle);\n\t\t} else $contents = stream_get_contents(STDIN);\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$M = (int)$Input->in();\n\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$temp = $Input->in();\n\t\t$len = strlen($temp);\n\t\tfor ($j = 0; $j < $len; $j++) {\n\t\t\tif ($temp[$j] === \"*\") $pos[] = $i. $j;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < count($pos) - 1; $i++) {\n\t\tif ($pos[$i][0] !== $pos[$i + 1][0] && $pos[$i][1] !== $pos[$i + 1][1] && $flag !== 1) {\n\t\t\t$dia_pos[] = $i;\n\t\t\t$dia_pos[] = $i + 1;\n\t\t\t$flag = 1;\n\t\t}\n\t}\n\t\n\tif (count($dia_pos) !== 2) {\n\t\t$no_dia_pos = 1;\n\t\t$dia_pos[] = 0;\n\t\t$dia_pos[] = 2;\n\t} else {\n\t\t$no_dia_pos = 3 - array_sum($dia_pos);\n\t}\n\t$ans[0] = $pos[$dia_pos[0]][0] + $pos[$dia_pos[1]][0] - $pos[$no_dia_pos][0] + 1;\n\t$ans[1] = $pos[$dia_pos[0]][1] + $pos[$dia_pos[1]][1] - $pos[$no_dia_pos][1] + 1;\n\tprint($ans[0]. \" \". $ans[1]);\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\n\t\t\tif (!feof($this->handle)) $contents = stream_get_contents($this->handle);\n\t\t} else $contents = stream_get_contents(STDIN);\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": "e344de8280fb607c556671db9cfbaa9e"} {"source_code": " $val) {\n if(count($val) == 1) {\n $dissmiss[] = $key;\n }\n }\n if(count($dissmiss) == 0) {\n break;\n }\n foreach ($dissmiss as $child) {\n if(!isset($link[$child])) {\n continue;\n }\n $pair = implode('',$link[$child]);\n if(!isset($link[$pair])) {\n continue;\n }\n $key = array_search($child, $link[$pair]);\n if($key === FALSE) {\n continue;\n }\n if(count($link[$pair]) == 1) {\n unset($link[$pair]);\n }\n else {\n unset($link[$pair][$key]);\n }\n \n unset($link[$child]);\n }\n $r++;\n}\necho($r);\n", "positive_code": [{"source_code": " $v) {\n\t\tif(!isset($a[$v[0]])) $a[$v[0]] = 0;\n\t\tif(!isset($a[$v[1]])) $a[$v[1]] = 0;\n\t\t$a[$v[0]]++;\n\t\t$a[$v[1]]++;\n\t}\n\tforeach($a AS $k => $v) {\n\t\tif ($v >= 2) continue;\n\t\t$bad = true;\n\t\t$ban[] = $k;\n\t\tunset($a[$k]);\n\t}\n\tif (!$bad) break;\n\t$ans++;\n\tforeach($links AS $k => $v) {\n\t\tif(!isset($a[$v[0]])) unset($links[$k]);\n\t\tif(!isset($a[$v[1]])) unset($links[$k]);\n\t}\n}\necho($ans);\n?>"}, {"source_code": ""}, {"source_code": " $v) {\n if(count($v) === 1) {\n $excl[$k] = reset($v);\n }\n }\n if(count($excl) > 0) {\n foreach($excl as $k => $v) {\n if(isset($link[$v])) {\n sort($link[$v]);\n for($i=0;$i $v) {\n\t\tif(!isset($a[$v[0]])) $a[$v[0]] = 0;\n\t\tif(!isset($a[$v[1]])) $a[$v[1]] = 0;\n\t\t$a[$v[0]]++;\n\t\t$a[$v[1]]++;\n\t}\n\tforeach($a AS $k => $v) {\n\t\tif ($v >= 2) continue;\n\t\t$bad = true;\n\t\t$ban[] = $k;\n\t\tunset($a[$k]);\n\t}\n\tif (!$bad) break;\n\tforeach($links AS $k => $v) {\n\t\tif(!isset($a[$v[0]])) unset($links[$k]);\n\t\tif(!isset($a[$v[1]])) unset($links[$k]);\n\t}\n}\necho($n - count($ban));\n?>"}, {"source_code": " $v) {\n\t\tif(!isset($a[$v[0]])) $a[$v[0]] = 0;\n\t\tif(!isset($a[$v[1]])) $a[$v[1]] = 0;\n\t\t$a[$v[0]]++;\n\t\t$a[$v[1]]++;\n\t}\n\tforeach($a AS $k => $v) {\n\t\tif ($v >= 2) continue;\n\t\t$bad = true;\n\t\t$ban[] = $k;\n\t\tunset($a[$k]);\n\t}\n\tif (!$bad) break;\n\tforeach($links AS $k => $v) {\n\t\tif(!isset($a[$v[0]])) unset($links[$k]);\n\t\tif(!isset($a[$v[1]])) unset($links[$k]);\n\t}\n}\nif(count($ban) > 0) echo('0'); else echo($n - count($ban));\n?>"}, {"source_code": " $v) {\n\t\tif(!isset($a[$v[0]])) $a[$v[0]] = 0;\n\t\tif(!isset($a[$v[1]])) $a[$v[1]] = 0;\n\t\t$a[$v[0]]++;\n\t\t$a[$v[1]]++;\n\t}\n\tforeach($a AS $k => $v) {\n\t\tif ($v >= 2) continue;\n\t\t$bad = true;\n\t\t$ban[] = $k;\n\t\tunset($a[$k]);\n\t}\n\tif (!$bad) break;\n\tforeach($links AS $k => $v) {\n\t\tif(!isset($a[$v[0]])) unset($links[$k]);\n\t\tif(!isset($a[$v[1]])) unset($links[$k]);\n\t}\n}\nif ($m == $n) {\n\techo(count($ban));\n} else {\n\techo($n - count($ban));\n}\n?>"}], "src_uid": "f8315dc903b0542c453cab4577bcb20d"} {"source_code": "", "positive_code": [{"source_code": "$max)\n $max=$ans[$i];\n \n}\necho $max;\n//print_r($ans);"}, {"source_code": "1) {\n for($ex=$sx+1; $ex<$n; $ex++) {\n if($cc!=$s[$ex]) break;\n $cn++;\n if($cn==$k) break;\n }\n }\n if($cn==$k) {\n if(array_key_exists($cc, $A)) $A[$cc]++;\n else $A[$cc] = 1;\n $sx = $ex+1;\n }\n else $sx = $ex;\n }\n if(count($A)==0) echo \"0\";\n else {\n arsort($A, SORT_NUMERIC);\n //print_r($A);\n reset($A);\n echo current($A);\n }\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": "$max)\n\t\t\t$max=$lcount;\n}\necho \"$max\";"}, {"source_code": "= 2)\n $r++;\n}\nteam($r);\n?>"}, {"source_code": "= 2)\n {\n $e++; \n }\n}\nprint $e;\n?>"}, {"source_code": "= 2)\n $cnt++;\n echo $cnt;\n?>"}, {"source_code": " 1) $total++;\n\t}\n\techo $total;\n?>"}, {"source_code": "=2) $out++;\n}\necho $out;\n?>"}, {"source_code": "= 2) ? $r+1:$r;\n}\necho $r;\n?>\n"}, {"source_code": "=2) ? 1 : 0;\n}\nprintf(\"%d\",$ans);\n?>"}, {"source_code": "= 2) {\n ++$solvedProblems;\n }\n}\nfprintf($output,\"%d\",$solvedProblems);\n\n?>"}, {"source_code": "=2) $ans++;\n}\nfprintf(STDOUT,\"%d\\n\",$ans);\n?>"}, {"source_code": " \n//3\n//1 1 0\n//1 1 1\n//1 0 0\n# sample output => 2\n# scihesham\n\n\n $tests_num = trim(fgets(STDIN));\n $sum = 0;\n\n for($i=0; $i<$tests_num; $i++){\n list($a, $b, $c) = explode(\" \", trim(fgets(STDIN)));\n $a + $b + $c > 1 ? $sum+=1 : '';\n }\n echo $sum;\n\n\n?>"}, {"source_code": "= 2 ) {\n\t\t$result++;\n\t}\n}\necho $result;"}, {"source_code": " 0) {\n $inputs = (explode(\" \",readline()));\n if(array_sum($inputs) >= 2){\n $p += 1;\n }\n $n--;\n}\n\necho $p;\n\n?>"}, {"source_code": "= 2){\n $result++;\n }\n}\n\necho $result;"}, {"source_code": "=2)\n $r++;\n}\necho $r;\n?>"}, {"source_code": "=2)++$z;\n unset($s);\n }\n echo $z;\n?>"}, {"source_code": "=2)\n {$d += 1;}else{$d += 0;}\n}\necho $d;\n?>"}, {"source_code": "= 2;\n}\n\n$arr = read();\n$filtered = array_filter($arr, \"isValid\");\n\necho count($filtered);"}, {"source_code": "1) ++$out;\n}\nprintf(\"%.0f\",$out);"}, {"source_code": "= 2)\n\t{\n\t$res++;\n\t}\n}\n\necho $res;"}, {"source_code": " 1){\n ++$ac;\n }\n }\n echo $ac . \"\\n\";\n}"}, {"source_code": " 1){\n ++$ac;\n }\n }\n echo $ac . \"\\n\";\n}"}, {"source_code": "= 101 || $res === 11) {\n $result++;\n }\n}\n\necho $result;\n"}, {"source_code": ""}, {"source_code": "= 2) {\n $tasks_count++;\n }\n}\necho $tasks_count;"}, {"source_code": " $value) {\n\t\t\tif($value == 1) $yes++;\n\t\t}\n\t\tif($yes >= 2) $solve++;\n\t\t$arr = [];\n\t}\n\techo $solve;\n?>"}, {"source_code": " 1) {\n $sum++;\n }\n}\n\nprintf(\"%d\", $sum);\n"}, {"source_code": " 100 ? $output += 1 : 1;\n}\necho $output;"}, {"source_code": "= 2){\n $w ++;\n }\n}\necho $w;"}, {"source_code": "= 2) $result++;\n }\n fwrite(STDOUT, $result++);"}, {"source_code": "= 2) {\n $implemention++;\n }\n}\n\necho $implemention . \"\\n\";\n"}, {"source_code": "1)\n\t\t\t$num = $num + 1;\n\t\t$i++;\n\t}\n\techo $num;\n?>"}, {"source_code": "=2)\n\t\t$vote_result+=1;\n}\necho $vote_result;\n?>"}, {"source_code": "=2){\n $tr=$tr+1; \n \n }\n }\n echo($tr);\n ?>"}, {"source_code": "=2){\n $tr=$tr+1; \n \n }\n }\n echo($tr);\n ?>"}, {"source_code": "=2) $ret++;\n}\n\necho $ret . PHP_EOL;"}, {"source_code": "0){\nfscanf(STDIN, \"%d %d %d\",$a,$b,$c);\nif( $a+$b+$c > 1 ) $sum++;\n$n--;\n}\nprintf(\"%d\\n\",$sum);\n?>"}, {"source_code": "0){\nfscanf(STDIN, \"%d %d %d\",$a,$b,$c);\nif( $a+$b+$c > 1 ) $sum = $sum+1;\n$n = $n-1;\n}\nprintf(\"%d\\n\",$sum);\n?>"}, {"source_code": "=2) $ans++;\n}\nfprintf(STDOUT,\"%d\\n\",$ans);\n?>"}, {"source_code": " 1){\n $sum++;\n }\n}\n\nprint $sum\n\n?>\n"}, {"source_code": "1) \n\t\t$counter++;\n}\necho $counter;\n?>"}, {"source_code": "= 2) {\n $ans++;\n }\n }\n echo $ans;"}, {"source_code": "= 2;\n}\n\n$c = 0;\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; ++$i) {\n list($p, $v, $t) = fscanf($input, \"%d %d %d\\n\");\n\n $c += foo($p, $v, $t) ? 1 : 0;\n}\n\nfwrite($output, $c);\n"}, {"source_code": "= 2)\n $k++;\n}\n\necho $k;\n"}, {"source_code": ""}, {"source_code": "= 1 && $lines <= 1000)\n{\n $problems = [];\n for($i = 0;$i < $lines; $i++)\n $problems[$i] = fgets(STDIN);\n $submissions = 0;\n \n foreach($problems as $problem)\n {\n $checker1 = $problem[0] == 1 || $problem[0] == 0;\n $checker2 = $problem[2] == 1 || $problem[2] == 0;\n $checker3 = $problem[4] == 1 || $problem[4] == 0;\n if($checker1 && $checker2 && $checker3)\n {\n $petya = (int)$problem[0];\n $vasya = (int)$problem[2];\n $tonya = (int)$problem[4];\n if(($petya + $vasya + $tonya) >= 2)\n {\n $submissions++; \n }\n }\n else\n {\n echo \"Not valid input\\n\";\n break;\n }\n \n } \n echo $submissions;\n \n \n}\nelse\n{\n echo \"Not valid input\\n\";\n}\n\n\n\n\n\n\n \n\n?>"}, {"source_code": "= 2) $r++;\n}\necho $r;\n"}, {"source_code": "= 2){$sum ++;}\n }\n echo $sum;\n?>"}, {"source_code": "= 2 ){\n $task_with_solution++;\n }\n}\necho $task_with_solution;\n\n\n"}, {"source_code": " 1)\n $res++;\n}\necho $res;"}, {"source_code": "= 2) $problemsOk++;\n}\necho $problemsOk.\"\\n\";\n"}, {"source_code": "= 2) $n++;\n}\nprint($n);\n?>"}, {"source_code": " 1) $counter++;\n}\n\necho $counter;"}, {"source_code": "= 2) {\n $des++;\n }\n}\n\necho $des;"}, {"source_code": "=2)\n {\n $summSolution++;\n }\n}\necho $summSolution;\n?>"}, {"source_code": " $value) {\n $stdIn[$key] = (int)$value;\n }\n }\n\n return $stdIn;\n}\n\nfunction stdOut($output)\n{\n fwrite(STDOUT, $output);\n}\n\nfunction solve(): void\n{\n // 3 people\n // 2 have to be sure\n // n problems\n [$n] = getStdIn(true);\n $solved = 0;\n for ($i = 0; $i < $n; $i++) {\n if (array_sum(getStdIn(true)) >= 2) {\n ++$solved;\n }\n }\n stdOut($solved);\n}\n\nsolve();\n"}, {"source_code": "= 2) {\n $count++;\n }\n}\n\necho $count;\n"}, {"source_code": "=2) {\n $countTask++;\n }\n}\necho $countTask;\n"}, {"source_code": "1) {$k++;}\n}\n\necho $k;\n?>"}, {"source_code": "=2)\n\t\t\t$cnt++;\n\t}\n\techo $cnt;\n?>\n \t\t \t \t\t \t\t \t \t\t\t\t"}, {"source_code": " 1) \n $r++;\n}\necho \"$r\\n\";\n?>"}, {"source_code": "1)\n \t\t$ans++;\n }\n\n print $ans;\n\n fclose($file);\n\n?>\n"}, {"source_code": "=2)\n\t\t\t{\n\t\t\t\t$count++;\n\t\t\t\t//continue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t}\n\techo \"$count\";\n\t\n}\n\n"}, {"source_code": " 1) $result++;\n}\n\nfclose($f);\n\nprint $result;\n"}, {"source_code": " 1){\n\t\t$res++;\n\t} \n\t\n}\necho $res;\n\n\n\n\n?>\n"}, {"source_code": " 0)\n {\n $count_solution += 1;\n }\n }\n if($count_solution > 1)\n {\n $solved += 1;\n }\n}\necho $solved;\n\n?>"}, {"source_code": "= 2) $n++;\n} echo $n;\n?>"}, {"source_code": "=2) $count++;\n}\n\necho $count;\n\n"}, {"source_code": ""}, {"source_code": "=2)) ? $s+1:$s;\n}\necho $s;"}, {"source_code": "0;$N--){\n $arr = explode(' ',rtrim(fgets(STDIN)));\n $Ans += floor(array_sum($arr)/2);\n}\nprintf(\"%d\\n\",$Ans);\n\n/* vim: set expandtab ts=4 sw=4 sts=4 tw=100: */\n?>\n"}, {"source_code": "= 2) {\n $problems++;\n }\n}\n\necho $problems;\n\n?>"}, {"source_code": " 0){\n $number--;\n $line = trim(fgets(STDIN));\n $line = str_replace(' ', '', $line);\n\n $line = (int)$line;\n\n $sRes[$line]++;\n}\n\nprint($sRes[11] + $sRes[110] + $sRes[101] + $sRes[111]);\n\n"}, {"source_code": "=2)\n\t\t$ans++;\n}\necho $ans;"}, {"source_code": " 1) ++$out;\n}\necho $out;"}, {"source_code": " 1)\n $result++;\n}\nprintf(\"%s\\n\", $result);\n"}, {"source_code": " 1)\n $total++;\n}\nprint $total;\n\n?>"}, {"source_code": " 1 ? 1 : 0;\n }\n echo $out;\n?>"}, {"source_code": "0){\n fscanf(STDIN,\"%d%d%d\",$p,$v,$t);\n if(($p+$v+$t)>1)$ans++;\n }\n fprintf(STDOUT,\"%d\\n\",$ans);\n}"}, {"source_code": " 1) {\n \n $count++;\n \n }\n \n}\n\n//Return The Output.\necho $count;\n\n?>"}, {"source_code": "=2)\n\t\t$hasil=$hasil+1;\n\t$i++;\n}\necho $hasil;\n?>"}, {"source_code": "=2)*/\n\tif($a[0]+$a[1]+$a[2] >= 2)\n\t\t$hasil=$hasil+1;\n\t$i++;\n}\necho $hasil;\n?>"}, {"source_code": " 1) $out++;\n}\n\necho $out;\n\n?>"}, {"source_code": "1) $c++;\n }\n echo $c;\n?>"}, {"source_code": "= 2;\n }\n\n echo $count . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->solve();\n\n"}, {"source_code": "1) {\n\t\t$out++;\n\t}\t\n}\t\necho $out;\n?>\n"}, {"source_code": "1 ) { $total++;}\n}\necho $total;\n\n?>"}, {"source_code": "\n * @link https://codeforces.com/problemset/problem/231/A\n * @version 1.0\n *\n *\n *\n */\n\n$problems = readline();\n\n$implementations = 0;\nfor ($n = 1; $n <= $problems; $n++){\n\tif(array_sum(explode(' ', readline())) >= 2) $implementations++;\n}\necho $implementations;"}, {"source_code": "0){\n $line=explode(' ',$line);\n $cpt1=0;\n foreach($line as $l){\n if($l==1) $cpt1++;\n }\n if($cpt1>=2) $cptFound++;\n }\n $cpt++;\n}\necho $cptFound;\n"}, {"source_code": "=2) $cptFound++;\n }\n $first=false;\n}\necho $cptFound;\n"}, {"source_code": "= 2){\n $ans++;\n }\n}\n\necho $ans;\n\n\n"}, {"source_code": "= 2){\n $out++;\n }\n}\necho $out;"}, {"source_code": " 1) {\n $answer++;\n }\n}\n\necho $answer . PHP_EOL;\n"}, {"source_code": " 1) \n $r++;\n}\necho \"$r\\n\";\n?>"}, {"source_code": " 1){\t\t// \u0435\u0441\u043b\u0438 \u0441\u0443\u043c\u043c\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 >= 2 - \n\t\t\tarray_push($result, $strings[$i]);\t\t// \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\n\t\t}\n\t}\t\n\t\n\t\nprintf(count($result));"}, {"source_code": "= 2) $solutionCount++;\n}\n\necho $solutionCount;\n"}], "negative_code": [{"source_code": "=2)\n {$d += 1;}\n}\necho $d;\n?>"}, {"source_code": "= 2;\n}\n\n$arr = read();\n$filtered = array_filter($arr, \"isValid\");\n\necho count($filtered);"}, {"source_code": " 101 || $res === 11) {\n $result++;\n }\n}\n\necho $result;\n"}, {"source_code": "= 2) $r++;\n}\necho $r;\n"}, {"source_code": "= 2) {\n\t $c++;\n\t}\n}\nprint($c);\n?>"}, {"source_code": "=2)\n {\n $summSolution++;\n }\n}\necho $summSolution;\n?>"}, {"source_code": "=2)\n\t\t\t$cnt++;\n\t}\n\techo $cnt;\n?>\n\t \t\t \t\t \t \t \t \t\t\t \t \t\t\t\t"}, {"source_code": "\n= 2) {\n \n $r++;\n \n \n }\n \n \n}\n\nprintf(\"%.0f\",$r);\n\n\n\n?>"}, {"source_code": "\n 1) {\n \n $r++;\n \n \n }\n \n \n}\n\nprintf(\"%.0f\",$r);\n\n\n\n?>"}, {"source_code": "\n= 2) {\n \n ++$r;\n \n \n }\n \n \n}\n\nprintf(\"%.0f\",$r);\n\n\n\n?>"}, {"source_code": "\n 1) {\n \n ++$r;\n \n \n }\n \n \n}\n\nprintf(\"%.0f\",$r);\n\n\n\n?>"}, {"source_code": " 0)\n {\n $count_solution += 1;\n }\n }\n if($count_solution > 1)\n {\n $solved += 1;\n }\n echo \"\\n\";\n}\n\necho $solved;\n?>"}, {"source_code": " 1)\n $result++;\n}\nforeach ($resultArray as $result) {\n printf(\"%s\\n\", $result);\n}\n"}, {"source_code": " 1)\n $total++;\n $hitung = 0;\n}\nprint $total;\n\n?>"}, {"source_code": " 1)\n $total++;\n $hitung = 0;\n}\nprint $total;\n\n?>"}, {"source_code": " 1)\n $total++;\n $hitung = 0;\n}\nprint $total;\n\n?>"}, {"source_code": " 1)\n $total++;\n $hitung = 0;\n}\nprint $total;\n\n?>"}, {"source_code": ""}, {"source_code": "=2)*/\n\tif($a[0]+$a[1]+a[2] >= 2)\n\t\t$hasil=$hasil+1;\n\t$i++;\n}\necho $hasil;\n?>"}, {"source_code": "1) {\n\t\t$out++;\n\t}\t\n}\t\necho $out;\n?>\n"}, {"source_code": "1 ) { $total++;}\n}\necho $total;\n\n?>"}, {"source_code": "=2) $cptFound++;\n }\n}\necho $cptFound;\n"}, {"source_code": "= 2){\n $ans++;\n }\n}\n\necho $ans;\n\n\n"}, {"source_code": " 1) {\n $answer++;\n }\n}\n\necho $answer . PHP_EOL;\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 2)\n $r++;\n }\necho $r;\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$n);\nteam($n);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 2)\n $r++;\n }\necho $r;\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$n);\nfor($i=0;$i<$n;$i++){\n fscanf($stdin,\"%d%d%d\",$a,$b,$c);\n}\nteam($n,$a,$b,$c);\n?>"}, {"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 $r++;\n break;\n }\necho $r;\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$n);\nteam($n);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= array_count_values($data[$i])[1]) {\n $counter++;\n }\n }\n echo $counter;"}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "b01602b51b9103c0f31c3f50b32aa88d"} {"source_code": " 3) {\n fprintf(STDOUT, ' ');\n}\n\nfprintf(STDOUT, \"%d\\n\", 2 + $n % 2);\n", "positive_code": [{"source_code": ""}, {"source_code": "= 0 ; $i--) { \n// if($i !=0){\n// $x=$array[$i];\n// $array[$i]=$array[$i-1];\n// $array[$i-1]=$x;\n// $s++;\n// }\n// }\n// echo $s;\n\n$n=fgets(STDIN);\nsettype($n,'int');\n$k=[];\nwhile($n>1){\n $n-=2;\n if($n!=1){\n $k[]=2;\n }else{\n $n+=2;\n $k[]=$n;\n break;\n }\n \n}\necho count($k).\"\\n\";\nfor ($i=0; $i "}, {"source_code": " 3) {\n fprintf(STDOUT, ' ');\n}\n\nfprintf(STDOUT, \"%d\\n\", 2 + $n % 2);\n"}, {"source_code": "", "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$t = IO::str();\r\n\r\nwhile ($t--) {\r\n $n = IO::str();\r\n $arr = IO::arr();\r\n $a = true;\r\n foreach ($arr as $ar) {\r\n $num = sqrt($ar);\r\n// echo $num; exit;\r\n if (strpos($num, '.')) {\r\n $res[] = 'YES';\r\n $a = false;\r\n break;\r\n }\r\n }\r\n if ($a) {\r\n $res[] = 'NO';\r\n }\r\n}\r\n\r\nforeach ($res as $r) {\r\n echo $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\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 $bool = false;\r\n for ($i = 0; $i < $n; $i++) {\r\n $x = sqrt($a[$i]);\r\n if (strpos((string)$x, '.') !== false) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if ($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\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\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 $bool = false;\r\n for ($i = 0; $i < $n; $i++) {\r\n $x = sqrt($a[$i]);\r\n if (strpos((string)$x, '.') !== false) {\r\n $bool = true;\r\n break;\r\n }\r\n $x = -1;\r\n for ($j = $i + 1; $j < $n; $j++) {\r\n if ($i == $j) {\r\n continue;\r\n }\r\n $z = $a[$i] * $a[$j];\r\n if ($x == -1) {\r\n $x = $a[$i] * $a[$j];\r\n } else {\r\n $x = $x * $a[$j];\r\n }\r\n $y = sqrt($x);\r\n $zy = sqrt($z);\r\n if (strpos((string)$y, '.') !== false || strpos((string)$zy, '.') !== false) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if ($bool) {\r\n break;\r\n }\r\n }\r\n\r\n if ($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\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\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 $bool = false;\r\n for ($i = 0; $i < $n; $i++) {\r\n $x = sqrt($a[$i]);\r\n if ((int)$x != $x) {\r\n $bool = true;\r\n break;\r\n }\r\n $x = -1;\r\n for ($j = 0; $j < $n; $j++) {\r\n if ($i == $j) {\r\n continue;\r\n }\r\n $z = $a[$i] * $a[$j];\r\n if ($x == -1) {\r\n $x = $a[$i] * $a[$j];\r\n } else {\r\n $x = $x * $a[$j];\r\n }\r\n $y = sqrt($x);\r\n $zy = sqrt($z);\r\n if ((int)$y != $y || (int)$zy != $zy) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if ($bool) {\r\n break;\r\n }\r\n }\r\n\r\n if ($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\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\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 $bool = false;\r\n for ($i = 0; $i < $n; $i++) {\r\n// $x = sqrt($a[$i]);\r\n// if ((int)$x != $x) {\r\n// $bool = true;\r\n// break;\r\n// }\r\n $x = -1;\r\n for ($j = 0; $j < $n; $j++) {\r\n if ($i == $j) {\r\n continue;\r\n }\r\n $z = $a[$i] * $a[$j];\r\n if ($x == -1) {\r\n $x = $a[$i] * $a[$j];\r\n } else {\r\n $x = $x * $a[$j];\r\n }\r\n $y = sqrt($x);\r\n $zy = sqrt($z);\r\n if ((int)$y != $y || (int)$zy != $zy) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if ($bool) {\r\n break;\r\n }\r\n }\r\n\r\n if ($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\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\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 $bool = false;\r\n for ($i = 0; $i < $n; $i++) {\r\n $x = sqrt($a[$i]);\r\n if ((int)$x != $x) {\r\n $bool = true;\r\n break;\r\n }\r\n $x = -1;\r\n for ($j = 0; $j < $n; $j++) {\r\n if ($i == $j) {\r\n continue;\r\n }\r\n if ($x == -1) {\r\n $x = $a[$i] * $a[$j];\r\n } else {\r\n $x = $x * $a[$j];\r\n }\r\n $y = sqrt($x);\r\n if ((int)$y != $y) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if ($bool) {\r\n break;\r\n }\r\n }\r\n\r\n if ($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\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\r\n//$iQueryCount = 1;\r\n\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 $bool = false;\r\n for ($i = 0; $i < $n; $i++) {\r\n $x = sqrt($a[$i]);\r\n if ((int)$x != $x) {\r\n $bool = true;\r\n break;\r\n }\r\n $x = -1;\r\n for ($j = 0; $j < $n; $j++) {\r\n if ($i == $j) {\r\n continue;\r\n }\r\n if ($x == -1) {\r\n $x = $a[$i] * $a[$j];\r\n } else {\r\n $x = $x * $a[$j];\r\n }\r\n if ((int)$x != $x) {\r\n $bool = true;\r\n break;\r\n }\r\n }\r\n if ($bool) {\r\n break;\r\n }\r\n }\r\n\r\n if ($bool) {\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": "33a31edb75c9b0cf3a49ba97ad677632"} {"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$a = $ir->readArrayOfInt($n, 1);\n\n$s = 0.0;\n$m = 0;\nfor ($i=1; $i<=$n; $i++) {\n\t$ai = $a[$i];\n\tif (!isset($b[$ai])) {\n\t\t$b[$ai] = [];\n\t}\n\t\n\t$b[$ai][] = $i;\n\t\n\tif ($m < $ai) {\n\t\t$m = $ai;\n\t}\n\t$s += $ai;\n}\n\n\n$items = [];\n\n// delete max element\nfor ($i=1; $i<=$n; $i++) {\n\t$ind = ($s - $a[$i])/2;\n\tif (intval($ind) == $ind) {\n\t\tif (isset($b[$ind]) && !($ind==$a[$i] && count($b[$ind])==1)) {\n\t\t\t$items[] = $i;\n\t\t}\n\t}\n}\n\necho count($items) . \"\\n\";\necho implode(' ', $items);\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "4cf0fe49f7ebf058317ac848043031a5"} {"source_code": " 0)\n {\n $e -= $d[$x];\n }\n}\n$h = 0;\n$i = 0;\nfor($x = $f; $x >= 1; $x--)\n{\n $i += $g[$x];\n if($g[$x] != $a)\n {\n if($i == $b)\n {\n $h++;\n $i = 0;\n }\n elseif($i > $b)\n {\n $x++;\n $h++;\n $i = 0;\n }\n }\n else\n {\n if($i == $g[$x])\n {\n break;\n }\n else\n {\n $h++;\n break;\n }\n }\n}\nprint $h;\n?>", "positive_code": [{"source_code": "= 1;$i--)\n{\n if(!isset($height_count[$i])) {\n $height_count[$i] = $height_count[$i+1];\n } else {\n $height_count[$i] += $height_count[$i+1];\n }\n}\nfor($i = $maxx-1;$i >= 1;$i--)\n{\n $height_count[$i] += $height_count[$i+1];\n}\n$cnt = 0;\n$height_count[$maxx + 1] = 0; \n$up = $maxx + 1;\n$low = $maxx;\nwhile($up > 1)\n{\n while($low >= 1&&$height_count[$low] - $height_count[$up] <= $k)\n {\n $low--;\n }\n $cnt++;\n $up = $low + 1;\n}\necho $cnt.\"\\n\";"}], "negative_code": [{"source_code": " 0)\n {\n $e -= $d[$x];\n }\n }\n $g = 0;\n $h = 0;\n for($x = max($c); $x >= 1; $x--)\n {\n $h += $f[$x];\n if($h >= $b)\n {\n $g++;\n $h = 0;\n }\n }\n print $g;\n}\n?>"}, {"source_code": " 0)\n {\n $e -= $d[$x];\n }\n }\n $g = 0;\n $h = 0;\n for($x = max($c); $x >= 1; $x--)\n {\n $h += $f[$x];\n if($h >= $b)\n {\n $g++;\n $h = 0;\n }\n }\n print $g;\n}\n?>"}, {"source_code": " 0)\n {\n $e -= $d[$x];\n }\n}\n$h = 0;\n$i = 0;\nfor($x = $f; $x >= 1; $x--)\n{\n $i += $g[$x];\n if($g[$x] != $a)\n {\n if($i == $b)\n {\n $h++;\n $i = 0;\n }\n elseif($i > $b)\n {\n $x++;\n $h++;\n $i = 0;\n }\n }\n else\n {\n if($i == $b)\n {\n break;\n }\n elseif($i > $b)\n {\n $h++;\n break;\n }\n }\n}\nprint $h;\n?>"}, {"source_code": " 0)\n {\n $e -= $d[$x];\n }\n}\n$h = 0;\n$i = 0;\nfor($x = $f; $x >= 1; $x--)\n{\n $i += $g[$x];\n if($g[$x] != $a)\n {\n if($i == $b)\n {\n $h++;\n $i = 0;\n }\n elseif($i > $b)\n {\n $x++;\n $h++;\n $i = 0;\n }\n }\n else\n {\n if($i <= $b)\n {\n break;\n }\n elseif($i > $b)\n {\n $h++;\n break;\n }\n }\n}\nprint $h;\n?>"}], "src_uid": "676729309dfbdf4c9d9d7c457a129608"} {"source_code": "=0; $j--)\n $pic_rotate[$i][($h-1)-$j]=$input_pic[$j][$i];\n list($h,$w) = array($w,$h);\n $input_pic = $pic_rotate;\n}\n\nfunction div($int,$divider){\n return (($int-($int%$divider))/$divider);\n}\n\nfunction reflect(&$input_pic,&$h,&$w){\n $pic_reflect = pic_gen($h,$w);\n for ($i=0; $i<$h; $i++)\n for ($j=0; $j<$w; $j++)\n $pic_reflect[$i][$j]=$input_pic[$i][($w-1)-$j];\n $input_pic = $pic_reflect;\n}\nfunction zoom(&$input_pic,&$h,&$w){\n list($h,$w) = array(2*$h,2*$w);\n $pic_zoom = pic_gen($h,$w);\n for ($i=0; $i<$h; $i++)\n for ($j=0; $j<$w; $j++)\n $pic_zoom[$i][$j]=$input_pic[div($i,2)][div($j,2)];\n $input_pic = $pic_zoom;\n}\n\nlist($w,$h) = explode(\" \",trim(fgets(STDIN)));\n$pic = init($h,$w);\nrotate($pic,$h,$w);\nreflect($pic,$h,$w);\nzoom($pic,$h,$w);\ndraw($pic,$h,$w);", "positive_code": [{"source_code": ""}, {"source_code": "= 0; $x--)\n{\n $g = array();\n $h = 0;\n for($y = $b - 1; $y >= 0; $y--)\n {\n $g[$y] = $c[$y][$x];\n $h++;\n }\n $e[$x] = $g;\n $f++;\n}\nfor($x = 0; $x < $a; $x++)\n{\n $e[$x] = array_reverse($e[$x]);\n}\n$i = array();\nfor($x = 0; $x < $a; $x++)\n{\n $j = array();\n for($y = 0; $y < $b; $y++)\n {\n for($z = 1; $z <= 2; $z++)\n {\n array_push($j, $e[$x][$y]);\n }\n }\n array_push($i, $j);\n array_push($i, $j);\n}\nfor($x = 0; $x < $a * 2 - 1; $x++)\n{\n print implode($i[$x]) . \"\\n\";\n}\nprint implode($i[$x]);\n?>"}, {"source_code": ""}, {"source_code": "=0; $j--)\n\t\t\t$pic_rotate[$i][($h-1)-$j]=$input_pic[$j][$i];\n\tlist($h,$w) = array($w,$h);\n\t$input_pic = $pic_rotate;\n}\n\nfunction div($int,$divider){\n\treturn (($int-($int%$divider))/$divider);\n}\n\nfunction reflect(&$input_pic,&$h,&$w){\n\t$pic_reflect = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\t$pic_reflect[$i] = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\tfor ($j=0; $j<$w; $j++)\n\t\t\t$pic_reflect[$i][$j]=$input_pic[$i][($w-1)-$j];\n\t$input_pic = $pic_reflect;\n}\nfunction zoom(&$input_pic,&$h,&$w){\n\tlist($h,$w) = array(2*$h,2*$w);\n\t$pic_zoom = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\t$pic_zoom[$i] = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\tfor ($j=0; $j<$w; $j++)\n\t\t\t$pic_zoom[$i][$j]=$input_pic[div($i,2)][div($j,2)];\n\t$input_pic = $pic_zoom;\n}\n\nlist($w,$h) = explode(\" \",trim(fgets(STDIN)));\n$pic = init($h,$w);\nrotate($pic,$h,$w);\nreflect($pic,$h,$w);\nzoom($pic,$h,$w);\n//printf(\"%dx%d\\n\",$h,$w);\ndraw($pic,$h,$w);"}, {"source_code": ""}], "negative_code": [{"source_code": "function init(&$h,&$w){\n\t$pic = array();\n\tfor ($i=0; $i<$h; $i++){\n\t\t$line = trim(fgets(STDIN));\n\t\t$pic[$i] = array();\n\t\tfor ($j=0; $j<$w; $j++){\n\t\t\t$pic[$i][$j] = $line[$j];\n\t\t}\n\t}\n\treturn $pic;\n}\n\nfunction draw(&$input_pic,&$h,&$w){\n\tfor ($i=0; $i<$h; $i++){\n\t\tfor ($j=0; $j<$w; $j++){\n\t\t\tprintf(\"%s\",$input_pic[$i][$j]);\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n}\n\nfunction rotate(&$input_pic,&$h,&$w){\n\t$pic_rotate = array();\n\tfor ($i=0; $i<$w; $i++)\n\t\t$pic_rotate[$i] = array();\n\n\tfor ($i=0; $i<$w; $i++)\n\t\tfor ($j=$h-1; $j>=0; $j--)\n\t\t\t$pic_rotate[$i][($h-1)-$j]=$input_pic[$j][$i];\n\tlist($h,$w) = array($w,$h);\n\t$input_pic = $pic_rotate;\n}\n\nfunction div($int,$divider){\n\treturn (($int-($int%$divider))/$divider);\n}\n\nfunction reflect(&$input_pic,&$h,&$w){\n\t$pic_reflect = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\t$pic_reflect[$i] = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\tfor ($j=0; $j<$w; $j++)\n\t\t\t$pic_reflect[$i][$j]=$input_pic[$i][($w-1)-$j];\n\t$input_pic = $pic_reflect;\n}\nfunction zoom(&$input_pic,&$h,&$w){\n\tlist($h,$w) = array(2*$h,2*$w);\n\t$pic_zoom = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\t$pic_zoom[$i] = array();\n\tfor ($i=0; $i<$h; $i++)\n\t\tfor ($j=0; $j<$w; $j++)\n\t\t\t$pic_zoom[$i][$j]=$input_pic[div($i,2)][div($j,2)];\n\t$input_pic = $pic_zoom;\n}\n\nlist($w,$h) = explode(\" \",trim(fgets(STDIN)));\n$pic = init($h,$w);\nrotate($pic,$h,$w);\nreflect($pic,$h,$w);\nzoom($pic,$h,$w);\n//printf(\"%dx%d\\n\",$h,$w);\ndraw($pic,$h,$w);"}, {"source_code": ""}], "src_uid": "9af19e1b482f7f0bcbffc754cf324092"} {"source_code": ""}, {"source_code": ""}, {"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}"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t
\r\n\t\t\tTest Cases : \r\n\t\t\t

\r\n\t\t\tInput String : \r\n\t\t\t

\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t
Your result will be Displyed here\";\r\n\t\t\t?>\r\n\t\t\t
\r\n\r\n\t\t\t
\r\n\t\t
\r\n\t\r\n\r\n"}, {"source_code": "", "positive_code": [{"source_code": "= count($e))\n {\n $g++;\n }\n}\nprint $g;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= count($e))\n {\n $g++;\n }\n}\nprint $g;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "solve($s) . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->run();\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\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$str = readString($f);\n\t$len = strlen($str);\n\t$min = false;\n\tfor ($i = 0; $i < $len; $i++) {\n\t\tif ($str[$i] == 'a') {\n\t\t\tcontinue;\n\t\t}\n\t\t$replaceTo = false;\n\t\tfor ($j = $i; $j < $len; $j++) {\n\t\t\tif ($str[$j] == 'a') {\n\t\t\t\t$replaceTo = $j;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($replaceTo == false) {\n\t\t\t$replaceTo = $len;\n\t\t}\n\t\t$replace = substr($str, $i, $replaceTo - $i);\n\t\t$_len = strlen($replace);\n\t\t$_str = '';\n\t\tfor ($k = 0; $k < $_len; $k++) {\n\t\t\t$c = ord($replace[$k]) - 1;\n\t\t\tif ($replace[$k] == 'a') {\n\t\t\t\t$c = ord('z');\n\t\t\t}\n\t\t\t$_str .= chr($c);\n\t\t}\n\n\t\t$min = substr($str, 0, $i) . $_str . substr($str, $replaceTo);\n\t\tbreak;\n\t}\n\tif ($min === false) {\n\t\t$min = $str;\n\t\t$min[strlen($min) - 1] = 'z';\n\t}\n\techo $min;\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": " \"a\", c => \"b\", d => \"c\", e => \"d\", f => \"e\", g => \"f\", h => \"g\", i => \"h\", j => \"i\", k => \"j\", l => \"k\", m => \"l\", n => \"m\", o => \"n\", p => \"o\", q => \"p\", r => \"q\", s => \"r\", t => \"s\", u => \"t\", v => \"u\", w => \"v\", x => \"w\", y => \"x\", z => \"y\");\n for($x = 0; $x < count($a); $x++)\n {\n if(($a[$x] != \"a\") && ($c == 0))\n {\n $c = 1;\n $a[$x] = $d[$a[$x]];\n }\n elseif(($a[$x] != \"a\") && ($c == 1))\n {\n $a[$x] = $d[$a[$x]];\n }\n elseif(($a[$x] == \"a\") && ($c == 1))\n {\n break;\n }\n }\n print implode($a);\n}\n?>"}, {"source_code": "solve($s) . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->run();\n\n"}], "negative_code": [{"source_code": " \"a\", c => \"b\", d => \"c\", e => \"d\", f => \"e\", g => \"f\", h => \"g\", i => \"h\", j => \"i\", k => \"j\", l => \"k\", m => \"l\", n => \"m\", o => \"n\", p => \"o\", r => \"p\", s => \"r\", t => \"s\", u => \"t\", v => \"u\", w => \"v\", x => \"w\", y => \"x\", z => \"y\");\n for($x = 0; $x < count($a); $x++)\n {\n if(($a[$x] != \"a\") && ($c == 0))\n {\n $c = 1;\n $a[$x] = $d[$a[$x]];\n }\n elseif(($a[$x] != \"a\") && ($c == 1))\n {\n $a[$x] = $d[$a[$x]];\n }\n elseif(($a[$x] == \"a\") && ($c == 1))\n {\n break;\n }\n }\n print implode($a);\n}\n?>"}, {"source_code": "solve($s) . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->run();\n\n"}, {"source_code": "solve($s) . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->run();\n\n"}], "src_uid": "e70708f72da9a203b21fc4112ede9268"} {"source_code": " -1) {\r\n for($i=0;$i<$n;$i++) {\r\n if (!($arr[$i] - $test[0] <= $brr[$i])) {\r\n return \"NO\" ;\r\n }\r\n }\r\n return \"YES\" ;\r\n }\r\n return \"NO\" ;\r\n }\r\n return \"NO\";\r\n}\r\n\r\n$t = (int) fgets(STDIN);\r\n$ans = [] ;\r\nwhile($t--) {\r\n $n = (int) fgets(STDIN);\r\n $arr = array_map(\"intval\", explode(\" \",fgets(STDIN)));\r\n $brr = array_map(\"intval\", explode(\" \",fgets(STDIN)));\r\n\r\n $ans[] = solve($n,$arr,$brr);\r\n}\r\nprint_r(implode(\"\\n\",$ans)) ;", "positive_code": [{"source_code": " $a[$i]) {\r\n $ans = 'NO';\r\n break;\r\n }\r\n if($b[$i] == 0) {\r\n $zeroMax = IO::getMaxValue($zeroMax, $a[$i]);\r\n } else {\r\n if(!$tt) {\r\n $temp = $a[$i] - $b[$i];\r\n $tt = true;\r\n } else {\r\n if(($a[$i] - $b[$i]) != $temp) {\r\n $ans = 'NO';\r\n break;\r\n } \r\n } \r\n }\r\n }\r\n $ans = $tt && $temp < $zeroMax ? 'NO' : $ans;\r\n IO::pr($ans);\r\n \r\n \r\n \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 $a[$i]) {\r\n $ans = 'NO';\r\n break;\r\n }\r\n if($b[$i] > 0 && $tt > 0 && ($a[$i] - $b[$i]) != $temp) {\r\n $ans = 'NO';\r\n break;\r\n } else {\r\n if($b[$i] > 0) {\r\n $tt = 1;\r\n $temp = $a[$i] - $b[$i]; \r\n }\r\n \r\n }\r\n if($b[$i] == 0 && ($tt > 0 && ($a[$i] - $b[$i]) > $temp)) {\r\n $ans = 'NO';\r\n break;\r\n } \r\n }\r\n IO::pr($ans);\r\n \r\n \r\n \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 $a[$i]) {\r\n $ans = 'NO';\r\n break;\r\n }\r\n if($b[$i] > 0 && $tt > 0 && ($a[$i] - $b[$i]) != $temp) {\r\n $ans = 'NO';\r\n break;\r\n } else {\r\n if($i > 0) {\r\n $tt = 1;\r\n $temp = $a[$i] - $b[$i]; \r\n }\r\n \r\n }\r\n if($b[$i] == 0 && (($a[$i] - $b[$i]) > $temp)) {\r\n $ans = 'NO';\r\n break;\r\n } \r\n }\r\n IO::pr($ans);\r\n \r\n \r\n \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 -1) {\r\n return \"YES\" ;\r\n }\r\n return \"NO\" ;\r\n }\r\n return \"NO\";\r\n}\r\n\r\n$t = (int) fgets(STDIN);\r\n$ans = [] ;\r\nwhile($t--) {\r\n $n = (int) fgets(STDIN);\r\n $arr = array_map(\"intval\", explode(\" \",fgets(STDIN)));\r\n $brr = array_map(\"intval\", explode(\" \",fgets(STDIN)));\r\n\r\n $ans[] = solve($n,$arr,$brr);\r\n}\r\nprint_r(implode(\"\\n\",$ans)) ;"}], "src_uid": "ee40e8b0ed2da53127f53eb694653a30"} {"source_code": " 1 || !($amount & 1)) {\n echo 'cslnb';\n} else {\n echo 'sjfnb';\n}\n", "positive_code": [{"source_code": " 1 || !($amount & 1)) {\n echo 'cslnb';\n} else {\n echo 'sjfnb';\n}\n"}], "negative_code": [{"source_code": " 1 || !($amount & 1)) {\n echo 'cslnb';\n} else {\n echo 'sjfnb';\n}\n"}], "src_uid": "dc225c801f55b8d7b40ebcc71b417edb"} {"source_code": " x = z = xt3 + c. \r\n }\r\n \r\n \r\n \r\n \r\n \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 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 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 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 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 "}], "negative_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 }\r\n\r\n class Algor {\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 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 $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 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 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 "}], "src_uid": "f0c22161cb5a9bc17320ccd05517f867"} {"source_code": " $deny[1]) {\n\t\t\t$dp[$deny[1]][$deny[0]] = 1;\n\t\t} else {\n\t\t\t$dp[$deny[0]][$deny[1]] = 1;\n\t\t}\n\t}\n\n\tasort($dc);\n\n\tif (!current($dc)) {\n\t\t$triv = key($dc);\n\t} else {\n\t\tforeach ($dc as $c=>$null) {\n\t\t\tif (sizeof($dp[$c]) < $n - $c) {\n\t\t\t\t\n\t\t\t\tfor($i=$c+1;$i<=$n;$i++) {\n\t\t\t\t\tif ($rr[$i] < 2 && !$dp[$c][$i]) {\n\t\t\t\t\t\t$out .= PHP_EOL.$c.' '.$i;\n\t\t\t\t\t\t$r++;\n\t\t\t\t\t\t$rr[$i]++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\n} else {\n\t$triv = 1;\n}\n\nif ($triv) {\n\t$r = $n - 1;\n\tfor ($i=1;$i<=$n;$i++) if ($i!=$triv) {\n\t\t$out .= PHP_EOL.$triv.' '.$i;\n\t}\n}\n\necho $r.$out;", "positive_code": [{"source_code": "\".$path[$j];\n echo PHP_EOL.$path[$j];\n }"}, {"source_code": " count($f))\n {\n print $a - 1 . \"\\n\";\n $h = range(1, $a);\n sort($f);\n for($x = 0; $x < $a; $x++)\n {\n if($h[$x] != $f[$x])\n {\n break;\n }\n }\n for($y = 0; $y < $a - 1; $y++)\n {\n if($h[$x] == $h[$y])\n {\n continue;\n }\n else\n {\n $i++;\n if($i == $a - 1)\n {\n print $h[$x] . \" \" . $h[$y];\n }\n else\n {\n print $h[$x] . \" \" . $h[$y] . \"\\n\";\n }\n } \n }\n if($i < $a - 1)\n {\n if($h[$x] == $h[$y])\n {\n continue;\n }\n else\n {\n print $h[$x] . \" \" . $h[$y];\n }\n }\n }\n}\n?>"}], "negative_code": [{"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\t// echo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo $path[$j].PHP_EOL;\n\t}"}, {"source_code": "\".$path[$j];\n echo PHP_EOL.$path[$j];\n }"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n echo PHP_EOL.$path[$j];\n }"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n echo PHP_EOL.$path[$j];\n }"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n echo PHP_EOL.$path[$j];\n }"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": "\".$path[$j];\n\t\techo PHP_EOL.$path[$j];\n\t}"}, {"source_code": " sizeof($right)) {\n\t\t$left += $all;\n\t} else {\n\t\t$right += $all;\n\t}\n\n} else {\n\t$left = array(1=>1);\n\tunset($all[1]);\n\t$right = $all;\n}\n\n$ql = sizeof($left);\n$qr = sizeof($right);\n\nif ($a = $ql * $qr) {\n\techo $a;\n\tforeach ($left as $l=>$null) {\n\t\tforeach ($right as $r=>$null) {\n\t\t\techo PHP_EOL.$l.' '.$r;\n\t\t}\n\t}\n} else {\n\techo 0;\n}"}, {"source_code": " sizeof($right)) {\n\t\t$left += $all;\n\t\t$ql += $qa;\n\t} else {\n\t\t$right += $all;\n\t\t$qr += $qa;\n\t}\n\n} else {\n\t$left = array(1=>1);\n\tunset($all[1]);\n\t$right = $all;\n}\n\n$ql = sizeof($left);\n$qr = sizeof($right);\n\nif ($a = $ql * $qr) {\n\tfwrite($f2, $a);\n\tforeach ($left as $l=>$null) {\n\t\tforeach ($right as $r=>$null) {\n\t\t\tfwrite($f2, $l.' '.$r);\n\t\t}\n\t}\n} else {\n\tfwrite($f2, 0);\n}\n\nfclose($f2);"}, {"source_code": " sizeof($right)) {\n\t\t$left += $all;\n\t} else {\n\t\t$right += $all;\n\t}\n\n} else {\n\t$left = array(1=>1);\n\tunset($all[1]);\n\t$right = $all;\n}\n\n$ql = sizeof($left);\n$qr = sizeof($right);\n\nif ($a = $ql * $qr) {\n\techo $a;\n\tforeach ($left as $l=>$null) {\n\t\tforeach ($right as $r=>$null) {\n\t\t\techo PHP_EOL.$l.' '.$r;\n\t\t}\n\t}\n} else {\n\techo 0;\n}"}, {"source_code": " sizeof($right)) {\n\t\t$left += $all;\n\t} else {\n\t\t$right += $all;\n\t}\n\n} else {\n\t$left = array(1=>1);\n\tunset($all[1]);\n\t$right = $all;\n}\n\n$ql = sizeof($left);\n$qr = sizeof($right);\n\nif ($a = $ql * $qr) {\n\tfwrite($f2, $a.PHP_EOL);\n\tforeach ($left as $l=>$null) {\n\t\tforeach ($right as $r=>$null) {\n\t\t\tfwrite($f2, $l.' '.$r.PHP_EOL);\n\t\t}\n\t}\n} else {\n\tfwrite($f2, 0);\n}\n\nfclose($f2);"}], "src_uid": "d93a0574497b60bb77fb1c1dfe95090f"} {"source_code": "", "positive_code": [{"source_code": "\n"}, {"source_code": ""}, {"source_code": " 0; $t--){\n\n\t$n = intval(fgets(STDIN));\n\n\tif(($a = $solve($n)) === false){\n\t\techo \"NO\";\n\t} else {\n\t\techo \"YES\\n\";\n\t\techo implode(' ', $a);\n\t}\n\techo \"\\n\";\n}\n"}, {"source_code": ""}, {"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n $n = intval(trim(fgets(STDIN)));\n if(($n / 2) % 2 == 1) {\n print \"NO\\n\";\n continue;\n }\n print \"YES\\n\";\n\n for($i = 0; $i < $n / 2; $i++){\n print (($i + 1) * 2).\" \";\n }\n\n for($i = 1; $i < $n - 1; $i += 2){\n print ($i).\" \";\n }\n\n print $n + $n / 2 - 1;\n print \"\\n\";\n\n\n\n}\n\n\n"}, {"source_code": " 1) {\n echo $diff.\" \";\n $sum -= $diff;\n $diff += 2;\n $k--;\n }\n echo $sum.\"\\n\";\n}"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n $n = intval(trim(fgets(STDIN)));\n if(($n / 2) % 2 == 1) {\n print \"NO\\n\";\n continue;\n }\n\n for($i = 0; $i < $n / 2; $i++){\n print (($i + 1) * 2).\" \";\n }\n\n for($i = 1; $i < $n - 1; $i += 2){\n print ($i).\" \";\n }\n\n print $n + $n / 2 - 1;\n print \"\\n\";\n\n\n\n}\n\n\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}], "src_uid": "0c7e019e1e955cadacca55b4e823a3e5"} {"source_code": "solution($data1, $data2 , $data3) . \"\\r\\n\";\r\n}\r\n\r\nclass MainClass {\r\n\r\n\tpublic function solution($n , $m , $data)\r\n\t{\r\n\t if($m == 1)\r\n \t return 0;\r\n \t\r\n \t$sum = array_sum($data);\r\n \tif($sum % $m != 0)\r\n \t return -1;\r\n \t \r\n \t$avg=$sum/count($data);\r\n \t$max= 0;\r\n \t$min= 0;\r\n \tforeach($data as $value)\r\n \t{\r\n \t if($value > $avg)\r\n \t {\r\n \t $max++;\r\n \t }\r\n \t elseif($value <= $avg)\r\n \t {\r\n \t $min++;\r\n \t }\r\n \t}\r\n \t\r\n\t return $max;\r\n\t}\r\n}\r\n", "positive_code": [{"source_code": " $d) { $ans++; }\r\n }\r\n echo $ans.PHP_EOL;\r\n }\r\n}\r\n\r\n?>"}], "negative_code": [{"source_code": "solution($data1, $data2 , $data3) . \"\\r\\n\";\r\n}\r\n\r\nclass MainClass {\r\n\r\n\tpublic function solution($n , $m , $array)\r\n\t{\r\n\t if($m == 1)\r\n \t return 0;\r\n \t \r\n\t $sum = $max_c = $max = 0;\r\n\t foreach($array as $index)\r\n\t {\r\n\t $sum += $index;\r\n\t if($max < $index)\r\n\t {\r\n\t $max = $index;\r\n\t }\r\n\t }\r\n\t \r\n\t if($sum % $m != 0)\r\n return -1;\r\n \r\n\t foreach($array as $index)\r\n\t {\r\n\t if($max == $index)\r\n {\r\n $max_c++;\r\n }\r\n\t }\r\n\t \r\n\t return $m - $max_c;\r\n\t}\r\n}\r\n"}, {"source_code": "solution($data1, $data2 , $data3) . \"\\r\\n\";\r\n}\r\n\r\n\r\n// End of interface\r\n\r\n\r\nclass MainClass {\r\n\t// 978\u0412.File name\r\n\t//public $problemLink = 'https://codeforces.com/problemset/problem/978/B';\r\n\t//public $submissionLink = '';\r\n\r\n\tpublic function solution($n , $m , $array)\r\n\t{\r\n\t if($m == 1)\r\n \t return 0;\r\n \t \r\n\t $sum = $max_c = $max = 0;\r\n\t foreach($array as $index)\r\n\t {\r\n\t $sum += $index;\r\n\t if($max < $index)\r\n\t {\r\n\t $max = $index;\r\n\t }\r\n\t }\r\n\t \r\n\t if($sum % $m != 0)\r\n return -1;\r\n \r\n\t foreach($array as $index)\r\n\t {\r\n\t if($max == $index)\r\n {\r\n $max_c++;\r\n }\r\n\t }\r\n\t \r\n\t return $max - $max_c;\r\n\t}\r\n}\r\n"}], "src_uid": "b8554e64b92b1b9458955da7d55eba62"} {"source_code": "= 0; $y--)\n {\n if($d[$c[$x]] == \"-1\")\n {\n $d[$c[$x]] = $e[$c[$x]];\n }\n else\n {\n break;\n }\n }\n }\n elseif($d[$c[$x]] == \"-1\")\n {\n $g = $b;\n for($y = $c[$x]; $y >= 0; $y--)\n {\n $g--;\n if(($g == 0) || ($y == 0) || ($d[$y] != \"-1\"))\n {\n if($d[$y] != \"-1\")\n {\n $g++;\n $y++;\n break;\n }\n break;\n }\n }\n $h = $y;\n $f .= $h . \" \";\n for($y = $h; $y <= $c[$x]; $y++)\n {\n $d[$y] = $h;\n $e[$y] = $h;\n }\n if($g > 0)\n {\n for($y = $c[$x] + 1; $y < 256; $y++)\n {\n if(($e[$y] == \"-1\") && ($g > 0))\n {\n $e[$y] = $h;\n }\n else\n {\n break;\n }\n $g--;\n }\n }\n }\n}\nprint $f;\n?>"}], "negative_code": [{"source_code": "= 0; $y--)\n {\n if($d[$c[$x]] == \"-1\")\n {\n $d[$c[$x]] = $e[$c[$x]];\n }\n else\n {\n break;\n }\n }\n }\n elseif($d[$c[$x]] == \"-1\")\n {\n $g = $b;\n for($y = $c[$x]; $y >= 0; $y--)\n {\n $g--;\n if(($g == 0) || ($y == 0) || ($d[$y] != \"-1\"))\n {\n if($d[$y] != \"-1\")\n {\n $g++;\n $y++;\n break;\n }\n break;\n }\n }\n $h = $y;\n $f .= $h . \" \";\n for($y = $h; $y <= $c[$x]; $y++)\n {\n $d[$y] = $h;\n $e[$y] = $h;\n }\n if($c[$x] == 0)\n {\n $g--;\n }\n if($g > 0)\n {\n for($y = $c[$x] + 1; $y < 256; $y++)\n {\n if(($e[$y] == \"-1\") && ($g > 0))\n {\n $e[$y] = $h;\n }\n else\n {\n break;\n }\n $g--;\n }\n }\n }\n}\nprint $f;\n?>"}, {"source_code": "= 0; $y--)\n {\n if($d[$c[$x]] == \"-1\")\n {\n $d[$c[$x]] = $e[$c[$x]];\n }\n else\n {\n break;\n }\n }\n }\n elseif($d[$c[$x]] == \"-1\")\n {\n $g = $b;\n for($y = $c[$x]; $y >= 0; $y--)\n {\n $g--;\n if(($g == 0) || ($y == 0) || ($d[$y] != \"-1\"))\n {\n if($d[$y] != \"-1\")\n {\n $g++;\n $y++;\n break;\n }\n break;\n }\n }\n $h = $y;\n $f .= $h . \" \";\n for($y = $h; $y <= $c[$x]; $y++)\n {\n $d[$y] = $h;\n $e[$y] = $h;\n }\n if($c[$x] == 0)\n {\n $g--;\n }\n if($g > 0)\n {\n for($y = $c[$x] + 1; $y < 256; $y++)\n {\n if(($e[$y] == \"-1\") && ($g > 0))\n {\n $e[$y] = $h;\n }\n else\n {\n break;\n }\n $g--;\n }\n }\n }\n}\nprint $f;\n?>"}, {"source_code": "= 0; $y--)\n {\n if($d[$c[$x]] == \"-1\")\n {\n $d[$c[$x]] = $e[$c[$x]];\n }\n else\n {\n break;\n }\n }\n }\n elseif($d[$c[$x]] == \"-1\")\n {\n $g = $b;\n for($y = $c[$x]; $y >= 0; $y--)\n {\n $g--;\n if(($g == 0) || ($y == 0) || ($d[$y] != \"-1\"))\n {\n if($d[$y] != \"-1\")\n {\n $g++;\n $y++;\n break;\n }\n break;\n }\n }\n $h = $y;\n $f .= $h . \" \";\n for($y = $h; $y <= $c[$x]; $y++)\n {\n $d[$y] = $h;\n $e[$y] = $h;\n }\n if($c[$x] == 0)\n {\n $g--;\n }\n if($g > 0)\n {\n for($y = $c[$x] + 1; $y < 256; $y++)\n {\n if(($e[$y] == \"-1\") && ($g > 0))\n {\n $e[$y] = $h;\n }\n else\n {\n break;\n }\n $g--;\n }\n }\n }\n }\n print $f;\n}\n?>"}, {"source_code": "$x && $start>=0 && $map[$start]==-1; $start--);\n $result[] = ++$start;\n for($i=0; $i<$k; $i++){\n $map[$start+$i] = $start;\n }\n }\n }\n return $result;\n}\n\nfunction main()\n{\n list($n, $k) = explode(\" \", fgets(STDIN));\n $arr = array();\n for($i=0; $i<$n; $i++){\n $arr[] = intval(stream_get_line(STDIN, 4, \" \"));\n }\n\n echo implode(\" \", mapping($arr, intval($k)));\n}\n\nmain();"}], "src_uid": "deed251d324f7bbe53eefa94f92c3bbc"} {"source_code": " intval(($t-$i-1+$n)/$n)){\n\t\t\t$m = intval(($t-$i-1+$n)/$n);\n\t\t\t$ans = $i;\n\t\t}\n\t}\n\tprint($ans+1);\n\tfclose($handle);\n?>", "positive_code": [{"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": "\n"}], "src_uid": "b18bbefd2a948da9dec1d6f27f219ed1"} {"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$t = $ir->readInt();\n\nfor($i=1; $i<=$t; $i++) {\n\tlist($l, $r) = $ir->readArrayOfInt(2);\n\techo $l.' '.(2*$l).\"\\n\";\n\tflush();\n}\n", "positive_code": [{"source_code": ""}, {"source_code": " 0 ; $i--) {\n list($x, $y) = explode(' ', trim(fgets(STDIN)));\n echo $x .\" \".($x*2).\"\\n\";\n $number--;\n}\n"}, {"source_code": " 0 ; $i--) {\n list($x, $y) = explode(' ', trim(fgets(STDIN)));\n for ($j=$x; $j < $y ; $j++) {\n if ($y%$j == 0) {\n echo $j .\" \".$y.\"\\n\";\n break;\n }\n }\n $number--;\n}\n"}, {"source_code": " 0 ; $i--) {\n list($x, $y) = explode(' ', trim(fgets(STDIN)));\n for ($j=$x; $j <= $y ; $j++) {\n if ($y%$j == 0 && $j != $y) {\n echo $j .\" \".$y.\"\\n\";\n break;\n }\n }\n $number--;\n}\n"}], "src_uid": "a9cd97046e27d799c894d8514e90a377"} {"source_code": " ($n * ($n - 1)) / 2) {\n\techo \"-1\\n\";exit;\n}\n$output = $n*$k.\"\\n\";\n$winMap = array();\nfor ($i = 1; $i <= $n; $i++) {\n\t$winMap[$i] = 0;\n}\nfor ($i = 1; $i <= $n; $i++) {\n\tfor ($j = $i + 1; $j <= $n; $j++) {\n\t\tif ($winMap[$i] < $k) {\n\t\t\t$output .= \"$i $j\\n\";\n\t\t\t$winMap[$i] += 1;\n\t\t} else if ($winMap[$j] < $k) {\n\t\t\t$winMap[$j] += 1;\n\t\t\t$output .= \"$j $i\\n\";\n\t\t}\n\t}\n}\necho $output;\n?>", "positive_code": [{"source_code": " floor(($t - 1) / 2))\n{\n\techo \"-1\" . PHP_EOL;\n\texit;\n}\n \n$gg = array();\n$gp = array();\n \n$tm = 0;\n \nfor($i = 0; $i < $t; $i++)\n{\n\t$w = 0;\n\tfor($j = 1; $w < $v; $j++)\n\t{\n\t\t$k = (($i + $j) >= $t) ? $i + $j - $t : $i + $j;\n \n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$w++;\n\t\t\t//$gg[] = ($i + 1) . \" \" . ($k + 1);\n \n\t\t $tm++;\n\t\t //don't add to array, just output\n\t\t $o .= ($i + 1) . \" \" . ($k + 1) . PHP_EOL;\n\t\t}\n \n \n\t\t$gp[$i][$k] = true;\n\t\t$gp[$k][$i] = true;\n\t}\n}\n \necho $tm . PHP_EOL . $o;"}], "negative_code": [{"source_code": " ($n * ($n - 1)) / 2) {\n\techo \"-1\\n\";exit;\n}\n$output = $n*$k.\"\\n\";\n$winMap = array();\nfor ($i = 1; $i <= $n; $i++) {\n\t$winMap[$i] = 0;\n}\nfor ($i = 1; $i <= $n; $i++) {\n\tfor ($j = $i + 1; $j <= $n; $j++) {\n\t\tif ($winMap[$i] < $k) {\n\t\t\t$output .= \"$i $j\\n\";\n\t\t\t$winMap[$i] += 1;\n\t\t} else if ($winMap[$j] < $k) {\n\t\t\t$winMap[$j] += 1;\n\t\t\t$output .= \"$j $i\\n\";\n\t\t}\n\t}\n}\necho $output;\n?>"}, {"source_code": " ($n * ($n - 1)) / 2) {\n\tdie(\"-1\\n\");\n}\necho $n*$k.\"\\n\";\n$winMap = array();\nfor ($i = 1; $i <= $n; $i++) {\n\t$winMap[$i] = 0;\n}\nfor ($i = 1; $i <= $n; $i++) {\n\tfor ($j = $i + 1; $j <= $n; $j++) {\n\t\tif ($winMap[$i] < $k) {\n\t\t\techo \"$i $j\\n\";\n\t\t\t$winMap[$i] += 1;\n\t\t} else if ($winMap[$j] < $k) {\n\t\t\t$winMap[$j] += 1;\n\t\t\techo \"$j $i\\n\";\n\t\t}\n\t}\n}\n?>"}, {"source_code": " ($n * ($n - 1)) / 2) {\n\tdie(\"-1\\n\");\n}\necho $n*$k.\"\\n\";\n$winMap = array();\nfor ($i = 1; $i <= $n; $i++) {\n\t$winMap[$i] = 0;\n}\nfor ($i = 1; $i <= $n; $i++) {\n\tfor ($j = $i + 1; $j <= $n; $j++) {\n\t\tif ($winMap[$i] < $k) {\n\t\t\techo \"$i $j\\n\";\n\t\t\t$winMap[$i] += 1;\n\t\t} else if ($winMap[$j] < $k) {\n\t\t\t$winMap[$j] += 1;\n\t\t\techo \"$j $i\\n\";\n\t\t}\n\t}\n}\n?>"}, {"source_code": " ($n * ($n - 1)) / 2) {\n\texit(\"-1\\n\");\n}\necho $n*$k.\"\\n\";\n$winMap = array();\nfor ($i = 1; $i <= $n; $i++) {\n\t$winMap[$i] = 0;\n}\nfor ($i = 1; $i <= $n; $i++) {\n\tfor ($j = $i + 1; $j <= $n; $j++) {\n\t\tif ($winMap[$i] < $k) {\n\t\t\techo \"$i $j\\n\";\n\t\t\t$winMap[$i] += 1;\n\t\t} else if ($winMap[$j] < $k) {\n\t\t\t$winMap[$j] += 1;\n\t\t\techo \"$j $i\\n\";\n\t\t}\n\t}\n}\n?>"}, {"source_code": "= $t) ? $i + $j - $t : $i + $j;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$w++;\n\t\t\t$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$k][$i] = true;\n\t}\n}\n\necho (sizeof($gg)) . PHP_EOL;\nforeach($gg as $g) {\n\techo $g . PHP_EOL;\n}\n"}, {"source_code": " ($t / 2))\n{\n\techo \"-1\" . PHP_EOL;\n\texit;\n}\n\n$gg = array();\n$gp = array();\n\n$tm = 0;\n\nfor($i = 0; $i < $t; $i++)\n{\n\t$w = 0;\n\tfor($j = 1; $w < $v; $j++)\n\t{\n\t\t$k = (($i + $j) >= $t) ? $i + $j - $t : $i + $j;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$w++;\n\t\t\t//$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t\n\t\t $tm++;\n\t\t //don't add to array, just output\n\t\t $o .= ($i + 1) . \" \" . ($k + 1) . PHP_EOL;\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$k][$i] = true;\n\t}\n}\n\necho $tm . PHP_EOL . $o;"}, {"source_code": "= $t) ? $i + $j + 1 - $t : $i + $j + 1;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$w++;\n\t\t\t$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$j][$k] = true;\n\t}\n}\n\necho (sizeof($gg)) . PHP_EOL;\nforeach($gg as $g) {\n\techo $g . PHP_EOL;\n}\n"}, {"source_code": " floor(($t / 2)))\n{\n\techo \"-1\" . PHP_EOL;\n\texit;\n}\n\n$gg = array();\n$gp = array();\n\nfor($i = 0; $i < $t; $i++)\n{\n\t$w = 0;\n\tfor($j = 1; $w < $v; $j++)\n\t{\n\t\t$k = (($i + $j) >= $t) ? $i + $j - $t : $i + $j;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$w++;\n\t\t\t$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$k][$i] = true;\n\t}\n}\n\necho (sizeof($gg)) . PHP_EOL;\nforeach($gg as $g) {\n\techo $g . PHP_EOL;\n}\n"}, {"source_code": "= $t) ? $i + $j + 1 - $t : $i + $j + 1;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$j][$k] = true;\n\t}\n}\n\nforeach($gg as $g) {\n\techo $g . PHP_EOL;\n}\n"}, {"source_code": "= $t) ? $i + $j - $t : $i + $j;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$w++;\n\t\t\t$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$j][$k] = true;\n\t}\n}\n\necho (sizeof($gg)) . PHP_EOL;\nforeach($gg as $g) {\n\techo $g . PHP_EOL;\n}\n"}, {"source_code": "= $t) ? $i + $j + 1 - $t : $i + $j + 1;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$j][$k] = true;\n\t}\n}\n\necho (sizeof($gg)) . PHP_EOL;\nforeach($gg as $g) {\n\techo $g . PHP_EOL;\n}\n"}, {"source_code": " ($t / 2))\n{\n\techo \"-1\" . PHP_EOL;\n\texit;\n}\n\n$gg = array();\n$gp = array();\n\nfor($i = 0; $i < $t; $i++)\n{\n\t$w = 0;\n\tfor($j = 1; $w < $v; $j++)\n\t{\n\t\t$k = (($i + $j) >= $t) ? $i + $j - $t : $i + $j;\n\t\t\n\t\tif(! @isset($gp[$i][$k]))\n\t\t{\n\t\t\t$w++;\n\t\t\t$gg[] = ($i + 1) . \" \" . ($k + 1);\n\t\t}\n\t\t\n\t\t\n\t\t$gp[$i][$k] = true;\n\t\t$gp[$k][$i] = true;\n\t}\n}\n\necho (sizeof($gg)) . PHP_EOL;\nforeach($gg as $g) {\n\techo $g . PHP_EOL;\n}\n"}], "src_uid": "14570079152bbf6c439bfceef9816f7e"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "6b2b56a423c247d42493d01e06e4b1d2"} {"source_code": "", "positive_code": [{"source_code": " (int)$inputArray[$i],\n 'word_1' => $inputArray[$i + 1],\n 'word_2' => $inputArray[$i + 2]\n );\n }\n \n $response = array();\n foreach ($casesArray as $case) {\n if (countDifferencesAndValidate($case['length'], $case['word_1'], $case['word_2'])) {\n array_push($response, \"YES\");\n } else {\n array_push($response, \"NO\");\n }\n }\n \n echo implode(PHP_EOL, $response);\n \n function countDifferencesAndValidate($length, $word_1, $word_2)\n {\n $charactersOfWord_1 = str_split($word_1);\n $charactersOfWord_2 = str_split($word_2);\n \n $counter = 0;\n $differencesArray = array();\n for ($i = 0; $i < $length; $i++) {\n if ($charactersOfWord_1[$i] != $charactersOfWord_2[$i]) {\n $counter++;\n $differencesArray[$i] = array('word_1' => $charactersOfWord_1[$i], 'word_2' => $charactersOfWord_2[$i]);\n }\n\n if ($counter > 2) {\n return false;\n }\n }\n \n if ($counter == 2) {\n $status = validateDifferences($differencesArray);\n \n return $status;\n } else {\n return false;\n }\n }\n \n function validateDifferences($inputArray)\n {\n $keys = array_keys($inputArray);\n if ($inputArray[$keys[0]]['word_1'] == $inputArray[$keys[1]]['word_1'] &&\n $inputArray[$keys[0]]['word_2'] == $inputArray[$keys[1]]['word_2']) {\n return true;\n }\n \n return false;\n }"}, {"source_code": " (int)$inputArray[$i],\n 'word_1' => $inputArray[$i + 1],\n 'word_2' => $inputArray[$i + 2]\n );\n }\n \n $response = array();\n foreach ($casesArray as $case) {\n if (countDifferencesAndValidate($case['length'], $case['word_1'], $case['word_2'])) {\n array_push($response, \"YES\");\n } else {\n array_push($response, \"NO\");\n }\n }\n \n echo implode(PHP_EOL, $response);\n \n function countDifferencesAndValidate($length, $word_1, $word_2)\n {\n $charactersOfWord_1 = str_split($word_1);\n $charactersOfWord_2 = str_split($word_2);\n \n $counter = 0;\n $differencesArray = array();\n for ($i = 0; $i < $length; $i++) {\n if ($charactersOfWord_1[$i] != $charactersOfWord_2[$i]) {\n $counter++;\n $differencesArray[$i] = array('word_1' => $charactersOfWord_1[$i], 'word_2' => $charactersOfWord_2[$i]);\n }\n\n if ($counter > 2) {\n return false;\n }\n }\n \n if ($counter == 2) {\n $status = validateDifferences($differencesArray);\n \n return $status;\n } else {\n return false;\n }\n }\n \n function validateDifferences($inputArray)\n {\n $keys = array_keys($inputArray);\n if ($inputArray[$keys[0]]['word_1'] == $inputArray[$keys[1]]['word_1'] &&\n $inputArray[$keys[0]]['word_2'] == $inputArray[$keys[1]]['word_2']) {\n return true;\n }\n \n return false;\n }"}, {"source_code": " 2)\n\t\t{\n\t\t\t$ans .= \"No\\n\";\n\t\t\tbreak;\n\t\t}\n\t}\n\t$found = 0;\n\t//print_r($df);\n\tif ($diff <= 2)\n\t{\n\t\tif ($diff == 0)\n\t\t{\n\t\t\t$ans .= \"Yes\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < count($df); $i++)\n\t\t\t{\n\t\t\t\tfor ($j = 0; $j < count($df); $j++)\n\t\t\t\t\tif (check($df[$i], $df[$j], $s1, $s2))\n\t\t\t\t\t{\n\t\t\t\t\t\t$found = 1;\n\t\t\t\t\t\t$ans .= \"Yes\\n\";\n\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif ($found == 0)\n\t\t\t\t$ans .= \"No\\n\";\n\t\t}\n\t}\n}\necho $ans;\n\n?>"}, {"source_code": " (int)$inputArray[$i],\n 'word_1' => $inputArray[$i + 1],\n 'word_2' => $inputArray[$i + 2]\n );\n }\n \n $response = array();\n foreach ($casesArray as $case) {\n if (countDifferencesAndValidate($case['length'], $case['word_1'], $case['word_2'])) {\n array_push($response, \"YES\");\n } else {\n array_push($response, \"NO\");\n }\n }\n \n echo implode(PHP_EOL, $response);\n \n function countDifferencesAndValidate($length, $word_1, $word_2)\n {\n $charactersOfWord_1 = str_split($word_1);\n $charactersOfWord_2 = str_split($word_2);\n \n $counter = 0;\n $differencesArray = array();\n for ($i = 0; $i < $length; $i++) {\n if ($charactersOfWord_1[$i] != $charactersOfWord_2[$i]) {\n $counter++;\n $differencesArray[$i] = array('word_1' => $charactersOfWord_1[$i], 'word_2' => $charactersOfWord_2[$i]);\n }\n\n if ($counter > 2) {\n return false;\n }\n }\n \n if ($counter == 2) {\n $status = validateDifferences($differencesArray);\n \n return $status;\n } else {\n return false;\n }\n }\n \n function validateDifferences($inputArray)\n {\n $keys = array_keys($inputArray);\n if ($inputArray[$keys[0]]['word_1'] == $inputArray[$keys[1]]['word_1'] &&\n $inputArray[$keys[0]]['word_2'] == $inputArray[$keys[1]]['word_2']) {\n return true;\n }\n \n return false;\n }"}, {"source_code": ""}, {"source_code": " 2 || count($bR) > 2){\n $bool = \"No\";\n break;\n }\n }\n \n if(count($aR) == 1){\n $bool = \"No\";\n }\n \n if($bool == \"Yes\"){\n $r1 = array_unique($aR);\n $r2 = array_unique($bR);\n if(count($r1) > 1 || count($r2) > 1){\n $bool = \"No\";\n }\n }\n echo $bool.\"\\n\";\n \n \n \n}\n \n"}, {"source_code": " $j,\n 'word' => $s1[$j]\n ];\n $aTest2[] = [\n 'key' => $j,\n 'word' => $s2[$j]\n ];\n $iCountFalse++;\n }\n }\n if($iCountFalse == 2 && ($aTest1[0]['word'] == $aTest1[1]['word'] && $aTest2[0]['word'] == $aTest2[1]['word'])){\n echo \"YES\".\"\\n\";\n } else {\n echo \"NO\".\"\\n\";\n }\n}\n\n\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;$t=0;\n $t = trim(fgets($handle));\n for($i=0;$i<$t;$i++)\n {\n $arr=array();\n $d = trim(fgets($handle));\n\n $str1 = trim(fgets($handle));\n $str2 = trim(fgets($handle));\n\n $arr=array();\n $ans=1;\n for ($h=0;$h<$d;$h++) {\n if($str1[$h]!=$str2[$h])\n {\n $arr[]=$str1[$h].$str2[$h];\n }\n }\n\n if(sizeof($arr)==2 && $arr[0]==$arr[1])\n printf(\"%s\\n\",\"Yes\");\n else\n printf(\"%s\\n\",\"No\");\n\n\n\n }\n\n}\n\nsolve();\n?>"}, {"source_code": "2)\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\tif($cnt==2&&$a[0]==$a[1]&&$b[0]==$b[1])\n\t\techo \"Yes\\n\";\n\telse\n\t\techo \"No\\n\";\n}"}], "negative_code": [{"source_code": " $j,\n 'word' => $s1[$j]\n ];\n $aTest2[] = [\n 'key' => $j,\n 'word' => $s2[$j]\n ];\n $iCountFalse++;\n }\n }\n if($iCountFalse == 2 && $k != $iCountFalse && ($aTest1[0]['word'] == $aTest1[1]['word'] && $aTest2[1]['word'] == $aTest2[0]['word'])){\n $s1[$aTest1[0]['key']] = $aTest2[0]['word'];\n $s2[$aTest2[1]['key']] = $aTest1[1]['word'];\n if($s1 == $s2){\n echo \"YES\".\"\\n\";\n } else {\n echo \"NO\".\"\\n\";\n }\n } else {\n echo \"NO\".\"\\n\";\n }\n}\n\n\n"}, {"source_code": ""}, {"source_code": " (int)$inputArray[$i],\n 'word_1' => $inputArray[$i + 1],\n 'word_2' => $inputArray[$i + 2]\n );\n }\n \n $response = array();\n foreach ($casesArray as $case) {\n if (countDifferencesAndValidate($case['length'], $case['word_1'], $case['word_2'])) {\n array_push($response, \"YES\");\n } else {\n array_push($response, \"NO\");\n }\n }\n \n echo implode(PHP_EOL, $response);\n \n function countDifferencesAndValidate($length, $word_1, $word_2)\n {\n $charactersOfWord_1 = str_split($word_1);\n $charactersOfWord_2 = str_split($word_2);\n \n $counter = 0;\n $differencesArray = array();\n for ($i = 0; $i < $length; $i++) {\n if ($charactersOfWord_1[$i] != $charactersOfWord_2[$i]) {\n $counter++;\n $differencesArray[$i] = array('word_1' => $charactersOfWord_1[$i], 'word_2' => $charactersOfWord_2[$i]);\n }\n\n if ($counter > 2) {\n return false;\n }\n }\n \n if ($counter == 2) {\n $status = validateDifferences($differencesArray);\n \n return $status;\n } else {\n return false;\n }\n }\n \n function validateDifferences($inputArray)\n {\n $keys = array_keys($inputArray);\n if ($inputArray[$keys[0]]['word_1'] == $inputArray[$keys[1]]['word_1'] &&\n $inputArray[$keys[0]]['word_2'] == $inputArray[$keys[1]]['word_2']) {\n return true;\n }\n \n return false;\n }"}, {"source_code": " (int)$inputArray[$i],\n 'word_1' => $inputArray[$i + 1],\n 'word_2' => $inputArray[$i + 2]\n );\n }\n \n $response = array();\n foreach ($casesArray as $case) {\n// if (countDifferencesAndValidate($case['length'], $case['word_1'], $case['word_2'])) {\n// $response[] = \"YES\";\n// } else {\n// $response[] = \"NO\";\n// }\n }\n \n echo 1; exit();"}, {"source_code": " (int)$inputArray[$i],\n 'word_1' => $inputArray[$i + 1],\n 'word_2' => $inputArray[$i + 2]\n );\n }\n \n $response = array();\n foreach ($casesArray as $case) {\n if (countDifferencesAndValidate($case['length'], $case['word_1'], $case['word_2'])) {\n array_push($response, \"YES\");\n } else {\n array_push($response, \"NO\");\n }\n }\n \n echo implode(' ', $response);\n \n function countDifferencesAndValidate($length, $word_1, $word_2)\n { \n $charactersOfWord_1 = str_split($word_1);\n $charactersOfWord_2 = str_split($word_2);\n \n $counter = 0;\n $differencesArray = array();\n for ($i = 0; $i < $length; $i++) {\n if ($charactersOfWord_1[$i] != $charactersOfWord_2[$i]) {\n $counter++;\n $differencesArray[$i] = array('word_1' => $charactersOfWord_1[$i], 'word_2' => $charactersOfWord_2[$i]);\n }\n\n if ($counter > 2) {\n return false;\n }\n }\n \n if ($counter == 2) {\n $status = validateDifferences($differencesArray);\n \n return $status;\n } else {\n return false;\n }\n }\n \n function validateDifferences($inputArray)\n {\n $keys = array_keys($inputArray);\n if ($inputArray[$keys[0]]['word_1'] == $inputArray[$keys[1]]['word_1'] &&\n $inputArray[$keys[0]]['word_2'] == $inputArray[$keys[1]]['word_2']) {\n return true;\n }\n \n return false;\n }"}, {"source_code": " (int)$inputArray[$i],\n 'word_1' => $inputArray[$i + 1],\n 'word_2' => $inputArray[$i + 2]\n );\n }\n \n var_dump($casesArray);exit();"}, {"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;$t=0;\n $t = trim(fgets($handle));\n for($i=0;$i<$t;$i++)\n {\n $arr=array();\n $d = trim(fgets($handle));\n\n $str1 = trim(fgets($handle));\n $str2 = trim(fgets($handle));\n $str1map=array();\n $str2map=array();\n for ($h=0;$h<$d;$h++)\n {\n if(isset($str1map[$str1[$h]])) {\n $str1map[$str1[$h]] = $str1map[$str1[$h]] + 1;\n }else\n {\n $str1map[$str1[$h]]=0;\n }\n if(isset($str2map[$str2[$h]])) {\n $str2map[$str2[$h]] = $str2map[$str2[$h]] + 1;\n }else\n {\n $str2map[$str2[$h]]=0;\n }\n\n }\n $arr=array();\n $ans=0;\n for ($h=0;$h<$d;$h++) {\n\n if ($str1[$h] != $str2[$h] && $str1map[$str1[$h]] == $str2map[$str2[$h]] && $str1map[$str1[$h]] == 1)\n $ans = 1;\n }\n if($ans==1)\n printf(\"%s\\n\",\"Yes\");\n else\n printf(\"%s\\n\",\"No\");\n\n\n\n }\n\n}\n\nsolve();\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;$t=0;\n $t = trim(fgets($handle));\n for($i=0;$i<$t;$i++)\n {\n $arr=array();\n $d = trim(fgets($handle));\n\n $str1 = trim(fgets($handle));\n $str2 = trim(fgets($handle));\n $str1map=array();\n $str2map=array();\n for ($h=0;$h<$d;$h++)\n {\n if(isset($str1map[$str1[$h]])) {\n $str1map[$str1[$h]] = $str1map[$str1[$h]] + 1;\n }else\n {\n $str1map[$str1[$h]]=0;\n }\n if(isset($str2map[$str2[$h]])) {\n $str2map[$str2[$h]] = $str2map[$str2[$h]] + 1;\n }else\n {\n $str2map[$str2[$h]]=0;\n }\n\n }\n $arr=array();\n $ans=1;\n for ($h=0;$h<$d;$h++) {\n if ($str1[$h] != $str2[$h] && $str1map[$str1[$h]] == $str2map[$str2[$h]] && $str1map[$str1[$h]] >0)\n $ans = 1;\n else if($str1[$h]==$str2[$h]){\n $ans=1;\n }else\n {\n $ans=0;\n }\n }\n if($ans==1)\n printf(\"%s\\n\",\"Yes\");\n else\n printf(\"%s\\n\",\"No\");\n\n\n\n }\n\n}\n\nsolve();\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($local, \"r\");\n $s=\"\";$d=0;$t=0;\n $t = trim(fgets($handle));\n for($i=0;$i<$t;$i++)\n {\n $arr=array();\n $d = trim(fgets($handle));\n\n $str1 = trim(fgets($handle));\n $str2 = trim(fgets($handle));\n\n $arr=array();\n $ans=1;\n for ($h=0;$h<$d;$h++) {\n if($str1[$h]!=$str2[$h])\n {\n $arr[]=$str1[$h].$str2[$h];\n }\n }\n\n if(sizeof($arr)==2 && $arr[0]==$arr[1])\n printf(\"%s\\n\",\"Yes\");\n else\n printf(\"%s\\n\",\"No\");\n\n\n\n }\n\n}\n\nsolve();\n?>"}], "src_uid": "97fa7e82566e3799e165ce6cbbf1da22"} {"source_code": "", "positive_code": [{"source_code": " $k) {\r\n for ($i=0; $i<$k; $i++) {\r\n for ($j=$k+$i; $j<$n; $j +=$k) {\r\n if($a[$i] < $a[$j]) {\r\n $a[$i] = $a[$j];\r\n }\r\n } \r\n } \r\n }\r\n \r\n $ans = 0;\r\n for ($i=0; $i<$k; $i++) {\r\n $ans = bcadd($ans, $a[$i]);\r\n }\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}"}], "negative_code": [], "src_uid": "f974c33780a933a6076c0559e48b7552"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "2b77aa85a192086316a7f87ce140112d"} {"source_code": " 1)\n {\n $k = 1;\n break;\n }\n else\n {\n $l += $o;\n }\n }\n }\n if($k == 0)\n {\n $h[count($h)] = $l;\n }\n }\n if(count($h) == 0)\n {\n print \"-1\";\n }\n else\n {\n print min($h);\n }\n }\n }\n \n}\n?>", "positive_code": [{"source_code": " 2) {\n\t\t\n\t\t// define first elements\n for ($i = -1; $i < 2; $i++) {\n\t\t\t\n\t\t\t$a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n\t\t\t\t\n\t\t\t\t$tryCount = abs($i) + abs($j);\n\n\t\t\t\tfor ($k = 2; $k < count($sequence); $k++) {\n\n\t\t\t\t\t$diff = abs($sequence[$k] - ($a1 + $k * ($a2 - $a1)));\n\t\t\t\t\t\n\t\t\t\t\tif ($diff > 1) {\n\t\t\t\t\t\t$tryCount = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tryCount += $diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($count <= 0 || ($count > $tryCount && $tryCount != -1))\n\t\t\t\t{\n\t\t\t\t\t$count = $tryCount;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($tryCount == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($count == 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $count;\n}\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\necho sequence1($sequence);\n\n//echo sequence1(explode(' ', '1 3 6 9 12'));"}, {"source_code": " 2) {\n\t\t\n\t\t// define first elements\n for ($i = -1; $i < 2; $i++) {\n\t\t\t\n\t\t\t$tryCount = 0;\n\t\t\t$a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n\t\t\t\t\n\t\t\t\t$tryCount = abs($i) + abs($j);\n\n\t\t\t\tfor ($k = 2; $k < count($sequence); $k++) {\n\n\t\t\t\t\t$diff = abs($sequence[$k] - ($a1 + $k * ($a2 - $a1)));\n\t\t\t\t\t\n\t\t\t\t\tif ($diff > 1) {\n\t\t\t\t\t\t$tryCount = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tryCount += $diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($count == 0 || $count > $tryCount)\n\t\t\t\t{\n\t\t\t\t\t$count = $tryCount;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\tif($tryCount != -1)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($tryCount == 0)\n\t\t\t{\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $count;\n}\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\necho sequence1($sequence);\n\n//echo sequence1(explode(' ', '24 21 14 10'));"}, {"source_code": " 2) {\n\t\t\n\t\t// define first elements\n for ($i = -1; $i < 2; $i++) {\n\t\t\t\n\t\t\t$tryCount = 0;\n\t\t\t$a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n\t\t\t\t\n\t\t\t\t$tryCount = abs($i) + abs($j);\n\n\t\t\t\tfor ($k = 2; $k < count($sequence); $k++) {\n\n\t\t\t\t\t$diff = abs($sequence[$k] - ($a1 + $k * ($a2 - $a1)));\n\t\t\t\t\t\n\t\t\t\t\tif ($diff > 1) {\n\t\t\t\t\t\t$tryCount = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tryCount += $diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$count = $tryCount;\n\t\t\t\n\t\t\tif($tryCount != -1)\n\t\t\t{\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $count;\n}\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\necho sequence1(sequence);"}, {"source_code": " 2) {\n\n $diff = $numbers[1] - $numbers[0];\n\n for ($i = 2; $i < count($numbers); $i++) {\n\n $prevDiff = $diff;\n $diff = $numbers[$i] - $numbers[$i - 1];\n\n $c = abs($prevDiff - $diff);\n\n if ($c <= 4) {\n $needChange += floor($c / 2);\n } else {\n $needChange = -1;\n break;\n }\n }\n }\n\n echo $needChange, PHP_EOL;\n}\n\nfscanf($handle, \"%i\", $n);\n\n$numbers = explode(' ', fgets($handle));\n\ncheck($numbers);\n\n\n\n"}, {"source_code": " 2) {\n\n $a1 = $sequence[0];\n $a2 = $sequence[1];\n\n $found = false;\n\n $d1 = 0;\n $d2 = 0;\n $minDiff = null;\n\n // define first elements\n for ($i = -1; $i < 2; $i++) {\n\n $a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n $r = abs($sequence[2] - ($a1 + 2 * ($a2 - $a1)));\n\n if ($r <= 1 && ($minDiff === null || $r < $minDiff)) {\n\n $found = true;\n\n $minDiff = $r;\n $d1 = $i;\n $d2 = $j;\n }\n }\n }\n\n if ($found) {\n\n $a1 = $sequence[0] + $d1;\n $a2 = $sequence[1] + $d2;\n\n $count = abs($d1) + abs($d2);\n\n for ($i = 2; $i < count($sequence); $i++) {\n\n $diff = abs($sequence[$i] - ($a1 + $i * ($a2 - $a1)));\n\n if ($diff > 1) {\n $count = -1;\n break;\n } else {\n $count += $diff;\n }\n }\n\n } else {\n $count = -1;\n }\n\n }\n\n return $count;\n}\n\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\n\necho sequence($sequence);"}, {"source_code": " 2) {\n\t\t\n\t\t// define first elements\n for ($i = -1; $i < 2; $i++) {\n\t\t\t\n\t\t\t$tryCount = 0;\n\t\t\t$a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n\t\t\t\t\n\t\t\t\t$tryCount = abs($i) + abs($j);\n\n\t\t\t\tfor ($k = 2; $k < count($sequence); $k++) {\n\n\t\t\t\t\t$diff = abs($sequence[$k] - ($a1 + $k * ($a2 - $a1)));\n\t\t\t\t\t\n\t\t\t\t\tif ($diff > 1) {\n\t\t\t\t\t\t$tryCount = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tryCount += $diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$count = $tryCount;\n\t\t\t\n\t\t\tif($tryCount != -1)\n\t\t\t{\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $count;\n}\n\n/*\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));*/\n\necho sequence1(explode(' ', '12 444 876 1309 1740 2174 2604 3037 3470 3901 4334 4764 5196 5629 6061 6492 6926 7357 7790 8222 8654 9086 9517 9950 10382 10814 11245 11676 12110 12542 12972 13404 13837 14268 14700 15133 15565 15997 16430 16862 17292 17725 18158 18588 19021 19452 19886 20316 20748 21181 21614 22045 22478 22909 23341 23773 24206 24638 25069 25502 25934 26366 26798 27230 27662 28093 28525 28956 29389 29821 30252 30684 31118 31548 31980 32412 32845 33277 33710 34142 34573 35005 35436 35869 36301 36733 37166 37598'));"}, {"source_code": " 2) {\n\t\t\n\t\t// define first elements\n for ($i = -1; $i < 2; $i++) {\n\t\t\t\n\t\t\t$tryCount = 0;\n\t\t\t$a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n\t\t\t\t\n\t\t\t\t$tryCount = abs($i) + abs($j);\n\n\t\t\t\tfor ($k = 2; $k < count($sequence); $k++) {\n\n\t\t\t\t\t$diff = abs($sequence[$k] - ($a1 + $k * ($a2 - $a1)));\n\t\t\t\t\t\n\t\t\t\t\tif ($diff > 1) {\n\t\t\t\t\t\t$tryCount = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tryCount += $diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\tif($count <= 0 || ($count > $tryCount && $tryCount != -1))\n\t\t\t\t{\n\t\t\t\t\t$count = $tryCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($tryCount == 0)\n\t\t\t{\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $count;\n}\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\necho sequence1($sequence);\n\n//echo sequence1(explode(' ', '24 21 14 10'));"}, {"source_code": " 2) {\n\t\t\n\t\t// define first elements\n for ($i = -1; $i < 2; $i++) {\n\t\t\t\n\t\t\t$tryCount = 0;\n\t\t\t$a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n\t\t\t\t\n\t\t\t\t$tryCount = abs($i) + abs($j);\n\n\t\t\t\tfor ($k = 2; $k < count($sequence); $k++) {\n\n\t\t\t\t\t$diff = abs($sequence[$k] - ($a1 + $k * ($a2 - $a1)));\n\t\t\t\t\t\n\t\t\t\t\tif ($diff > 1) {\n\t\t\t\t\t\t$tryCount = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tryCount += $diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($count <= 0 || $count > $tryCount)\n\t\t\t\t{\n\t\t\t\t\t$count = $tryCount;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\tif($tryCount != -1)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($tryCount == 0)\n\t\t\t{\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $count;\n}\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\necho sequence1($sequence);\n\n//echo sequence1(explode(' ', '24 21 14 10'));"}, {"source_code": " 2) {\n\t\t\n\t\t// define first elements\n for ($i = -1; $i < 2; $i++) {\n\t\t\t\n\t\t\t$tryCount = 0;\n\t\t\t$a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n\t\t\t\t\n\t\t\t\t$tryCount = abs($i) + abs($j);\n\n\t\t\t\tfor ($k = 2; $k < count($sequence); $k++) {\n\n\t\t\t\t\t$diff = abs($sequence[$k] - ($a1 + $k * ($a2 - $a1)));\n\t\t\t\t\t\n\t\t\t\t\tif ($diff > 1) {\n\t\t\t\t\t\t$tryCount = -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tryCount += $diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$count = $tryCount;\n\t\t\t\n\t\t\t\tif($tryCount != -1)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($tryCount != -1)\n\t\t\t{\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $count;\n}\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\necho sequence1($sequence);\n\n//echo sequence1(explode(' ', '24 21 14 10'));"}, {"source_code": " 2) {\n\n $a1 = $sequence[0];\n $a2 = $sequence[1];\n\n $found = false;\n\n // define first elements\n for ($i = -1; $i < 2 && !$found; $i++) {\n\n $a1 = $sequence[0] + $i;\n\n for ($j = -1; $j < 2; $j++) {\n\n $a2 = $sequence[1] + $j;\n $r = abs($sequence[2] - ($a1 + 2 * ($a2 - $a1)));\n\n if ($r <= 1) {\n\n $found = true;\n $count += abs($i) + abs($j) + $r;\n break;\n }\n }\n }\n\n if ($found) {\n\n for ($i = 3; $i < count($sequence); $i++) {\n\n $diff = abs($sequence[$i] - ($a1 + $i * ($a2 - $a1)));\n\n if ($diff > 1) {\n $count = -1;\n break;\n } else {\n $count += $diff;\n }\n }\n\n } else {\n $count = -1;\n }\n\n }\n\n return $count;\n}\n\n\nfscanf($handle, \"%i\", $n);\n\n$sequence = array_map('intval', explode(' ', trim(fgets($handle))));\n\necho sequence($sequence);"}], "src_uid": "79b0794f81acc1c882649d96b1c7f8da"} {"source_code": "= $e)\n {\n break;\n }\n else\n {\n $f += $b[$d];\n }\n }\n elseif($f == $g)\n {\n $c = $f;\n $d++;\n if($d >= $e)\n {\n break;\n }\n else\n {\n $f += $b[$d];\n }\n }\n elseif($f > $g)\n {\n $e--;\n if($d >= $e)\n {\n break;\n }\n else\n {\n $g += $b[$e];\n }\n }\n }\n printf(\"%.0f\", $c);\n}\n?>"}], "negative_code": [{"source_code": "= $e)\n {\n break;\n }\n else\n {\n $f += $b[$d];\n }\n }\n elseif($f == $g)\n {\n $c = $f;\n $d++;\n if($d >= $e)\n {\n break;\n }\n else\n {\n $f += $b[$d];\n }\n }\n elseif($f > $g)\n {\n $e--;\n if($d >= $e)\n {\n break;\n }\n else\n {\n $g += $b[$e];\n }\n }\n }\n print $c;\n}\n?>"}, {"source_code": "= $sum1) {\n\t\t$array1[$sum1] = 1;\n\t}\n\t$sum2 += $a[$n - $i - 1];\n\tif ($upper >= $sum2) {\n\t\t$array2[$sum2] = 1;\n\t}\n}\n\n/*\necho \"1: \";\nforeach ($array1 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\necho \"2: \";\nforeach ($array2 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\n */\n\nkrsort($array1);\n\nforeach ($array1 as $key => $dummy) {\n\tif (isset($array2[$key])) {\n\t\techo $key . PHP_EOL;\n\t\texit;\n\t}\n}\necho \"0\";\n"}, {"source_code": "= $sum1) {\n\t\t$array1[$sum1] = 1;\n\t}\n\t$sum2 += $a[$n - $i - 1];\n\tif ($upper >= $sum2) {\n\t\t$array2[$sum2] = 1;\n\t}\n}\n\n/*\necho \"1: \";\nforeach ($array1 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\necho \"2: \";\nforeach ($array2 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\n */\n\nkrsort($array1);\nkrsort($array2);\n\nforeach ($array1 as $key => $dummy) {\n\tif (isset($array2[$key])) {\n\t\techo $key . PHP_EOL;\n\t\texit;\n\t}\n}\necho \"0\";\n"}, {"source_code": "= $sum1) {\n\t\t$array1[$sum1] = 1;\n\t}\n\t$sum2 += $a[$n - $i - 1];\n\t$sum2 = intval($sum2);\n\tif ($upper >= $sum2) {\n\t\t$array2[$sum2] = 1;\n\t}\n}\n\n/*\necho \"1: \";\nforeach ($array1 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\necho \"2: \";\nforeach ($array2 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\n */\n\nkrsort($array1);\nkrsort($array2);\n\nforeach ($array1 as $key => $dummy) {\n\tif (isset($array2[$key])) {\n\t\techo $key . PHP_EOL;\n\t\texit;\n\t}\n}\necho \"0\";\n"}, {"source_code": "= $sum1) {\n\t\t$array1[$sum1] = 1;\n\t}\n\t$sum2 += $a[$n - $i - 1];\n\t$sum2 = floor($sum2);\n\tif ($upper >= $sum2) {\n\t\t$array2[$sum2] = 1;\n\t}\n}\n\n/*\necho \"1: \";\nforeach ($array1 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\necho \"2: \";\nforeach ($array2 as $key => $dummy) {\necho $key . \" \";\n}\necho PHP_EOL;\n */\n\nkrsort($array1);\nkrsort($array2);\n\nforeach ($array1 as $key => $dummy) {\n\tif (isset($array2[$key])) {\n\t\techo $key . PHP_EOL;\n\t\texit;\n\t}\n}\necho \"0\";\n"}, {"source_code": " false,\r\n \"i\" => false,\r\n \"m\" => false,\r\n \"u\" => false,\r\n \"r\" => false,\r\n ];\r\n\r\n if($length != 5)\r\n {\r\n echo \"NO\\n\";\r\n continue;\r\n }\r\n\r\n foreach(str_split($string) as $c)\r\n {\r\n if(array_key_exists($c, $name))\r\n {\r\n if($name[$c] == false)\r\n {\r\n $name[$c] = true;\r\n }\r\n else\r\n {\r\n echo \"NO\\n\";\r\n continue 2;\r\n }\r\n }\r\n else{\r\n echo \"NO\\n\";\r\n continue 2;\r\n }\r\n }\r\n\r\n echo ((bool)array_product($name) ) ? \"YES\\n\" : \"NO\\n\";\r\n}\r\n\r\n?>"}, {"source_code": " 0, 'i' => 0, 'm' => 0, 'u' => 0, 'r' => 0];\r\n \r\n $n = IO::get();\r\n $s = IO::get();\r\n if($n != 5) {\r\n IO::pr('No');\r\n } else {\r\n $b = true;\r\n for ($i=0; $i<$n; $i++) {\r\n if(isset($aInner[$s[$i]])) {\r\n $aInner[$s[$i]] = 1; \r\n } else {\r\n $b = false; \r\n break;\r\n } \r\n } \r\n foreach ($aInner as $k=>$v) {\r\n if($v === 0) {\r\n $b = false; \r\n }\r\n } \r\n IO::pr($b ? 'Yes' : 'No');\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}"}], "negative_code": [{"source_code": " false,\r\n \"i\" => false,\r\n \"m\" => false,\r\n \"u\" => false,\r\n \"r\" => false,\r\n ];\r\n\r\n if($length != 5)\r\n {\r\n echo \"NO\\n\";\r\n }\r\n\r\n foreach(str_split($string) as $c)\r\n {\r\n if(array_key_exists($c, $name))\r\n {\r\n if($name[$c] == false)\r\n {\r\n $name[$c] = true;\r\n }\r\n else\r\n {\r\n echo \"NO\\n\";\r\n continue 2;\r\n }\r\n }\r\n else{\r\n echo \"NO\\n\";\r\n continue 2;\r\n }\r\n }\r\n\r\n echo ((bool)array_product($name) ) ? \"YES\\n\" : \"NO\\n\";\r\n}\r\n\r\n?>"}], "src_uid": "6c137a74b36dede61037cb3b05167329"} {"source_code": "= $k) { echo 'YES'.PHP_EOL; echo $str.'a'.PHP_EOL; }\r\n if ($j < $k) { echo 'YES'.PHP_EOL; echo 'a'.$str.PHP_EOL; }\r\n }\r\n }\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 $a = str_split(IO::str());\r\n $n = count($a);\r\n $s = $e = '';\r\n $bool = true;\r\n for ($i = 0; $i < $n; $i++) {\r\n $f = $a[$i];\r\n $l = $a[count($a) - $i - 1];\r\n if ('a' !== $l && $bool) {\r\n $s .= 'a';\r\n $bool = false;\r\n }\r\n $s .= $f;\r\n }\r\n\r\n if(!$bool) {\r\n IO::line('YES');\r\n IO::line($s);\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": "=$n; $i--, $k--) {\n\t\t\tif ($s[strlen($s)-$i] != 'a') {\n\t\t\t\t$no = false;\n\t\t\t\techo \"YES\\n\";\n\t\t\t\tfor ($j=0; $j<$i; $j++) {\n\t\t\t\t\techo $s[$j];\n\t\t\t\t}\n\t\t\t\techo 'a';\n\t\t\t\tfor ($j=$i; $j 0){\n\t\t\t\t\t$k2--;\n\t\t\t\t\techo $s[$k2];\n\t\t\t\t}\n\t\t\t\techo 'a';\n\t\t\t\tfor ($i=strlen($s)-$k-1; $i<=strlen($s)-1; $i++){\n\t\t\t\t\techo $s[$i];\n\t\t\t\t}\n\t\t\t\techo \"\\n\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tif ($no) echo \"NO\\n\";\n\t\t\n\t}\n?>"}], "negative_code": [{"source_code": "=$n; $i--, $k--) {\n\t\t\tif ($s[strlen($s)-$i] != 'a') {\n\t\t\t\t$no = false;\n\t\t\t\techo \"YES\\n\";\n\t\t\t\tfor ($j=0; $j<$i; $j++) {\n\t\t\t\t\techo $s[$j];\n\t\t\t\t}\n\t\t\t\techo 'a';\n\t\t\t\tfor ($j=$i; $j 0){\n\t\t\t\t\t$k2--;\n\t\t\t\t\techo $s[$k2];\n\t\t\t\t}\n\t\t\t\techo 'a';\n\t\t\t\tfor ($i=strlen($s)-$k-1; $i"}, {"source_code": "=$n; $i--) {\n\t\t\tif ($s[strlen($s)-$i] != 'a') {\n\t\t\t\t$no = false;\n\t\t\t\techo \"YES\\n\";\n\t\t\t\tfor ($j=0; $j<$i; $j++) {\n\t\t\t\t\techo $s[$j];\n\t\t\t\t}\n\t\t\t\techo 'a';\n\t\t\t\tfor ($j=$i; $j"}, {"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 $a = str_split(IO::str());\r\n $n = ceil(count($a) / 2);\r\n $s = $e = '';\r\n $bool = true;\r\n for ($i = 0; $i < $n; $i++) {\r\n $f = $a[$i];\r\n $l = $a[count($a) - $i - 1];\r\n if ('a' !== $l && $bool) {\r\n $s .= 'a';\r\n $bool = false;\r\n }\r\n $s .= $f;\r\n $sp = isset($a[count($a) - $i - 2]) ? $a[count($a) - $i - 2] : 'a';\r\n if ($sp !== 'a' && $bool) {\r\n $s .= 'a';\r\n $bool = false;\r\n }\r\n if (count($a) - $i - 1 !== $i) {\r\n $e = $l . $e;\r\n }\r\n }\r\n\r\n if(!$bool) {\r\n IO::line('YES');\r\n IO::line($s . $e);\r\n } else {\r\n IO::line('NO');\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\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 $n = ceil(count($a) / 2);\r\n $s = $e = '';\r\n $bool = true;\r\n for ($i = 0; $i < $n; $i++) {\r\n $f = $a[$i];\r\n $l = $a[count($a) - $i - 1];\r\n if ('a' !== $l && $bool) {\r\n $s .= 'a';\r\n $bool = false;\r\n }\r\n $s .= $f;\r\n if (count($a) - $i - 1 !== $i) {\r\n $e = $l . $e;\r\n }\r\n }\r\n\r\n if(!$bool) {\r\n IO::line('YES');\r\n IO::line($s . $e);\r\n } else {\r\n IO::line('NO');\r\n }\r\n\r\n}\r\n\r\n?>"}], "src_uid": "e2dc3de62fc45c7e9ddb92daa5c5d8de"} {"source_code": "= 0; --$i) {\r\n if ($sm[$i] >= $mx) {\r\n $mx = $b[$i];\r\n } else {\r\n break;\r\n }\r\n }\r\n $ans = [];\r\n for ($i = 0; $i < $n; ++$i) {\r\n $a[$i] >= $mx && $ans[] = $i + 1;\r\n }\r\n echo count($ans) , PHP_EOL;\r\n echo implode(' ', $ans) , PHP_EOL;\r\n}\r\n", "positive_code": [{"source_code": "= 0; --$i) {\r\n if ($sm[$i] >= $mx) {\r\n $mx = $b[$i];\r\n } else {\r\n break;\r\n }\r\n }\r\n $ans = [];\r\n for ($i = 0; $i < $n; ++$i) {\r\n $a[$i] >= $mx && $ans[] = $i + 1;\r\n }\r\n echo count($ans) , PHP_EOL;\r\n echo implode(' ', $ans) , PHP_EOL;\r\n}\r\n"}], "negative_code": [], "src_uid": "debce043777e7e575f77a94edf89c7f1"} {"source_code": "9);\r\n return [$x,$p];\r\n}\r\nfor($j=0;$j<$caseCount;$j++) {\r\n fscanf($stdin, \"%d %d\\n\", $x1,$p1);\r\n fscanf($stdin, \"%d %d\\n\", $x2,$p2);\r\n// echo \"[$x1,$p1]\\n\";\r\n list($x1,$p1)=proc($x1,$p1);\r\n// echo \"[$x1,$p1]\\n\";\r\n list($x2,$p2)=proc($x2,$p2);\r\n if($p1>$p2){echo \">\";}elseif($p1<$p2){echo \"<\";}elseif($x1<$x2){echo \"<\";}elseif($x1>$x2){echo \">\";}else{echo \"=\";}\r\n echo \"\\n\";\r\n}\r\n", "positive_code": [{"source_code": " $bNumLen)\r\n {\r\n echo '>';\r\n }\r\n else if($aNumLen < $bNumLen)\r\n {\r\n echo '<';\r\n }\r\n else\r\n {\r\n while(strlen(strval($a)) !== strlen(strval($b)))\r\n {\r\n if(strlen(strval($a)) < strlen(strval($b)))\r\n {\r\n $a *= 10;\r\n }\r\n else\r\n {\r\n $b *= 10;\r\n }\r\n }\r\n\r\n if($a > $b)\r\n {\r\n echo '>';\r\n }\r\n else if($a < $b)\r\n {\r\n echo '<';\r\n }\r\n else\r\n {\r\n echo '=';\r\n }\r\n }\r\n\r\n echo \"\\n\";\r\n}"}, {"source_code": "';\r\n\r\n\tfor ($d = abs($len1 - $len2); $d > 0; $d--){\r\n\t\tif($p1 > $p2){\r\n\t\t\t$x1 .='0';\r\n\t\t} else {\r\n\t\t\t$x2 .='0';\r\n\t\t}\r\n\t}\r\n\r\n\t$x1 = intval($x1);\r\n\t$x2 = intval($x2);\r\n\tif($x1 < $x2){\r\n\t\treturn '<';\r\n\t}\r\n\tif($x2 == $x1){\r\n\t\treturn '=';\r\n\t}\r\n\treturn '>';\r\n\r\n};\r\n\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor (; $t > 0; $t--) {\r\n\r\n\tlist ($x1, $p1) = explode(' ', fgets(STDIN));\r\n\tlist ($x2, $p2) = explode(' ', fgets(STDIN));\r\n\r\n\techo $solve($x1, $p1, $x2, $p2);\r\n\techo \"\\n\";\r\n\r\n}\r\n"}], "negative_code": [{"source_code": "9){$p++;}\r\n return [$x,$p];\r\n}\r\nfor($j=0;$j<$caseCount;$j++) {\r\n fscanf($stdin, \"%d %d\\n\", $x1,$p1);\r\n fscanf($stdin, \"%d %d\\n\", $x2,$p2);\r\n// echo \"[$x1,$p1]\\n\";\r\n list($x1,$p1)=proc($x1,$p1);\r\n// echo \"[$x1,$p1]\\n\";\r\n list($x2,$p2)=proc($x2,$p2);\r\n if($p1>$p2){echo \">\";}elseif($p1<$p2){echo \"<\";}elseif($x1<$x2){echo \"<\";}elseif($x1>$x2){echo \">\";}else{echo \"=\";}\r\n echo \"\\n\";\r\n}\r\n"}], "src_uid": "a4eeaf7252b9115b67b9eca5f2bf621d"} {"source_code": "", "positive_code": [{"source_code": " $c)\n {\n $d = bcsub($b[2], $c);\n $e = bcdiv($d, 2);\n $f = bcadd($b[1], $e);\n print $f . \"\\n\";\n }\n}\n?>"}, {"source_code": "= 0; $i --)\n {\n $suffix_sum[0][$i] = $suffix_sum[0][$i + 1] ;\n $suffix_sum[1][$i] = $suffix_sum[1][$i + 1] ;\n \n if($Hate[$i] == '0') $suffix_sum[0][$i] ++ ;\n if($Hate[$i] == '1') $suffix_sum[1][$i] ++ ;\n }\n \n $ans = $len ;\n for($i = 0; $i < $len; $i ++)\n {\n $ans = min($ans, $prefix_sum[1][$i] + $suffix_sum[0][$i + 1]) ;\n $ans = min($ans, $prefix_sum[0][$i] + $suffix_sum[1][$i + 1]) ;\n }\n \n echo $ans . \"\\n\" ;\n }\n?>", "positive_code": [{"source_code": "= 0; $i --)\n {\n $suffix_sum[0][$i] = $suffix_sum[0][$i + 1] ;\n $suffix_sum[1][$i] = $suffix_sum[1][$i + 1] ;\n \n if($Hate[$i] == '0') $suffix_sum[0][$i] ++ ;\n if($Hate[$i] == '1') $suffix_sum[1][$i] ++ ;\n }\n \n $ans = $len ;\n for($i = 0; $i < $len; $i ++)\n {\n $ans = min($ans, $prefix_sum[1][$i] + $suffix_sum[0][$i + 1]) ;\n $ans = min($ans, $prefix_sum[0][$i] + $suffix_sum[1][$i + 1]) ;\n }\n \n echo $ans . \"\\n\" ;\n }\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": "= 0; $i --)\n {\n $suffix_sum[0][$i] = $suffix_sum[0][$i + 1] ;\n $suffix_sum[1][$i] = $suffix_sum[1][$i + 1] ;\n \n if($Hate[$i] == '0') $suffix_sum[0][$i] ++ ;\n if($Hate[$i] == '1') $suffix_sum[1][$i] ++ ;\n }\n \n $ans = $len ;\n for($i = 0; $i + 1 < $len; $i ++)\n {\n $ans = min($ans, $prefix_sum[1][$i] + $suffix_sum[0][$i + 1]) ;\n $ans = min($ans, $prefix_sum[0][$i] + $suffix_sum[1][$i + 1]) ;\n }\n \n echo $ans . \"\\n\" ;\n }\n?>"}], "src_uid": "803e5ccae683b91a4cc486fbc558b330"} {"source_code": ""}, {"source_code": " $i) {\n\tfputs($f, $i[0].' '.$i[1].\"\\n\");\n}\n\n\nfclose($f);"}, {"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": ""}], "src_uid": "564664d9cd2ccbccb42574b3881ec5fe"} {"source_code": " 0) {\r\n $q--; \r\n }\r\n } \r\n }\r\n \r\n $ans = $q == 0 ? 'YES' : 'NO';\r\n \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}\r\n", "positive_code": [{"source_code": " 0) {\r\n $messages = trim(fgets(STDIN));\r\n $dialog = trim(fgets(STDIN));\r\n\r\n $questions = 0;\r\n\r\n for ($i = 0; $i < strlen($dialog); $i++) {\r\n if ($dialog[$i] === 'Q') {\r\n $questions++;\r\n } else if ($questions > 0) {\r\n $questions--;\r\n }\r\n }\r\n\r\n if ($questions === 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"}, {"source_code": " 0) $ans[] = \"No\";\r\n else $ans[] = \"Yes\";\r\n}\r\necho implode(PHP_EOL,$ans);"}, {"source_code": "0)\r\n\t\t\t{\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n }\r\n\tif($counter<=0){\r\n\t\techo \"Yes\";\r\n\t}\r\n\telse{\r\n\t\techo \"No\";\r\n\t}\r\n echo \"\\n\";\r\n}\r\n "}], "negative_code": [{"source_code": " 0) {\r\n $messages = trim(fgets(STDIN));\r\n $dialog = trim(fgets(STDIN));\r\n\r\n $questions = 0;\r\n $answers = 0;\r\n\r\n for ($i = 0; $i < strlen($dialog); $i++) {\r\n if ($dialog[$i] === 'Q') {\r\n $questions++;\r\n } else {\r\n $answers++;\r\n }\r\n }\r\n\r\n if ($answers >= $questions) {\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"}, {"source_code": " ($n-$qcnt)) $ans[] = \"No\";\r\n else $ans[] = \"Yes\";\r\n}\r\necho implode(PHP_EOL,$ans);"}], "src_uid": "c5389b39312ce95936eebdd83f510e40"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "046900001c7326fc8d890a22fa7267c9"} {"source_code": "\n\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0 )\n\t{\n\t\techo \"NO\";die;\n\t}else {\n\t\t$count++;\n\t}\n}\nif($count == 0)\n{\n\techo \"NO\";\n} else {\n\techo \"YES\";\n}\n\n?>"}, {"source_code": ""}, {"source_code": "1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t}\n\tif($r_cnt==1){\n\t\techo \"YES\";\n\t}else{\n\t\techo \"NO\";\n\t}\n}\n\n?>"}], "negative_code": [{"source_code": " 1) {\n\t\t\techo \"NO\";\n\t\t} else {\n\t\t\techo \"YES\";\n\t\t}\n\t}\n\t\n?>"}, {"source_code": " 1) {\n\t\t\techo \"NO\";\n\t\t} else {\n\t\t\techo \"YES\";\n\t\t}\n\t}\n\t\n?>"}, {"source_code": "= $n-1) return true;\n return false;\n}\n\nif (test($x,$n)){\n echo (\"YES\");\n}\nelse echo (\"NO\");\n"}, {"source_code": " 0 )\n\t{\n\t\techo \"NO\";die;\n\t}else {\n\t\t$count++;\n\t}\n}\necho \"YES\";\n?>"}, {"source_code": " 0 )\n\t{\n\t\techo \"NO\";die;\n\t}else {\n\t\t$count++;\n\t}\n}\nif($count == 0)\n{\n\techo \"NO\";\n} else {\n\techo \"YES\";\n}\n\n?>"}, {"source_code": " $number) {\n\tif($number){\n\t\tcontinue;\n\t}\n\tif($count >0 )\n\t{\n\t\techo \"NO\";die;\n\t}else{\n\t\t$count++;\n\t}\n}\necho \"YES\";\n?>"}, {"source_code": " $number) {\n\tif($number == 1){\n\t}elseif ($count >0 )\n\t{\n\t\techo \"NO\";die;\n\t}else {\n\t\t$count++;\n\t}\n}\necho \"YES\";\n?>"}, {"source_code": " $number) {\n\tif($number == 1){\n\t\tcontinue;\n\t}elseif ($count > 0 )\n\t{\n\t\techo \"NO\";die;\n\t}else {\n\t\t$count++;\n\t}\n}\necho \"YES\";\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "7db0b870177e7d7b01da083e21ba35f5"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "b3c6058893f935d88196113fab581cf8"} {"source_code": " $t)\n ++$i;\n $j = $i;\n while ($j < $n && $a[$j] <= $t)\n ++$j;\n $ans += max($j - $c - $i + 1, 0);\n $i = $j;\n}\nprint $ans;\n?>", "positive_code": [{"source_code": "= $c)\n {\n $g += $f[$x] - $c + 1;\n }\n}\nprint $g;\n?>"}, {"source_code": "$t) {\n if (count($temp)>0)\n $a[] = $temp;\n $temp = array();\n } else {\n $temp[] = $i;\n }\n}\n$a[] = $temp;\n\n$result = 0;\nforeach($a as $i){\n if (count($i)>=$c)\n $result = $result+(count($i)-$c)+1;\n}\n\necho $result;\n\n\n"}, {"source_code": "= $c) {\n\t\t\t\t$result += $len-$c+1;\n\t\t\t}\n\t\t}\n\t\t$startFrom = null;\n\t}\n}\n\nif ($startFrom !== null) {\n $len = $i - $startFrom;\n if ($len >= $c) {\n $result += $len-$c+1;\n }\n}\n\necho $result;\n"}, {"source_code": "$t){\n if($x>=$c)\n $z += $x - $c + 1;\n $x=0;\n }else{\n $x++;\n }\n if($i+1==$n && $x>=$c){\n $z+= $x - $c + 1;\n }\n\n}\necho $z;\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $c) {\n $answer++;\n }\n}\n\necho $answer . PHP_EOL;"}, {"source_code": " $t)\n ++$i;\n $j = $i;\n while ($j < count($a) && $a[$j] <= $t)\n ++$j;\n $ans += max($j - $c - $i + 1, 0);\n $i = $j;\n}\nprint $ans;\n?>"}, {"source_code": " $t)\n ++$i;\n $j = $i;\n while ($j < $n && $a[$j] <= $t)\n ++$j;\n $ans += max($j - $c - $i + 1, 0);\n $i = $j;\n}\nprint $ans;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": "$t){\n $r[] = $x;\n $x=0;\n }else{\n $x++;\n }\n if($i+1==$n && $x>0)\n $r[] = $x;\n}\n$z=0;\nforeach($r as $e){\n $z+= $e - $c + 1;\n}\necho $z;"}], "src_uid": "7d1e8769a6b1d5c6680ab530d19e7fa4"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "74cbcbafbffc363137a02697952a8539"} {"source_code": "", "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$cnt = 0;\r\nwhile ($t--) {\r\n $res = array();\r\n $n = IO::str();\r\n $s = IO::str();\r\n $s = str_split($s);\r\n\r\n for ($i = 0; $i < $n-1; $i++){\r\n if ($i == $n - 1) break;\r\n if ($s[$i] != $s[$i+1]) {\r\n if (isset($res[$s[$i]]) || isset($res[$s[$i+1]])) {\r\n $f[$cnt] = 'NO';\r\n break;\r\n }\r\n $res[$s[$i]] = 1;\r\n }\r\n }\r\n if (!isset($f[$cnt])) {\r\n $f[$cnt] = 'YES';\r\n }\r\n $cnt++;\r\n}\r\n\r\nIO::res($f);"}, {"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 $a = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n $n = IO::str();\r\n $s = IO::str();\r\n $d = str_split($s);\r\n $last = $d[0];\r\n $res = [];\r\n $bool = true;\r\n foreach ($d as $v) {\r\n if ($v !== $last && isset($res[$v])) {\r\n $bool = false;\r\n break;\r\n }\r\n $last = $v;\r\n $res[$v] = 1;\r\n }\r\n if ($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n\r\n}\r\n\r\n?>"}, {"source_code": " 0; $t --){\r\n $n = intval(trim(fgets(STDIN)));\r\n\r\n $string = str_split(trim(fgets(STDIN)));\r\n $occurrences = [];\r\n $flag = 1;\r\n\r\n foreach ($string as $i => $char){\r\n if(isset($occurrences[$char])){\r\n if($string[$i] !== $string[$i - 1]){\r\n echo \"NO\\n\";\r\n $flag = 0;\r\n break;\r\n }\r\n }\r\n\r\n $occurrences[$char] = 1;\r\n }\r\n\r\n if($flag)\r\n echo \"YES\\n\";\r\n}\r\n"}, {"source_code": " 1) { echo 'NO'.PHP_EOL; }\r\n else { echo 'YES'.PHP_EOL; }\r\n}\r\n\r\n?>"}], "negative_code": [], "src_uid": "3851854541b4bd168f5cb1e8492ed8ef"} {"source_code": "= 0; $x--)\n{\n $c = trim(fgets(STDIN));\n $b[$x] = $c;\n}\nksort($b);\n$d = array_unique($b);\n$e = array_keys($d);\nfor($x = 0; $x < count($e) - 1; $x++)\n{\n print $d[$e[$x]] . \"\\n\";\n}\nprint $d[$e[$x]];\n?>", "positive_code": [{"source_code": " $v)echo $key.\"\\n\";\n?>"}, {"source_code": " 0){\n $s = \"\";\n if (!isset($cur[$s = array_pop($name)])) {\n $ans .= $s . \"\\n\";\n $cur[$s] = 1;\n }\n }\n echo $ans;\n \n \n "}, {"source_code": "#!/usr/bin/php\n 0; $i--) {\n\t$l[] = trim(fgets(STDIN));\n}\nfor ($i = $N; $i > 0; $i--) {\n\tif (!isset($t[$l[$i-1]])) {\n\t\t$a[] = $l[$i-1];\n\t\t$t[$l[$i-1]] = true;\n\t}\n}\n\nforeach ($a as $_) {\n\techo $_.\"\\n\";\n}\n\nexit();\n"}, {"source_code": " $v) echo $k . PHP_EOL;\n"}, {"source_code": " $i) {\n\t\techo $user . PHP_EOL;\n\t}\n\n?>"}, {"source_code": "= 0; $i--){\n if($arr2[$arr[$i]] != 2){\n $arr2[$arr[$i]] = 2;\n fwrite($stdout, $arr[$i].\"\\n\");\n $j++;\n if($max == $j) break;\n }\n}\nfclose($stdout);\n\n?>"}], "negative_code": [{"source_code": " $v) echo $k . PHP_EOL;\n"}, {"source_code": " $v) echo $k . PHP_EOL;\n"}, {"source_code": ""}], "src_uid": "18f4d9262150294b63d99803250ed49c"} {"source_code": " $brr[0]){\r\n echo \"Alice\\nAlice\\n\";\r\n }\r\n else if($arr[0] < $brr[0]){\r\n // echo \"Bob\\nBob\\n\";\r\n echo str_repeat(\"Bob\\n\", 2);\r\n }\r\n else{\r\n echo \"Alice\\nBob\\n\";\r\n }\r\n}\r\n\r\n$test_cases = trim(fgets(STDIN));\r\nwhile($test_cases--){\r\n run();\r\n}\r\n?>", "positive_code": [{"source_code": "= $maxB) {\r\n echo 'Alice' . PHP_EOL;\r\n } else {\r\n echo 'Bob' . PHP_EOL;\r\n }\r\n \r\n if ($maxB >= $maxA) {\r\n echo 'Bob' . PHP_EOL;\r\n } else {\r\n echo 'Alice' . PHP_EOL;\r\n }\r\n\r\n\r\n }\r\n?>"}, {"source_code": " $bMax) {\r\n IO::pr('Alice');\r\n IO::pr('Alice');\r\n } elseif($aMax == $bMax) {\r\n IO::pr('Alice');\r\n IO::pr('Bob'); \r\n \r\n }else {\r\n IO::pr('Bob');\r\n IO::pr('Bob');\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n \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 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 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 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 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 && ($result[(2*$i) +1] - $result[2*$i] >1) && ($result[(2*$i) +1] - $result[(2*$i)+2] > 1)){\n $result[(2*$i) +1] = $result[(2*$i) +1] -1;\n $k = $k -1;\n }\n}\necho implode(' ', $result) . PHP_EOL;", "positive_code": [{"source_code": "0){\n if($r[$ri]-$r[$ri-1]>1&&$r[$ri]-$r[$ri+1]>1){$k--;$r[$ri]--;}\n $ri+=2;\n}\n\nprint implode(' ',$r);\n\n?>"}, {"source_code": " 0) && ($c[$x - 1] - $c[$x - 2] > 1) && ($c[$x - 1] - $c[$x] > 1))\n {\n $c[$x - 1]--;\n $b--;\n }\n}\nprint implode(\" \", $c);\n?>"}, {"source_code": " $lo[$x] + 1) && ($hi[$x] > $lo[$x + 1] + 1) && ($ct > 0)) {\n\t\t$res .= ($hi[$x] - 1) . \" \";\n\t\t$ct--;\n\t} else {\n\t\t$res .= $hi[$x] . \" \";\n\t}\n}\n$res .= $lo[$n];\n\necho $res;\n\n// End of submission file\n// Submission by chaotic_iak\n?>"}], "negative_code": [{"source_code": " 0))\n {\n $c[$x - 1]--;\n $b--;\n }\n}\nprint implode(\" \", $c);\n?>"}, {"source_code": " 0) && ($c[$x - 1] > 1))\n {\n $c[$x - 1]--;\n $b--;\n }\n}\nprint implode(\" \", $c);\n?>"}, {"source_code": "0 && ($result[(2*$i) +1] - $result[2*$i] >1) && ($result[(2*$i) +1] - $result[(2*$i)+2] > 1)){\n $result[(2*$i) +1] = $result[(2*$i) +1] -1;\n $k = $k -1;\n }\n}\n\necho implode(' ', $result) . PHP_EOL;"}, {"source_code": "0 && $result[(2*$i) +1] - $result[2*$i] >1 && $result[(2*$i) +1] - $result[(2*$i)+2] > 1){\n $result[(2*$i) +1] = $result[(2*$i) +1] -1;\n $k = $k -1;\n }\n}\n\nprint(implode(' ', $result));"}, {"source_code": "1 && $result[(2*$i) +1] - $result[(2*$i)+2] > 1){\n $result[(2*$i) +1] = $result[(2*$i) +1] -1;\n $k--;\n if($k == 0){\n break;\n }\n }\n}\n\nprint(implode(' ', $result));\n"}], "src_uid": "1adb4675dc88208f8a05a2db49bb44cb"} {"source_code": " $k-1) {\r\n $swapa += 1 ;\r\n }\r\n }\r\n puts($swapa);\r\n}\r\n\r\n", "positive_code": [{"source_code": " $k) $ans++;\r\n }\r\n fprintf($cout, \"%d\\n\", $ans);\r\n} ?>"}], "negative_code": [], "src_uid": "10927dcb59007fc3a31fdb6b5d13846f"} {"source_code": " $n + 1)\n {\n $g = ($n * 2 + 1) - $i;\n }\n for ($j = 0; $j < $g; $j++)\n {\n\n if ($j > $n)\n $str .= $g . \" \";\n else\n $str .= $j . \" \";\n }\n $mas[] = $str;\n}\n\n$k = 0;\nfor ($i = 1; $i < $n * 2; $i++)\n{\n $k = $i;\n if ($k > $n)\n {\n $k = $n * 2 - $i;\n }\n for ($j = $k; $j > 0; $j--)\n {\n $mas[$i] .= ($j - 1) . \" \";\n }\n}\n$p = 0;\nfor ($i = 0; $i < $n * 2 + 1; $i++)\n{\n if ($i <= $n)\n {\n $mas[$i] = str_repeat(\" \", $n * 2 - $i * 2) . $mas[$i];\n }\n else\n {\n $p += 2;\n $mas[$i] = str_repeat(\" \", $p) . $mas[$i];\n }\n}\nfor ($i = 0; $i < $n * 2 + 1; $i++)\n{\n $itog .= rtrim($mas[$i]) . \"\\n\";\n}\nprint($itog);\n?>", "positive_code": [{"source_code": ""}, {"source_code": " 0) {\n $d = ($m-$i);\n }\n $rows = array();\n for($n=0;$n<$w;$n++) {\n $r = ( $m>$n ? $n :( $m - ($n - $m) ) ) + $d;\n $rows[] = ($r < 0 ? ' ':$r);\n \n }\n print_r( rtrim(implode(' ', $rows)). \"\\n\" );\n}\n"}, {"source_code": " $rowData) {\n echo str_repeat(\" \", getNumberOfNeededSpaces($number, $rowPosition));\n echo implode(' ', $rowData);\n echo \"\\n\";\n}\n"}, {"source_code": " 0\n 0 1 0\n0 1 2 1 0\n 0 1 0\n 0 0\n 0 1 0\n 0 1 2 1 0\n0 1 2 3 2 1 0\n 0 1 2 1 0\n 0 1 0\n 0 0\n 0 1 0\n 0 1 2 1 0\n 0 1 2 3 2 1 0\n0 1 2 3 4 3 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 1 0\n 0 1 0\n 0 0\n 0 1 0\n 0 1 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 1 0\n 0 1 0\n 0 0\n 0 1 0\n 0 1 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n0 1 2 3 4 5 6 5 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 1 0\n 0 1 0\n 0 0\n 0 1 0\n 0 1 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 5 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 5 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 1 0\n 0 1 0\n 0 0\n 0 1 0\n 0 1 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 5 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 7 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 7 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 5 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 1 0\n 0 1 0\n 0 0\n 0 1 0\n 0 1 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 5 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 7 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0\n0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 7 6 5 4 3 2 1 0\n 0 1 2 3 4 5 6 5 4 3 2 1 0\n 0 1 2 3 4 5 4 3 2 1 0\n 0 1 2 3 4 3 2 1 0\n 0 1 2 3 2 1 0\n 0 1 2 1 0\n 0 1 0\n 0"}, {"source_code": "= 0 ; $j--) { \n $out[$i] .= \"$j \"; \n }\n $out[$i] = rtrim($out[$i]).\"\\n\";\n if ($i !== $n) {\n $out[($n*2)-$i] = $out[$i];\n }\n}\n\nfor ($i=0; $i <= $n * 2 ; $i++) { \n echo $out[$i];\n}\n\n?>"}, {"source_code": "=0;$j--)\n $out = $j.\" \".$out.\" \".$j;\n for ($j=($n-$k);$j>0;$j--)\n $out = \" \".$out.\" \";\n \n return rtrim($out).\"\\n\"; \n}\nfor ($j=0;$j<=$n;$j++)\n echo line($j,$n);\nfor ($j=($n-1);$j>=0;$j--)\n echo line($j,$n);\n\n?>"}, {"source_code": ""}, {"source_code": "0;$j--) print $j.' ';\n print \"0\\r\\n\";\n}\n?>"}, {"source_code": "$a)\n {\n for($k=0; $k<(-1*($i-$a*2))*2+1; ++$k)\n {\n if($k>(-1*($i-$a*2)))\n {\n if($k-(-1*($i-$a*2))*2<0)\n {\n $b .= (-1*($k-(-1*($i-$a*2))*2)).\" \";\n }else{\n $b .= ($k-(-1*($i-$a*2))*2).\" \";\n }\n }else{\n $b .= $k.\" \";\n }\n }\n }else{\n for($k=0; $k<$i*2+1; ++$k)\n {\n if($k>$i)\n {\n if($k-$i*2<0)\n {\n $b .= (-1*($k-$i*2)).\" \";\n }else{\n $b .= ($k-$i*2).\" \";\n }\n }else{\n $b .= $k.\" \";\n }\n }\n }\n if($i==$a*2)\n {\n $b = rtrim($b);\n }else{\n $b = rtrim($b);\n $b .= \"\\n\";\n }\n}\necho $b;\n?>"}, {"source_code": "=0; $l--)\n{\n $line=str_repeat(\" \", ($max-$l)*2);\n $line.=($l==0)?0:(implode(\" \", range(0, $l)).\" \".implode(\" \", range($l-1, 0)));\n $res[]=$line;\n}\necho implode(\"\\n\", $res);\n\n?>"}, {"source_code": "= 0; $k--) {\n $rows[$i] .= $k.\" \";\n }\n $rows[$i] = substr($rows[$i], 0, -1);\n}\nfor ($j = $n - 1; $j >= 0; $j--) {\n $rows[] = $rows[$j];\n}\nforeach ($rows as $value) {\n echo $value.\"\\n\";\n}\n?>"}, {"source_code": "=0; $i--)\n{\n echo $lines[$i];\n if ($i !== 0)\n echo PHP_EOL;\n}"}], "negative_code": [{"source_code": ""}, {"source_code": "=0;$j--)\n $out = $j.\" \".$out.\" \".$j;\n for ($j=($n-$k);$j>0;$j--)\n $out = \" \".$out.\" \";\n \n return rtrim($out).\"\\n\"; \n}\nfor ($j=0;$j<=$n;$j++)\n echo line($j,$n);\nfor ($j=($n-1);$j>=0;$j--)\n echo line($j,$n);\n\n?>"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 0; $k--) {\n $rows[$i] .= $k.\" \";\n }\n $rows[$i] = substr($rows[$i], 0, -1);\n}\nfor ($j = $n - 1; $j >= 0; $j--) {\n $rows[] = $rows[$j];\n}\nforeach ($rows as $value) {\n echo $value.\"\\n\";\n}\n?>"}, {"source_code": "= 0; $k--) {\n $rows[$i] .= $k.\" \";\n }\n $rows[$i] .= substr($padding, 1);\n}\nfor ($j = $n - 1; $j >= 0; $j--) {\n $rows[] = $rows[$j];\n}\nforeach ($rows as $value) {\n echo $value.\"\\n\";\n}\n?>"}], "src_uid": "7896740b6f35010af751d3261b5ef718"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=2 && $n<=100)\n {\n $f=true;\nfor ($i=1; $i<=$n-2; $i++)\n{\n $r=stripos($s,' ');\n $mas[$i]=substr($s, 0, $r);\n if (($mas[$i]<1) || ($mas[$i]>100))\n {$f=false;}\n $s=substr($s, $r+1, $len-$r-1);\n }\n $mas[$n-1]=$s;\n if (($mas[$n-1]<1) || ($mas[$n-1]>100))\n {$f=false;}\n$r=stripos($s1,' ');\n$a=substr($s1, 0, $r);\n$b=substr($s1, $r+1, $len1-$r-1);\nif (($a<1)||($b<=$a)||($b>$n)){$f=false;}\n if ($f)\n {\n\n $count=0;\n for ($i=$a; $i<=$b-1; $i++)\n {\n $count=$count+$mas[$i];\n }\nfputs(STDOUT, \"$count\");\n }\n /*else\n {fputs(STDOUT, \"Nevernii diapozon\");}*/\n }\n/*else\n {fputs(STDOUT, \"\u0427\u0438\u0441\u043b\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u0437 \u0434\u0438\u0430\u043f\u043e\u0437\u043e\u043d\u0430 2<=n<=100\");}*/\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=2 && $n<=100)\n\t{\n\t\t$f=true;\nfor ($i=1; $i<=$n-2; $i++)\n{\n\t$r=stripos($s,' ');\n\t$mas[$i]=substr($s, 0, $r);\n\tif (($mas[$i]<1) || ($mas[$i]>100))\n\t{$f=false;}\n\t$s=substr($s, $r+1, $len-$r-1);\n\t}\n\t$mas[$n-1]=$s;\n\tif (($mas[$n-1]<1) || ($mas[$n-1]>100))\n\t{$f=false;}\n\tif ($f)\n\t{\n$r=stripos($s1,' ');\n$a=substr($s1, 0, $r);\n$b=substr($s1, $r+1, $len1-$r-1);\nfputs(STDOUT, \"Vihodnie dannie: \");\n\t$count=0;\n\tfor ($i=$a; $i<=$b-1; $i++)\n\t{\n\t\t$count=$count+$mas[$i];\n\t\t}\nfputs(STDOUT, \"$count\");\n\t}\n\telse\n\t{fputs(STDOUT, \"Nevernii diapozon\");}\n\t}\nelse\n\t{fputs(STDOUT, \"\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd 2<=n<=100\");}\n?>"}], "src_uid": "69850c2af99d60711bcff5870575e15e"} {"source_code": "\n", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "5358fff5b798ac5e500d0f5deef765c7"} {"source_code": " 0)\n {\n $f[$c[$x]]--;\n $i[count($i)] = $h;\n $h = 0;\n }\n}\nif($h > 0)\n{\n $i[count($i) - 1] += $h;\n}\nprint $g . \"\\n\";\nprint implode(\" \", $i);\n?>", "positive_code": [{"source_code": " $val) {\n\t$cnt++;\n\t$score += $val;\n\t$pos[] = $key;\n\tif ($cnt == $k) {\n\t\tbreak;\n\t}\n\n}\n// echo \"pos:\";\nsort($pos);\n// var_dump($pos);\n$s[0] = -1;\nfor ($i = 0; $i < $k - 1; $i++) {\n\t$s[$i + 1] = $pos[$i];\n}\n$s[$k] = $n - 1;\nfor ($i = 0; $i < $k; $i++) {\n\t$ans[] = $s[$i + 1] - $s[$i];\n}\n// var_dump($s);\necho $score . PHP_EOL;\necho implode(\" \", $ans);"}], "negative_code": [], "src_uid": "9cc61be7dc9b79f46a3e796db0134173"} {"source_code": " 1, b => 2, c => 2, d => 2, e => 1, f => 2, g => 2, h => 2, i => 1, j => 2, k => 2, l => 2, m => 2, n => 2, o => 1, p => 2, q => 2, r => 2, s => 2, t => 2, u => 1, v => 2, w => 2, x => 2, y => 2, z => 2);\n $d = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($c[$a[$x]] != $c[$b[$x]])\n {\n $d = 1;\n break;\n }\n }\n if($d == 0)\n {\n print \"Yes\";\n }\n else\n {\n print \"No\";\n }\n}\n?>"}, {"source_code": "handle();\n\nclass A1111{\n \n private $s;\n private $t;\n \n public function __construct($s, $t){\n $this->s = $s;\n $this->t = $t;\n }\n \n public function handle(){\n if($this->isLengthDifferent()){\n return \"No\";\n }\n \n for($i = 0; $i < strlen($this->s); $i++){\n if($this->isVowel($this->s[$i]) && $this->isConsonent($this->t[$i])){\n return 'No';\n }\n if($this->isConsonent($this->s[$i]) && $this->isVowel($this->t[$i])){\n return 'No';\n }\n }\n \n return 'Yes';\n }\n \n private function isLengthDifferent(){\n return strlen($this->s) !== strlen($this->t);\n }\n \n private function isVowel($c){\n return in_array($c, ['a', 'e', 'i', 'o', 'u']);\n }\n \n private function isConsonent($c){\n return ! $this->isVowel($c);\n }\n}"}, {"source_code": "\n"}, {"source_code": "run(file_get_contents('php://stdin'));\n\n"}, {"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n"}, {"source_code": ""}, {"source_code": "handle();\n\nclass A1111{\n \n private $s;\n private $t;\n \n public function __construct($s, $t){\n $this->s = $s;\n $this->t = $t;\n }\n \n public function handle(){\n if($this->isLengthDifferent()){\n return \"No\";\n }\n \n for($i = 0; $i < strlen($this->s); $i++){\n if($this->isVowel($this->s[$i]) && $this->isConsonent($this->t[$i])){\n return 'No';\n }\n if($this->isConsonent($this->s[$i]) && $this->isVowel($this->t[$i])){\n return 'No';\n }\n \n return 'Yes';\n }\n }\n \n private function isLengthDifferent(){\n return strlen($this->s) !== strlen($this->t);\n }\n \n private function isVowel($c){\n return in_array($c, ['a', 'e', 'i', 'o', 'u']);\n }\n \n private function isConsonent($c){\n return ! $this->isVowel($c);\n }\n}"}, {"source_code": "\n"}, {"source_code": "charCompare($s[$i], $t[$i])) {\n return 'No';\n }\n }\n\n return 'Yes';\n }\n\n public function charCompare(string $a, string $b): bool\n {\n return in_array($a, self::VOWELS, true) === in_array($b, self::VOWELS, true);\n }\n}\n\necho (new main)->run(file_get_contents('php://stdin'));\n\n"}, {"source_code": "charCompare($s[$i], $t[$i])) {\n return 'No';\n }\n }\n\n return 'Yes';\n }\n\n public function charCompare(string $a, string $b): bool\n {\n return in_array($a, $this->vowels, true) === in_array($b, $this->vowels, true);\n }\n}\n\necho (new main)->run(file_get_contents('php://stdin'));\n\n"}, {"source_code": ""}, {"source_code": "'; print_r($var); echo '';}\n function read_str(){return trim(fgets($GLOBALS['file']));}\n function read_array(){return explode(' ', read_str());}\n /***************************************************************/\n list($n, $m) = read_array();\n $timer = 0;\n $result=array();\n $start = microtime(true);\n \n $students = array();\n for ($i=1; $i<=$n; $i++) \n {\n $student = array();\n list($student['time'], $student['loc']) = read_array();\n $student['i'] = $i;\n $students[] = $student;\n }\n \n\n \n $chunks = array_chunk($students, $m);\n \n function sf($a,$b)\n {\n if ($a['loc'] < $b['loc']) return -1;\n if ($a['loc'] > $b['loc']) return 1;\n return 0;\n }\n \n foreach($chunks as $chunk)\n { \n $last_time = end($chunk); $last_time = $last_time['time'];if ($last_time > $timer) $timer += $last_time - $timer; \n //uasort($chunk, 'sf');\n \n \n \n \n $locs = array();\n foreach($chunk as $st)\n {\n $l = $st['loc'];\n $locs[$l][] = $st['i']; \n }\n ksort($locs);\n \n $prev_loc = 0;\n foreach($locs as $loc=>$sts)\n {\n $count = count($sts);\n $timer += $loc - $prev_loc;\n $prev_loc = $loc;\n foreach($sts as $i) $result[$i] = $timer;\n \n $timer += 1 + floor($count/2);\n }\n $timer += $loc; \n }\n \n for($i=1; $i<=$n; $i++) echo $result[$i].' ';\n ", "positive_code": [{"source_code": ""}, {"source_code": " $val)\n\t\t{\n\t\t\t$countEl = count($val);\n\t\t\tforeach($val as $v)\n\t\t\t{\n\t\t\t\t$exit[$v] = $key + $time + $extTime;\n\t\t\t}\n\t\t\t$extTime += floor(1 + $countEl / 2);\n\t\t}\n\t\t$time += $extTime + $key * 2;\n\t\t$seatBusy = 0;\n\t\t$taxi = array();\n\t}\n\t$i++;\n}\nksort($exit);\necho implode(' ', $exit);\nfclose($fp);\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "bb2ee9d4f718116ec391c93af58ec012"} {"source_code": " $s2l) ? $s2l : $s1l;\n\n// Get valid\n$i = 0;\nfor (; $i < $length; ++$i)\n{\n if ($s1[$i] != $s2[$i]) {\n break;\n }\n}\n\n// Moves\necho $potential_moves - 2*$i;\n", "positive_code": [{"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nfor($j=$t;$j>=1;$j=$j-100) {\n if (substr($a,-$j) == substr($b, -$j)) {\n break;\n }\n}\n\nfor($i=$j+100;$i>=1;$i--) {\n if ($i <= $t && substr($a,-$i) == substr($b, -$i)) {\n break;\n }\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b))\n{\n $c += strlen($a) - strlen($b);\n $a = substr($a, $c);\n}\n$c += strlen($a) * 2;\nfor($x = strlen($a) - 1; $x >= 0; $x--)\n{\n if($a[$x] == $b[$x])\n {\n $c -= 2;\n }\n else\n {\n break;\n }\n}\nprint $c;\n?>"}, {"source_code": "=0&&$j>=0&&$str1[$i]==$str2[$j] ; $i--,$j--);\n{ \n\techo $i+$j+2;\n}"}], "negative_code": [{"source_code": "strlen($str1))\n{\n\t$temp=$str2;\n\t$str2=$str1;\n\t$str1=$temp;\n}\n\n$lstr1=strlen($str1);\n$lstr2=strlen($str2);\n//echo \"$lstr1 $lstr2\";\nif($str1[$lstr1-1]!=$str2[$lstr2-1])\n\techo $lstr1+$lstr2;\nelse\n{\t\n\t\t$diff=$lstr1-$lstr2;\n\t\t$count=0;\n\t\tfor ($i=$diff,$j=0; $i <$lstr1 ; $i++)\n\t\t{\n\t\t if($str1[$i]!=$str2[$j++])\n\t\t {\n\t\t \t$count+=2;\n\t\t }\n\t\t}\n\t\techo $count+$diff.\"\\n\";\n}"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j+$m;$i>=$j;$i--) {\n if ($i <= $t && substr($a,-$i) == substr($b, -$i)) {\n break 2;\n }\n}\n}\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\necho $b;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j;$i<$j+$m;$i++) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i;\n }\n}\nbreak;\n}\n}\necho strlen($a) - $num + strlen($b) - $num;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\necho substr($a,-10);\necho \"\\n\";\necho substr($b,-10);\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j;$i<$j+$m;$i++) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i;\n }\n}\nbreak;\n}\n}\necho strlen($a) - $num + strlen($b) - $num;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen(a);\n\nfor($i=$t;$i<1;$i--) {\n if (substr($a,-$i) == substr($b, -$i)) {\n break;\n }\n}\n\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 10) {\n$m = 10;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j+$m;$i>=$j;$i--) {\n if ($i <= $t && substr($a,-$i) == substr($b, -$i)) {\n break 2;\n }\n}\n}\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j+$m;$i<$j;$i--) {\n if (substr($a,-$i) == substr($b, -$i)) {\n break 2;\n }\n}\n}\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": "Last login: Thu Jul 12 09:43:57 on console\nxiaoxiaode-Mac-mini:~ eooe$ cd firebase/\nxiaoxiaode-Mac-mini:firebase eooe$ cd hahamut/\nxiaoxiaode-Mac-mini:hahamut eooe$ l\ntotal 32\ndrwxr-xr-x 6 eooe staff 204 7 6 11:04 .\ndrwxr-xr-x 8 eooe staff 272 3 23 16:25 ..\n-rw-r--r-- 1 eooe staff 54 10 2 2017 .firebaserc\n-rw-r--r-- 1 eooe staff 6009 11 29 2017 a.js\n-rw-r--r-- 1 eooe staff 3 10 2 2017 firebase.json\ndrwxr-xr-x 9 eooe staff 306 7 10 15:15 functions\nxiaoxiaode-Mac-mini:hahamut eooe$ cd functions/\nxiaoxiaode-Mac-mini:functions eooe$ l\ntotal 7696\ndrwxr-xr-x 9 eooe staff 306 7 10 15:15 .\ndrwxr-xr-x 6 eooe staff 204 7 6 11:04 ..\n-rw-r--r-- 1 eooe staff 3597255 3 27 14:20 go-pear.phar\n-rw-r--r-- 1 eooe staff 62023 7 10 15:14 index.js\ndrwxr-xr-x 351 eooe staff 11934 3 12 18:20 node_modules\n-rw-r--r-- 1 eooe staff 221196 3 12 18:20 package-lock.json\n-rw-r--r-- 1 eooe staff 352 3 12 18:25 package.json\n-rw-r--r-- 1 eooe staff 17795 10 23 2017 pk.js\n-rw-r--r-- 1 eooe staff 22541 6 6 17:47 pk2.js\nxiaoxiaode-Mac-mini:functions eooe$ vim index.js \nxiaoxiaode-Mac-mini:functions eooe$ firebase deploy --only functions:messages_create\n\n=== Deploying to 'hahamut-8888'...\n\ni deploying functions\ni functions: ensuring necessary APIs are enabled...\n\u2714 functions: all necessary APIs are enabled\ni functions: preparing functions directory for uploading...\n\nError: Error occurred while parsing your function triggers.\n\n/Users/eooe/firebase/hahamut/functions/index.js:497\n ) {\n ^\n\nSyntaxError: Unexpected token )\n at createScript (vm.js:80:10)\n at Object.runInThisContext (vm.js:139:10)\n at Module._compile (module.js:599:28)\n at Object.Module._extensions..js (module.js:646:10)\n at Module.load (module.js:554:32)\n at tryModuleLoad (module.js:497:12)\n at Function.Module._load (module.js:489:3)\n at Module.require (module.js:579:17)\n at require (internal/module.js:11:18)\n at /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:18:11\nxiaoxiaode-Mac-mini:functions eooe$ vim index.js \nxiaoxiaode-Mac-mini:functions eooe$ firebase deploy --only functions:messages_create\n\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Update available: 3.19.3 (current: 3.17.6) \u2502\n\u2502 Run npm install -g firebase-tools to update. \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\n=== Deploying to 'hahamut-8888'...\n\ni deploying functions\ni functions: ensuring necessary APIs are enabled...\n\u2714 functions: all necessary APIs are enabled\ni functions: preparing functions directory for uploading...\ni functions: packaged functions (842.32 KB) for uploading\n\u2714 functions: functions folder uploaded successfully\ni functions: current functions in project: abuse, badfriend, bot_message_get, bottalk, chatListCreate, chatListDelete, chatlist_field_update_delete_member_cd, chatlist_field_update_favorite_order, chatlist_field_update_has_chat, chatlist_field_update_is_favorite, chatlist_field_update_is_friend, chatlist_field_update_is_inviting, chatlist_field_update_is_mute, chatlist_field_update_last_read_time, chatlist_field_update_name, chatlist_field_update_noreadnum, chatlist_field_update_related_acg_name, chatlist_field_update_related_c1, chatlist_field_update_type, chatlist_is_mute, crontab, fansbadfriend, fcmToken_change, fcmToken_new, hala_promotion_create, has_new_message, hot_forum, imgthumb, infoChange, info_name_update, isHotForum, is_friendUpdate, messageSend, messages_create, messages_create2, messages_delete, pk, pkRD, pkgirl, pking, pktest, reflashChatlist, sticker_check, sticker_create, sticker_ctime, sticker_delete, sticker_update, testfcm, testpubsub, time5s, userInfo, userNameChange, user_create\ni functions: uploading functions in project: messages_create\ni functions: updating function messages_create...\n\u2714 functions[messages_create]: Successful update operation. \n\n\u2714 Deploy complete!\n\nProject Console: https://console.firebase.google.com/project/hahamut-8888/overview\nxiaoxiaode-Mac-mini:functions eooe$ cd -\n/Users/eooe/firebase/hahamut\nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\n\n^C\nxiaoxiaode-Mac-mini:hahamut eooe$ \nxiaoxiaode-Mac-mini:hahamut eooe$ \nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nPHP Notice: Use of undefined constant a - assumed 'a' in /Users/eooe/firebase/hahamut/a.php on line 7\n\nNotice: Use of undefined constant a - assumed 'a' in /Users/eooe/firebase/hahamut/a.php on line 7\n6xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\n0xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\n0xiaoxiaode-Mac-mini:hahamut eooe$ err\n-bash: err: command not found\nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\n40xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\n4west--test\nest--est\n2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nwest\ntest\n2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nwest\ntest\nPHP Notice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 7\n\nNotice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 7\nPHP Notice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 7\n\nNotice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 7\nPHP Notice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\n\nNotice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\nPHP Notice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\n\nNotice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\n8xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\nPHP Notice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\n\nNotice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\nPHP Notice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\n\nNotice: Undefined variable: i in /Users/eooe/firebase/hahamut/a.php on line 15\n8xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n6xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n6xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n3216xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n3216xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n332xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n4xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n4xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\ntest\nwest\n432xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n-2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n2\n-2xiaoxiaode-Mac-mini:hahamut eooe$ \nxiaoxiaode-Mac-mini:hahamut eooe$ \nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n-2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n1-2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n1-2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nxz\nz\n1-1xiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n1-2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n1-2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n1210xiaoxiaode-Mac-mini:hahamut eooe$ \nxiaoxiaode-Mac-mini:hahamut eooe$ \nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzz\n61xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nz\nz\n0xiaoxiaode-Mac-mini:hahamut eooe$ php a.php\nwest\ntest\n2xiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\nxiaoxiaode-Mac-mini:hahamut eooe$ vim a.php\n\n strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1; \n} \nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j;$i<$j+$m;$i++) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i; \n } \n} \nbreak; \n} \n} \n \nif( $num == 0 ) { \n for($i=100;$i<=1;$i--) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i;\n break;\n }\n }\n} \necho strlen($a) - $num + strlen($b) - $num;\n\n"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nfor($j=$t;$j>=1;$j=$j-100) {\n if (substr($a,-$j) == substr($b, -$j)) {\n break;\n }\n}\n\nfor($i=$j+100;$i>=$j;$i--) {\n if ($i <= $t && substr($a,-$i) == substr($b, -$i)) {\n break;\n }\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j;$i<$j+$m;$i++) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i;\n }\n}\nbreak;\n}\n}\n\nif( $num == 0 ) {\n for($i=100;$i<=1;$i--) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i;\n break;\n }\n }\n}\necho strlen($a) - $num + strlen($b) - $num;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j+$m;$i>$j;$i--) {\n if (substr($a,-$i) == substr($b, -$i)) {\n break 2;\n }\n}\n}\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j;$i<$j+$m;$i++) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i;\n }\n}\nbreak;\n}\n}\necho strlen($a) - $num + strlen($b) - $num;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j;$i<=$j+$m;$i++) {\n if (substr($a,-$i) == substr($b, -$i)) {\n break 2;\n }\n}\n}\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\necho strlen($a).','.substr($a,-10);\necho \"\\n\";\necho strlen($b).','.substr($b,-10);\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j;$i<$j+$m;$i++) {\n if (substr($a,-$i) == substr($b, -$i)) {\n $num = $i;\n }\n}\nbreak;\n}\n}\necho strlen($a) - $num + strlen($b) - $num;\n"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j+m;$i<=$j;$i--) {\n if (substr($a,-$i) == substr($b, -$i)) {\n break 2;\n }\n}\n}\n}\necho strlen($a) - $i + strlen($b) - $i;"}, {"source_code": " strlen($b)) ? strlen($b) : strlen($a);\nif ($t > 100) {\n$m = 100;\n}else{\n$m = 1;\n}\nfor($j=$t;$j>=1;$j=$j-$m) {\nif (substr($a,-$j) == substr($b, -$j)) {\nfor($i=$j+$m;$i<=$j;$i--) {\n if (substr($a,-$i) == substr($b, -$i)) {\n break 2;\n }\n}\n}\n}\necho strlen($a) - $i + strlen($b) - $i;"}], "src_uid": "59d926bca19a6dcfe3eb3e3dc03fffd6"} {"source_code": " $max) {\n $max = $m;\n }\n}\n\necho $max;", "positive_code": [{"source_code": " $res) {\n\t\t\t$res = $x + $y;\n\t\t}\n\t}\n\tprint($res);\n\n\n\n\n\t// fclose($in);\n\t// fclose($out);\n ?>"}, {"source_code": " 0) {\n $max = $sum;\n }\n}\n\necho $max;"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "= $max_x_x) {\n\n if ($y >= $max_x_y) {\n $max_x_x = $x;\n $max_x_y = $y;\n }\n }\n\n if ($y >= $max_y_y) {\n\n if ($x >= $max_y_x) {\n\n $max_y_x = $x;\n $max_y_y = $y;\n }\n\n }\n}\n\necho max($max_x_y + $max_x_x, $max_y_x + $max_y_y);"}], "src_uid": "7c41fb6212992d1b3b3f89694b579fea"} {"source_code": "= $b[1] + $b[$a - 1])\n{\n $d = $b[0];\n $e = $b[1];\n $b[0] = $e;\n $b[1] = $d;\n}\nif($b[0] >= $b[1] + $b[$a - 1])\n{\n $c = 1;\n}\nif($b[$a - 1] >= $b[$a - 2] + $b[0])\n{\n $c = 1;\n}\nfor($x = 1; $x < $a - 1; $x++)\n{\n if($b[$x] >= $b[$x - 1] + $b[$x + 1])\n {\n $c = 1;\n break;\n }\n}\nif($c == 0)\n{\n print \"YES\\n\";\n print implode(\" \", $b);\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": "= ($prev + $prevPrev)) {\n die('NO');\n }\n}\necho 'YES' . PHP_EOL . $arr[$n - 2] . ' ';\nunset ($arr[$n - 2]);\necho implode(' ', $arr);\n"}, {"source_code": "= ($arr[$n - 2] + $arr[$n - 3])) {\n die('NO');\n}\necho 'YES' . PHP_EOL . $arr[$n - 2] . ' ';\nunset ($arr[$n - 2]);\necho implode(' ', $arr);\n"}, {"source_code": " $a[$n-1]) {\n echo \"YES\\n\";\n foreach ($a as $v) {\n echo $v.\" \";\n }\n exit;\n} else {\n if ($a[$n-3] + $a[$n-2] > $a[$n-1]) {\n $b = $a[$n-1];\n $a[$n-1] = $a[$n-2];\n $a[$n-2] = $b ;\n echo \"YES\\n\";\n foreach ($a as $v) {\n echo $v.\" \";\n }\n exit;\n }\n}\n\necho \"NO\";\n?>\n\n"}, {"source_code": "= $b[1] + $b[$a - 1])\n{\n $c = 1;\n}\nif($b[$a - 1] >= $b[$a - 2] + $b[0])\n{\n $c = 1;\n}\nfor($x = 1; $x < $a - 1; $x++)\n{\n if($b[$x] >= $b[$x - 1] + $b[$x + 1])\n {\n $c = 1;\n break;\n }\n}\nif($c == 0)\n{\n print \"YES\\n\";\n print implode(\" \", $b);\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": "= (($arr[$i - 1] ?? $last) + ($arr[$i + 1] ?? $arr[0]))) {\n die('NO');\n }\n}\necho 'YES' . PHP_EOL . implode(' ', $arr);\n"}, {"source_code": "", "positive_code": [{"source_code": " $c2) {\n $btmp += $c2;\n } else {\n $btmp += $b * $c1;\n }\n}\nif ($btmp > $c3) {\n $btmp = $c3;\n}\nforeach ($trolley as $t) {\n if (($t * $c1) > $c2) {\n $ttmp += $c2;\n } else {\n $ttmp += $t * $c1;\n }\n}\nif ($btmp > $c3) {\n $btmp = $c3;\n}\nif ($ttmp > $c3) {\n $ttmp = $c3;\n}\nif (($btmp + $ttmp) > $c4) {\n echo $c4;\n} else {\n echo $btmp + $ttmp;\n}"}, {"source_code": "=$c4 || $bablo_a>=$c3){\n $bablo_a=min($c3,$c4);\n break;\n }\n}\nif($bablo_a<$c4){\n foreach ($b as $b1) {\n $bablo_t += min($b1*$c1,$c2,$c3,$c4);\n if($bablo_t>=$c4 || $bablo_t>=$c3){\n $bablo_t=min($c3,$c4);\n break;\n }\n }\n}\n$bablo=min($bablo_a+$bablo_t,$c3+$c3,$c4);\nprint $bablo;"}, {"source_code": ""}], "negative_code": [{"source_code": "=$c4 || $bablo_a>=$c3){\n $bablo_a=min($c3,$c4);\n break;\n }\n }\n if($bablo_a<$c4){\n foreach ($b as $b1) {\n $bablo_t += min($b1*$c1,$c2,$c3,$c4);\n if($bablo_t>=$c4 || $bablo_t>=$c3){\n $bablo_t=min($c3,$c4);\n break;\n }\n }\n }\n $bablo=min($bablo_a+$bablo_t,$c3+$c3,$c4);\n print $bablo;"}, {"source_code": "\nc1 , c2 , c3 , c4
\nn , m
\na
\nb \n\n\n\";\nif(isset($_POST[\"submit\"])){\n$c1=$_POST[\"c1\"];\n$c2=$_POST[\"c2\"];\n$c3=$_POST[\"c3\"];\n$c4=$_POST[\"c4\"];\n$n=$_POST[\"n\"];\n$m=$_POST[\"m\"];\n$a=$_POST[\"a\"];\n$Bus=0;\n$Train=0;\n$i=0;\n$l=0;\n$nv=explode(\" \",$_POST[\"a\"]);\n$b=$_POST[\"b\"];\n$mv=explode(\" \",$_POST[\"b\"]);\nwhile($n!==0){\n$f1=$nv[$i]*$c1;\n$f2=$c2;\n$Bus=$Bus+min($f1,$f2);\n$i++;\n$n--;\n }\n$Bustotal=min($Bus,$c3);\n\n\nwhile($m!==0){\n$t1=$mv[$l]*$c1;\n$t2=$c2;\n$Train=$Train+min($t1,$t2);\n$l++;\n$m--;\n }\n$Traintotal=min($Train,$c3);\n\n\necho min($Traintotal+$Bustotal,$c4) ;\n \n\t\t\t\t\t\t\t}\n\n?>"}, {"source_code": "\nc1 , c2 , c3 , c4
\nn , m
\na
\nb \n\n\n\";}\n\n?>"}], "src_uid": "11fabde93815c1805369bbbc5a40e2d8"} {"source_code": " $max) $max = $angles2[$i];\n}\nfwrite($f2, (360 - $max));\nfclose($f2);", "positive_code": [{"source_code": " $max) $max = $angle;\n}\n$angle = $angles[0] + 360 - $angles[$n - 1];\nif ($angle > $max) $max = $angle;\nfwrite($f2, (360 - $max));\nfclose($f2);"}], "negative_code": [{"source_code": " $max) $max = $angle;\n}\n$angle = $angles[0] + 360 - $angles[$n - 1];\nif ($angle > $max) $max = $angle;\nfwrite($f2, (360 - $max));\nfclose($f2);"}, {"source_code": " $max) $max = $angles2[$i];\n}\nfwrite($f2, (360 - $max));\nfclose($f2);"}], "src_uid": "a67cdb7501e99766b20a2e905468c29c"} {"source_code": " 1) {\n\t\t$a[$n - 1][0]--;\n\t\t$a[0][0]++;\n\t\t$b[$j][0] = $a[$n - 1][1];\n\t\t$b[$j][1] = $a[0][1];\n\t\t$j++;\n\t}\n}\nsort($a);\nprintf(\"%d %d\\n\", $a[$n - 1][0] - $a[0][0], $j);\nfor ($i = 0; $i < $j; $i++) {\n\tprintf(\"%d %d\\n\", $b[$i][0], $b[$i][1]);\n}\n?>\n", "positive_code": [{"source_code": ""}, {"source_code": " 1 ) {\n\t\t$a[$n - 1][0]--;\n\t\t$a[0][0]++;\n\t\t$b[$j][0] = $a[$n - 1][1];\n\t\t$b[$j][1] = $a[0][1];\n\t\t$j++;\n\t}\n}\nsort($a);\nprintf(\"%d %d\\n\",$a[$n - 1][0] - $a[0][0],$j);\nfor($i = 0; $i < $j; $i++ )\n\tprintf(\"%d %d\\n\",$b[$i][0],$b[$i][1]);\n\n?>"}], "negative_code": [{"source_code": " 1) {\n $a[$n - 1][0]--;\n $a[0][0]++;\n $b[$j][0] = $a[$n - 1][1];\n $b[$j][1] = $a[0][1];\n $j++;\n }\n}\nsort($a);\nprintf(\"%d %d\\n\", $a[$n - 1][0] - $a[0][0], $j);\nfor ($i = 0; $i < $j; $i++) {\n printf(\"%d %d\\n\", $b[$i][0], $b[$i][1]);\n}\n?>"}], "src_uid": "9cd42fb28173170a6cfa947cb31ead6d"} {"source_code": "", "positive_code": [{"source_code": " $iMax) {\n $iMax = $i2;\n }\n if ($i > $iMax) {\n $iMax = $i;\n }\n }\n }\n return $iMax;\n}\n\n?>"}, {"source_code": " 1) {\n $success = false;\n for ($j = 2; $j <= sqrt($number); $j++) {\n if ($number % $j == 0) {\n $number = $j;\n $turns_number++;\n $success = true;\n break;\n }\n }\n if (!$success){\n $number--;\n $turns_number++;\n }\n }\n array_push($result, $turns_number);\n}\n\nfor ($i = 0; $i < $count; $i++){\n echo $result[$i];\n if ($i < $count - 1)\n echo \"\\n\";\n}\n?>"}], "src_uid": "614aa068ce74090b6577006c45e549cf"} {"source_code": " 4; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\t$onecount++;\n\t}\n\techo str_repeat(\"1 * 1 = 1\\n\", $onecount);\n\techo \"4 * 3 = 12\\n\";\n\techo \"12 * 2 = 24\\n\";\n\techo \"24 * 1 = 24\\n\";\n\n} else {\n\techo \"YES\\n\";\n\t$onecount = 0;\n\tfor ($i = $n; $i > 5; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\t$onecount++;\n\t}\n\techo str_repeat(\"1 * 1 = 1\\n\", $onecount);\n\techo \"2 * 4 = 8\\n\";\n\techo \"3 - 1 = 2\\n\";\n\techo \"5 - 2 = 3\\n\";\n\techo \"8 * 3 = 24\\n\";\n}\n?>", "positive_code": [{"source_code": " 4; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\tif ($switch == true) {\n\t\t\techo \"1 - 1 = 0\\n\";\n\t\t\t$zerocount++;\n\t\t\t$switch = false;\n\t\t} else {\n\t\t\t$switch = true;\n\t\t}\n\t}\n\tif ($switch == true) {\n\t\techo \"1 * 1 = 1\\n\";\n\t}\n\techo str_repeat(\"0 + 0 = 0\\n\", $zerocount - 1);\n\tif ($n > 6) { echo \"1 + 0 = 1\\n\"; }\n\techo \"4 * 3 = 12\\n\";\n\techo \"12 * 2 = 24\\n\";\n\techo \"24 * 1 = 24\\n\";\n} else {\n\techo \"YES\\n\";\n\t$switch = false;\n\t$zerocount = 0;\n\tfor ($i = $n; $i > 5; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\tif ($switch == true) {\n\t\t\techo \"1 - 1 = 0\\n\";\n\t\t\t$zerocount++;\n\t\t\t$switch = false;\n\t\t} else {\n\t\t\t$switch = true;\n\t\t}\n\t}\n\tif ($switch == true) {\n\t\techo \"1 * 1 = 1\\n\";\n\t}\n\techo str_repeat(\"0 + 0 = 0\\n\", $zerocount - 1);\n\tif ($n > 7) { echo \"1 + 0 = 1\\n\"; }\n\techo \"2 * 4 = 8\\n\";\n\techo \"3 - 1 = 2\\n\";\n\techo \"5 - 2 = 3\\n\";\n\techo \"8 * 3 = 24\\n\";\n}\n?>"}, {"source_code": " 4; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\techo \"1 * 24 = 24\\n\";\n\t}\n\n} else {\n\techo \"YES\\n\";\n\techo \"2 * 4 = 8\\n\";\n\techo \"3 - 1 = 2\\n\";\n\techo \"5 - 2 = 3\\n\";\n\techo \"8 * 3 = 24\\n\";\n\tfor ($i = $n; $i > 5; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\techo \"1 * 24 = 24\\n\";\n\t}\n}\n?>"}], "negative_code": [{"source_code": " 4; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\t$onecount++;\n\t}\n\techo str_repeat(\"1 * 1 = 1\\n\", $onecount);\n\techo \"4 * 3 = 12\\n\";\n\techo \"12 * 2 = 24\\n\";\n\techo \"24 * 1 = 24\\n\";\n\n} else {\n\techo \"YES\\n\";\n\t$onecount = 0;\n\tfor ($i = $n; $i > 5; $i = $i - 2) {\n\t\t$minus = $i - 1;\n\t\techo $i.\" - \".$minus.\" = 1\\n\";\n\t\t$onecount++;\n\t}\n\techo str_repeat(\"1 * 1 = 1\", $onecount);\n\techo \"2 * 4 = 8\\n\";\n\techo \"3 - 1 = 2\\n\";\n\techo \"5 - 2 = 3\\n\";\n\techo \"8 * 3 = 24\\n\";\n}\n?>"}], "src_uid": "1bd1a7fd2a07e3f8633d5bc83d837769"} {"source_code": "", "positive_code": [{"source_code": " 0) {\n $arr[] = ($c[$i] - $c[$i-1]);\n }\n}\nfunction gcd($a, $b)\n{\n if ($a == 0 || $b == 0)\n return abs( max(abs($a), abs($b)) );\n \n $r = $a % $b;\n return ($r != 0) ?\n gcd($b, $r) :\n abs($b);\n}\n/*\nfunction gcd_array($array, $a = 0)\n{\n $b = array_pop($array);\n return ($b === null) ?\n (int)$a :\n gcd_array($array, gcd($a, $b));\n}*/\n//$arrgcd = gcd_array($arr);\n$arrgcd = $arr[0];\nfor ($i = 0; $i < $n-1; $i++)\n $arrgcd = gcd($arrgcd,$arr[$i]);\n$ans = 0;\nfor ($i=1; $i<$n;++$i) {\n $dif = $c[$i] - $c[$i-1];\n $ans += ($dif / $arrgcd) - 1;\n}\nprintf(\"%d\",$ans);\n?>"}, {"source_code": " $ci) {\n $gcd = gcd($gcd, $bi);\n}\n\n$ans = 0;\nforeach ($b as $bi => $ci) {\n $ans += ($bi / $gcd - 1) * $ci;\n}\necho $ans;\n"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $b) {\n\t\t$t = $a;\n\t\t$a = $b;\n\t\t$b = $t;\n\t}\n\tif ($a == 0 || $b == 0)\n\t\treturn $a + $b;\n\treturn gcd ($b % $a, $a); \n}\n\nfscanf (STDIN, \"%d\", $n);\n$x = [];\n$s = fgets (STDIN);\n$s .= ' ';\n$last = \"\";\nfor ($i = 0; $i < strlen ($s); $i++) {\n\tif (substr ($s, $i, 1) == ' ') {\n\t\tif ($last != \"\") \n\t\t\t$x[] = (int) $last;\n\t\t$last = \"\";\n\t} else {\n\t\t$last .= substr ($s, $i, 1);\n\t}\n}\n\nsort ($x);\n$d = $x[1] - $x[0];;\nfor ($i = 2; $i < $n; $i++)\n\t$d = gcd ($d, $x[$i] - $x[$i - 1]);\nfprintf (STDOUT, \"%d\", ($x[$n - 1] - $x[0]) / $d - $n + 1);\n?>\n"}, {"source_code": ""}, {"source_code": "=$R)\n return;\n global $a, $b;\n $m = (int) (($L + $R) / 2);\n merge_sort($L, $m);\n merge_sort($m+1, $R);\n $id = $L;\n $id1 = $L;\n $id2 = $m+1;\n while ($id1 <= $m && $id2 <= $R) {\n if($a[$id1] < $a[$id2]) {\n $b[$id] = $a[$id1];\n $id1++;\n $id++;\n }\n else {\n $b[$id] = $a[$id2];\n $id2++;\n $id++;\n }\n }\n while ($id1 <= $m) {\n $b[$id] = $a[$id1];\n $id1++;\n $id++;\n }\n while ($id2 <= $R) {\n $b[$id] = $a[$id2];\n $id2++;\n $id++;\n }\n for($i=$L; $i <= $R; $i++) {\n $a[$i] = $b[$i];\n }\n}\nfunction gcd($a, $b) {\n if($a == 0)\n return $b;\n return gcd($b % $a, $a);\n}\n?>"}, {"source_code": ""}, {"source_code": " $str) {\n $arr[$i] = intval($str);\n}\nsort($arr);\n$min = $arr[0];\n$max = $arr[$n - 1];\n$res = $max - $min;\nforeach ($arr as $x) {\n $res = gcd($res, $x - $min);\n}\nprint(($max - $min) / $res - $n + 1);\nprint(\"\\n\");\n"}, {"source_code": "$A){\n $maina = $A;\n $A = $B;\n $B = $maina;\n }\n //echo \" \".$A.\" \".$B.\"\\n\";\n $A = $A % $B;\n if( $A==0 ) return $B;\n else return gcd($B, $A);\n }\n\n $n = (int)fgets(STDIN);\n\n $list = explode(\" \", fgets(STDIN));\n for($i = 0; $i<$n; $i++) $list[$i] = (int)$list[$i];\n\n sort($list);\n\n $a = array();\n\n for($i = 1; $i<$n; $i++){\n $a[$i-1] = (int)$list[$i] - (int)$list[$i-1];\n }\n\n $gcd = $a[0];\n for($i = 0; $i<$n-1; $i++){\n $gcd = gcd($gcd, $a[$i]);\n }\n\n $rez = 0;\n for($i = 0; $i<$n-1; $i++){\n $rez += max( 0, ( $a[$i]/$gcd ) - 1 );\n }\n echo $rez.\"\\n\";\n\n\n?>"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n $arr[] = ($c[$i] - $c[$i-1]);\n }\n}\nfunction gcd($a, $b)\n{\n if ($a == 0 || $b == 0)\n return abs( max(abs($a), abs($b)) );\n \n $r = $a % $b;\n return ($r != 0) ?\n gcd($b, $r) :\n abs($b);\n}\n/*\nfunction gcd_array($array, $a = 0)\n{\n $b = array_pop($array);\n return ($b === null) ?\n (int)$a :\n gcd_array($array, gcd($a, $b));\n}*/\n//$arrgcd = gcd_array($arr);\n$arrgcd = 0;\nfor ($i = 0; $i < $n; $i++)\n $arrgcd = gcd($arrgcd,$c[$i]);\n$ans = 0;\nfor ($i=1; $i<$n;++$i) {\n $dif = $c[$i] - $c[$i-1];\n \n $ans += ($dif / $arrgcd) - 1;\n}\nprintf(\"%d\",$ans);\n?>"}, {"source_code": " 0) {\n $arr[] = ($c[$i] - $c[$i-1]);\n }\n}\nfunction gcd($a, $b)\n{\n if ($a == 0 || $b == 0)\n return abs( max(abs($a), abs($b)) );\n \n $r = $a % $b;\n return ($r != 0) ?\n gcd($b, $r) :\n abs($b);\n}\n/*\nfunction gcd_array($array, $a = 0)\n{\n $b = array_pop($array);\n return ($b === null) ?\n (int)$a :\n gcd_array($array, gcd($a, $b));\n}*/\n//$arrgcd = gcd_array($arr);\n$arrgcd = $c[0];\nfor ($i = 0; $i < $n; $i++)\n $arrgcd = gcd($arrgcd,$c[$i]);\n$ans = 0;\nfor ($i=1; $i<$n;++$i) {\n $dif = $c[$i] - $c[$i-1];\n \n $ans += ($dif / $arrgcd) - 1;\n}\nprintf(\"%d\",$ans);\n?>"}, {"source_code": ""}], "src_uid": "805d82c407c1b34f217f8836454f7e09"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $l) $l = $len;\n}\n\nfor($i=1;$i<=($l+2);$i++){print '*';}print \"\\r\\n\";\n\n$j = 1;\nforeach($s as $v){\n print '*';\n if($l%2 == $v[1]%2){//no justify\n print str_repeat(' ',($l-$v[1])/2).$v[0].str_repeat(' ',($l-$v[1])/2);\n }else{//justify\n print str_repeat(' ',($l-$v[1]-$j)/2).$v[0].str_repeat(' ',($l-$v[1]+$j)/2);\n $j = -$j;\n }\n print \"*\\r\\n\";\n}\n\nfor($i=1;$i<=($l+2);$i++){print '*';}print \"\\r\\n\";\n\n?>"}, {"source_code": " $text) {\n // \u0414\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438\n $length = strlen($text);\n \n // \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u043d\u0430 \u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0435\u043d\u0438\u044f \n $space_left = ceil(($max_length-$length)/2);\n $space_right = $space_left;\n if( ($max_length - $length) % 2 !=0 ) {\n if($w) {\n $space_left--;\n $w=false;\n } else {\n $space_right--;\n $w=true;\n }\n }\n\n $sting = '*' . str_repeat(\" \", $space_left) . $text . str_repeat(\" \", $space_right) . '*';\n printf('%s', $sting.\"\\n\");\n}\nprintf('%s', $first_and_end_string.\"\\n\");\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $text) {\n // \u0414\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438\n $length = strlen($text);\n // \u041f\u0440\u043e\u0431\u0435\u043b\u044b \u0434\u043e\n $space_left = ceil(($max_length-$length)/2);\n // \u041f\u0440\u043e\u0431\u0435\u043b\u044b \u043f\u043e\u0441\u043b\u0435\n $space_right = ($max_length-$length) - $space_left;\n $sting = '*' . str_repeat(\" \", $space_left) . $text . str_repeat(\" \", $space_right) . '*';\n printf('%s', $sting.\"\\n\");\n}\nprintf('%s', $first_and_end_string.\"\\n\");\n?>"}, {"source_code": " $text) {\n // \u0414\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438\n $length = strlen($text);\n \n // \u041f\u0440\u043e\u0431\u0435\u043b\u044b \u0434\u043e\n $space_left = ceil(($max_length-$length)/2);\n \n // \u041f\u0440\u043e\u0431\u0435\u043b\u044b \u043f\u043e\u0441\u043b\u0435\n $space_right = ($max_length-$length) - $space_left;\n $sting = '*' . str_repeat(\" \", $space_left) . $text . str_repeat(\" \", $space_right) . '*';\n printf('%s', $sting.\"\\n\");\n}\nprintf('%s', $first_and_end_string.\"\\n\");\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "a017393743ae70a4d8a9d9dc40410653"} {"source_code": "", "positive_code": [{"source_code": "= doubleval($d.'.'.$ds) && $ds != 0 ){\n $max[] = (100 - $ds);\n }elseif($s >=$d && $ds ==0){\n $sugar[] = $ds;\n }\n}\n\nif(getArrayMax( $max ) > 0){\n print getArrayMax($max);\n}elseif( count( $sugar ) > 0 ){\n print 0;\n}\nelse{\n print '-1';\n}\n\n\nfunction getArrayMax( $array ){\n $maxV = 0;\n foreach( $array as $key=>$value ){\n if( $value > $maxV ){\n $maxV = $value;\n }\n }\n\n return $maxV;\n}\n\n\n"}, {"source_code": ""}], "negative_code": [{"source_code": "= $b) || ($j == 5))\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = floor(($h - $g) * 100);\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": "= $b) || ($j == 5))\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = number_format(($h - $g) * 100);\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": "= $b) || ($j == 5))\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = ($h - $g) * 100;\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": "= $b)\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = $h - $g;\n if(strlen($i) > 4)\n {\n $i = substr($i, 0, 4) * 100;\n }\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": " $b) || ($j == 5))\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = number_format(($h - $g) * 100);\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": "= $b)\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = $h - $g;\n if(strlen($i) > 4)\n {\n $i = substr($i, 0, 4) * 100;\n }\n else\n {\n $i = $i * 100;\n }\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": "= $b)\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = ($h - $g) * 100;\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": "= $b)\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = ($h - $g) * 100;\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": " $b) || ($j == 5))\n {\n break;\n }\n else\n {\n $h = ceil($g);\n $i = number_format(($h - $g) * 100);\n array_push($e, $i);\n }\n }\n}\nif(count($e) == 0)\n{\n print \"-1\";\n}\nelse\n{\n rsort($e);\n print $e[0];\n}\n?>"}, {"source_code": "= $d && $ds != 0 ){\n $max[] = (100 - $ds);\n }\n}\n\nif( count($max) == 0 ){\n print '-1';\n}else{\n print getArrayMax( $max );\n}\n\nfunction getArrayMax( $array ){\n $maxV = 0;\n foreach( $array as $key=>$value ){\n if( $value > $maxV ){\n $maxV = $value;\n }\n }\n\n return $maxV;\n}\n\n\n"}, {"source_code": "= $d && $ds != 0 ){\n $max[] = (100 - $ds);\n }elseif($s >=$d && $ds ==0){\n $sugar[] = $ds;\n }\n}\n\nif(getArrayMax( $max ) > 0){\n print getArrayMax($max);\n}elseif( count( $sugar ) > 0 ){\n print 0;\n}\nelse{\n print '-1';\n}\n\n\nfunction getArrayMax( $array ){\n $maxV = 0;\n foreach( $array as $key=>$value ){\n if( $value > $maxV ){\n $maxV = $value;\n }\n }\n\n return $maxV;\n}\n\n\n"}, {"source_code": "= $d && $s >= $d.$ds && $ds != 0 ){\n $max[] = (100 - $ds);\n }elseif($s >=$d && $ds ==0){\n $sugar[] = $ds;\n }\n}\n\nif(getArrayMax( $max ) > 0){\n print getArrayMax($max);\n}elseif( count( $sugar ) > 0 ){\n print 0;\n}\nelse{\n print '-1';\n}\n\n\nfunction getArrayMax( $array ){\n $maxV = 0;\n foreach( $array as $key=>$value ){\n if( $value > $maxV ){\n $maxV = $value;\n }\n }\n\n return $maxV;\n}\n\n\n"}], "src_uid": "91be5db48b44a44adff4c809ffbb8e3e"} {"source_code": "", "positive_code": [{"source_code": "=0; $i--) {\n for ($j=$slov-1; $j>=0; $j--) {\n if ($words[$i]==$words[$j]) {\n if ($i==$slov-1||$j==$slov-1) {\n $dp[$i][$j] = 1;\n } else {\n $dp[$i][$j] = $dp[$i+1][$j+1]+1;\n }\n }\n }\n}\n\n$ans = $n;\nfor ($i=0; $i<$slov; $i++) {\n $sum = 0;\n $word = '';\n for ($length=0; $length<$slov-$i; $length++) {\n $j = 0;\n $number = 0;\n if ($length==0) {\n $word = $words[$i+$length];\n $sum = strlen($words[$i+$length]);\n } else {\n $word = $word.' '.$words[$i+$length];\n $sum = $sum + strlen($words[$i+$length]) + 1;\n }\n while ($j<$slov) {\n //echo $j.' ';\n if ($dp[$i][$j]>$length) {\n $number++;\n $j = $j + $length + 1;\n } else {\n $j++;\n }\n }\n // echo PHP_EOL;\n $res = $n + $number*($length+1) - $number*$sum;\n //echo $word.'sum= '.$sum.' n='.$n.'res='.$res.'number ='.$number.'length ='.$length.PHP_EOL;\n if ($number>1) {\n if ($ans>$res) {\n $ans=$res;\n }\n }\n }\n}\necho $ans.PHP_EOL;\n/*for ($i=0; $i"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=2) {\n //$length = $n-$repeat*strlen($search) + $repeat*strlen($replace);\n $w[$search] = strlen(str_replace($search, $replace, $string))-2;\n if ($min>$w[$search]) {\n $min = $w[$search];\n }\n }\n }\n}\n\necho $min;\n?>"}, {"source_code": "=2) {\n $length = $n-$repeat*strlen($search) + $repeat*strlen($replace);\n $w[$search] = $length;\n if ($min>$length) {\n $min = $length;\n }\n }\n }\n}\necho $min;\n?>"}, {"source_code": "=2) {\n //$length = $n-$repeat*strlen($search) + $repeat*strlen($replace);\n $w[$search] = strlen(str_replace($search, $replace, $string))-2;\n if ($min>$w[$search]) {\n $min = $w[$search];\n }\n }\n }\n}\n\necho $min;\n?>"}, {"source_code": "=2) {\n $w[$i][$j] = strlen(str_replace($search, $replace, $string));\n if ($min>$w[$i][$j]) {\n $min = $w[$i][$j];\n }\n }\n //$w[$i][$j] = 'search = '.$search.' replace = '.$replace;\n }\n}\nprint_r($min);\n?>"}, {"source_code": "=2) {\n $w[$i][$j] = strlen(str_replace($search, $replace, $string));\n if ($min>$w[$i][$j]) {\n $min = $w[$i][$j];\n }\n }\n //$w[$i][$j] = 'search = '.$search.' replace = '.$replace;\n }\n}\nprint_r($min);\n?>"}, {"source_code": "=2) {\n //$length = $n-$repeat*strlen($search) + $repeat*strlen($replace);\n $w[$search] = strlen(str_replace($search, $replace, $string))-2;\n if ($min>$w[$search]) {\n $min = $w[$search];\n }\n }\n }\n}\n\necho $min;\n?>"}, {"source_code": "=2) {\n $w[$i][$j] = strlen(str_replace($search, $replace, $string));\n if ($min>$w[$i][$j]) {\n $min = $w[$i][$j];\n }\n }\n //$w[$i][$j] = 'search = '.$search.' replace = '.$replace;\n }\n}\nprint_r($min);\n?>"}, {"source_code": "=2) {\n //$length = $n-$repeat*strlen($search) + $repeat*strlen($replace);\n $w[$search] = strlen(str_replace($search, $replace, $string))-2;\n if ($min>$w[$search]) {\n $min = $w[$search];\n }\n }\n }\n}\necho $min;\n?>"}, {"source_code": "=2) {\n $length = $n-$repeat*strlen($search) + $repeat*strlen($replace);\n $w[$search] = $length;\n if ($min>$length) {\n $min = $length;\n }\n }\n }\n}\nprint_r($min);\n?>"}, {"source_code": "=2) {\n //$length = $n-$repeat*strlen($search) + $repeat*strlen($replace);\n $w[$search] = strlen(str_replace($search, $replace, $string))-2;\n if ($min>$w[$search]) {\n $min = $w[$search];\n }\n }\n }\n}\n\necho $min;\n?>"}, {"source_code": "=2) {\n $w[$i][$j] = strlen(str_replace($search, $replace, $string));\n if ($min>$w[$i][$j]) {\n $min = $w[$i][$j];\n }\n }\n //$w[$i][$j] = 'search = '.$search.' replace = '.$replace;\n }\n}\nprint_r($min);\n?>"}, {"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": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "1fb69f26fb14076df31534c77bf40c1e"} {"source_code": "", "positive_code": [{"source_code": " 0; $t--){\n\n\n\t$a = explode(' ', fgets(STDIN));\n\n\techo $a[1]. ' ' . $a[2]. ' '. $a[2] .\"\\n\";\n\n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "821d48c9a67d37ad7acc50d4d0d0d723"} {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n fgetc(STDIN);\n fgetc(STDIN);\n}\nfor ($i = $upper; $i <= $bottom; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n echo $pixels[$i][$j];\n }\n }\n if ($i != $bottom) {\n echo \"\\n\";\n }\n}\n\n", "positive_code": [{"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n $emptyRow = true;\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') {\n $emptyRow = false; \n echo($value[$i]);\n }\n }\n if (!$emptyRow) echo \"\\n\";\n}\n\n/*\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n else next($entries);\n }\n echo \"\\n\";\n}\n*/\n\n?>"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": "0 && !isset($cols[$iLeft]);$iLeft--);\n$iLeft++;\n$iLeft = $iLeft-$i;\n\nfor($j=0;$j<$y && !isset($rows[$j]);$j++);\nfor($jLeft=$y;$jLeft>0 && !isset($rows[$jLeft]);$jLeft--);\n$jLeft;\nfor(;$j<=$jLeft;$j++){\n\techo substr($lines[$j], $i, $iLeft) . \"\\n\";\n}\n"}, {"source_code": "0 && !isset($cols[$iLeft]);$iLeft--);\n$iLeft++;\nif ($i == $iLeft)\n\t$iLeft = 1;\nelse\n\t$iLeft = $iLeft-$i;\n\nfor($j=0;$j<$y && !isset($rows[$j]);$j++);\nfor($jLeft=$y;$jLeft>0 && !isset($rows[$jLeft]);$jLeft--);\n$jLeft;\nfor(;$j<=$jLeft;$j++){\n\techo substr($lines[$j], $i, $iLeft) . \"\\n\";\n}\n"}, {"source_code": " $max_x) $max_x = $j;\n if($i > $max_y) $max_y = $i;\n if($j < $min_x) $min_x = $j;\n if($i < $min_y) $min_y = $i;\n }\n }\n }\n // fputs($stdout, $min_x . \" \" . $min_y . \"\\n\");\n // fputs($stdout, $max_x . \" \" . $max_y . \"\\n\");\n\n for($i=$min_y; $i<=$max_y; ++$i){\n for($j=$min_x; $j<=$max_x; ++$j){\n fputs($stdout, $matrix[$i][$j]);\n }\n fputs($stdout, \"\\n\");\n }\n \n?>\n"}, {"source_code": " &$valf) {\n\t$valf = trim($valf);\n\t$valf = str_split($valf);\n\tforeach ($valf as $k => $a) {\n\t\t$arr2[$k][$k1] = $a;\n\t}\n\t\n}\nforeach ($arr as $k => $val) {\n\tif (in_array('*', $val)) {\n\t\t$minx = isset($minx) ? $minx : $k;\n\t\t$maxx = $k;\n\t}\n}\n\nforeach ($arr2 as $k => $val) {\n\tif (in_array('*', $val)) {\n\t\t$miny = isset($miny) ? $miny : $k;\n\t\t$maxy = $k;\n\t}\n}\n\nfor ($i = $minx; $i <= $maxx; $i++) {\n\tfor ($j = $miny; $j <= $maxy; $j++) {\n\t\techo $arr[$i][$j];\n\t}\n\techo \"\\n\";\n}\n"}, {"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 '';\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 *****************************************************/\nlist($n, $m) = explode(' ', g());\n\n$lines = array();\nfor ($i = 0; $i < $n; $i++) {\n $lines[] = g();\n}\n\n$x1 = -1;\n$x2 = -1;\n$y1 = -1;\n$y2 = -1;\n\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if(substr($lines[$i], $j, 1) == '*' && $y1 < 0) {\n $y1 = $i;\n }\n\n if(substr($lines[$n - $i - 1], $j, 1) == '*' && $y2 < 0) {\n $y2 = $n - $i - 1;\n }\n }\n}\n\nfor ($j = 0; $j < $m; $j++) {\n for ($i = 0; $i < $n; $i++) {\n if(substr($lines[$i], $j, 1) == '*' && $x1 < 0) {\n $x1 = $j;\n }\n\n if(substr($lines[$i], $m - $j - 1, 1) == '*' && $x2 < 0) {\n $x2 = $m - $j - 1;\n }\n }\n}\n\nfor($i = $y1; $i <= $y2; $i++) {\n echo substr($lines[$i], $x1, $x2 - $x1 + 1) . \"\\n\";\n}\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": "0 && !isset($cols[$iLeft]);$iLeft--);\n$iLeft++;\n$iLeft = $iLeft-$i;\n\nfor($j=0;$j<$y && !isset($rows[$j]);$j++);\nfor(;$j<=$y && isset($rows[$j]);$j++){\n\techo substr($lines[$j], $i, $iLeft) . \"\\n\";\n}\n\n\n\n//var_dump($lines);\n//var_dump($cols);\n//var_dump($rows);\n\n"}, {"source_code": "0 && !isset($cols[$iLeft]);$iLeft--);\n$iLeft++;\n$iLeft = $iLeft-$i;\n\nfor($j=0;$j<$y && !isset($rows[$j]);$j++);\nfor($jLeft=$y;$jLeft>0 && !isset($rows[$jLeft]);$jLeft--);\n$jLeft++;\n$jLeft = $jLeft-$j;\nfor(;$j<=$jLeft-1;$j++){\n\techo substr($lines[$j], $i, $iLeft) . \"\\n\";\n}\n"}, {"source_code": "0 && !isset($cols[$iLeft]);$iLeft--);\n$iLeft = $x-$iLeft;\nfor($j=0;$j<$y && !isset($rows[$j]);$j++);\nfor(;$j<$y && isset($rows[$j]);$j++){\n\techo substr($lines[$j], $i, $iLeft) . \"\\n\";\n}\n\n\n\nvar_dump($lines);\n\n\n"}, {"source_code": "0 && !isset($cols[$iLeft]);$iLeft--);\n$iLeft++;\n$iLeft = $iLeft-$i;\n\nfor($j=0;$j<$y && !isset($rows[$j]);$j++);\nfor($jLeft=$y;$jLeft>0 && !isset($rows[$jLeft]);$jLeft--);\n$jLeft++;\n$jLeft = $jLeft-$j;\nfor(;$j<=$jLeft;$j++){\n\tif (isset($rows[$j]))\n\t\techo substr($lines[$j], $i, $iLeft) . \"\\n\";\n}\n\n\n\n//var_dump($lines);\n//var_dump($cols);\n//var_dump($rows);\n\n"}, {"source_code": " $max_x) $max_x = $j;\n if($i > $max_y) $max_y = $i;\n if($j < $min_x) $min_x = $j;\n if($i < $min_y) $min_y = $i;\n }\n }\n }\n // fputs($stdout, $min_x . \" \" . $min_y . \"\\n\");\n // fputs($stdout, $max_x . \" \" . $max_y . \"\\n\");\n\n for($i=$min_y; $i<=$max_y; ++$i){\n for($j=$min_x; $j<=$max_x; ++$j){\n fputs($stdout, $matrix[$i][$j]);\n }\n fputs($stdout, \"\\n\");\n }\n \n?>\n "}, {"source_code": " $max_x) $max_x = $j;\n if($i > $max_y) $max_y = $i;\n if($j < $min_x) $min_x = $j;\n if($i < $min_y) $min_y = $i;\n }\n }\n }\n // fputs($stdout, $min_x . \" \" . $min_y . \"\\n\");\n // fputs($stdout, $max_x . \" \" . $max_y . \"\\n\");\n\n for($i=$min_y; $i<=$max_y; ++$i){\n for($j=$min_x; $j<=$max_x; ++$j){\n fputs($stdout, $matrix[$i][$j]);\n }\n fputs($stdout, \"\\n\");\n }\n \n?>\n"}, {"source_code": " $max_x) $max_x = $j;\n if($i > $max_y) $max_y = $i;\n if($j < $min_x) $min_x = $j;\n if($i < $min_y) $min_y = $i;\n }\n }\n }\n // fputs($stdout, $min_x . \" \" . $min_y . \"\\n\");\n // fputs($stdout, $max_x . \" \" . $max_y . \"\\n\");\n\n for($i=$min_y; $i<=$max_y; ++$i){\n for($j=$min_x; $j<=$max_x; ++$j){\n fputs($stdout, $matrix[$i][$j]);\n }\n fputs($stdout, \"\\n\");\n }\n \n?>"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\n/*\nforeach ($entries as $value) {\n $emptyRow = true;\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') {\n $emptyRow = false; \n echo($value[$i]);\n }\n }\n if (!$emptyRow) echo \"\\n\";\n}\n*/\n\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n else next($entries);\n }\n echo \"\\n\";\n}\n\n\n?>"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n $emptyRow = true;\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') {$emptyRow = false; echo($value[$i]);}\n }\n if (!$emptyRow) echo \"\\n\";\n}\n\n?>"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n }\n echo \"\\n\";\n}\n//\n\n?>"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n }\n echo \"\\n\";\n}\n\n?>"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n }\n echo \"\\n\";\n}\n\n?>"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n }\n echo \"\\n\";\n}\n\n?>"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n $emptyRow = true;\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') {\n $emptyRow = false; \n echo($value[$i]);\n }\n }\n if (!$emptyRow) echo \"\\n\";\n}\n\n/*\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n else next($entries);\n }\n echo \"\\n\";\n}\n*/\n\n?>"}, {"source_code": "http://codeforces.com/problemset/problem/14/A"}, {"source_code": "= 0; $i--) {\n if (check_if_empty_col($entries, $i)) $entries = delete_col($entries, $i); \n else break;\n}\n\nfor ($i = 0; $i < $rows; $i++) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nfor ($i = $rows - 1; $i >= 0; $i--) {\n if (check_if_empty_row($entries, $i)) $entries = delete_row($entries, $i); \n else break;\n}\n\nforeach ($entries as $value) {\n for ($i = 0; $i < strlen($value); $i++) {\n if ($value[$i] != 'x') print_r($value[$i]);\n }\n echo \"\\n\";\n}\nprint_r($entries);\n\n?>"}, {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n fgetc(STDIN);\n fgetc(STDIN);\n}\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n echo $pixels[$i][$j];\n }\n if ($j == $m - 1) {\n echo \"\\n\";\n }\n }\n}\n\n"}, {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n fgetc(STDIN);\n}\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n echo $pixels[$i][$j];\n }\n if ($j == $m - 1) {\n echo \"\\n\";\n }\n }\n}\n\n"}, {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n fgetc(STDIN);\n fgetc(STDIN);\n}\nfor ($i = $upper; $i <= $bottom; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n echo $pixels[$i][$j];\n }\n }\n}\n\n"}, {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n// fgetc(STDIN);\n}\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n echo $pixels[$i][$j];\n }\n if ($j == $m - 1) {\n echo \"\\n\";\n }\n }\n}\n\n"}, {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n fgetc(STDIN);\n}\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n echo $pixels[$i][$j];\n }\n }\n echo \"\\n\";\n}\n\n"}, {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n fgetc(STDIN);\n}\nfor ($i = 0; $i < $n; $i++) {\n for ($j = 0; $j < $m; $j++) {\n// if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n echo $pixels[$i][$j];\n// }\n if ($j == $m - 1) {\n echo \"\\n\";\n }\n }\n}\n\n"}, {"source_code": " $j) {\n $left = $j;\n }\n if ($right < $j) {\n $right = $j;\n }\n if ($upper > $i) {\n $upper = $i;\n }\n if ($bottom < $i) {\n $bottom = $i;\n }\n }\n }\n fgetc(STDIN);\n}\n//for ($i = 0; $i < $n; $i++) {\n// for ($j = 0; $j < $m; $j++) {\n// if ($i <= $bottom && $i >= $upper && $j <= $right && $j >= $left) {\n// echo $pixels[$i][$j];\n// }\n// if ($j == $m - 1) {\n// echo \"\\n\";\n// }\n// }\n//}\n\nprint_r($pixels);\n"}, {"source_code": ""}], "src_uid": "d715095ff068f4d081b58fbfe103a02c"} {"source_code": "= 0 && bcmod($k, 3) ==0) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n\n}\n?>", "positive_code": [{"source_code": ""}, {"source_code": "= $a && $q-$a <= $n \n && $q >= $b && $q-$b <= $n \n && $q >= $c && $q-$c <= $n \n ){\n echo \"YES\\n\";\n continue;\n }\n }\n \n echo \"NO\\n\";\n \n \n }"}, {"source_code": "= 0; $i--){\n\n $rest += max($sisters) - $sisters[$i];\n\n }\n if(($polycrap - $rest) % $arraysize == 0 && ($polycrap - $rest) >= 0){\n return \"YES\\n\";\n }else {\n return \"NO\\n\";\n }\n}\nfscanf(STDIN, \"%d\\n\", $size);\nfor($i = 0; $i < $size; $i++){\n $cases = fgets(STDIN);\n $x = array_map('intval', preg_split('/ /', $cases, -1, PREG_SPLIT_NO_EMPTY));\n $polycrap = $x[count($x)-1];\n unset($x[count($x)-1]);\n $sisters = $x;\n $results = sistersdivide($polycrap,$sisters);\n echo $results;\n}\n"}, {"source_code": "=0)\n {\n echo \"YES\".\"\\n\";\n }else {\n echo \"NO\".\"\\n\";\n}\n\n\n}\n\n\n\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $val){\n sort($val);\n if($key >= $x){\n for($t = 0; $t < $key - $x; $t++){\n $res .= 'R';\n }\n $x = $key;\n } else {\n echo \"NO\\n\";\n continue 2;\n }\n foreach($val as $v){\n if($v >= $y){\n for($t = 0; $t < $v - $y; $t++){\n $res .= 'U';\n }\n $y = $v;\n } else {\n echo \"NO\\n\";\n continue 3;\n }\n }\n \n }\n echo \"YES\\n\";\n echo $res.\"\\n\";\n \n}"}, {"source_code": ""}], "src_uid": "bc5fb5d6882b86d83e5c86f21d806a52"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n print intval(fgets(STDIN)).\"\\n\";\n}\n\n\n"}], "negative_code": [{"source_code": " 0; $t --){\n print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n}\n\n\n"}, {"source_code": " 0; $t --){\n //print pow(2, intval(fgets(STDIN)) - 1).\"\\n\";\n print intval(fgets(STDIN)).\"/n\";\n}\n\n\n"}], "src_uid": "740c05c036b646d8fb6b391af115d7f0"} {"source_code": ""}, {"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\n?>"}, {"source_code": "= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcdiv($sBigint1, $sBigint2);\r\n }\r\n}\r\n\r\nfunction bigintAdd($sBigint1, $sBigint2, $sCale = '') {\r\n switch ($sCale) {\r\n case 'ceil':\r\n return bcadd(bcadd($sBigint1, $sBigint2), 1);\r\n case 'floor':\r\n return bcadd($sBigint1, $sBigint2);\r\n case 'round':\r\n $sResult = bcadd($sBigint1, $sBigint2);\r\n return bcsub(bcadd($sBigint1, $sBigint2, 2), $sResult, 2) >= 0.5 ? bcadd($sResult, 1) : $sResult;\r\n default:\r\n return bcadd($sBigint1, $sBigint2);\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?>"}], "negative_code": [{"source_code": "= $count2 ? $count1 : $count2;\r\n \r\n for ($i=0; $i<$count1; $i++) {\r\n $baseArray[$i] += $numberArray1[$i];\r\n } \r\n \r\n $memory = 0;\r\n for ($i=0; $i<$count2; $i++) {\r\n $elementsSum = $baseArray[$i] + $numberArray2[$i];\r\n $elementsSum += $memory;\r\n $baseArray[$i] = ($elementsSum)%10;\r\n $memory = floor($elementsSum/10);\r\n } \r\n \r\n while ($memory > 0) {\r\n $elementsSum = $baseArray[$i] + $memory;\r\n $baseArray[$i] = ($elementsSum)%10;\r\n $memory = round($elementsSum/10);\r\n $i++;\r\n } \r\n \r\n $digitsCount = ($i >= $maxCount) ? $i : $maxCount;\r\n \r\n $resultArray = array_slice($baseArray, 0, $digitsCount);\r\n $resultArray = array_reverse($resultArray);\r\n \r\n return implode($resultArray);\r\n}\r\n \r\nfunction getArrayBeauty($array, $x) {\r\n $sum = \"0\";\r\n \r\n foreach($array as $element) {\r\n $sum = getNumbersSum($sum, ceil($element / $x));\r\n }\r\n \r\n return $sum;\r\n}\r\n \r\nfunction getSum($array, $n) {\r\n $sum = \"0\";\r\n \r\n for ($k=0; $k<$n; $k++) {\r\n $sum = getNumbersSum($sum, $array[$k]);\r\n }\r\n\r\n return $sum;\r\n}\r\n \r\nfor ($i=0; $i<$rowsNumber; $i++) {\r\n list($n, $x) = explode(' ', fgets($file));\r\n $array = explode(' ', fgets($file));\r\n \r\n echo getArrayBeauty([getSum($array, $n)], $x); \r\n echo \" \";\r\n echo getArrayBeauty($array, $x); \r\n echo \"\\n\";\r\n}"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1) { $k += ceil($a[$j] / $x); }\r\n if ($j < 1) { $c += ceil($a[$j] / $x); }\r\n }\r\n \r\n $k += ceil(($a[0] + $a[1]) / $x);\r\n $c += ceil(($a[1] + $a[2]) / $x);\r\n \r\n $min = min($m, $k, $c);\r\n $max = max($m, $k, $c);\r\n echo $min.' '.$max.PHP_EOL;\r\n}\r\n?>"}, {"source_code": " 1) { $k += ceil($a[$j] / $x); }\r\n if ($j < 1) { $c += ceil($a[$j] / $x); }\r\n }\r\n \r\n $k += ceil(($a[0] + $a[1]) / $x);\r\n $c += ceil(($a[1] + $a[2]) / $x);\r\n \r\n $min = min($m, $k, $c);\r\n $max = max($m, $k, $c);\r\n echo $min.' '.$max.PHP_EOL;\r\n}\r\n?>"}, {"source_code": " 1) { $k += ceil($a[$j] / $x); }\r\n if ($j < 1) { $c += ceil($a[$j] / $x); }\r\n }\r\n \r\n $k += ceil(($a[0] + $a[1]) / $x);\r\n $c += ceil(($a[1] + $a[2]) / $x);\r\n \r\n $min = min($m, $k, $c);\r\n $max = max($m, $k, $c);\r\n echo $min.' '.$max.PHP_EOL;\r\n}\r\n?>"}, {"source_code": " 1) { $k += ceil($a[$j] / $x); }\r\n if ($j < 1) { $c += ceil($a[$j] / $x); }\r\n }\r\n \r\n $k += ceil(($a[0] + $a[1]) / $x);\r\n $c += ceil(($a[1] + $a[2]) / $x);\r\n \r\n $min = min($m, $k, $c);\r\n $max = max($m, $k, $c);\r\n echo $min.' '.$max;\r\n}\r\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\r\n"}, {"source_code": " 0);\r\n}\r\nfunction bc1($x, $e, $y = null)\r\n{\r\n is_null($y) && list($e, $y) = explode(' ', trim($e));\r\n '+' == $e && $ans = bcadd($x, $y);\r\n '-' == $e && $ans = bcsub($x, $y);\r\n '*' == $e && $ans = bcmul($x, $y);\r\n '/' == $e && $ans = bcdiv($x, $y);\r\n '%' == $e && $ans = bcmod($x, $y);\r\n\r\n return $ans;\r\n}\r\n"}, {"source_code": "\n", "positive_code": [{"source_code": "\n"}], "negative_code": [], "src_uid": "f60ea0f2caaec16894e84ba87f90c061"} {"source_code": "$v) {\n $resStr .= ($k+1).' ';\n $resNum += $v*$x+1;\n $x++;\n}\n\necho $resNum.\"\\n\";\necho $resStr.\"\\n\";", "positive_code": [{"source_code": ""}, {"source_code": "$v) {\n $resStr .= ($k+1).' ';\n $resNum += $v*$x+1;\n $x++;\n}\n\necho $resNum.\"\\n\";\necho $resStr.\"\\n\";"}], "negative_code": [], "src_uid": "c79f25dab583edfcabb6991be7abf971"} {"source_code": "", "positive_code": [{"source_code": " 0; $t --) {\r\n $n = intval(trim(fgets(STDIN)));\r\n\r\n $array = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($array[0] == 1 && $array[$n - 1] == $n){\r\n $new_arr = array_slice($array, 1, $n - 2);\r\n\r\n sort($new_arr);\r\n\r\n if($new_arr == array_slice($array, 1, $n - 2))\r\n echo \"0\\n\";\r\n\r\n else\r\n echo \"1\\n\";\r\n\r\n continue;\r\n\r\n }\r\n\r\n\r\n\r\n if($array[0] == 1 || $array[$n - 1] == $n){\r\n echo \"1\\n\";\r\n continue;\r\n }\r\n\r\n if($array[0] == $n && $array[$n - 1] == 1){\r\n echo \"3\\n\";\r\n continue;\r\n }\r\n\r\n echo \"2\\n\";\r\n\r\n\r\n\r\n}\r\n\r\n"}], "negative_code": [{"source_code": " 0; $t --) {\r\n $n = intval(trim(fgets(STDIN)));\r\n\r\n $array = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($array[0] == 1 && $array[$n - 1] == $n){\r\n $new_arr = array_slice($array, 1, $n - 2);\r\n\r\n sort($new_arr);\r\n\r\n if($new_arr == array_slice($array, 1, $n - 2))\r\n echo \"0\\n\";\r\n\r\n else\r\n echo \"1\\n\";\r\n\r\n continue;\r\n\r\n }\r\n\r\n\r\n\r\n if($array[0] == 1 || $array[$n - 1] == $n){\r\n echo \"1\\n\";\r\n continue;\r\n }\r\n\r\n echo \"2\\n\";\r\n\r\n\r\n\r\n}\r\n\r\n"}, {"source_code": ""}], "src_uid": "c212524cc1ad8e0332693e3cf644854b"} {"source_code": ">1)).\" \".(1+($m>>1)).\"\\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": [{"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": " $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": "e6753e3f71ff13cebc1aaf04d3d2106b"} {"source_code": "$v){\n if($s+$v>$d) break;\n $s += $v;\n $r[] = $k;\n}\nprint count($r).\"\\r\\n\".implode(' ',$r);\n\n?>", "positive_code": [{"source_code": "= 0)\n {\n $j++;\n }\n}\n$k = \"\";\n$m = array_keys($i);\nfor($x = 0; $x < $j; $x++)\n{\n $k .= ($m[$x] + 1) . \" \";\n}\nprint $j . \"\\n\" . trim($k);\n?>"}], "negative_code": [{"source_code": " 0)\n {\n $j++;\n }\n}\n$k = \"\";\n$m = array_keys($i);\nfor($x = 0; $x < $j; $x++)\n{\n $k .= ($m[$x] + 1) . \" \";\n}\nprint $j . \"\\n\" . trim($k);\n?>"}, {"source_code": " 0)\n {\n $j++;\n }\n}\n$k = \"\";\n$m = array_keys($i);\nfor($x = 0; $x < $j; $x++)\n{\n $k .= $m[$x] . \" \";\n}\nprint $j . \"\\n\" . trim($k);\n?>"}], "src_uid": "4d7de18e76600777ff023e1b61366ee4"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1,\n 'woman' => 2,\n 'child' => 2,\n 'man' => 3,\n 'captain' => 4,\n ];\n\n public function __construct($name, $category)\n {\n $this->name = $name;\n $this->category = self::$priority[$category];\n }\n}\n\nfscanf(STDIN, \"%d\", $n);\n$data = [];\nfor ($i = 0; $i < $n; $i++) {\n fscanf(STDIN, \"%s %s\", $name, $category);\n $member = new Member(trim($name), trim($category));\n $data[$member->category][] = $member->name;\n}\n\nksort($data);\nforeach ($data as $category => $name) {\n printf(\"%s\\n\", implode(\"\\n\", $name));\n}\n"}, {"source_code": " \"captain\", \"man\" => \"man\", \"rat\" => \"rat\", \"woman\" => \"mid\", \"child\" => \"mid\");\n $peoples = array(\"captain\" => array(), \"man\" => array(), \"rat\" => array(), \"mid\" => array());\n \n for ($i = 0; $i < $n; ++$i) {\n $str = trim(fgets(STDIN));\n $strs = split(\" \", $str);\n \n $peoples[$rev[$strs[1]]][] = $strs[0];\n }\n \n krsort($peoples);\n foreach ($peoples as $key => $value) {\n foreach ($value as $name) {\n echo $name.\"\\n\";\n }\n }\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": " 1,\n 'woman' => 2,\n 'child' => 2,\n 'man' => 3,\n 'captain' => 4,\n ];\n\n public function __construct($name, $category)\n {\n $this->name = $name;\n $this->category = $category;\n }\n}\n\nfunction cmp($mem1, $mem2)\n{\n return Member::$priority[$mem1->category] > Member::$priority[$mem2->category];\n}\n\nfscanf(STDIN, \"%d\", $n);\n$data = [];\nfor ($i = 0; $i < $n; $i++) {\n fscanf(STDIN, \"%s %s\", $name, $category);\n $data[] = new Member($name, $category);\n}\nusort($data, \"cmp\");\nforeach ($data as $member) {\n printf(\"%s\\n\", $member->name);\n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\";\n}\nforeach($a as $val){\n\tif($val[1]=='child' || $val[1]=='woman')\n\t\techo $val[0].\"
\";\n}\nforeach($a as $val){\n\tif($val[1]=='man')\n\t\techo $val[0].\"
\";\n}\nforeach($a as $val){\n\tif($val[1]=='captain')\n\t\techo $val[0];\n}\n?>"}, {"source_code": ""}], "src_uid": "753113fa5130a67423f2e205c97f8017"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "d8349ff9b695612473b2ba00d08e505b"} {"source_code": "??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??>>?\n9?>>?0\n0?<>1\n1?<>2\n2?<>3\n3?<>4\n4?<>5\n5?<>6\n6?<>7\n7?<>8\n8?<>9\n?<>1\n>>??", "positive_code": [{"source_code": "?0???<>1\n0???>>1\n1???>>2\n2???>>3\n3???>>4\n4???>>5\n5???>>6\n6???>>7\n7???>>8\n8???>>9\n9???>>???0\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??>>???\n?0<>\n>>?0??\n"}, {"source_code": "??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??>>?\n9?>>?0\n0?<>1\n1?<>2\n2?<>3\n3?<>4\n4?<>5\n5?<>6\n6?<>7\n7?<>8\n8?<>9\n?<>1\n>>??"}, {"source_code": "??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??>>?\n0?<>1\n1?<>2\n2?<>3\n3?<>4\n4?<>5\n5?<>6\n6?<>7\n7?<>8\n8?<>9\n9?>>?0\n?<>1\n>>??"}], "negative_code": [{"source_code": ">>??\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??>>?\n9?>>?0\n0?<>1\n1?<>2\n2?<>3\n3?<>4\n4?<>5\n5?<>6\n6?<>7\n7?<>8\n8?<>9\n?<>1"}, {"source_code": ">>?\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?\n9?>>?0\n0?<>1\n1?<>2\n2?<>3\n3?<>4\n4?<>5\n5?<>6\n6?<>7\n7?<>8\n8?<>9\n?<>1"}, {"source_code": "??0>>0??\n\n??1>>1??\n\n??2>>2??\n\n??3>>3??\n\n??4>>4??\n\n??5>>5??\n\n??6>>6??\n\n??7>>7??\n\n??8>>8??\n\n??9>>9??\n\n??>>?\n\n9?>>?0\n\n0?<>1\n\n1?<>2\n\n2?<>3\n\n3?<>4\n\n4?<>5\n\n5?<>6\n\n6?<>7\n\n7?<>8\n\n8?<>9\n\n?<>1"}, {"source_code": "??0>>0??\n\n??1>>1??\n\n??2>>2??\n\n??3>>3??\n\n??4>>4??\n\n??5>>5??\n\n??6>>6??\n\n??7>>7??\n\n??8>>8??\n\n??9>>9??\n\n??>>?\n\n9?>>?0\n\n0?<>1\n\n1?<>2\n\n2?<>3\n\n3?<>4\n\n4?<>5\n\n5?<>6\n\n6?<>7\n\n7?<>8\n\n8?<>9\n\n?<>1\n\n>>??\n"}, {"source_code": "??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?0???<>1\n0???>>1\n1???>>2\n2???>>3\n3???>>4\n4???>>5\n5???>>6\n6???>>7\n7???>>8\n8???>>9\n9???>>???0\n??>>???\n?0<>\n>>?0??\n"}, {"source_code": "?0???<>1\n0???>>1\n1???>>2\n2???>>3\n3???>>4\n4???>>5\n5???>>6\n6???>>7\n7???>>8\n8???>>9\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??\n9???>>???0\n??>>???\n?0<>\n>>?0??\n"}, {"source_code": "??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?0???<>1\n0???->1\n1???->2\n2???->3\n3???->4\n4???->5\n5???->6\n6???->7\n7???->8\n8???->9\n9???->???0\n??->???\n?0<>\n->?0??\n"}], "src_uid": "90929863d289a475b766d5f2b0cd7c61"} {"source_code": " $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n }\n}\n?>"}], "negative_code": [{"source_code": " $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n printf(\"%.0f\", $r);\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d = bcadd($d, $k);\n $e = bcadd($e, $l);\n }\n else\n {\n $k = bcadd($k, bcsub($m[1], $m[0]));\n $l = bcadd($k, bcsub($m[2], $m[1]));\n $d = bcsub($d, $k);\n $e = bcsub($e, $l);\n }\n }\n print $r;\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n }\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d = bcadd($d, $k);\n $e = bcadd($e, $l);\n }\n else\n {\n $k = bcadd($k, bcsub($m[1], $m[0]));\n $l = bcadd($k, bcsub($m[2], $m[1]));\n $d = bcsub($d, $k);\n $e = bcsub($e, $l);\n }\n }\n print $r;\n }\n}\nelse\n{\n if($c[0] != 0)\n {\n array_unshift($c, 0);\n }\n if($c[count($c) - 1] != $b)\n {\n array_push($c, $b);\n }\n if(count($c) == 2)\n {\n print $c[count($c) - 1] - $c[0];\n }\n else\n {\n $d = 0;\n $e = 0;\n $f = array();\n $g = array();\n $h = 0;\n $i = 0;\n for($x = 0; $x < count($c) - 1; $x++)\n {\n $g[count($g)] = $c[$x];\n $h++;\n if($h == 3)\n {\n $f[count($f)] = $g;\n $g = array($c[$x]);\n $h = 1;\n }\n $j = $i % 2;\n $i++;\n if($j == 0)\n {\n $d += $c[$x + 1] - $c[$x];\n }\n else\n {\n $e += $c[$x + 1] - $c[$x];\n }\n }\n $g[count($g)] = $c[$x];\n if(count($g) == 3)\n {\n $f[count($f)] = $g;\n $g = array();\n $h = 0;\n }\n $k = 0;\n $l = 0;\n $r = $d;\n for($x = 0; $x < count($f); $x++)\n {\n $m = $f[$x];\n if(($m[2] - $m[1] != 1) || (($m[2] - $m[1] != 1) && ($m[1] - $m[0] != 1)))\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $n = $m[1] - $m[0];\n $o = ($m[2] - $m[1]) - 1;\n $d -= $k;\n $e -= $l;\n if(($d <= 0) && ($e <= 0))\n {\n $p = ($k - ($m[1] - $m[0])) + $n + $o;\n }\n else\n {\n $p = $e + $n + $o;\n }\n if($p > $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n }\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n }\n}\n?>"}, {"source_code": " $r)\n {\n $r = $p;\n }\n $d = bcadd($d, $k);\n $e = bcadd($e, $l);\n }\n else\n {\n $k = bcadd($k, bcsub($m[1], $m[0]));\n $l = bcadd($k, bcsub($m[2], $m[1]));\n $d = bcsub($d, $k);\n $e = bcsub($e, $l);\n }\n }\n printf(\"%.0f\", $r);\n }\n}\nelse\n{\n if($c[0] != 0)\n {\n array_unshift($c, 0);\n }\n if($c[count($c) - 1] != $b)\n {\n array_push($c, $b);\n }\n if(count($c) == 2)\n {\n print $c[count($c) - 1] - $c[0];\n }\n else\n {\n $d = 0;\n $e = 0;\n $f = array();\n $g = array();\n $h = 0;\n $i = 0;\n for($x = 0; $x < count($c) - 1; $x++)\n {\n $g[count($g)] = $c[$x];\n $h++;\n if($h == 3)\n {\n $f[count($f)] = $g;\n $g = array($c[$x]);\n $h = 1;\n }\n $j = $i % 2;\n $i++;\n if($j == 0)\n {\n $d += $c[$x + 1] - $c[$x];\n }\n else\n {\n $e += $c[$x + 1] - $c[$x];\n }\n }\n $g[count($g)] = $c[$x];\n if(count($g) == 3)\n {\n $f[count($f)] = $g;\n $g = array();\n $h = 0;\n }\n $k = 0;\n $l = 0;\n $r = $d;\n for($x = 0; $x < count($f); $x++)\n {\n $m = $f[$x];\n if(($m[2] - $m[1] != 1) || (($m[2] - $m[1] != 1) && ($m[1] - $m[0] != 1)))\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $n = $m[1] - $m[0];\n $o = ($m[2] - $m[1]) - 1;\n $d -= $k;\n $e -= $l;\n if(($d <= 0) && ($e <= 0))\n {\n $p = ($k - ($m[1] - $m[0])) + $n + $o;\n }\n else\n {\n $p = $e + $n + $o;\n }\n if($p > $r)\n {\n $r = $p;\n }\n $d += $k;\n $e += $l;\n }\n else\n {\n $k += $m[1] - $m[0];\n $l += $m[2] - $m[1];\n $d -= $k;\n $e -= $l;\n }\n }\n print $r;\n }\n}\n?>"}], "src_uid": "085b03a45fec13b759c3bd334888caf5"} {"source_code": " $q[1]){\n $max = $q[0];\n $min = $q[1];\n } else {\n $max = $q[1];\n $min = $q[0];\n }\n \n if(($min * 2) < $max){\n echo \"NO\\n\";\n } else if(($min * 2) == $max){\n echo \"YES\\n\";\n } else {\n if((($min + $max) % 3) == 0){\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n }\n}", "positive_code": [{"source_code": " $b) {\n $max = $a;\n $min = $b;\n } else {\n $max = $b;\n $min = $a;\n }\n \n $iSum = $max - (($max - $min) * 2);\n } else {\n $iSum = $a;\n }\n \n if ($iSum >= 0 && $iSum%3 == 0 ) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n }\n \n}\n \n \n \n?>"}], "negative_code": [{"source_code": "= $b ? $a : $b;\n $min = $a <= $b ? $a : $b;\n if ((2*$min - $max)%3 == 0) {\n echo 'YES'.\"\\n\";\n } else {\n echo 'NO'.\"\\n\";\n }\n }\n \n?>"}, {"source_code": "= $b ? $a : $b;\n $min = $a <= $b ? $a : $b;\n if ((2*$min - $max)%3 == 0) {\n echo 'YES'.\"\\n\";\n } else {\n echo 'NO'.\"\\n\";\n }\n }\n }\n \n?>"}, {"source_code": " $b) {\n $max = $a;\n $min = $b;\n } else {\n $max = $b;\n $min = $a;\n }\n \n $iSum = $max - (($max - $min) * 2);\n } else {\n $iSum = $a;\n }\n \n if ($iSum%3 == 0) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }}\n}\n \n \n \n?>\n"}, {"source_code": " $b) {\n $max = $a;\n $min = $b;\n } else {\n $max = $b;\n $min = $a;\n }\n \n $iSum = $max - (($max - $min) * 2);\n \n} else {\n $iSum = $a;\n}\n\nif ($iSum%3 == 0) {\n echo \"YES\\n\";\n} else {\n echo \"NO\\n\";\n }\n }\n \n \n \n?>"}, {"source_code": " $b) {\n $max = $a;\n $min = $b;\n } else {\n $max = $b;\n $min = $a;\n }\n \n $iSum = $max - (($max - $min) * 2);\n } else {\n $iSum = $a;\n }\n \n if ($iSum%3 == 0) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n }\n \n}\n \n \n \n?>"}, {"source_code": ""}, {"source_code": " $b) {\n $max = $a;\n $min = $b;\n } else {\n $max = $b;\n $min = $a;\n }\n \n $iSum = $max - (($max - $min) * 2);\n } else {\n $iSum = $a;\n }\n \n if ($iSum%3 == 0) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n \n \n \n?>"}, {"source_code": "= $b ? $a : $b;\n $min = $a <= $b ? $a : $b;\n if ((2*($min - $max))%3 == 0) {\n echo 'YES'.\"\\n\";\n } else {\n echo 'NO'.\"\\n\";\n }\n }\n \n?>"}, {"source_code": " $b) {\n $max = $a;\n $min = $b;\n } else {\n $max = $b;\n $min = $a;\n }\n \n $iSum = $max - (($max - $min) * 2);\n } else {\n $iSum = $a;\n }\n \n if ($iSum%3 == 0) {\n echo \"YES\\n\";\n } else {\n echo \"NO\\n\";\n }}\n}\n \n \n \n?>\n"}], "src_uid": "0a720a0b06314fde783866b47f35af81"} {"source_code": ">$j)&1) != (($a[$m]>>$j)&1))\n\t\t\t$dif++;\n\tif($dif <= $k)\n\t\t$counter++;\n}\nprintf(\"%d\",$counter);\n?>", "positive_code": [{"source_code": " strlen($b[$m])){\n $sTest = $b[$i];\n $sTest2 = str_pad($b[$m], strlen($b[$i]), \"0\", STR_PAD_LEFT);\n }else{\n $sTest = str_pad($b[$i], strlen($b[$m]), \"0\", STR_PAD_LEFT);\n $sTest2 = $b[$m];\n }\n\n $aTest = str_split($sTest);\n $aTest2 = str_split($sTest2);\n $iRep = 0;\n foreach($aTest2 as $iK => $iV){\n if($aTest[$iK] != $iV ){\n $iRep++;\n }\n }\n \n if($iRep <= $k){\n $iResult++;\n }\n}\n\necho $iResult;"}, {"source_code": "> 1;\n }\n\n // echo \"x=$x col_bit=$col_bit\\n\";\n if ($col_bit <= $k) {\n $col ++;\n }\n}\n\necho \"$col\\n\";\n\n?>"}, {"source_code": ""}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=0;$j<=$n-1;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n //echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\n//echo \"\\n\";\necho $sCount;\n?>"}], "negative_code": [{"source_code": ">$j)&1) != (($a[$m]>>$j)&1))\n\t\t\t$dif++;\n\tif($dif <= $k)\n\t\t$counter++;\n}\nprintf(\"%d\",$counter);\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=0;$j<=$n-1;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n //echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\n//echo \"\\n\";\necho $sCount;\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=1;$j<=$n;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n //echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\n//echo \"\\n\";\necho $sCount;\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=1;$j<=$n;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n //echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\n//echo \"\\n\";\n//echo $sCount;\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=0;$j<=$n-1;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\necho \"\\n\";\necho $sCount;\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=0;$j<=$n;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n //echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\n//echo \"\\n\";\necho $sCount;\n?>"}, {"source_code": " $sArm) {\n if($sArm != $sVedaArm) {\n $sOtl = 0;\n for($j=1;$j<=$n;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n if($k >= $sOtl) {\n $sCount++;\n }\n }\n}\n\necho $sCount;\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=1;$j<=$n;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n //echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\n//echo \"\\n\";\necho $sCount;\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=0;$j<=$n;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n echo $sOtl.\"\\n\";\n \n if($k >= $sOtl) {\n $sCount++;\n }\n}\necho \"\\n\";\necho $sCount;\n?>"}, {"source_code": " $sArm) {\n $sOtl = 0;\n for($j=1;$j<=$n;$j++) {\n if($sArm[$j] != $sVedaArm[$j]) {\n $sOtl++;\n }\n }\n //echo $sOtl.\"\\n\";\n \n if($k > $sOtl) {\n $sCount++;\n }\n}\n//echo \"\\n\";\necho $sCount;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "5ebb0ee239d68ea33d9dac2d0bdd5f4e"} {"source_code": " 0 && $rP > 0)\n do\n {\n $nP = next($arPlus);\n $nM = next($arMinus);\n $total = $total + $nP + $nM;\n } while ($nP > 0 && $nM > 0);\n\necho $total;", "positive_code": [{"source_code": " 0)\n {\n array_push($d, $f);\n array_push($e, $g);\n }\n}\n$h = $b;\narsort($h);\n$i = array_keys($h);\n$j = array();\nfor($x = 0; $x < count($b); $x++)\n{\n $j[$x] = $c[$i[$x]];\n}\n$k = $d;\nasort($k);\n$l = array_keys($k);\n$m = array();\nfor($x = 0; $x < count($d); $x++)\n{\n $m[$x] = $e[$l[$x]];\n}\nif(count($j) < count($m))\n{\n $n = array_sum($j);\n $o = array_sum(array_slice($m, 0, count($j) + 1));\n print $n + $o;\n}\nelseif(count($j) == count($m))\n{\n $n = array_sum($j);\n $o = array_sum($m);\n print $n + $o;\n}\nelseif(count($j) > count($m))\n{\n $n = array_sum(array_slice($j, 0, count($m) + 1));\n $o = array_sum($m);\n print $n + $o;\n}\n?>"}, {"source_code": " 0){\n $max_right_length ++;\n $a_right[$a[0]] = $a[1];\n }\n }\n //print_r($a_left);\n ksort($a_left);\n ksort($a_right);\n //print_r($a_left);\n $a_left = array_values($a_left);\n $a_right = array_values($a_right);\n //print_r($a_left);\n //print_r(array_slice($a_right, $max_left_length+1));\n //echo $max_left_length.\" \".$max_right_length.\"\\n\"; \n if($max_left_length > $max_right_length){\n $sum = array_sum($a_right) + array_sum(array_slice($a_left, -$max_right_length-1));\n echo $sum+(isset($arr[0]) ? $arr[0] : 0);\n }else if ($max_left_length < $max_right_length) {\n $sum = array_sum($a_left) + array_sum(array_slice($a_right, 0, $max_left_length+1));\n echo $sum+(isset($arr[0]) ? $arr[0] : 0);\n }else{\n echo array_sum($arr);\n }\n echo \"\\n\";"}, {"source_code": " 0)\n {\n array_push($d, $f);\n array_push($e, $g);\n }\n}\n$h = $b;\narsort($h);\n$i = array_keys($h);\n$j = array();\nfor($x = 0; $x < count($b); $x++)\n{\n $j[$x] = $c[$i[$x]];\n}\n$k = $d;\nasort($k);\n$l = array_keys($k);\n$m = array();\nfor($x = 0; $x < count($d); $x++)\n{\n $m[$x] = $e[$l[$x]];\n}\nif(count($j) < count($m))\n{\n $n = array_sum($j);\n $o = array_sum(array_slice($m, 0, count($j) + 1));\n print $n + $o;\n}\nelseif(count($j) == count($m))\n{\n $n = array_sum($j);\n $o = array_sum($m);\n print $n + $o;\n}\nelseif(count($j) > count($m))\n{\n $n = array_sum(array_slice($j, 0, count($m) + 1));\n $o = array_sum($m);\n print $n + $o;\n}\n?>"}], "negative_code": [{"source_code": " 0)\n {\n array_push($d, $f);\n array_push($e, $g);\n }\n}\n$h = $b;\narsort($h);\n$i = array_keys($h);\n$j = array();\nfor($x = 0; $x < count($b); $x++)\n{\n $j[$x] = $c[$i[$x]];\n}\n$k = $d;\nsort($k);\n$l = array_keys($k);\n$m = array();\nfor($x = 0; $x < count($d); $x++)\n{\n $m[$x] = $e[$l[$x]];\n}\nif(count($j) < count($m))\n{\n $n = array_sum($j);\n $o = array_sum(array_slice($m, 0, count($j) + 1));\n print $n + $o;\n}\nelseif(count($j) == count($m))\n{\n $n = array_sum($j);\n $o = array_sum($m);\n print $n + $o;\n}\nelseif(count($j) > count($m))\n{\n $n = array_sum(array_slice($j, 0, count($m) + 1));\n $o = array_sum($m);\n print $n + $o;\n}\n?>"}, {"source_code": "$count = trim(fgets(STDIN));\n$nom = trim(fgets(STDIN));\nvar_dump($count, $nom);"}, {"source_code": "$count = trim(fgets(STDIN));"}, {"source_code": "$count = trim(fgets(STDIN));\n//echo($count);"}, {"source_code": "$cot = fgets(STDIN);\n$count = trim(fgets(STDIN));\n$elementsStr = trim(fgets(STDIN));\necho \"1\";"}, {"source_code": " 0){\n $max_right_length ++;\n $a_right[$a[0]] = $a[1];\n }\n }\n //print_r($a_left);\n ksort($a_left);\n ksort($a_right);\n //print_r($a_left);\n $a_left = array_values($a_left);\n $a_right = array_values($a_right);\n //print_r($a_left);\n //print_r(array_slice($a_right, $max_left_length+1));\n echo $max_left_length.\" \".$max_right_length.\"\\n\"; \n if($max_left_length > $max_right_length){\n $sum = array_sum($a_right) + array_sum(array_slice($a_left, -$max_right_length-1));\n echo $sum+(isset($arr[0]) ? $arr[0] : 0);\n }else if ($max_left_length < $max_right_length) {\n $sum = array_sum($a_left) + array_sum(array_slice($a_right, 0, $max_left_length+1));\n echo $sum+(isset($arr[0]) ? $arr[0] : 0);\n }else{\n echo array_sum($arr);\n }\n echo \"\\n\";"}], "src_uid": "bf573af345509b2364ada6e613b6f998"} {"source_code": "1){\nwhile($c<10000){\n\t//echo \"--------\";\n\t$c++;\n\tif($animals[$i]>$animals[$i+1]){\n\t\t$f=1;\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t$i+=2;\n\t\twhile($animals[$i]>$animals[$i+1] && $i=count($animals)-1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfs($l,$r,$animals);\n\t\t$out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t//printseq($animals);\t\n\t}\n\t\n\t$i++; \n\tif($i>=count($animals)-1){\n\t\tif($f==0){\n\t\t\tbreak;\n\t\t}\n\t\tif($f==1){\n\t\t\t$f=0;\n\t\t\t$i=0;\n\t\t}\n\t\t\n\t\t\n\t}\t\n\n\t//echo \"--------\";\n \t\n}\n}\n\necho $out;\n\n", "positive_code": [{"source_code": "= 0; $x--)\n {\n for($y = $x; $y < $a - 1; $y++)\n {\n if($b[$y] > $b[$y + 1])\n {\n $d[$f] = $y + 1;\n $e[$f] = $y + 2;\n $f++;\n $g = $b[$y];\n $h = $b[$y + 1];\n $b[$y] = $h;\n $b[$y + 1] = $g;\n }\n }\n }\n for($x = 0; $x < count($d); $x++)\n {\n print $d[$x] . \" \" . $e[$x] . \"\\n\";\n }\n}\n?>"}, {"source_code": "$animals[$i+1]){\n\t\t$f=1;\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t$i+=2;\n\t\twhile($animals[$i]>$animals[$i+1] && $i=count($animals)-1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfs($l,$r,$animals);\n\t\t$out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t//printseq($animals);\t\n\t}\n\t\n\t$i++; \n\tif($i>=count($animals)-1){\n\t\tif($f==0){\n\t\t\tbreak;\n\t\t}\n\t\tif($f==1){\n\t\t\t$f=0;\n\t\t\t$i=0;\n\t\t}\n\t\t\n\t\t\n\t}\t\n\n\t//echo \"--------\";\n \t\n}\n\necho $out;\n\n"}, {"source_code": "=count($animals)-1){$i=0;}\n\tif($animals[$i]>$animals[$i+1]){\n\t\t$f=1;\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t//echo $i.\"?\";\n\t\t$i+=2;\n\t\t\n\t\tif($i>count($animals)-1){\n\t\t //echo $i.\"!\";\n\t\t fs($l,$r,$animals);\n\t\t $out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t $i=0;\n\t\t continue;\n\t\t}\n\t\t\n\t\twhile($animals[$i]>$animals[$i+1] && $i$animals[$i+1]){\n\t\t$f=1;\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t$i+=2;\n\t\twhile($animals[$i]>$animals[$i+1] && $i=count($animals)-1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfs($l,$r,$animals);\n\t\t$out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t//printseq($animals);\t\n\t}\n\t\n\t$i++; \n\tif($i>=count($animals)-1){\n\t\tif($f==0){\n\t\t\tbreak;\n\t\t}\n\t\tif($f==1){\n\t\t\t$f=0;\n\t\t\t$i=0;\n\t\t}\n\t\t\n\t\t\n\t}\t\n\n\t//echo \"--------\";\n \t\n}\n\necho $out;\n\n"}, {"source_code": "$animals[$i+1]){\n\t\t$f=1;\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t$i+=2;\n\t\twhile($animals[$i]>$animals[$i+1] && $i=count($animals)-1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfs($l,$r,$animals);\n\t\t$out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t//printseq($animals);\t\n\t}\n\t\n\t$i++; \n\tif($i>=count($animals)-1){\n\t\tif($f==0){\n\t\t\tbreak;\n\t\t}\n\t\tif($f==1){\n\t\t\t$f=0;\n\t\t\t$i=0;\n\t\t}\n\t\t\n\t\t\n\t}\t\n\n\t//echo \"--------\";\n \t\n}\n\necho $out;\n\n"}, {"source_code": "$animals[$i+1]){\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t$i+=2;\n\t\t\n\t\tif($i>=count($animals)){\n\t\t fs($l,$r,$animals);\n\t\t $out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t $i=0;\n\t\t continue;\n\t\t}\n\t\t\n\t\twhile($animals[$i]>$animals[$i+1] && $i>=count($animals)){\n\t\t\t$r=$i+1;\n\t\t\t$i+=2;\n\t\t}\n\t\tfs($l,$r,$animals);\n\t\t$out.=($l+1).\" \".($r+1).\"\\n\";\n\n\t\t$i++;\n\t\tif($i>=count($animals)-1){\n\t\t $i=0;\n\t\t}\n\t\t\n\t\t\n\t}else{\n\t $i++; \n\t if($i>=count($animals)-1){\n\t\t $i=0;\n\t\t}\n\t}\n \t\n}\n\necho $out;\n\n"}, {"source_code": "=count($animals)-1){$i=0;}\n\tif($animals[$i]>$animals[$i+1]){\n\t //echo $i.\"!\";\n\t\t$f=1;\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t$i+=2;\n\t\t\n\t\t\n\t\tif($i>count($animals)-1){\n\t\t //echo $i.\"!\";\n\t\t fs($l,$r,$animals);\n\t\t $out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t $i=0;\n\t\t continue;\n\t\t}\n\t\t\n\t\twhile($animals[$i]>$animals[$i+1] && $i=count($animals)-1){break;}\n\t $i++; \n\t}\n \t\n}\n\necho $out;\n\n"}, {"source_code": "=count($animals)-1){$i=0;}\n\tif($animals[$i]>$animals[$i+1]){\n\t //echo $i.\"!\";\n\t\t$f=1;\n\t\t$l=$i;\n\t\t$r=$i+1;\n\t\t$i+=2;\n\t\t\n\t\t\n\t\tif($i>count($animals)-1){\n\t\t echo $i.\"!\";\n\t\t fs($l,$r,$animals);\n\t\t $out.=($l+1).\" \".($r+1).\"\\n\";\n\t\t $i=0;\n\t\t continue;\n\t\t}\n\t\t\n\t\twhile($animals[$i]>$animals[$i+1] && $i=count($animals)-1){break;}\n\t $i++; \n\t}\n \t\n}\n\necho $out;\n\n"}], "src_uid": "233c2806db31916609421fbd126133d0"} {"source_code": "\n", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "94278e9c55f0fc82b48145ebecbc515f"} {"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}", "positive_code": [{"source_code": "=0)\r\n $ans=0;\r\n $sum+=$a[$i];\r\n }\r\n if($ans==0)\r\n echo \"-1\\n\";\r\n else\r\n {\r\n $sum=0;\r\n for($i=0;$i<$n;$i++)\r\n {\r\n $sum+=$a[$i];\r\n echo $sum.\" \";\r\n }\r\n echo \"\\n\";\r\n }\r\n \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}"}], "src_uid": "f4b790bef9a6cbcd5d1f9235bcff7c8f"} {"source_code": "", "positive_code": [{"source_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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$path = readString($f);\n\t$t1 = readString($f);\n\t$t2 = readString($f);\n\n\t$isForward = false;\n\t$i1 = strpos($path, $t1);\n\tif ($i1 !== false && strpos($path, $t2, $i1 + strlen($t1)) !== false) {\n\t\t$isForward = true;\n\t}\n\n\t$isBack = false;\n\t$path = strrev($path);\n\t$i1 = strpos($path, $t1);\n\tif ($i1 !== false && strpos($path, $t2, $i1 + strlen($t1)) !== false) {\n\t\t$isBack = true;\n\t}\n\n\tif ($isForward && $isBack) {\n\t\techo 'both';\n\t} elseif ($isForward) {\n\t\techo 'forward';\n\t} elseif ($isBack) {\n\t\techo 'backward';\n\t} else {\n\t\techo 'fantasy';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"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 '';\n}\n\n$stdin = @fopen('data.txt', 'r');\nif (!$stdin) {\n $stdin = fopen('php://stdin', 'r');\n}\n\nfunction g() {\n global $stdin;\n return trim(fgets($stdin));\n}\n\n/****************************************************** Solving block *****************************************************/\n$flags = g();\n$first = g();\n$second = g();\n\nfunction find($flags, $first, $second) {\n $str1 = strpos($flags, $first);\n $str2 = strpos($flags, $second, $str1 !== false ? $str1 + strlen($first) : 0);\n return $str1 !== false && $str2 !== false;\n}\n\n$forward = find($flags, $first, $second);\n$flags = strrev($flags);\n$backward = find($flags, $first, $second);\n\nif($forward && $backward) {\n echo 'both';\n} else if($forward) {\n echo 'forward';\n} else if($backward) {\n echo 'backward';\n} else {\n echo 'fantasy';\n}\n\n?>"}, {"source_code": ""}], "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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$path = readString($f);\n\t$t1 = readString($f);\n\t$t2 = readString($f);\n\n\t$isForward = false;\n\t$i1 = strpos($path, $t1);\n\tif ($i1 !== false && strpos($path, $t2, $i1 + 1) !== false) {\n\t\t$isForward = true;\n\t}\n\n\t$isBack = false;\n\t$path = strrev($path);\n\tif ($i1 !== false && strpos($path, $t2, $i1 + 1) !== false) {\n\t\t$isBack = true;\n\t}\n\n\tif ($isForward && $isBack) {\n\t\techo 'both';\n\t} elseif ($isForward) {\n\t\techo 'forward';\n\t} elseif ($isBack) {\n\t\techo 'backward';\n\t} else {\n\t\techo 'fantasy';\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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$path = readString($f);\n\t$t1 = readString($f);\n\t$t2 = readString($f);\n\n\t$isForward = false;\n\t$i1 = strpos($path, $t1);\n\tif ($i1 !== false && strpos($path, $t2, $i1 + 1) !== false) {\n\t\t$isForward = true;\n\t}\n\n\t$isBack = false;\n\t$path = strrev($path);\n\t$i1 = strpos($path, $t1);\n\tif ($i1 !== false && strpos($path, $t2, $i1 + 1) !== false) {\n\t\t$isBack = true;\n\t}\n\n\tif ($isForward && $isBack) {\n\t\techo 'both';\n\t} elseif ($isForward) {\n\t\techo 'forward';\n\t} elseif ($isBack) {\n\t\techo 'backward';\n\t} else {\n\t\techo 'fantasy';\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el < $s)\r\n\t\t\t$arr[$i] = $el + $arr[$i + $el];\r\n\t\tif($arr[$i] > $MAX)\r\n\t\t\t$MAX = $arr[$i];\r\n\t}\r\n\treturn $MAX;\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 = preg_split(\"/[\\s,]+/\", $arr_str);\r\n\tprint(buildMap($arr).\"\\r\\n\");\r\n}\r\n//$end = fgets(STDIN);\r\n?>", "positive_code": [{"source_code": "= 0; --$i) {\r\n $s[$i] = $a[$i];\r\n if ($i + $a[$i] < $n) {\r\n $s[$i] += $s[$i + $a[$i]];\r\n }\r\n }\r\n echo max($s).PHP_EOL;\r\n}\r\n"}, {"source_code": "= 0; $i--) {\r\n $aRes[$i] = $a[$i];\r\n $k = $i + $a[$i];\r\n if ($k < $n) {\r\n $aRes[$i] += $aRes[$k];\r\n }\r\n }\r\n echo max($aRes);\r\n}\r\n \r\n$t = trim(fgets(STDIN));\r\nwhile ($t--) {\r\n solve();\r\n echo \"\\n\";\r\n}\r\n?>"}, {"source_code": "= 0; $i--) {\r\n if (isset($aRes[$i])) {\r\n $aRes[$i] += $a[$i];\r\n } else {\r\n $aRes[$i] = $a[$i];\r\n }\r\n $k = $i + $a[$i];\r\n if ($k < $n) {\r\n $aRes[$i] += $aRes[$k];\r\n }\r\n }\r\n\r\n echo max($aRes);\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"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el < $s)\r\n\t\t\t$arr[$i] = $el + $arr[$i + $el];\r\n\t\tif($arr[$i] > $MAX)\r\n\t\t\t$MAX = $arr[$i];\r\n\t}\r\n\treturn $MAX;\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(buildMap($arr).\"\\r\\n\");\r\n}\r\n//$end = fgets(STDIN);\r\n?>"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el < $s)\r\n\t\t{\r\n\t\t\t$arr[$i] = $el + $arr[$i + $el];\r\n\t\t\t$el = $arr[$i];\r\n\t\t}\r\n\t\tif($el > $MAX)\r\n\t\t\t$MAX = $el;\r\n\t}\r\n\treturn $MAX;\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 = preg_split(\"/[\\s,]+/\", $arr_str);\r\n\tprint(buildMap($arr).\"\\r\\n\");\r\n}\r\n//$end = fgets(STDIN);\r\n?>"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el < $s)\r\n\t\t\t$arr[$i] = $el + $arr[$i + $el];\r\n\t}\r\n\treturn max($arr);\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 = preg_split(\"/[\\s,]+/\", $arr_str);\r\n\tprint(buildMap($arr).\"\\r\\n\");\r\n}\r\n$end = fgets(STDIN);\r\n?>"}], "negative_code": [{"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el < $s)\r\n\t\t\t$arr[$i] = $el + $arr[$i + $el];\r\n\t\tif($arr[$i] > $MAX)\r\n\t\t\t$MAX = $arr[$i];\r\n\t}\r\n\treturn $MAX;\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(\" \", $arr_str);\r\n\tprint(buildMap($arr).\"\\r\\n\");\r\n}\r\n//$end = fgets(STDIN);\r\n?>"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el < $s)\r\n\t\t{\r\n\t\t\t$arr[$i] = $el + $arr[$i + $el];\r\n\t\t\t$el = $arr[$i];\r\n\t\t}\r\n\t\tif($el > $MAX)\r\n\t\t\t$MAX = $el;\r\n\t}\r\n\treturn $MAX;\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(\" \", $arr_str);\r\n\tprint(buildMap($arr).\"\\r\\n\");\r\n}\r\n$end = fgets(STDIN);\r\n?>"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el >= $s)\r\n\t\t{\r\n\t\t\tif($el > $MAX)\r\n\t\t\t\t$MAX = $el;\r\n\t\t\t$MAP[$i] = $el;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$el2 = $MAP[$i + $el];\r\n\t\t\tif($el + $el2 > $MAX)\r\n\t\t\t\t$MAX = $el + $el2;\r\n\t\t\t$MAP[$i] = $el + $el2;\r\n\t\t}\r\n\t}\r\n\treturn $MAX;\r\n}\r\n\r\n$ans = array();\r\n$t = readline();\r\nfor($i=0;$i<$t;$i++)\r\n{\r\n\t$arr = array();\r\n\t$n = readline();\r\n\t$arr = fscanf(STDIN, str_repeat(\"%d \", $n).\"\\n\");\r\n\tarray_push($ans, buildMap($arr).\"\\r\\n\");\r\n}\r\nforeach($ans as $key => $value)\r\n\tprint($value);\r\n//$end = readline();\r\n?>"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el >= $s)\r\n\t\t{\r\n\t\t\tif($el > $MAX)\r\n\t\t\t\t$MAX = $el;\r\n\t\t\t$MAP[$i] = $el;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$el2 = $MAP[$i + $el];\r\n\t\t\tif($el + $el2 > $MAX)\r\n\t\t\t\t$MAX = $el + $el2;\r\n\t\t\t$MAP[$i] = $el + $el2;\r\n\t\t}\r\n\t}\r\n\treturn $MAX;\r\n}\r\n\r\n$ans = array();\r\n$t = readline();\r\nfor($i=0;$i<$t;$i++)\r\n{\r\n\t$arr = array();\r\n\t$n = readline();\r\n\t$arr = fscanf(STDIN, str_repeat(\"%d \", $n));\r\n\tarray_push($ans, buildMap($arr).\"\\r\\n\");\r\n}\r\nforeach($ans as $key => $value)\r\n\tprint($value);\r\n$end = readline();\r\n?>"}, {"source_code": "=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el >= $s)\r\n\t\t{\r\n\t\t\tif($el > $MAX)\r\n\t\t\t\t$MAX = $el;\r\n\t\t\t$MAP[$i] = $el;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif($el > $MAX)\r\n\t\t\t\t$MAX = $el;\r\n\t\t\t$MAP[$i] = $el + $MAP[$i + $el];\r\n\t\t}\r\n\t}\r\n\treturn $MAX;\r\n}\r\n\r\n$arr = array();\r\n$ans = array();\r\n$t = readline();\r\nfor($i=0;$i<$t;$i++)\r\n{\r\n\t$n = readline();\r\n\t$arr_str = readline();\r\n\t$arr = explode(\" \", $arr_str);\r\n\tarray_push($ans, buildMap($arr).\"\\r\\n\");\r\n}\r\nforeach($ans as $key => $value)\r\n\tprint($value);\r\n$end = readline();\r\n?>"}, {"source_code": " $MAX)\r\n\t\t$MAX = $a;\r\n\treturn $a;\r\n}\r\n\r\nfunction buildMap($arr)\r\n{\r\n\tglobal $MAX;\r\n\t$MAP = array();\r\n\t$s = sizeof($arr);\r\n\tfor($i=$s-1; $i>=0; $i--)\r\n\t{\r\n\t\t$el = $arr[$i];\r\n\t\tif($i + $el >= $s)\r\n\t\t\t$MAP[$i] = maxs($el);\r\n\t\telse\r\n\t\t\t$MAP[$i] = maxs($el + $MAP[$i + $el]);\r\n\t}\r\n\treturn $MAX;\r\n}\r\n\r\n$arr = array();\r\n$ans = array();\r\n$t = readline();\r\nfor($i=0;$i<$t;$i++)\r\n{\r\n\t$n = readline();\r\n\t$arr_str = readline();\r\n\t$arr = explode(\" \", $arr_str);\r\n\tarray_push($ans, buildMap($arr).\"\\r\\n\");\r\n}\r\nforeach($ans as $key => $value)\r\n\tprint($value);\r\n$end = readline();\r\n?>"}, {"source_code": "= 0; --$i) {\r\n $s[$i] = $a[$i];\r\n if ($i + $a[$i] < $n) {\r\n $s[$i] += $s[$i + $a[$i]];\r\n }\r\n }\r\n echo max($s).PHP_EOL;\r\n}\r\n"}], "src_uid": "ee8ca9b2c6104d1ff9ba1fc39e9df277"} {"source_code": "bottom_left_x = $xl;\n $this->bottom_left_y = $yl;\n $this->upper_right_x = $xr;\n $this->upper_right_y = $yr;\n }\n public function uion(Rectangle $a)\n {\n $this->bottom_left_x = (int)max($this->bottom_left_x,$a->bottom_left_x);\n $this->bottom_left_y = (int)max($this->bottom_left_y,$a->bottom_left_y);\n $this->upper_right_x = (int)min($this->upper_right_x,$a->upper_right_x);\n $this->upper_right_y = (int)min($this->upper_right_y,$a->upper_right_y);\n if($this->bottom_left_x <= $this->upper_right_x&&$this->bottom_left_y <= $this->upper_right_y)\n {\n //var_dump('1111111');\n return true;\n }\n return false;\n }\n}\nfscanf(STDIN,\"%d\",$number);\n$arr_l = array();\n$arr_r = array();\nfor($i = 1;$i <= $number;$i++)\n{\n fscanf(STDIN,\"%d %d %d %d\",$xl,$yl,$xr,$yr);\n $arr_l[$i] = new Rectangle($xl,$yl,$xr,$yr);\n $arr_r[$i] = new Rectangle($xl,$yl,$xr,$yr);\n}\n$arr_l[0] = new Rectangle(-maxx,-maxx,maxx,maxx);\n$arr_l[$number + 1] = new Rectangle(-maxx,-maxx,maxx,maxx);\n$arr_r[$number + 1] = new Rectangle(-maxx,-maxx,maxx,maxx);\n$arr_r[0] = new Rectangle(-maxx,-maxx,maxx,maxx);\n$arr_l[$number+1] = $arr_r[0] = $arr_r[$number+1] = new Rectangle(-maxx,-maxx,maxx,maxx);\nfor($i = 2;$i <= $number;$i++)\n{\n $arr_l[$i]->uion($arr_l[$i-1]);\n //var_dump($arr_l[$i]);\n $arr_r[$number-$i + 1]->uion($arr_r[$number-$i + 2]);\n}\nfor($i = 1;$i <= $number;$i++)\n{\n //if($i == $number)\n // var_dump($arr_l[$i-1],$arr_r[$i+1]);\n if($arr_l[$i-1]->uion($arr_r[$i+1]))\n {\n echo $arr_l[$i-1]->bottom_left_x.' '.$arr_l[$i-1]->bottom_left_y;\n break;\n }\n // var_dump($arr_l[$i-1]);\n}\n", "positive_code": [{"source_code": "bottom_left_x = $xl;\n $this->bottom_left_y = $yl;\n $this->upper_right_x = $xr;\n $this->upper_right_y = $yr;\n }\n public function uion(Rectangle $a)\n {\n $this->bottom_left_x = (int)max($this->bottom_left_x,$a->bottom_left_x);\n $this->bottom_left_y = (int)max($this->bottom_left_y,$a->bottom_left_y);\n $this->upper_right_x = (int)min($this->upper_right_x,$a->upper_right_x);\n $this->upper_right_y = (int)min($this->upper_right_y,$a->upper_right_y);\n if($this->bottom_left_x <= $this->upper_right_x&&$this->bottom_left_y <= $this->upper_right_y)\n {\n //var_dump('1111111');\n return true;\n }\n return false;\n }\n}\nfscanf(STDIN,\"%d\",$number);\n$arr_l = array();\n$arr_r = array();\nfor($i = 1;$i <= $number;$i++)\n{\n fscanf(STDIN,\"%d %d %d %d\",$xl,$yl,$xr,$yr);\n $arr_l[$i] = new Rectangle($xl,$yl,$xr,$yr);\n $arr_r[$i] = new Rectangle($xl,$yl,$xr,$yr);\n}\n$arr_l[0] = new Rectangle(-maxx,-maxx,maxx,maxx);\n$arr_l[$number + 1] = new Rectangle(-maxx,-maxx,maxx,maxx);\n$arr_r[$number + 1] = new Rectangle(-maxx,-maxx,maxx,maxx);\n$arr_r[0] = new Rectangle(-maxx,-maxx,maxx,maxx);\nfor($i = 2;$i <= $number;$i++)\n{\n $arr_l[$i]->uion($arr_l[$i-1]);\n //var_dump($arr_l[$i]);\n $arr_r[$number-$i + 1]->uion($arr_r[$number-$i + 2]);\n}\nfor($i = 1;$i <= $number;$i++)\n{\n //if($i == $number)\n // var_dump($arr_l[$i-1],$arr_r[$i+1]);\n if($arr_l[$i-1]->uion($arr_r[$i+1]))\n {\n echo $arr_l[$i-1]->bottom_left_x.' '.$arr_l[$i-1]->bottom_left_y;\n break;\n }\n // var_dump($arr_l[$i-1]);\n}\n"}], "negative_code": [], "src_uid": "6b049bd466b050f2dd0a305a381bc0bf"} {"source_code": "\n", "positive_code": [{"source_code": " 0){\n\t\tif(count($ns) % 2 == 0){\n\t\t\tif(substr(implode('', $ns), 0, count($ns)/2) == substr(implode('', $ns), count($ns)/2, count($ns))){\n\t\t\n\t\t\t\tfor($i = count($s)-1; $i>count($s)-count($ns)/2-1; $i--){\n\t\t\t\t\t//echo \"(\".$s[$i].\")\";\n\t\t\t\t\tif($s[$i] == 'a'){\n\t\t\t\t\t\techo \":(\";\n\t\t\t\t\t\t$ok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($ok) echo substr(implode('', $s), 0, -(count($ns)/2));\n\t\t\t}else{\n\t\t\t\techo \":(\";\n\t\t\t}\n\t\t}else{\n\t\t\techo \":(\";\n\t\t}\n\t}else{\n\t\techo implode('',$s);\n\t}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0){\n\t\tif(count($ns) % 2 == 0){\n\t\t\tif(substr(implode('', $ns), 0, count($ns)/2) == substr(implode('', $ns), count($ns)/2, count($ns))){\n\t\t\n\t\t\t\tfor($i = count($s)-1; $i>count($s)-count($ns)/2; $i--){\n\t\t\t\t\tif($s[$i] == 'a'){\n\t\t\t\t\t\techo \":(\";\n\t\t\t\t\t\t$ok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($ok) echo substr(implode('', $s), 0, -(count($ns)/2));\n\t\t\t}else{\n\t\t\t\techo \":(\";\n\t\t\t}\n\t\t}else{\n\t\t\techo \":(\";\n\t\t}\n\t}else{\n\t\techo implode('',$s);\n\t}\n?>"}, {"source_code": " 0){\n\t\tif(count($ns) % 2 == 0){\n\t\t\tfor($i = count($s)-1; $i>count($s)-count($ns)/2; $i--){\n\t\t\t\tif($s[$i] == 'a'){\n\t\t\t\t\techo \":(\";\n\t\t\t\t\t$ok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($ok) echo substr(implode('', $s), 0, -(count($ns)/2));\n\t\t}else{\n\t\t\techo \":(\";\n\t\t}\n\t}else{\n\t\techo implode('',$s);\n\t}\n?>"}, {"source_code": " 0){\n\t\tif(count($ns) % 2 == 0){\n\t\t\tif(substr(implode('', $ns), 0, count($ns)/2) == substr(implode('', $ns), count($ns)/2, count($ns))){\n\t\t\n\t\t\t\tfor($i = count($s)-1; $i>count($s)-count($ns)/2-1; $i--){\n\t\t\t\t\techo \"(\".$s[$i].\")\";\n\t\t\t\t\tif($s[$i] == 'a'){\n\t\t\t\t\t\techo \":(\";\n\t\t\t\t\t\t$ok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($ok) echo substr(implode('', $s), 0, -(count($ns)/2));\n\t\t\t}else{\n\t\t\t\techo \":(\";\n\t\t\t}\n\t\t}else{\n\t\t\techo \":(\";\n\t\t}\n\t}else{\n\t\techo implode('',$s);\n\t}\n?>"}], "src_uid": "b5bcb6d78daacd56362fd76e35b903ac"} {"source_code": " $h)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " max($a2)){\n\t\techo \"YES\\n\";\n\t} else {\n\t\techo \"NO\\n\";\n\t}\n}\n\n\n"}, {"source_code": " $b) {\n echo 'Yes'.PHP_EOL;\n } else {\n echo 'No'.PHP_EOL;\n }\n}\n\n\n?>"}, {"source_code": "$max)\n {\n $max=$p1[$j];\n }\n }\n $max1=0;\n for($j=0;$j<$a[2];$j++)\n {\n if($p22[$j]>$max1)\n {\n $max1=$p22[$j];\n }\n }\n if($max<$max1)\n {\n echo \"NO\".\"\\n\";\n }else\n {\n echo \"YES\".\"\\n\";\n }\n}\n\n?>\n"}], "negative_code": [], "src_uid": "3ef23f114be223255bd10131b2375b86"} {"source_code": " $k ? $b : $k;", "positive_code": [{"source_code": "= $j[$x])\n {\n $m = $b % $j[$x];\n $n = floor($b / $j[$x]);\n if($m == 0)\n {\n $o = $n * $k[$x];\n }\n else\n {\n $o = $n * $k[$x] + $m;\n }\n array_push($l, $o);\n }\n}\nif(count($l) == 0)\n{\n print $b;\n}\nelse\n{\nrsort($l);\nprint $l[0];\n}\n?>"}], "negative_code": [{"source_code": " $k ? $b : $k;"}, {"source_code": " $prices[$j]){\n\t\t\tbreak;\n\t\t}\n\t\tif($j + 1 == $n){// end of line\n\t\t\t$segments[] = array($i, $j);\n\t\t\t$i = $j;\n\t\t\tbreak;\n\t\t}\n\t\tif($prices[$j] > $prices[$j + 1]){// end of a segment\n\t\t\t$segments[] = array($i, $j);\n\t\t\t$i = $j;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nforeach($segments as $segment){\n\t$unit = floor($b / $prices[$segment[0]]);\n\t$b -= $unit * $prices[$segment[0]];\n\t$sell = $unit * $prices[$segment[1]];\n\t$b += $sell;\n}\necho $b;"}, {"source_code": " $prices[$j]){\n\t\t\tbreak;\n\t\t}\n\t\tif($j + 1 == $n){// end of line\n\t\t\t$segments[] = array($i, $j);\n\t\t\tbreak;\n\t\t}\n\t\tif($prices[$j] > $prices[$j + 1]){// end of a segment\n\t\t\t$segments[] = array($i, $j);\n\t\t\t$i = $j;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nforeach($segments as $segment){\n\t$unit = floor($b / $prices[$segment[0]]);\n\t$b -= $unit * $prices[$segment[0]];\n\t$sell = $unit * $prices[$segment[1]];\n\t$b += $sell;\n}\necho $b;"}, {"source_code": " $prices[$j]){\n\t\t\tbreak;\n\t\t}\n\t\tif($j + 1 == $n){// end of line\n\t\t\t$segments[] = array($i, $j);\n\t\t\t$i = $j + 1;\n\t\t\tbreak;\n\t\t}\n\t\tif($prices[$j] > $prices[$j + 1]){// end of a segment\n\t\t\t$segments[] = array($i, $j);\n\t\t\t$i = $j + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nforeach($segments as $segment){\n\t$unit = floor($b / $prices[$segment[0]]);\n\t$b -= $unit * $prices[$segment[0]];\n\t$sell = $unit * $prices[$segment[1]];\n\t$b += $sell;\n}\necho $b;"}, {"source_code": " $prices[$max]){\n\t\t\t$max = $j;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif($max > $i){\n\t\t$segments[] = array($i, $max);\n\t}\n}\n\nforeach($segments as $segment){\n\t$unit = floor($b / $prices[$segment[0]]);\n\t$b -= $unit * $prices[$segment[0]];\n\t$sell = $unit * $prices[$segment[1]];\n\t$b += $sell;\n}\necho $b;"}, {"source_code": " $prices[$max]){\n\t\t\t$max = $j;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif($max > $i){\n\t\t$segments[] = array($i, $max);\n\t}\n}\n$max_segment = array();\n$max_diff = 0;\nforeach($segments as $segment){\n\t$diff = $prices[$segment[1]] - $prices[$segment[0]];\n\tif($diff > $max_diff){\n\t\t$max_diff = $diff;\n\t\t$max_segment = $segment;\n\t}\n}\nif(!empty($max_segment)){\n\t$unit = floor($b / $prices[$max_segment[0]]);\n\t$b -= $unit * $prices[$max_segment[0]];\n\t$sell = $unit * $prices[$max_segment[1]];\n\t$b += $sell;\n}\necho $b;"}], "src_uid": "2c9133650d831fa6ab4c11661bcb9cbb"} {"source_code": "", "positive_code": [{"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n }\n }\n $p = $count % $a[1];\n $val[count($val) - 1] = count($b);\n if(($count < $a[1] || ($count + 1 - $a[1]) % 2 == 0)){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $sV){\n if($sV % 2 != 0){\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } elseif($iCount == 1 && test($aArray,$sK,$x) % 2 != 0){\n $aTest[] = $x;\n $iCount--;\n $bFlag = true;\n } else {\n $iCount--;\n }\n }\n }\n if(!$bFlag){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n}\n\nfunction test(&$aArray, $iStart, $iEnd){\n $iT = 0;\n for($i = $iStart; $i < $iEnd; $i++){\n $iT += $aArray[$i];\n }\n return $iT;\n}\n"}], "negative_code": [{"source_code": " $sV){\n if($sV % 2 != 0){\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } elseif($iCount == 1){\n $aTest[] = $x;\n $iCount--;\n } else {\n $aTest[] = $x;\n $iCount--;\n }\n }\n }\n if(count($aTest) != $y){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}, {"source_code": " $sV){\n $aArrayB = $aArray;\n if($sV % 2 != 0){\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } elseif($iCount == 1 && array_sum(array_slice($aArrayB,$sK,false)) % 2 != 0){\n $aTest[] = $x;\n $iCount--;\n $bFlag = true;\n }\n }\n }\n if(!$bFlag){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}, {"source_code": " $sV){\n if($sV % 2 != 0){\n $aArrayB = array_slice($aArray,$sK,$x,false);\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } elseif($iCount == 1 && array_sum($aArrayB) % 2 != 0){\n $aTest[] = $x;\n $iCount--;\n $bFlag = true;\n }\n }\n }\n if(!$bFlag){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}, {"source_code": " $sV){\n if($sV % 2 != 0){\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } elseif($iCount == 1 && array_sum(array_slice($aArrayB,$sK - 1)) % 2 != 0){\n $aTest[] = $x;\n $iCount--;\n $bFlag = true;\n }\n }\n }\n if(!$bFlag){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}, {"source_code": " $sV){\n if($sV % 2 != 0){\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } else{\n $aTest[] = $x;\n $iCount--;\n }\n }\n }\n if(count($aTest) != $y){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n \n }\n }\n $val[count($val) - 1] = count($b);\n if($count < $a[1] || $count - 1 == $a[1]){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n \n }\n }\n $p = $count % $a[1];\n $val[count($val) - 1] = count($b);\n if($count < $a[1] || ($p % 2 == 1)){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n \n }\n }\n $val[count($val) - 1] = count($b);\n if($count < $a[1] || $count % $a[1] == 1){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n }\n }\n $p = $count % $a[1];\n $val[count($val) - 1] = count($b);\n if(($count < $a[1] || ($count + 1 - $a[1]) % 2 == 0) || (($p % 2 == 1) || ($count % 2 == 0 && $a[1] == 1))){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n $n += $v;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n }\n }\n $p = $count % $a[1];\n $val[count($val) - 1] = count($b);\n if($count < $a[1] || (($p % 2 == 1) || ($n % 2 == 0 && $a[1] == 1))){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n $val[] = $k + 1;\n }\n }\n $val[count($val) - 1] = count($b);\n if($count < $a[1]){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n $n += $v;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n }\n }\n $p = $count % $a[1];\n $val[count($val) - 1] = count($b);\n if($count < $a[1] || (($p % 2 == 1) || ($n % 2 == 0))){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n \n }\n }\n $p = $count % $a[1];\n echo $p;\n $val[count($val) - 1] = count($b);\n if($count < $a[1] || ($p % 2 == 1)){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": " $v){\n if($v % 2 == 1){\n $count += 1;\n if($count <= $a[1]){\n $val[] = $k + 1;\n }\n \n }\n }\n $val[count($val) - 1] = count($b);\n if($count < $a[1]){\n echo \"NO\\n\";\n continue;\n } else {\n echo \"YES\\n\";\n foreach($val as $r){\n echo $r.\" \";\n }\n echo \"\\n\";\n }\n}\n\n\n\n\n?>"}, {"source_code": ""}, {"source_code": " $sV){\n $aArrayB = $aArray;\n if($sV % 2 != 0){\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } elseif($iCount == 1 && array_sum(array_slice($aArrayB,$sK,true)) % 2 != 0){\n $aTest[] = $x;\n $iCount--;\n $bFlag = true;\n }\n }\n }\n if(!$bFlag){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}, {"source_code": " $sV){\n if($sV % 2 != 0){\n if($iCount > 0){\n $aTest[] = $sK + 1;\n $iCount--;\n } else{\n $aTest[] = $x;\n $iCount--;\n }\n }\n }\n if(count($aTest) != $y){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}, {"source_code": " $sV){\n if($sV % 2 != 0){\n if($iCount > 1){\n $aTest[] = $sK + 1;\n $iCount--;\n } elseif($iCount == 1 && array_sum(array_slice($aArrayB,$sK)) % 2 != 0){\n $aTest[] = $x;\n $iCount--;\n $bFlag = true;\n }\n }\n }\n if(!$bFlag){\n echo \"NO\\n\";\n } else {\n echo \"YES\\n\";\n echo implode(\" \",$aTest). \"\\n\";\n }\n\n}\n"}], "src_uid": "7f5269f3357827b9d8682d70befd3de1"} {"source_code": "", "positive_code": [{"source_code": " $c2) {\n $c2 = $c;\n }\n } else {\n $c = 0;\n }\n}\nprint $c2;\n?>\n\n\n"}, {"source_code": "$maxi)\n $maxi=$counter;\n $counter=0;\n }\n }\n if($counter>$maxi)\n $maxi=$counter;\n echo $maxi;\n?>\n\n"}, {"source_code": " $len) $len = $cur_len;\n $i = $j;\n }\n}\n\nprint_r( $len);\n"}], "negative_code": [{"source_code": ""}, {"source_code": " $c2) {\n $c2 = $c;\n }\n } else {\n $c = 0;\n }\n}\nprint $c2;\n?>\n\n\n"}], "src_uid": "a6ee741df426fd2d06fdfda4ca369397"} {"source_code": " $c)\n {\n print $c - ($b % $c) . \"\\n\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "2b37f27a98ec8f80d0bff3f7ae8f2cff"} {"source_code": "_fh = $fileHandler;\n\t}\n\t\n\tpublic function readFloat() \n\t{\n\t\t$d = trim(fgets($this->_fh));\n\t\t\n\t\treturn (float)$d;\n\t}\n\t\n\tpublic function readInt() \n\t{\n\t\t$d = trim(fgets($this->_fh));\n\t\t\n\t\treturn (int)$d;\n\t}\n\t\n\tpublic function readString() \n\t{\n\t\t$s = trim(fgets($this->_fh));\n\t\t\n\t\treturn $s;\n\t}\n\t\n\tpublic function readArrayOfInt($size, $indexFrom = 0) \n\t{\n\t\t$a = [];\n\t\t$ind = $indexFrom;\n\t\tforeach (explode(' ', fgets($this->_fh)) as $item) {\n\t\t\t$a[$ind++] = (int)$item;\n\t\t}\n\t\t\n\t\treturn $a;\n\t}\n\t\n\tpublic function readArrayOfString($size, $indexFrom = 0) \n\t{\n\t\t$a = [];\n\t\t$ind = $indexFrom;\n\t\tforeach (explode(' ', fgets($this->_fh)) as $item) {\n\t\t\t$a[$ind++] = $item;\n\t\t}\n\t\t\n\t\treturn $a;\n\t}\n}\n\nfunction ntimes($n, $func, $returnResults = false) {\n\t$a = [];\n\tfor ($i=1; $i<=$n; $i++) {\n\t\t$result = $func();\n\t\t\n\t\tif ($returnResults) {\n\t\t\t$a[$i] = $result;\n\t\t}\n\t}\n\t\n\treturn $a;\n}\n\n$ir = new InputReader();\n$testsCount = $ir->readInt();\nntimes($testsCount, function() use ($ir) {\n\t$d = $ir->readInt();\n\t\n\tif ($d==0) {\n\t\tprintf(\"Y %01.9f %01.9f\\n\", 0.0, 0.0);\n\t} else if ($d<4) {\n\t\tprintf(\"N\\n\");\n\t} else {\n\t\t$discr = sqrt($d*$d/4 - $d);\n\t\t$b1 = $discr + $d/2;\n\t\t$b2 = -$discr + $d/2;\n\t\t$a1 = $d - $b1;\n\t\t$a2 = $d - $b2;\n\t\t\n\t\tif ($a1>=0 && $b1>=0) {\n\t\t\tprintf(\"Y %01.9f %01.9f\\n\", $a1, $b1);\n\t\t} elseif ($a2>=0 && $b2>=0) {\n\t\t\tprintf(\"Y %01.9f %01.9f\\n\", $a2, $b2);\n\t\t} else {\n\t\t\tprintf(\"N\\n\");\n\t\t}\n\t}\n});\n\n", "positive_code": [{"source_code": "_fh = $fileHandler;\n\t}\n\t\n\tpublic function readFloat() \n\t{\n\t\t$d = trim(fgets($this->_fh));\n\t\t\n\t\treturn (float)$d;\n\t}\n\t\n\tpublic function readInt() \n\t{\n\t\t$d = trim(fgets($this->_fh));\n\t\t\n\t\treturn (int)$d;\n\t}\n\t\n\tpublic function readString() \n\t{\n\t\t$s = trim(fgets($this->_fh));\n\t\t\n\t\treturn $s;\n\t}\n\t\n\tpublic function readArrayOfInt($size, $indexFrom = 0) \n\t{\n\t\t$a = [];\n\t\t$ind = $indexFrom;\n\t\tforeach (explode(' ', fgets($this->_fh)) as $item) {\n\t\t\t$a[$ind++] = (int)$item;\n\t\t}\n\t\t\n\t\treturn $a;\n\t}\n\t\n\tpublic function readArrayOfString($size, $indexFrom = 0) \n\t{\n\t\t$a = [];\n\t\t$ind = $indexFrom;\n\t\tforeach (explode(' ', fgets($this->_fh)) as $item) {\n\t\t\t$a[$ind++] = $item;\n\t\t}\n\t\t\n\t\treturn $a;\n\t}\n}\n\nfunction ntimes($n, $func, $returnResults = false) {\n\t$a = [];\n\tfor ($i=1; $i<=$n; $i++) {\n\t\t$result = $func();\n\t\t\n\t\tif ($returnResults) {\n\t\t\t$a[$i] = $result;\n\t\t}\n\t}\n\t\n\treturn $a;\n}\n\n$ir = new InputReader();\n$testsCount = $ir->readInt();\nntimes($testsCount, function() use ($ir) {\n\t$d = $ir->readInt();\n\t\n\tif ($d==0) {\n\t\tprintf(\"YES %01.9f %01.9f\\n\", 0.0, 0.0);\n\t} else if ($d<4) {\n\t\tprintf(\"NO\\n\");\n\t} else {\n\t\t$discr = sqrt($d*$d/4 - $d);\n\t\t$b1 = $discr + $d/2;\n\t\t$b2 = -$discr + $d/2;\n\t\t$a1 = $d - $b1;\n\t\t$a2 = $d - $b2;\n\t\t\n\t\tif ($a1>=0 && $b1>=0) {\n\t\t\tprintf(\"YES %01.9f %01.9f\\n\", $a1, $b1);\n\t\t} elseif ($a2>=0 && $b2>=0) {\n\t\t\tprintf(\"YES %01.9f %01.9f\\n\", $a2, $b2);\n\t\t} else {\n\t\t\tprintf(\"NO\\n\");\n\t\t}\n\t}\n});\n\n"}, {"source_code": " 0)\n {\n $f = \"*\";\n $d--;\n $c2 = $c;\n }\n else\n {\n $f = \"\";\n $c2 = $c + 1;\n }\n for($y = 0; $y < $c2; $y++)\n {\n $f .= $a[$e];\n $e++;\n }\n print $f . \"\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " $i){\n $result = $result . \"*\";\n $j++;\n array_unshift($handleArray, \" \");\n }\n }\n }\n $result = $result . \"\\n\";\n}\nprint($result);"}, {"source_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 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$s = $ir->readString();\n$n = strlen($s);\n\n$r = intval($n/20);\nif ($r*20 != $n) {\n\t$r++;\n}\n\n$c = 20;\n$d = 20*$r - $n;\nif ($d>0) {\n\t$c -= intval($d/$r);\n}\n\necho \"$r $c\\n\";\n$stars = $c*$r - $n;\n$start = 0;\nfor ($i = 1; $i<=$r; $i++) {\n\tif ($stars) {\n\t\techo substr($s, $start, $c-1).'*'.\"\\n\";\n\t\t$start += $c-1;\n\t\t$stars--;\n\t} else {\n\t\techo substr($s, $start, $c).\"\\n\";\n\t\t$start += $c;\n\t}\n}\n"}], "negative_code": [{"source_code": " 0)\n {\n $f = \"*\";\n $d--;\n $c2 = $c;\n }\n else\n {\n $f = \"\";\n $c2 = $c + 1;\n }\n for($y = 0; $y < $c2; $y++)\n {\n $f .= $a[$e];\n $e++;\n }\n print $f . \"\\n\";\n }\n}\n?>"}], "src_uid": "ac047ceede246b40892c80dbd696e6b4"} {"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++];}} \n/*init*/ $dxs = new stdIn(false);\n$notas = Array();$n=0;$m=0;\n$max_n = Array();$max_e = Array();$exc = Array();\n\nfunction analizaCurso($x){global $notas,$n,$max_n,$max_e,$exc;\n\tfor($i=0;$i<$n;$i++){\n\t\t$nota = $notas[$i][$x];\n\t\tif($nota > @$max_n[$x]){\n\t\t\t\n\t\t\tforeach($max_e[$x] as $key => $est){\n\t\t\t\t$exc[$est]--;\n\t\t\t\tunset($max_e[$x][$key]);\n\t\t\t}\n\t\t\t$max_n[$x] = $nota;\n\t\t\t$exc[$i]++;\n\t\t\t$max_e[$x] = Array($i);\n\t\t}else if($nota == $max_n[$x]){\n\t\t\t$max_e[$x][] = $i;\n\t\t\t$exc[$i]++;\n\t\t}\n\t}\n}\n\nfunction capture($line,$y,$x){\n\tglobal $notas;\n\t$nota = substr($line,0,1);\n\t$notas[$y][$x] = $nota;\n\tif($line < 10){return true;}\n\tcapture(substr($line,1),$y,$x+1);\n}\n\n$n = $dxs->G();$m=$dxs->G();\nfor($i=0;$i<$n;$i++){\n\tcapture($dxs->G(),$i,0);\n}\nfor($i=0;$i<$m;$i++){analizaCurso($i);}\n//arsort($exc,SORT_NUMERIC);\n$total = 0;arsort($exc);\n$ret =0;\nforeach($exc as $std => $tots){\n\tif($tots>0){$ret++;}\n}\necho $ret;\n?>", "positive_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++];}} \n/*init*/ $dxs = new stdIn(false);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n$notas = Array();$n=0;$m=0;\n$max_n = Array();$max_e = Array();$exc = Array();\n\nfunction analizaCurso($x){global $notas,$n,$max_n,$max_e,$exc;\n\tfor($i=0;$i<$n;$i++){\n\t\t$nota = $notas[$i][$x];\n\t\tif($nota > @$max_n[$x]){\n\t\t\t\n\t\t\tforeach($max_e[$x] as $key => $est){\n\t\t\t\t$exc[$est]--;\n\t\t\t\tunset($max_e[$x][$key]);\n\t\t\t}\n\t\t\t$max_n[$x] = $nota;\n\t\t\t$exc[$i]++;\n\t\t\t$max_e[$x] = Array($i);\n\t\t}else if($nota == $max_n[$x]){\n\t\t\t$max_e[$x][] = $i;\n\t\t\t$exc[$i]++;\n\t\t}\n\t}\n}\n\nfunction capture($line,$y,$x){\n\tglobal $notas;\n\t$nota = substr($line,0,1);\n\t$notas[$y][$x] = $nota;\n\tif($line < 10){return true;}\n\tcapture(substr($line,1),$y,$x+1);\n}\n\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$n = $dxs->G();$m=$dxs->G();\nfor($i=0;$i<$n;$i++){\n\tcapture($dxs->G(),$i,0);\n}\nfor($i=0;$i<$m;$i++){analizaCurso($i);}\n//arsort($exc,SORT_NUMERIC);\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n$total = 0;arsort($exc);\n//print_r($notas);print_r($max_n);print_r($max_e);print_r($exc);\n$ret =0;\nforeach($exc as $std => $tots){\n\tif($tots>0){$ret++;}\n}\necho $ret;\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": " $value ){\n\t\tif( $max < $value[$i] ){\n\t\t\t$max = $value[$i];\n\t\t\t$maxArr = array();\n\t\t\t$maxArr[] = $key;\n\t\t} else if( $max == $value[$i] ){\n\t\t\t$maxArr[] = $key;\n\t\t}\n\t}\n\tforeach( $maxArr as $val ){\n\t\t$res[ $val ]= true;\n\t}\n}\necho count( $res );\nfclose($fp);\n?>"}, {"source_code": " $max) $max = $c[$j][$i];\n for ($j = 0; $j < $n; $j++) if ($c[$j][$i] == $max) $u[$j] = true;\n}\nfprintf(STDOUT, \"%d\\n\", count($u));\n"}, {"source_code": " 0)\n {\n array_push($i, $j);\n unset($f[$x][$y]);\n }\n } \n}\n$k = array_unique($i);\nprint count($k);\n?>"}, {"source_code": "Scan();\n\t$inp_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t$temp_max = $inp_arr[$k][$j];\n\t\t\t\t$temp_flag = 0;\n\t\t\t\t$temp_pos = $k;\n\t\t\t\t$temp_arr = array();\n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t\t\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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\t\t$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\t//$c = 0;\n\t//$temp_c = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = array();\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max > $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k; \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_pos[] = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_pos as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\t\t\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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\t/*if(!is_file($opend) && !is_link($opend)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark, \"\\n\");\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k; \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tforeach ($as_val as $as_i) {\n\t\t\tprint($as_key . \" \" .$as_i.\"\\n\");\n\t\t}\n\t}\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k; \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t\t $temp_arr = array(); \n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k; \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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\t\t$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k; \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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\t\t$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k; \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\t//$c = 0;\n\t//$temp_c = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$temp_arr1 = array();\n\t$temp_arr2 = array();\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max > $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_arr1[$j] = $k;\n\t\t\t\t $temp_arr2[$j][] = array();\n\t\t\t\t $temp_flag = 0;\n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_pos = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t}\n\t\t\t$flag = 0;\n\t\t\tif ($temp_flag === 1) {\n\t\t\t\tforeach ($temp_arr1 as $as_i1) {\n\t\t\t\t\tif ($as_i1 === $temp_pos) {\n\t\t\t\t\t\t$flag = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($flag !== 1){\n\t\t\t\t\tforeach ($temp_arr2 as $as_i2) {\n\t\t\t\t\t\tif ($as_i2 === $temp_pos) {\n\t\t\t\t\t\t\t$flag = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($flag === 0){\n\t\t\t\t\t$temp_arr2[$j][] = $temp_arr1[$j];\n\t\t\t\t\t$temp_arr2[$j][] = $temp_pos;\n\t\t\t\t\t$temp_arr1[$j] = 0;\n\t\t\t\t}\t\t\t\t\n\t\t\t} \n\t\t}\n\t\t$ttemp_flag = 0;\n\t\tif ($temp_arr1[$j] !== 0) {\n\t\t\tforeach ($temp_arr1 as $as_i) {\n\t\t\t\tif ($as_i === $temp_pos) {\n\t\t\t\t\t$ttemp_flag = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($ttemp_flag === 1) {\n\t\t\t\t$temp_arr = array_pop($temp_arr1);\n\t\t\t}\n\t\t}\t\t\t\n\t}\n\t\n\t$temp_c = count($temp_arr1) + count($temp_arr2);\n\t\t\t\t\n\tprintf(\"%d\", $temp_c);\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\t/*if(!is_file($opend) && !is_link($opend)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t\t $temp_arr = array(); \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t\t $temp_arr = array(); \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t\t $temp_arr = array(); \n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\tforeach ($inp_arr as $as_key => $as_val) {\n\t\tforeach ($as_val as $as_i) {\n\t\t\tprint($as_key . \" \" .$as_i.\"\\n\");\n\t\t}\n\t}\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k; \n\t\t\t} elseif ($temp_max = $inp_arr[$k][$j]) {\n\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t$temp_flag = 1;\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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)){\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$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t$temp_max = $inp_arr[$k][$j];\n\t\t\t\t$temp_flag = 0;\n\t\t\t\t$temp_pos = $k;\n\t\t\t\t$temp_arr = array();\n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t\tvar_dump($temp_arr);\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t\tvar_dump($temp_pos);\n\t\t}\n\t\t\n\t}\n\t\n\t$temp_c = 0;\n\tvar_dump($arr);\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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\t\t$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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_m = $Scanner->Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_mark = $Scanner->Scan();\n\t\t//$inp_mark = rtrim($inp_mark, \"\\r\\n\");\n\t\t$inp_mark = rtrim($inp_mark);\n\t\t$inp_arr[$i] = str_split($inp_mark);\n\t}\n\t\n\t$arr = array_fill(0, $inp_n, 0) ;\n\t\n\tfor ($j = 0; $j < $inp_m; $j++) {\n\t\t$temp_pos = 0;\n\t\t$temp_max = 0;\n\t\t$temp_flag = 0;\n\t\t$temp_arr = array();\n\t\tfor ($k = 0; $k < $inp_n; $k++) {\n\t\t\tif ($temp_max < $inp_arr[$k][$j]) {\n\t\t\t\t $temp_max = $inp_arr[$k][$j];\n\t\t\t\t $temp_flag = 0;\n\t\t\t\t $temp_pos = $k;\n\t\t\t} elseif ($temp_max === $inp_arr[$k][$j]) {\n\t\t\t\t$temp_flag = 1;\n\t\t\t\tif (!in_array($temp_pos, $temp_arr)) {\n\t\t\t\t\t$temp_arr[] = $temp_pos;\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t} else {\n\t\t\t\t\t$temp_arr[] = $k;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\tif ($temp_flag === 1) {\n\t\t\tforeach ($temp_arr as $as_i) {\n\t\t\t\t$arr[$as_i] = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$arr[$temp_pos] = 1;\n\t\t}\n\t}\n\t\n\t$temp_c = 0;\n\tforeach ($arr as $as_j) {\n\t\tif ($as_j === 1) {\n\t\t\t$temp_c++;\n\t\t}\n\t}\n\t\n\tprintf(\"%d\", $temp_c);\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\t\t$contents = str_replace(\"\\n\", \" \", $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\"\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\t/*if(!is_file($opend) && !is_link($opend)){\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": " 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++];}} \n/*init*/ $dxs = new stdIn(false);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n$notas = Array();$n=0;$m=0;\n$max_n = Array();$max_e = Array();$exc = Array();\nfunction analizeLine($line,$x,$y){global $max_n,$max_e,$exc;\n$nota = substr($line,0,1);\nif($max_n[$y]<$nota){echo $nota;\n@$max_n[$y]=$nota;\nif(isset($max_e[$y])){$exc[$max_e[$y]]--;}\n@$exc[$x]++;\n$max_e[$y]=$x;}\nif($line < 10){return true;}\nanalizeLine(substr($line,1),$x,$y+1);}\n\nfunction analizaCurso($x){global $notas,$n,$max_n,$max_e,$exc;\n\tfor($i=0;$i<$n;$i++){\n\t\t$nota = $notas[$i][$x];\n\t\tif($nota > @$max_n[$x]){\n\t\t\t\n\t\t\tforeach($max_e[$x] as $key => $est){\n\t\t\t\t$exc[$est]--;\n\t\t\t\tunset($max_e[$x][$key]);\n\t\t\t}\n\t\t\t$max_n[$x] = $nota;\n\t\t\t$exc[$i]++;\n\t\t\t$max_e[$x] = Array($i);\n\t\t}else if($nota == $max_n[$x]){\n\t\t\t$max_e[$x][] = $i;\n\t\t\t$exc[$i]++;\n\t\t}\n\t}\n}\n\nfunction capture($line,$y,$x){\n\tglobal $notas;\n\t$nota = substr($line,0,1);\n\t$notas[$y][$x] = $nota;\n\tif($line < 10){return true;}\n\tcapture(substr($line,1),$y,$x+1);\n}\n\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$n = $dxs->G();$m=$dxs->G();\nfor($i=0;$i<$n;$i++){\n\tcapture($dxs->G(),$i,0);\n}\nfor($i=0;$i<$m;$i++){analizaCurso($i);}\n//arsort($exc,SORT_NUMERIC);\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n$total = 0;arsort($exc);\n//print_r($notas);print_r($max_n);print_r($max_e);print_r($exc);\n$ret =0;\nforeach($exc as $std => $tots){if($total==0){$total=$tots;}\nif($tots != $total){echo $ret;exit();}\n$ret++;\n}\necho $ret;\n/////////////////////////////////////////////////////////////////////////////////////////////////\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++];}} \n/*init*/ $dxs = new stdIn(false);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n$notas = Array();\nfunction analizeLine($line){global $notas;$nota = substr($line,0,1);$notas[$nota]++;\nif($line < 10){return true;}analizeLine(substr($line,1));}\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$n = $dxs->G();$m=$dxs->G();for($i=0;$i<$n;$i++){analizeLine($dxs->G());}arsort($notas,SORT_NUMERIC);\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\nforeach($notas as $not => $tot){echo $not;exit();}\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": " $max) $max = $c[$i][$j];\n for ($j = 0; $j < $n; $j++) if ($c[$j][$i] == $max) $u[$j] = true;\n}\nfprintf(STDOUT, \"%d\\n\", count($u));\n"}], "src_uid": "41bdb08253cf5706573f5d469ab0a7b3"} {"source_code": "=1; $k--) {\n\t\tif($n%$k==0) break;\n\t}\n\t$q=intdiv($n,$k);\n\techo \"$q\\n\";\n\tfor($i=0; $i<$q; $i++) echo \"$k \";\n?>", "positive_code": [{"source_code": ""}, {"source_code": "1){\n for($i =2; $i <10; $i++){\n if($n % $i == 0) {\n $iNum = $i;\n $bFlag = true;\n }\n }\n if(!$bFlag){\n echo $n. \"\\n\";\n for($i =1; $i <=$n; $i++){\n echo \"1 \";\n }\n } else {\n $counter = $n/$iNum;\n echo $counter .\"\\n\";\n for($i = 1; $i<=$counter; $i++){\n echo $iNum . \" \";\n }\n }\n} else {\n echo \"1 \\n1\";\n}\n"}, {"source_code": "=1; $i--) {\n if ($n%$i == 0) {\n echo $n/$i . \"\\n\";\n $a = array();\n for ($j = 0; $j < $n/$i; $j++) {\n $a[] = $i;\n }\n echo implode(' ', $a);\n break;\n }\n }\n }\n \n?>"}, {"source_code": ""}, {"source_code": "=1; $i--)\n{\n if ((($str % $i) == 0)&&($test) )\n {\n $cou = $str/$i;\n $num = $i;\n $test=!$test;\n\n }\n\n}\n$res = $num;\nfor ($i=1; $i<$cou; $i++)\n $res.=' '.$num;\nprint $cou.'\n'.$res;\nfclose($fd);\n\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\";\nfor($i=0; $i<$n; $i++){\n echo \"1 \";\n }\n?>"}, {"source_code": "\";\nfor($i=0; $i<$n; $i++){\n echo \"1 \";\n }\n?>"}, {"source_code": ""}, {"source_code": "1){\n for($i =2; $i <$n; $i++){\n if($n % $i == 0) {\n $iNum = $i;\n $bFlag = true;\n }\n }\n\n if(!$bFlag){\n echo $n. \"\\n\";\n for($i =1; $i <=$n; $i++){\n echo \"1 \";\n }\n } else {\n $counter = $n/$iNum;\n echo $counter .\"\\n\";\n for($i = 1; $i<=$counter; $i++){\n echo $iNum . \" \";\n }\n }\n} else {\n echo '1';\n}\n"}, {"source_code": "1){\n for($i =2; $i <$n; $i++){\n if($n % $i == 0) {\n $iNum = $i;\n $bFlag = true;\n }\n }\n\n if(!$bFlag){\n echo $n. \"\\n\";\n for($i =1; $i <=$n; $i++){\n echo \"1 \";\n }\n } else {\n $counter = $n/$iNum;\n echo $counter .\"\\n\";\n for($i = 1; $i<=$counter; $i++){\n echo $iNum . \" \";\n }\n }\n} else {\n echo \"1 \\n1\";\n}\n"}], "src_uid": "7c483498f497f4291e3d33375c0ebd53"} {"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 $n = IO::str();\r\n $x = floor($n / 3);\r\n $two = $x;\r\n $one = $x * 2;\r\n $t = $n - $two - $one;\r\n if ($t == 1) {\r\n $x++;\r\n } elseif ($t == 2) {\r\n $two++;\r\n }\r\n IO::line($x . ' ' . $two);\r\n}\r\n\r\n\r\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\r\n $n = trim(fgets(STDIN));\r\n $n3 = floor($n / 3);\r\n\r\n switch ($n % 3) {\r\n case 0:\r\n echo $n3 . ' ' . $n3 . PHP_EOL;\r\n break;\r\n case 1:\r\n echo ($n3 + 1) . ' ' . $n3 . PHP_EOL;\r\n break;\r\n case 2:\r\n echo $n3 . ' ' . ($n3 + 1) . PHP_EOL;\r\n break;\r\n }\r\n}\r\n\r\n?>"}, {"source_code": ""}, {"source_code": "= 2) {\r\n $i2 = $i1 - 1;\r\n $i1 = $i1 - 2;\r\n }\r\n echo ($iCount + $i1) . ' ' . ($iCount + $i2) . \"\\n\";\r\n}"}], "negative_code": [], "src_uid": "71335a9489f0985f4e16435b14d6a34a"} {"source_code": " $vs) {\n $visited = array();\n dfs($map,$u1,$visited,$c);\n $arr = array_keys($visited);\n $cnt = count($arr);\n for($j=0;$j<$cnt;$j++) {\n for($kl=0;$kl<$j;$kl++) {\n if($map[$arr[$j]][$arr[$kl]]!=1)\n add($map,$arr[$j],$arr[$kl],$c);\n }\n }\n }\n $count = 0;\n foreach($map[$u1] as $c => $vs) {\n if($vs[$v1] == 1) ++$count;\n }\n echo \"$count\\n\";\n}\n\nfunction add(&$map,$u,$v,$c) {\n if($u==$v) return;\n //echo \"$u $v c = $c\\n\";\n $map[$u][$c][$v] = 1;\n $map[$v][$c][$u] = 1;\n}\n\nfunction dfs($map,$u,&$visited,$c) {\n if(!isset($visited[$u])) {\n $visited[$u] = 1;\n $nbrs = $map[$u][$c];\n foreach($nbrs as $n => $v) {\n dfs($map,$n,$visited,$c);\n }\n }\n}", "positive_code": [{"source_code": " $vs) {\n $visited = array();\n dfs($map,$u1,$visited,$c);\n $arr = array_keys($visited);\n $cnt = count($arr);\n for($j=0;$j<$cnt;$j++) {\n for($kl=0;$kl<$j;$kl++) {\n if($map[$arr[$j]][$arr[$kl]]!=1)\n add($map,$arr[$j],$arr[$kl],$c);\n }\n }\n }\n $count = 0;\n foreach($map[$u1] as $c => $vs) {\n if($vs[$v1] == 1) ++$count;\n }\n echo \"$count\\n\";\n}\n\nfunction add(&$map,$u,$v,$c) {\n $map[$u][$c][$v] = 1;\n $map[$v][$c][$u] = 1;\n}\n\nfunction dfs($map,$u,&$visited,$c) {\n if($visited[$u] == 1) return;\n $visited[$u] = 1;\n $nbrs = $map[$u][$c];\n foreach($nbrs as $n => $v) {\n dfs($map,$n,$visited,$c);\n }\n}"}, {"source_code": " $vs) {\n $visited = array();\n dfs($map,$u1,$visited,$c);\n $arr = array_keys($visited);\n $cnt = count($arr);\n for($j=0;$j<$cnt;$j++) {\n for($kl=0;$kl<$j;$kl++) {\n if($map[$arr[$j]][$arr[$kl]]!=1)\n add($map,$arr[$j],$arr[$kl],$c);\n }\n }\n }\n $count = 0;\n foreach($map[$u1] as $c => $vs) {\n if($vs[$v1] == 1) ++$count;\n }\n echo \"$count\\n\";\n}\n\nfunction add(&$map,$u,$v,$c) {\n if($u==$v) return;\n //echo \"$u $v c = $c\\n\";\n $map[$u][$c][$v] = 1;\n $map[$v][$c][$u] = 1;\n}\n\nfunction dfs($map,$u,&$visited,$c) {\n if($visited[$u] == 1) return;\n $visited[$u] = 1;\n $nbrs = $map[$u][$c];\n foreach($nbrs as $n => $v) {\n dfs($map,$n,$visited,$c);\n }\n}\n"}, {"source_code": " $vs) {\n $visited = array();\n dfs($map,$u1,$visited,$c);\n $arr = array_keys($visited);\n $cnt = count($arr);\n for($j=0;$j<$cnt;$j++) {\n for($kl=0;$kl<$j;$kl++) {\n if($map[$arr[$j]][$arr[$kl]]!=1)\n add($map,$arr[$j],$arr[$kl],$c);\n }\n }\n }\n $count = 0;\n foreach($map[$u1] as $c => $vs) {\n if($vs[$v1] == 1) ++$count;\n }\n echo \"$count\\n\";\n}\n\nfunction add(&$map,$u,$v,$c) {\n if($u==$v) return;\n //echo \"$u $v c = $c\\n\";\n $map[$u][$c][$v] = 1;\n $map[$v][$c][$u] = 1;\n}\n\nfunction dfs($map,$u,&$visited,$c) {\n if(!isset($visited[$u])) {\n $visited[$u] = 1;\n $nbrs = $map[$u][$c];\n foreach($nbrs as $n => $v) {\n dfs($map,$n,$visited,$c);\n }\n }\n}"}, {"source_code": " $vs) {\n $visited = array();\n dfs($map,$u1,$visited,$c);\n // print_r(\"for u = $u and c= $c visited=\");\n // print_r($visited);\n $arr = array();\n foreach($visited as $k => $v) {\n $arr[] = $k;\n }\n for($j=0;$j $vs) {\n if($vs[$v1] == 1) ++$count;\n }\n echo \"$count\\n\";\n}\n\nfunction add(&$map,$u,$v,$c) {\n if($u==$v) return;\n //echo \"$u $v c = $c\\n\";\n $map[$u][$c][$v] = 1;\n $map[$v][$c][$u] = 1;\n}\n\nfunction dfs($map,$u,&$visited,$c) {\n if($visited[$u] == 1) return;\n $visited[$u] = 1;\n $nbrs = $map[$u][$c];\n foreach($nbrs as $n => $v) {\n dfs($map,$n,$visited,$c);\n }\n}\n"}, {"source_code": ""}, {"source_code": " $vs) {\n $visited = array();\n dfs($map,$u1,$visited,$c);\n $dfs_done[$u1] = 1;\n $arr = array_keys($visited);\n $cnt = count($arr);\n for($j=0;$j<$cnt;$j++) {\n for($kl=0;$kl<$j;$kl++) {\n if($map[$arr[$j]][$arr[$kl]]!=1)\n add($map,$arr[$j],$arr[$kl],$c);\n }\n }\n }\n }\n $count = 0;\n foreach($map[$u1] as $c => $vs) {\n if($vs[$v1] == 1) ++$count;\n }\n echo \"$count\\n\";\n}\n\nfunction add(&$map,$u,$v,$c) {\n if($u==$v) return;\n //echo \"$u $v c = $c\\n\";\n $map[$u][$c][$v] = 1;\n $map[$v][$c][$u] = 1;\n}\n\nfunction dfs($map,$u,&$visited,$c) {\n if($visited[$u] == 1) return;\n $visited[$u] = 1;\n $nbrs = $map[$u][$c];\n foreach($nbrs as $n => $v) {\n dfs($map,$n,$visited,$c);\n }\n}"}], "negative_code": [], "src_uid": "e3ec343143419592e73d4be13bcf1cb5"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n "}, {"source_code": ""}, {"source_code": " $value){\n if(!isset($err2[$key])){\n fwrite(STDOUT, $key);\n break;\n }\n if($err2[$key] < $value){\n fwrite(STDOUT, $key);\n break;\n }\n }\n fwrite(STDOUT, \"\\n\");\n foreach ($err2 as $key => $value){\n if(!isset($err3[$key])){\n fwrite(STDOUT, $key);\n break;\n }\n if($err3[$key] < $value){\n fwrite(STDOUT, $key);\n break;\n }\n }\n \n ?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $bWeight){\n echo \"White\";\n}\nif($wWeight < $bWeight){\n echo \"Black\";\n}\nif($wWeight == $bWeight){\n echo \"Draw\";\n}\n\n"}, {"source_code": " $value){\n if(!isset($err2[$key])){\n fwrite(STDOUT, $key);\n break;\n }\n if($err2[$key] < $value){\n fwrite(STDOUT, $key);\n break;\n }\n }\n fwrite(STDOUT, '\\n');\n foreach ($err2 as $key => $value){\n if(!isset($err3[$key])){\n fwrite(STDOUT, $key);\n break;\n }\n if($err3[$key] < $value){\n fwrite(STDOUT, $key);\n break;\n }\n }\n \n ?>"}, {"source_code": " 0 || $m > 0){\n $n--;\n $m--;\n if(($n == 0 && $m > 0) || ($n > 0 && $m == 0)){\n $i++;\n break;\n } elseif($n == 0 && $m == 0){\n break;\n }\n if($n < $m){\n $m--;\n } else {\n $n--;\n }\n $i++;\n }\n \n fwrite(STDOUT, $i);\n ?>"}, {"source_code": " $value){\n if(!isset($err2[$key])){\n fwrite(STDOUT, $key);\n break;\n }\n if($err2[$key] < $value){\n fwrite(STDOUT, $key);\n break;\n }\n }\n fwrite(STDOUT, '\\r\\n');\n foreach ($err2 as $key => $value){\n if(!isset($err3[$key])){\n fwrite(STDOUT, $key);\n break;\n }\n if($err3[$key] < $value){\n fwrite(STDOUT, $key);\n break;\n }\n }\n \n ?>"}], "src_uid": "1985566215ea5a7f22ef729bac7205ed"} {"source_code": "= 0; $x--)\n {\n if($b[$x] == 0)\n {\n $j += $h;\n }\n else\n {\n $h--;\n }\n } \n print min($i, $j); \n }\n}\nelse\n{\n print \"0\";\n}\n?>"}], "negative_code": [], "src_uid": "1a3b22a5a8e70505e987d3e7f97e7883"} {"source_code": " $row) {\n foreach ($row as $j => $value) {\n if ($value == '.') {\n break 2;\n }\n }\n }\n\n performDFS($data, $i, $j, $k);\n return $data;\n}\n\nfunction performDFS(&$data, $i, $j, $k, $tracker = [])\n{\n $step = 0;\n $stack = new Stack();\n $stack->push([$i, $j]);\n $parent = null;\n while (!$stack->isEmpty() && $k > 0) {\n $step++;\n\n list($i, $j) = $stack->pop();\n \n if (!isset($tracker[$i][$j])) {\n $tracker[$i][$j]['parent'] = $parent;\n }\n\n $up = $i - 1;\n $right = $j + 1;\n $down = $i + 1;\n $left = $j - 1;\n $parent = [$i, $j];\n // Right\n if (isset($data[$i][$right]) && $data[$i][$right] == '.' && !isset($tracker[$i][$right])) {\n $stack->push([$i, $right]);\n continue;\n }\n // Down\n if (isset($data[$down][$j]) && $data[$down][$j] == '.' && !isset($tracker[$down][$j])) {\n $stack->push([$down, $j]);\n continue;\n }\n // Left\n if (isset($data[$i][$left]) && $data[$i][$left] == '.' && !isset($tracker[$i][$left])) {\n $stack->push([$i, $left]);\n continue;\n }\n // Up\n if (isset($data[$up][$j]) && $data[$up][$j] == '.' && !isset($tracker[$up][$j])) {\n $stack->push([$up, $j]);\n continue;\n }\n\n // If come this far we got no other way just write X and decrease K, go back to parent\n $k--;\n $data[$i][$j] = 'X';\n $stack->push($tracker[$i][$j]['parent']);\n }\n}\n\n$in = fopen( 'php://stdin', 'r' );\n$lineArr = explode(' ', trim(fgets($in)));\n$rows = intval($lineArr[0]);\n$cols = intval($lineArr[1]);\n$k = intval($lineArr[2]);\n$data = [];\nfor ($i=0; $i<$rows; $i++) {\n $line = str_replace(\"\\n\", \"\", fgets($in));\n $data[] = str_split($line);\n}\nfclose($in);\n\n// $lineArr = explode(' ', \"3 4 4\");\n// $rows = intval($lineArr[0]);\n// $cols = intval($lineArr[1]);\n// $k = intval($lineArr[2]);\n\n// $data = [\n// ['#', '.', '.', '#'],\n// ['.', '.', '#', '.'],\n// ['#', '.', '.', '.'],\n// ];\n\n\n$out = fopen('php://stdout', 'w');\n$answer = getSolution($data, $rows, $cols, $k);\n// printSolution($answer);\n// die;\n// dd(getStrSolution($answer));\nfputs($out, getStrSolution($answer));\nfclose($out);\n", "positive_code": [{"source_code": " $k)\n {\n break;\n }\n $d[$f[$x] - 1][$g[$x]] = \".\";\n }\n if($d[$f[$x] + 1][$g[$x]] == \"X\")\n {\n $f[$i] = $f[$x] + 1;\n $g[$i] = $g[$x];\n $i++;\n $j++;\n if($j > $k)\n {\n break;\n }\n $d[$f[$x] + 1][$g[$x]] = \".\";\n }\n if($d[$f[$x]][$g[$x] - 1] == \"X\")\n {\n $f[$i] = $f[$x];\n $g[$i] = $g[$x] - 1;\n $i++;\n $j++;\n if($j > $k)\n {\n break;\n }\n $d[$f[$x]][$g[$x] - 1] = \".\";\n }\n if($d[$f[$x]][$g[$x] + 1] == \"X\")\n {\n $f[$i] = $f[$x];\n $g[$i] = $g[$x] + 1;\n $i++;\n $j++;\n if($j > $k)\n {\n break;\n }\n $d[$f[$x]][$g[$x] + 1] = \".\";\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n print implode($d[$x]) . \"\\n\";\n}\nprint implode($d[$x]);\n?>"}], "negative_code": [{"source_code": " $row) {\n foreach ($row as $j => $value) {\n if ($value == '.') {\n break 2;\n }\n }\n }\n\n performDFS($data, $i, $j, $k);\n return $data;\n}\n\nfunction performDFS(&$data, $i, $j, $k, $tracker = [])\n{\n $step = 0;\n $stack = new Stack();\n $stack->push([$i, $j]);\n $parent = null;\n while (!$stack->isEmpty() && $k > 0) {\n $step++;\n \n list($i, $j) = $stack->pop();\n \n if (!isset($tracker[$i][$j])) {\n $tracker[$i][$j]['parent'] = $parent;\n }\n\n $up = $i - 1;\n $right = $j + 1;\n $down = $i + 1;\n $left = $i - 1;\n $parent = [$i, $j];\n // Right\n if (isset($data[$i][$right]) && $data[$i][$right] == '.' && !isset($tracker[$i][$right])) {\n $stack->push([$i, $right]);\n continue;\n }\n // Down\n if (isset($data[$down][$j]) && $data[$down][$j] == '.' && !isset($tracker[$down][$j])) {\n $stack->push([$down, $j]);\n continue;\n }\n // Left\n if (isset($data[$i][$left]) && $data[$i][$left] == '.' && !isset($tracker[$i][$left])) {\n $stack->push([$i, $left]);\n continue;\n }\n // Up\n if (isset($data[$up][$j]) && $data[$up][$j] == '.' && !isset($tracker[$up][$j])) {\n $stack->push([$up, $j]);\n continue;\n }\n\n // If come this far we got no other way just write X and decrease K, go back to parent\n $k--;\n $data[$i][$j] = 'X';\n $stack->push($tracker[$i][$j]['parent']);\n }\n}\n\n$in = fopen( 'php://stdin', 'r' );\n$lineArr = explode(' ', trim(fgets($in)));\n$rows = intval($lineArr[0]);\n$cols = intval($lineArr[1]);\n$k = intval($lineArr[2]);\n$data = [];\nfor ($i=0; $i<$rows; $i++) {\n $line = str_replace(\"\\n\", \"\", fgets($in));\n $data[] = str_split($line);\n}\nfclose($in);\n\n// $lineArr = explode(' ', \"3 4 4\");\n// $rows = intval($lineArr[0]);\n// $cols = intval($lineArr[1]);\n// $k = intval($lineArr[2]);\n\n// $data = [\n// ['#', '.', '.', '#'],\n// ['.', '.', '#', '.'],\n// ['#', '.', '.', '.'],\n// ];\n\n\n$out = fopen('php://stdout', 'w');\n$answer = getSolution($data, $rows, $cols, $k);\n// printSolution($answer);\n// die;\nfputs($out, $answer);\nfclose($out);\n"}, {"source_code": " $row) {\n foreach ($row as $j => $value) {\n if ($value == '.') {\n break 2;\n }\n }\n }\n\n performDFS($data, $i, $j, $k);\n return $data;\n}\n\nfunction performDFS(&$data, $i, $j, $k, $tracker = [])\n{\n $step = 0;\n $stack = new Stack();\n $stack->push([$i, $j]);\n $parent = null;\n while (!$stack->isEmpty() && $k > 0) {\n $step++;\n \n list($i, $j) = $stack->pop();\n \n if (!isset($tracker[$i][$j])) {\n $tracker[$i][$j]['parent'] = $parent;\n }\n\n $up = $i - 1;\n $right = $j + 1;\n $down = $i + 1;\n $left = $i - 1;\n $parent = [$i, $j];\n // Right\n if (isset($data[$i][$right]) && $data[$i][$right] == '.' && !isset($tracker[$i][$right])) {\n $stack->push([$i, $right]);\n continue;\n }\n // Down\n if (isset($data[$down][$j]) && $data[$down][$j] == '.' && !isset($tracker[$down][$j])) {\n $stack->push([$down, $j]);\n continue;\n }\n // Left\n if (isset($data[$i][$left]) && $data[$i][$left] == '.' && !isset($tracker[$i][$left])) {\n $stack->push([$i, $left]);\n continue;\n }\n // Up\n if (isset($data[$up][$j]) && $data[$up][$j] == '.' && !isset($tracker[$up][$j])) {\n $stack->push([$up, $j]);\n continue;\n }\n\n // If come this far we got no other way just write X and decrease K, go back to parent\n $k--;\n $data[$i][$j] = 'X';\n $stack->push($tracker[$i][$j]['parent']);\n }\n}\n\n$in = fopen( 'php://stdin', 'r' );\n$lineArr = explode(' ', trim(fgets($in)));\n$rows = intval($lineArr[0]);\n$cols = intval($lineArr[1]);\n$k = intval($lineArr[2]);\n$data = [];\nfor ($i=0; $i<$rows; $i++) {\n $line = str_replace(\"\\n\", \"\", fgets($in));\n $data[] = str_split($line);\n}\nfclose($in);\n\n// $lineArr = explode(' ', \"3 4 4\");\n// $rows = intval($lineArr[0]);\n// $cols = intval($lineArr[1]);\n// $k = intval($lineArr[2]);\n\n// $data = [\n// ['#', '.', '.', '#'],\n// ['.', '.', '#', '.'],\n// ['#', '.', '.', '.'],\n// ];\n\n\n$out = fopen('php://stdout', 'w');\n$answer = getSolution($data, $rows, $cols, $k);\n// printSolution($answer);\n// die;\nfputs($out, getStrSolution($answer));\nfclose($out);\n"}], "src_uid": "3aba4a129e24ca2f06f5f3ef13415b8b"} {"source_code": " 0) {\n $s .= ' ';\n }\n $s .= $nn - ($r1+$r2)*$n + $r1*$r2;\n }\n echo \"$s\\n\";\n?>\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "faf1abdeb6f0cf34972d5cb981116186"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "17cf2d6f59773925b228188b5a47b710"} {"source_code": ""}], "negative_code": [{"source_code": " \";\r\n }\r\n ?>"}], "src_uid": "a6b6d9ff2ac5c367c00a64a387cc9e36"} {"source_code": "= 0; $y--)\n {\n if($c[$y] == \"1\")\n {\n break;\n }\n }\n $c = substr($c, 0, $y + 1);\n $d = 0;\n for($y = 0; $y < strlen($c); $y++)\n {\n if($c[$y] == 0)\n {\n $d++;\n }\n }\n print $d . \"\\n\";\n}\n?>"}, {"source_code": "=0;$i--)\n {\n if($s[$i]=='1')\n {\n $last=$i;\n break;\n }\n }\n for ($i=$first;$i<=$last;$i++)\n {\n if($s[$i]=='0')\n {\n $count++;\n }\n }\n echo $count.\"\\n\";\n\n}\n\n\n?>"}], "negative_code": [], "src_uid": "5de66fbb594bb317654366fd2290c4d3"} {"source_code": " 0; $t --) {\r\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($b == 1){\r\n echo sprintf(\"NO\\n\");\r\n }\r\n\r\n else{\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%s %s %s\\n\", $a * $b, $a, $a * $b + $a);\r\n }\r\n\r\n}\r\n\r\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " 0; $t --) {\r\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($b == 1){\r\n echo sprintf(\"NO\\n\");\r\n }\r\n\r\n else{\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", $a * $b, $a, $a * $b + $a);\r\n }\r\n\r\n}\r\n\r\n"}, {"source_code": " 0; $t --) {\r\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($b == 1){\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", 2 * $a, $a, 3 * $a);\r\n }\r\n\r\n else{\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", $a * $b, $a, $a * $b + $a);\r\n }\r\n\r\n}\r\n\r\n"}, {"source_code": " 0; $t --) {\r\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($b == 1){\r\n echo sprintf(\"no\\n\");\r\n echo sprintf(\"%d %d %d\\n\", 2 * $a, $a, 3 * $a);\r\n }\r\n\r\n else{\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", $a * $b, $a, $a * $b + $a);\r\n }\r\n\r\n}"}, {"source_code": " 0; $t --) {\r\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($b === 1){\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", 2 * $a, $a, 3 * $a);\r\n }\r\n\r\n else{\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", $a * $b, $a, $a * $b + $a);\r\n }\r\n\r\n}"}, {"source_code": " 0; $t --) {\r\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\r\n\r\n\r\n\r\n \r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", $a * $b, $a, $a * $b + $a);\r\n \r\n\r\n}"}, {"source_code": " 0; $t --) {\r\n list($a, $b) = explode(' ', trim(fgets(STDIN)));\r\n\r\n if($a % $b === 0)\r\n echo sprintf(\"NO\\n\");\r\n\r\n else{\r\n echo sprintf(\"YES\\n\");\r\n echo sprintf(\"%d %d %d\\n\", $a * $b, $a, $a * $b + $a);\r\n }\r\n\r\n}"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "f10aa45956e930df3df0e23f2592c8f1"} {"source_code": "$v)\n{\n\tif ($d === false || floor($mas[$k]/$mas2[$k]) < $d) $d = floor($mas[$k]/$mas2[$k]);\n}\n\n//\u0423\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nforeach ($mas as $k=>$v)\n{\n\t$mas[$k] -= $mas2[$k] * $d;\n}\n\n//echo $d;\n//var_export($mas);\n\n$rep_cnt = 0; \n//\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f\n$flag = true;\nif (sizeof($mas2) <= 0) $flag = false;\nwhile ($flag)\n{\n\t//\u0431\u0435\u0436\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0431\u0443\u043a\u0432\u0430\u043c \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445\n\t$reserv = false;\n\tforeach($mas2 as $k=>$v)\n\t{\n\t\t$mas[$k] -= $v;\n\t\tif ($mas[$k] < 0)\n\t\t{//\u0431\u0443\u043a\u0432\u044b \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0437\u0430\u043c\u0435\u043d\u044b\n\t\t\t//echo \"no lit $rep_cnt \\n\";\n\t\t\t/*if ($rep_cnt > 0)\n\t\t\t{\n\t\t\t\t$rep_cnt --;\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\t$out = preg_replace('@\\?@', $t[$i], $out, 1);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\tfor ($i = $mas[$k]; $i < 0; $i++)\n\t\t\t{\n\t\t\t\tif (isset($rep[$rep_cnt]))\n\t\t\t\t{\n\t\t\t\t\t$pos = $rep[$rep_cnt];\n\t\t\t\t\t$mas[$k] ++;\n\t\t\t\t\t$rep_cnt ++;\n\t\t\t\t\t$out[$pos] = $k;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$reserv = true;\n\t\t}\n\t}\n\t/*\n\t//E\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0432 \u0440\u0435\u0437\u0435\u0440\u0432\u0435, \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u043a\u0438 \u043f\u0443\u0447\u043a\u0430\u043c\u0438\n\tif (!$reserv)\n\t{\n\t\t//echo \"RESERV OUT\\n\";\n\t\t//echo $out.\" \";\n\t\t$out = str_replace($auto, $t, $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$out = str_replace('?', $t[0], $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$flag = false;\n\t}*/\n}\n\necho $out;\n?>", "positive_code": [{"source_code": " strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelseif(strlen($a) == strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n $g = 0;\n for($x = 0; $x < 26; $x++)\n {\n if($d[$f[$x]] > $e[$f[$x]])\n {\n $g = 1;\n break;\n }\n else\n {\n $n[$f[$x]] = $e[$f[$x]] - $d[$f[$x]];\n }\n }\n if($g == 0)\n {\n $h = array_sum($n);\n $i = $c2 - $h;\n $n[$f[0]] += $i;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$f[$z]] > 0)\n {\n $a[$x] = $f[$z];\n $n[$f[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n }\n}\nelseif(strlen($a) < strlen($b))\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "$v)\n{\n\tif ($d === false || floor($mas[$k]/$mas2[$k]) < $d) $d = floor($mas[$k]/$mas2[$k]);\n}\n\n//\u0423\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nforeach ($mas as $k=>$v)\n{\n\t$mas[$k] -= $mas2[$k] * $d;\n}\n\n//echo $d;\n//var_export($mas);\n\n//$rep_cnt = sizeof($rep); \n$rep_cnt = 0; \n//\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f\n$flag = true;\nif (sizeof($mas2) <= 0) $flag = false;\nwhile ($flag)\n{\n\t//\u0431\u0435\u0436\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0431\u0443\u043a\u0432\u0430\u043c \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445\n\t$reserv = false;\n\tforeach($mas2 as $k=>$v)\n\t{\n\t\t$mas[$k] -= $v;\n\t\tif ($mas[$k] < 0)\n\t\t{//\u0431\u0443\u043a\u0432\u044b \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0437\u0430\u043c\u0435\u043d\u044b\n\t\t\t//echo \"no lit $rep_cnt \\n\";\n\t\t\t/*\n\t\t\tfor ($i = $mas[$k]; $i < 0; $i++)\n\t\t\t{\n\t\t\t\tif ($rep_cnt > 0)\n\t\t\t\t{\n\t\t\t\t\t$rep_cnt --;\n\t\t\t\t\t$mas[$k] ++;\n\t\t\t\t\t//$out = preg_replace('@\\?@', $k, $out, 1);\n\t\t\t\t\t$pos = strpos($out, '?');\n\t\t\t\t\t$out[$pos] = $k;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}*/\n\t\t\t\n\t\t\tfor ($i = $mas[$k]; $i < 0; $i++)\n\t\t\t{\n\t\t\t\tif (isset($rep[$rep_cnt]))\n\t\t\t\t{\n\t\t\t\t\t$pos = $rep[$rep_cnt];\n\t\t\t\t\t$mas[$k] ++;\n\t\t\t\t\t$rep_cnt ++;\n\t\t\t\t\t$out[$pos] = $k;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$reserv = true;\n\t\t}\n\t}\n\t\n\t//E\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0432 \u0440\u0435\u0437\u0435\u0440\u0432\u0435, \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u043a\u0438 \u043f\u0443\u0447\u043a\u0430\u043c\u0438\n\tif (!$reserv)\n\t{\n\t\t//echo \"RESERV OUT\\n\";\n\t\t//echo $out.\" \";\n\t\t$cnt = 0;\n\t\t$out = str_replace($auto, $t, $out, $cnt);\n\t\t$rep_cnt += $cnt * strlen($t);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t//$out = str_replace('?', $t[0], $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t//$flag = false;\n\t}\n}\n\necho $out;\n?>"}], "negative_code": [{"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $c2 . \"\\n\";\n print_r($n);\n }\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($e);\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($i);\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($i);\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n {\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n }\n else\n {\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n }\n}\nif(($a[0] == \"o\") && ($a[1] == \"z\"))\n{\n print $x2;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($h);\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($h);\n print_r($i);\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n if(($a[0] == \"z\") && ($a[1] == \"j\"))\n {\n print_r($h);\n }\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $c2 . \"\\n\";\n print_r($h);\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($e);\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $c . \"\\n\";\n }\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $x2;\n }\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $x2;\n }\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($i);\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($n);\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($n);\n }\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": " strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelseif(strlen($a) == strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n $g = 0;\n for($x = 0; $x < 26; $x++)\n {\n if($d[$f[$x]] > $e[$f[$x]])\n {\n $g = 1;\n break;\n }\n else\n {\n $n[$f[$x]] = $e[$f[$x]] - $d[$f[$x]];\n }\n }\n \n}\nelseif(strlen($a) < strlen($b))\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $x2 += $v;\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $x2 . \"\\n\";\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n if(($a[0] == \"z\") && ($a[1] == \"j\"))\n {\n print strlen($a) . \"\\n\";\n print strlen($b) . \"\\n\";\n print $c . \"\\n\";\n print $x2 . \"\\n\";\n }\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print \"fsjkdfj\\n\";\n }\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $x2 += $v;\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($n);\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($d);\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($h);\n print_r($k);\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$f[$z]] > 0)\n {\n $a[$x] = $f[$z];\n $n[$f[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$f[$z]] > 0)\n {\n $a[$x] = $f[$z];\n $n[$f[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print_r($h);\n print_r($i);\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n if(($a[0] == \"z\") && ($a[1] == \"j\"))\n {\n print_r($i);\n }\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $c2 . \"\\n\";\n print_r($n);\n }\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $x2 += $v;\n $w = $c2 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "= strlen($b))\n{\n $c = 0;\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);\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] != \"?\")\n {\n $d[$a[$x]]++;\n }\n else\n {\n $c++;\n }\n }\n $c2 = $c;\n $e = 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);\n for($x = 0; $x < strlen($b); $x++)\n {\n $e[$b[$x]]++;\n }\n $f = 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 $n = 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);\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n unset($n[$f[$x]]);\n }\n }\n for($x = 0; $x < 26; $x++)\n {\n if($e[$f[$x]] == NULL)\n {\n unset($d[$f[$x]]);\n }\n }\n $g = array_keys($d);\n $h = array();\n $i = array();\n for($x = 0; $x < count($d); $x++)\n {\n $j = floor($d[$g[$x]] / $e[$g[$x]]);\n $h[$g[$x]] = $j;\n $k = $d[$g[$x]] % $e[$g[$x]];\n $i[$g[$x]] = $k;\n }\n $l = $h;\n $m = array_unique($l);\n sort($m);\n $o = 0;\n $p = array_keys($h);\n $x2 = $m[0];\n for($x = 0; $x < count($m) - 1; $x++)\n {\n $r = $m[$x + 1];\n $c3 = $c2;\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $c2 -= $t;\n }\n }\n if($c2 >= 0)\n {\n $x2 = $m[$x + 1];\n for($y = 0; $y < count($h); $y++)\n {\n if($h[$p[$y]] < $r)\n {\n $s = $r - $h[$p[$y]];\n $t = $s * $e[$p[$y]] - $i[$p[$y]];\n $i[$p[$y]] = 0;\n $h[$p[$y]] = $r;\n $n[$p[$y]] += $t;\n }\n }\n }\n else\n {\n $o = 1;\n for($y = 0; $y < 26; $y++)\n {\n if($h[$p[$y]] >= $r)\n {\n unset($e[$p[$y]]);\n }\n }\n $u = array_sum($e);\n $v = floor($c3 / $u);\n $x2 += $v;\n $x2 += $v;\n $w = $c3 % $u;\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n break;\n }\n }\n if($o == 0)\n {\n $x2 += $v;\n $u = array_sum($e);\n $v = floor($c2 / $u);\n $w = $c2 % $u;\n if(($a[0] == \"o\") && ($a[1] == \"z\"))\n {\n print $u . \"\\n\";\n print $v . \"\\n\";\n print $w . \"\\n\";\n }\n for($y = 0; $y < count($h); $y++)\n {\n $n[$p[$y]] += $v * $e[$p[$y]];\n }\n $n[$p[0]] += $w;\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n else\n {\n $z = 0;\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n if($n[$p[$z]] > 0)\n {\n $a[$x] = $p[$z];\n $n[$p[$z]]--;\n }\n else\n {\n $z++;\n $x--;\n }\n }\n }\n print $a;\n }\n}\nelse\n{\n for($x = 0; $x < strlen($a); $x++)\n {\n if($a[$x] == \"?\")\n {\n $a[$x] = \"a\";\n }\n }\n print $a;\n}\n?>"}, {"source_code": "$v)\n{\n\tif ($d === false || floor($mas[$k]/$mas2[$k]) < $d) $d = floor($mas[$k]/$mas2[$k]);\n}\n\n//\u0423\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nforeach ($mas as $k=>$v)\n{\n\t$mas[$k] -= $mas2[$k] * $d;\n}\n\n$rep_cnt = 0; \n//\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f\n$flag = true;\nwhile ($flag)\n{\n\t//\u0431\u0435\u0436\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0431\u0443\u043a\u0432\u0430\u043c \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445\n\t$reserv = false;\n\tforeach($mas2 as $k=>$v)\n\t{\n\t\t$mas[$k] -= 1;\n\t\tif ($mas[$k] < 0)\n\t\t{//\u0431\u0443\u043a\u0432\u044b \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0437\u0430\u043c\u0435\u043d\u044b\n\t\t\t//echo \"no lit $rep_cnt \\n\";\n\t\t\t/*if ($rep_cnt > 0)\n\t\t\t{\n\t\t\t\t$rep_cnt --;\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\t$out = preg_replace('@\\?@', $t[$i], $out, 1);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\t\n\t\t\tif (isset($rep[$rep_cnt]))\n\t\t\t{\n\t\t\t\t$pos = $rep[$rep_cnt];\n\t\t\t\t$mas[$k] ++;\n\t\t\t\t$rep_cnt ++;\n\t\t\t\t$out[$pos] = $k;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$reserv = true;\n\t\t}\n\t}\n\t\n\t//E\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0432 \u0440\u0435\u0437\u0435\u0440\u0432\u0435, \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u043a\u0438 \u043f\u0443\u0447\u043a\u0430\u043c\u0438\n\tif (!$reserv)\n\t{\n\t\t//echo \"RESERV OUT\\n\";\n\t\t//echo $out.\" \";\n\t\t$out = str_replace($auto, $t, $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$out = str_replace('?', $t[0], $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$flag = false;\n\t}\n}\n\necho $out;\n\nfunction get_min($mas)\n{\n\t$res = false;\n\tforeach($mas as $k=>$v)\n\t{\n\t\tif ($res === false || $mas[$k] < $mas[$res]) $res = $k;\n\t}\n\treturn $res;\n}\n?>"}, {"source_code": " 0)\n\t\t\t{\n\t\t\t\t$rep_cnt --;\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\techo \"{$t[$i]}=> {$mas[$t[$i]]} \\n\";\n\t\t\t\t$out = preg_replace('@\\?@', $t[$i], $out, 1);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\necho $out;\n\nfunction get_min($mas)\n{\n\t$res = false;\n\tforeach($mas as $k=>$v)\n\t{\n\t\tif ($res === false || $mas[$k] < $mas[$res]) $res = $k;\n\t}\n\treturn $res;\n}\n?>"}, {"source_code": "$v)\n\t{\n\t\tif ($res === false || $mas[$k] < $mas[$res]) $res = $k;\n\t}\n\treturn $res;\n}\n?>"}, {"source_code": "$v)\n{\n\tif ($d === false || floor($mas[$k]/$mas2[$k]) < $d) $d = floor($mas[$k]/$mas2[$k]);\n}\n\n//\u0423\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nforeach ($mas as $k=>$v)\n{\n\t$mas[$k] -= $mas2[$k] * $d;\n}\n\n//echo $d;\n//var_export($mas);\n\n$rep_cnt = 0; \n//\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f\n$flag = true;\nwhile ($flag)\n{\n\t//\u0431\u0435\u0436\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0431\u0443\u043a\u0432\u0430\u043c \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445\n\t$reserv = false;\n\tforeach($mas2 as $k=>$v)\n\t{\n\t\t$mas[$k] -= $v;\n\t\tif ($mas[$k] < 0)\n\t\t{//\u0431\u0443\u043a\u0432\u044b \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0437\u0430\u043c\u0435\u043d\u044b\n\t\t\t//echo \"no lit $rep_cnt \\n\";\n\t\t\t/*if ($rep_cnt > 0)\n\t\t\t{\n\t\t\t\t$rep_cnt --;\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\t$out = preg_replace('@\\?@', $t[$i], $out, 1);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\tfor ($i = $mas[$k]; $i < 0; $i++)\n\t\t\t{\n\t\t\t\tif (isset($rep[$rep_cnt]))\n\t\t\t\t{\n\t\t\t\t\t$pos = $rep[$rep_cnt];\n\t\t\t\t\t$mas[$k] ++;\n\t\t\t\t\t$rep_cnt ++;\n\t\t\t\t\t$out[$pos] = $k;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$reserv = true;\n\t\t}\n\t}\n\t\n\t//E\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0432 \u0440\u0435\u0437\u0435\u0440\u0432\u0435, \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u043a\u0438 \u043f\u0443\u0447\u043a\u0430\u043c\u0438\n\tif (!$reserv)\n\t{\n\t\t//echo \"RESERV OUT\\n\";\n\t\t//echo $out.\" \";\n\t\t$out = str_replace($auto, $t, $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$out = str_replace('?', $t[0], $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$flag = false;\n\t}\n}\n\necho $out;\n\nfunction get_min($mas)\n{\n\t$res = false;\n\tforeach($mas as $k=>$v)\n\t{\n\t\tif ($res === false || $mas[$k] < $mas[$res]) $res = $k;\n\t}\n\treturn $res;\n}\n?>"}, {"source_code": "$v)\n\t{\n\t\tif ($res === false || $mas[$k] < $mas[$res]) $res = $k;\n\t}\n\treturn $res;\n}\n?>"}, {"source_code": " 0)\n\t\t\t{\n\t\t\t\t$rep_cnt --;\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\t$out = preg_replace('@\\?@', $t[$i], $out, 1);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\t\n\t\t\tif ($rep[$rep_cnt] > 0)\n\t\t\t{\n\t\t\t\t$pos = $rep[$rep_cnt];\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\t$rep_cnt ++;\n\t\t\t\t$out[$pos] = $t[$i];\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}\n\necho $out;\n\nfunction get_min($mas)\n{\n\t$res = false;\n\tforeach($mas as $k=>$v)\n\t{\n\t\tif ($res === false || $mas[$k] < $mas[$res]) $res = $k;\n\t}\n\treturn $res;\n}\n?>"}, {"source_code": "$v)\n{\n\tif ($d === false || floor($mas[$k]/$mas2[$k]) < $d) $d = floor($mas[$k]/$mas2[$k]);\n}\n\n//\u0423\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nforeach ($mas as $k=>$v)\n{\n\t$mas[$k] -= $mas2[$k] * $d;\n}\n\n//echo $d;\n//var_export($mas);\n\n$rep_cnt = 0; \n//\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f\n$flag = true;\nwhile ($flag)\n{\n\t//\u0431\u0435\u0436\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0431\u0443\u043a\u0432\u0430\u043c \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445\n\t$reserv = false;\n\tforeach($mas2 as $k=>$v)\n\t{\n\t\t$mas[$k] -= $v;\n\t\tif ($mas[$k] < 0)\n\t\t{//\u0431\u0443\u043a\u0432\u044b \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0437\u0430\u043c\u0435\u043d\u044b\n\t\t\t//echo \"no lit $rep_cnt \\n\";\n\t\t\t/*if ($rep_cnt > 0)\n\t\t\t{\n\t\t\t\t$rep_cnt --;\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\t$out = preg_replace('@\\?@', $t[$i], $out, 1);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\tfor ($i = $mas[$k]; $i < 0; $i++)\n\t\t\t{\n\t\t\t\tif (isset($rep[$rep_cnt]))\n\t\t\t\t{\n\t\t\t\t\t$pos = $rep[$rep_cnt];\n\t\t\t\t\t$mas[$k] ++;\n\t\t\t\t\t$rep_cnt ++;\n\t\t\t\t\t$out[$pos] = $k;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$reserv = true;\n\t\t}\n\t}\n\t\n\t//E\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0432 \u0440\u0435\u0437\u0435\u0440\u0432\u0435, \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u043a\u0438 \u043f\u0443\u0447\u043a\u0430\u043c\u0438\n\tif (!$reserv)\n\t{\n\t\t//echo \"RESERV OUT\\n\";\n\t\t//echo $out.\" \";\n\t\t$out = str_replace($auto, $t, $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$out = str_replace('?', $t[0], $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$flag = false;\n\t}\n}\n\necho $out;\n?>"}, {"source_code": "$v)\n{\n\tif ($d === false || floor($mas[$k]/$mas2[$k]) < $d) $d = floor($mas[$k]/$mas2[$k]);\n}\n\n//\u0423\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u0430\nforeach ($mas as $k=>$v)\n{\n\t$mas[$k] -= $mas2[$k] * $d;\n}\n\n//echo $d;\n//var_export($mas);\n\n$rep_cnt = 0; \n//\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f\n$flag = true;\nif (sizeof($mas2) <= 0) $flag = false;\nwhile ($flag)\n{\n\t//\u0431\u0435\u0436\u0438\u043c \u043f\u043e \u0432\u0441\u0435\u043c \u0431\u0443\u043a\u0432\u0430\u043c \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445\n\t$reserv = false;\n\tforeach($mas2 as $k=>$v)\n\t{\n\t\t$mas[$k] -= $v;\n\t\tif ($mas[$k] < 0)\n\t\t{//\u0431\u0443\u043a\u0432\u044b \u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0437\u0430\u043c\u0435\u043d\u044b\n\t\t\t//echo \"no lit $rep_cnt \\n\";\n\t\t\t/*if ($rep_cnt > 0)\n\t\t\t{\n\t\t\t\t$rep_cnt --;\n\t\t\t\t$mas[$t[$i]] ++;\n\t\t\t\t$out = preg_replace('@\\?@', $t[$i], $out, 1);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$flag = false;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\tfor ($i = $mas[$k]; $i < 0; $i++)\n\t\t\t{\n\t\t\t\tif (isset($rep[$rep_cnt]))\n\t\t\t\t{\n\t\t\t\t\t$pos = $rep[$rep_cnt];\n\t\t\t\t\t$mas[$k] ++;\n\t\t\t\t\t$rep_cnt ++;\n\t\t\t\t\t$out[$pos] = $k;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$flag = false;\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$reserv = true;\n\t\t}\n\t}\n\t\n\t//E\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0432 \u0440\u0435\u0437\u0435\u0440\u0432\u0435, \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0438\u043a\u0438 \u043f\u0443\u0447\u043a\u0430\u043c\u0438\n\tif (!$reserv)\n\t{\n\t\t//echo \"RESERV OUT\\n\";\n\t\t//echo $out.\" \";\n\t\t$out = str_replace($auto, $t, $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$out = str_replace('?', $t[0], $out);\n\t\t//echo \"|\".$out.\"|\\n\";\n\t\t$flag = false;\n\t}\n}\n\necho $out;\n?>"}], "src_uid": "fb96c841b1973a04becf7a5d1392eab3"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "ec09b2df4ed3abbca4c47f48f12010ca"} {"source_code": " $odd ? $odd : $even;\r\n InOutPut::print($ans);\r\n}\r\n\r\n\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": " $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 "}], "src_uid": "4b33db3950303b8993812cb265fa9819"} {"source_code": "0)) {\n if ($a[$cur] > 0) {\n $a[$cur]--;\n $s .= \"P\";\n\n if ($a[$cur] > 0) $b = true;\n else $b = false;\n\n $e = false;\n\n if (($cur + 1) < $len) {\n $cur++;\n $s .= \"R\";\n } else {\n $s .= \"L\";\n $cur--;\n $e = true;\n }\n\n if ($b) {\n\n if (!$e) {\n\n if ($a[$cur] > 0) {\n $a[$cur]--;\n $s .= \"PL\";\n $cur--;\n } else {\n $s .= \"L\";\n $cur--;\n }\n } else {\n if ($a[$cur] > 0) {\n $a[$cur]--;\n $s .= \"PR\";\n $cur++;\n } else {\n $s .= \"R\";\n $cur++;\n }\n }\n }\n } else {\n $cur++;\n $s .= \"R\";\n }\n}\necho $s;", "positive_code": [{"source_code": " 0) {\n $done = false;\n print 'P';\n $a[$i] --;\n }\n print 'R';\n }\n for ($i = $n-1; $i-1 >= 0; $i --) {\n if ($a[$i] > 0) {\n $done = false;\n print 'P';\n $a[$i] --;\n }\n print 'L';\n }\n if ($done) break;\n}\n"}, {"source_code": " 1000000)\n exit;\n if($current[ $pos ] > 0){\n $current[ $pos ]--;\n $puts++;\n echo 'P';\n }\n if($puts == $count_puts){\n exit;\n }\n if($pos > 0){\n if($current[ $pos - 1 ] > 0){\n $pos--;\n echo 'L';\n continue;\n }\n } \n if ($pos_last > $pos) {\n echo 'R';\n $pos++;\n continue;\n }\n if ($pos_last == $pos) {\n echo 'L';\n $pos--;\n continue;\n }\n}"}, {"source_code": " 1)\n {\n print \"PRL\";\n $b[$c]--;\n }\n elseif($d > 0)\n {\n print \"P\";\n $b[$c]--;\n }\n elseif($d == 0)\n {\n print \"R\";\n $c++;\n }\n }\n elseif($c == ($a - 1))\n {\n if($d > 1)\n {\n print \"PLR\";\n $b[$c]--;\n }\n elseif($d > 0)\n {\n print \"P\";\n $b[$c]--;\n }\n elseif($d == 0)\n {\n break;\n }\n }\n else\n {\n if($d > 1)\n {\n print \"PRL\";\n $b[$c]--;\n }\n elseif($d > 0)\n {\n print \"P\";\n $b[$c]--;\n }\n elseif($d == 0)\n {\n print \"R\";\n $c++;\n }\n }\n}\n?>"}, {"source_code": " 0) {\n\t\tif ($j == $l1 and $a[$j] == 0) {\n\t\t\t$l1++;\n\t\t}\n\n\t\tif ($j+1 == $n) {\n\t\t\t$m = -1;\n\t\t\tif ($j == $l2 and $a[$j] == 0) {\n\t\t\t\t$l2--;\n\t\t\t}\n\t\t\t$j--;\n\t\t\tprint 'L';\n\t\t}\n\t\telse {\n\t\t\t$j++;\n\t\t\tprint 'R';\n\t\t}\n\n\t\tif ($j > $l2) $m = -1;\n\t}\n\telseif ($m < 0) {\n\t\tif ($j == $l2 and $a[$j] == 0) {\n\t\t\t$l2--;\n\t\t}\n\n\t\tif ($j == 0) {\n\t\t\t$m = 1;\n\t\t\tif ($j == $l1 and $a[$j] == 0) {\n\t\t\t\t$l1++;\n\t\t\t}\n\t\t\t$j++;\n\t\t\tprint 'R';\n\t\t}\n\t\telse {\n\t\t\t$j--;\n\t\t\tprint 'L';\n\t\t}\n\n\t\tif ($j < $l1) $m = 1;\n\t}\n\n\tif (abs($l1-$l2) <=1 and $a[$l1] == 0 and $a[$l2] == 0) {\n\t\tbreak;\n\t}\n\n}\n"}], "negative_code": [{"source_code": "0) {\n if ($a[$cur] > 0) {\n $a[$cur]--;\n $s .= \"P\";\n\n if ($a[$cur] > 0) $b = true;\n else $b = false;\n\n $e = false;\n\n if (($cur + 1) < $len) {\n $cur++;\n $s .= \"R\";\n } else {\n $s .= \"L\";\n $cur--;\n $e = true;\n }\n\n if ($b) {\n\n if (!$e) {\n\n if ($a[$cur] > 0) {\n $a[$cur]--;\n $s .= \"PL\";\n $cur--;\n } else {\n $s .= \"L\";\n $cur--;\n }\n } else {\n if ($a[$cur] > 0) {\n $a[$cur]--;\n $s .= \"PR\";\n $cur++;\n } else {\n $s .= \"R\";\n $cur++;\n }\n }\n }\n } else {\n $cur++;\n $s .= \"R\";\n }\n}\n\necho $s;"}], "src_uid": "50e88225d8b081d63eebe446f48057f4"} {"source_code": " -1; $j--) {\r\n if($posl[$arr[$j]] === null) {\r\n $posl[$arr[$j]] = $j ;\r\n }\r\n }\r\n// print_r($posf);\r\n// print_r($posl);\r\n while($l--) {\r\n [$lo,$up] = array_map('intval',explode(\" \",trim(fgets(STDIN)))) ;\r\n if( ($posf[$lo] !== null & $posl[$up] !== null ) && ($posf[$lo] < $posl[$up])) {\r\n $ans[] = \"YES\" ;\r\n }\r\n else {\r\n $ans[] = \"NO\" ;\r\n }\r\n }\r\n\r\n print_r(implode(\"\\n\",$ans)) ;\r\n}\r\n\r\n$t = (int) fgets(STDIN);\r\n$ans = [] ;\r\nwhile($t--) {\r\n $emp = fgets(STDIN) ;\r\n $que = explode(\" \",trim(fgets(STDIN)));\r\n $st = trim(fgets(STDIN)) ;\r\n solve($que,$st);\r\n print_r(\"\\n\");\r\n}\r\n", "positive_code": [{"source_code": " 0) {\r\n fgets(STDIN); // discard one line\r\n\r\n $n = 0; $q = 0;\r\n\r\n fscanf(STDIN, \"%d %d\", $n, $q);\r\n\r\n $instr = trim(fgets(STDIN));\r\n $stations = array_map('intval', explode(' ', $instr));\r\n \r\n $l = array(); $r = array();\r\n foreach($stations as $id => $st) {\r\n if (!array_key_exists($st, $l)) {\r\n $l[$st] = $id;\r\n }\r\n $r[$st] = $id;\r\n }\r\n\r\n $s1; $s2;\r\n for ($i = 0; $i < $q; $i++) {\r\n fscanf(STDIN, \"%d %d\", $s1, $s2);\r\n $reachable = false;\r\n if (array_key_exists($s1, $r) && array_key_exists($s2, $r)) {\r\n if ($l[$s1] < $r[$s2]) $reachable = true;\r\n }\r\n if ($reachable) echo \"YES\\n\";\r\n else echo \"NO\\n\";\r\n }\r\n}"}], "negative_code": [{"source_code": " -1; $j--) {\r\n if($posl[$arr[$j]] === null) {\r\n $posl[$arr[$j]] = $j ;\r\n }\r\n }\r\n// print_r($posf);\r\n// print_r($posl);\r\n while($l--) {\r\n [$lo,$up] = array_map('intval',explode(\" \",trim(fgets(STDIN)))) ;\r\n if($posf[$lo] < $posl[$up]) {\r\n $ans[] = \"YES\" ;\r\n }\r\n else {\r\n $ans[] = \"NO\" ;\r\n }\r\n }\r\n\r\n print_r(implode(\"\\n\",$ans)) ;\r\n}\r\n\r\n$t = (int) fgets(STDIN);\r\n$ans = [] ;\r\nwhile($t--) {\r\n $emp = fgets(STDIN) ;\r\n $que = explode(\" \",trim(fgets(STDIN)));\r\n $st = trim(fgets(STDIN)) ;\r\n solve($que,$st);\r\n print_r(\"\\n\");\r\n}\r\n"}, {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= $num) break;\n}"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c047040426e736e9085395ed9666135f"} {"source_code": "=0)\n {\n if($str[$count] == 1)\n {\n $count--;\n }else\n {\n $str[$count] = 1;\n break;\n }\n\n }\n }\n if(($item<>'L')&&($item<>'R'))\n {\n $str[$item]= 0 ;\n }\n $count = 0;\n }\n echo $str;\n\n\n // // $output = explode(\" \",trim(fgets($input)));\n // $output = str_split($input);\n // foreach ($output as $key){\n // echo $key.\" \";\n // }\n ?>", "positive_code": [{"source_code": "= 0; $y--)\n {\n if($c[$y] == 0)\n {\n $c[$y] = 1;\n break;\n }\n }\n }\n else\n {\n $c[$b[$x]] = 0;\n }\n}\nprint implode($c);\n?>"}, {"source_code": " $pm)\n $pm = $p;\n if ($n > 0)\n $n--;\n }\n else {\n $n++;\n if ($n > $nm)\n $nm = $n;\n if ($p > 0)\n $p--; }\n}\n\nif ($pm > $nm)\n echo \"$pm\\n\";\nelse\n echo \"$nm\\n\";\n?>\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $vm)\n $vm = abs($v);\n}\n\necho \"$vm\\n\";\n?>\n"}, {"source_code": " $vm)\n $vm = $v;\n }\n else\n $v = 1;\n}\n\necho \"$vm\\n\";\n?>"}, {"source_code": " $vm)\n $vm = $v;\n }\n else\n $v = 1;\n}\n\necho \"$vm\\n\";\n?>"}, {"source_code": " $pm)\n $pm = $p;\n if ($n > 0)\n $n--;\n }\n else {\n $n++;\n if ($n > $nm)\n $nm = $n;\n if ($p > 0)\n $p--; }\n}\n\nif ($p > $n)\n echo \"$pm\\n\";\nelse\n echo \"$nm\\n\";\n?>\n"}], "src_uid": "a9cd99d74418b5f227b358a910496b02"} {"source_code": "\n", "positive_code": [{"source_code": " $numberOfMonsters){\n //print $keyPerMonster . \" \" . $numberOfMonsters . \"\\n\";\n if($k<$keyPerMonster*$numberOfMonsters){\n $killCount += floor($k/$keyPerMonster);\n break;\n }\n $k -= $keyPerMonster*$numberOfMonsters;\n $killCount += $numberOfMonsters;\n //print \"k count is: \" . $k . \"\\n\";\n //print \"kill count is: \" . $killCount . \"\\n\";\n}\nprint $killCount;\n?>\n"}, {"source_code": " $b + $c)\n {\n $h = $e[$x] % ($b + $c);\n if($h < 1)\n {\n $i = ceil($c / $b);\n $g[count($g)] = $i;\n }\n elseif(($h >= 1) && ($h <= $b))\n {\n $f++;\n }\n elseif($h > $b)\n {\n $h -= $b;\n $i = ceil($h / $b);\n $g[count($g)] = $i;\n }\n }\n}\nsort($g);\nfor($x = 0; $x < count($g); $x++)\n{\n if($d >= $g[$x])\n {\n $f++;\n $d -= $g[$x];\n }\n}\nprint $f;\n?>"}], "negative_code": [{"source_code": " $numberOfMonsters){\n //print $keyPerMonster . \" \" . $numberOfMonsters . \"\\n\";\n if($k<$keyPerMonster*$numberOfMonsters){\n $killCount += floor($k/$keyPerMonster);\n break;\n }\n $k -= $keyPerMonster*$numberOfMonster;\n $killCount += $numberOfMonsters;\n}\nprint $killCount;\n?>\n"}, {"source_code": " $numberOfMonsters){\n if($k<$keyPerMonster*$numberOfMonsters){\n $killCount += floor($k/$keyPerMonster);\n break;\n }\n $k -= $keyPerMonster*$numberOfMonster;\n $killCount += $numberOfMonsters;\n}\n\nprint $killCount;\n?>\n"}, {"source_code": " $numberOfMonsters){\n if($k<$keyPerMonster*$numberOfMonsters){\n $killCount += floor($k/$keyPerMonster);\n break;\n }\n $k -= $keyPerMonster*$numberOfMonster;\n $killCount += $numberOfMonsters;\n}\nprint $killCount;\n?>\n"}, {"source_code": "$i*$m[$i];$i++){\n $k -= $m[$i]*$i;\n $killCount += $m[$i];\n if ($killCount == $n){\n $k = 0;\n break;\n }\n}\n$killCount += floor($k/$i);\nprint $killCount;\n?>\n"}, {"source_code": " $numberOfMonsters){\n print $keyPerMonster . \" \" . $numberOfMonsters . \"\\n\";\n if($k<$keyPerMonster*$numberOfMonsters){\n $killCount += floor($k/$keyPerMonster);\n break;\n }\n $k -= $keyPerMonster*$numberOfMonster;\n $killCount += $numberOfMonsters;\n}\n\nprint $killCount;\n?>\n"}], "src_uid": "ada28bbbd92e0e7c6381bb9a4b56e7f9"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n "}, {"source_code": " $girls[$gi]){\n $gi++;\n }else{\n $matches++;\n $bi++;\n $gi++;\n }\n\n}\necho $matches;"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "\n "}, {"source_code": "= $m){\n break;\n }\n}\n\necho $matches;"}], "src_uid": "62766ef9a0751cbe7987020144de7512"} {"source_code": "\n\n"}, {"source_code": ""}], "negative_code": [{"source_code": " $ballonsForEachPacket[$i]]; \n } else {\n //echo $i;\n $firstPlayerPackets['count']++;\n $firstPlayerPackets['ballonsConut'] += $ballonsForEachPacket[$i] ;\n $firstPlayerPackets['ballons'][$i] = $ballonsForEachPacket[$i];\n \n }\n }\n \n if($secondPlayerPackets['count'] == $firstPlayerPackets['count'])\n {\n echo -1;\n } else{\n echo $firstPlayerPackets['count'].PHP_EOL;\n foreach($firstPlayerPackets['ballons'] as $key=>$ballons)\n {\n echo ($key+1).' ';\n }\n }\n }\n}\n?>\n\n"}, {"source_code": " $ballonsForEachPacket[$i]]; \n } else {\n //echo $i;\n $firstPlayerPackets['count']++;\n $firstPlayerPackets['ballonsConut'] += $ballonsForEachPacket[$i] ;\n $firstPlayerPackets['ballons'][$i] = $ballonsForEachPacket[$i];\n \n }\n }\n \n if($secondPlayerPackets['ballonsConut'] === $firstPlayerPackets['ballonsConut'])\n {\n echo -1;\n } else{\n echo $firstPlayerPackets['count'].PHP_EOL;\n foreach($firstPlayerPackets['ballons'] as $key=>$ballons)\n {\n echo ($key+1).' ';\n }\n }\n }\n}\n?>\n\n"}, {"source_code": "\n\n"}, {"source_code": " $ballonsForEachPacket[$i]]; \n } else {\n //echo $i;\n $firstPlayerPackets['count']++;\n $firstPlayerPackets['ballons'][] = $ballonsForEachPacket[$i];\n \n }\n }\n \n if($secondPlayerPackets['count'] == $firstPlayerPackets['count'])\n {\n echo -1;\n } else{\n echo $firstPlayerPackets['count'].PHP_EOL;\n for($i = 0; $i < count($firstPlayerPackets['ballons']); $i++)\n {\n echo $firstPlayerPackets['ballons'][$i].' ';\n }\n }\n }\n}\n?>\n\n"}, {"source_code": " $ballonsForEachPacket[$i]]; \n } else {\n //echo $i;\n $firstPlayerPackets['count']++;\n $firstPlayerPackets['ballonsConut'] += $ballonsForEachPacket[$i] ;\n $firstPlayerPackets['ballons'][] = $ballonsForEachPacket[$i];\n \n }\n }\n \n if($secondPlayerPackets['count'] == $firstPlayerPackets['count'])\n {\n echo -1;\n } else{\n echo $firstPlayerPackets['count'].PHP_EOL;\n for($i = 0; $i < count($firstPlayerPackets['ballons']); $i++)\n {\n echo $firstPlayerPackets['ballons'][$i].' ';\n }\n }\n }\n}\n?>\n\n"}], "src_uid": "2b55012c899645bac8d293e85e73148f"} {"source_code": " $val) {\n // echo \"key:{$key} val:{$val}\\n\";\n $tmp = floor($sum[$key] / $sample[$key]);\n $ans = min($tmp, $ans);\n }\n\n echo $ans;\n\n", "positive_code": [{"source_code": " 1, u => 1, l => 1, b => 1, a => 1, s => 1, r => 1);\nfor($x = 0; $x < strlen($a); $x++)\n{\n if($b[$a[$x]] == TRUE)\n {\n $b[$a[$x]]++;\n }\n}\n$b[B]--;\n$b[u]--;\n$b[l]--;\n$b[b]--;\n$b[a]--;\n$b[s]--;\n$b[r]--;\n$c = $b[B];\n$d = floor($b[u] / 2);\n$e = $b[l];\n$f = $b[b];\n$g = floor($b[a] / 2);\n$h = $b[s];\n$i = $b[r];\nprint min($c, $d, $e, $f, $g, $h, $i);\n?>"}, {"source_code": "0,'u'=>0,'l'=>0,'b'=>0,'a'=>0,'s'=>0,'r'=>0];\nforeach ($CH as $key => &$item){\n\t$item = c($key);\n}\n$cntr = 0;\nwhile(1){\n\tif($CH['B']>=1&&$CH['u']>=2&&$CH['l']>=1&&$CH['b']>=1&&$CH['a']>=2&&$CH['s']>=1&&$CH['r']>=1){\n\t\t$cntr++;\n\t\tforeach ($CH as $key => &$item){\n\t\t\tif ($key == 'u'||$key == 'a'){\n\t\t\t\t$item -= 2;\n\t\t\t}else{\n\t\t\t\t$item--;\n\t\t\t}\n\t\t}\n\t} else{\n\t\tbreak;\n\t}\n}\necho $cntr;\n?>"}], "negative_code": [{"source_code": "0,'u'=>0,'l'=>0,'b'=>0,'a'=>0,'s'=>0,'r'=>0];\nforeach ($CH as $key => &$item){\n\t$item = c($key);\n}\n$cntr = 0;\nwhile(1){\n\tif($CH['B']>=1&&$CH['u']>=2&&$CH['l']>=1&&$CH['b']>=2&&$CH['a']>=2&&$CH['s']>=1&&$CH['r']>=1){\n\t\t$cntr++;\n\t\tforeach ($CH as $key => &$item){\n\t\t\tif ($key == 'u'||$key == 'b'||$key == 'a'){\n\t\t\t\t$item -= 2;\n\t\t\t}else{\n\t\t\t\t$item--;\n\t\t\t}\n\t\t}\n\t} else{\n\t\tbreak;\n\t}\n}\necho $cntr;\n?>"}, {"source_code": "0,'u'=>0,'l'=>0,'b'=>0,'a'=>0,'s'=>0,'r'=>0];\nforeach ($CH as $key => &$item){\n\t$item = c($key);\n}\n$cntr = 0;\nwhile(1){\n\tif($CH['B']>=1&&$CH['u']>=2&&$CH['l']>=1&&$CH['b']>=2&&$CH['a']>=2&&$CH['s']>=1&&$CH['r']>=1){\n\t\t$cntr++;\n\t\tforeach ($CH as $key => &$item){\n\t\t\tif ($key == 'u'||$key == 'b'||$key == 'a'){\n\t\t\t\t$item -= 2;\n\t\t\t}else{\n\t\t\t\t$item--;\n\t\t\t}\n\t\t}\n\t} else{\n\t\tbreak;\n\t}\n}\necho $cntr ;\n?>"}], "src_uid": "9c429fd7598ea75acce09805a15092d0"} {"source_code": " 0; $t--){\n\n\t$a = [];\n\n\t$cells = [0,3,6,7,1,4,8,5,2];\n\n\tfor($i = 0; $i < 9; $i++){\n\n\t\t$j = $cells[$i];\n\t\t$a = fgets(STDIN);\n\t\t$b = $a[$j];\n\t\t$a[$j] = $b == 9 ? 1 : $b+1;\n\t\techo $a;\n\t}\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "0e21f1c48c8c0463b2ffa7275eddc633"} {"source_code": "=0;$i--){\n $c+=$m[$i];\n $x++;\n if($c > $t-$c){echo $x;break;}\n}\n?>", "positive_code": [{"source_code": "$average)\n {\n echo $i+1;\n break;\n }\n}"}, {"source_code": " $middle)\n {\n break;\n }\n }\n fputs(STDOUT, $count);\n?>"}, {"source_code": " $sum_rest){\n echo $ans . PHP_EOL;\n exit;\n }\n $ans++;\n}\necho count($line) . PHP_EOL;\nexit;"}, {"source_code": " ($s - $r)) break;\n }\n\n echo $count;\n\n\n\n"}, {"source_code": " $arr_twins[$j+1]) {\n $buf = $arr_twins[$j+1];\n $arr_twins[$j+1] = $arr_twins[$j];\n $arr_twins[$j] = $buf;\n }\n }\n}\n$sum1 = 0;\nfor ($i = 0; $i < count($arr_twins); $i++) {\n $sum1 = $sum1 + $arr_twins[$i];\n}\n$k = count($arr_twins)-1;\n$ch = 0;\n$sum2 = 0;\ndo {\n $sum1 = $sum1 - $arr_twins[$k];\n $sum2 = $sum2 + $arr_twins[$k];\n $k = $k-1;\n $ch = $ch + 1;\n}\nwhile ($sum2 <= $sum1);\nprint($ch);"}, {"source_code": " $targetValue) {\n break;\n }\n}\n\necho $keptCoinCount; \n\n?>"}, {"source_code": " $v) {\n\t\t++$t;\n\t\tbreak;\n\t}\n\telse {\n\t\t++$t;\n\t}\n}\necho $t;"}, {"source_code": " sum($a, $i + 1))\n {\n echo $r;\n break;\n }\n $r++;\n }\n }\n else echo 0;\n?>"}, {"source_code": " $coinB + $x[$i]){\n\t\t$coinA -= $x[$i];\n\t\t$coinB += $x[$i];\n\t\t$coin--;\n\t}\n\telse{\n\t\tbreak;\n\t}\n}\necho $coin;\n?> "}, {"source_code": "= 0; $i--)\n{\n unset($sum_hvost);\n unset($sum_money);\n \n $mas_hvost[] = $money[$i];\n unset($money[$i]);\n $sum_money = array_sum($money);\n $sum_hvost = array_sum($mas_hvost);\n \n if ($sum_hvost > $sum_money)\n {\n echo count($mas_hvost);\n break;\n }\n}\n?>"}, {"source_code": " $total-$temp){\n\t\tbreak;\n\t}else{\n\t\t$temp=$temp+$a[$i];\n\t\t$hitung++;\t\n\t}\n\t$i++;\n}\necho $hitung;\n\n?>"}, {"source_code": "= 0 ; $i--) { \n $col++;\n $min += array_pop($a);\n if ($min > array_sum($a)) {\n break;\n }\n}\n\necho $col;\n\n?>"}, {"source_code": "($sum/2)) continue;\n $count=$count+$b[$i]; \n $k++; \n }\n print($k);\n?>"}, {"source_code": ""}, {"source_code": " $testVal){\n echo $i+1;\n break;\n } \n}\n?>"}, {"source_code": " ($allSum - $sums[$i])) {\n $result = $i+1;\n break;\n }\n}\n\n\n\n\necho $result;\n\n?>"}, {"source_code": "=0; $i--) {\n $sum2 += $arr[$i];\n ++$counter;\n if($sum2 > $sum) {\n break;\n }\n}\n\necho $counter.\"\\n\";"}, {"source_code": " $b-$a1) break;\n}\n\nprint $i+1;\n?>"}, {"source_code": "0;$n--){\n $os+=$a[$n-1];\n $s-=$a[$n-1];\n $c++;\n if($os>$s)break;\n}\necho$c;"}, {"source_code": "array_sum($second))\n if(count($first)<$min)\n $min=count($first);\n}\necho $min;\n?>"}, {"source_code": "= $x)\n {\n $i++;\n $temp = $A[$i];\n $A[$i] = $A[$j];\n $A[$j] = $temp;\n }\n }\n return $i<$r ?$i : $i-1;\n}\n\n$stdin = fopen('php://stdin', 'r');\n\nfscanf($stdin, '%d', $n);\n\n$moneys = explode(' ', trim(fgets($stdin)));\n\n$totalSum = array_sum($moneys);\n$half = floor($totalSum / 2);\n\nquicksort($moneys, 0, $n - 1);\n$coins = 0;\nforeach($moneys as $coin)\n{\n\t$half -= $coin;\n\t$coins++;\n\t\n\tif($half < 0)\n\t{\n\t\tbreak;\n\t}\n}\n\necho $coins;\n"}, {"source_code": " $digits[$i]) {\n $tmp = $digits[$j+1];\n $digits[$j+1] = $digits[$i];\n $digits[$i] = $tmp;\n }\n }\n $sum+=$digits[$i];\n}\n\n$sum2 = 0;\nforeach ($digits as $value) {\n $iteration++;\n $sum2 += $value;\n $count++;\n if ($sum2 > ($sum-$sum2)) {\n break;\n }\n}\n\n fputs(STDOUT, $count);\n?>"}, {"source_code": ""}, {"source_code": "$b[$i]){\n $temp=$b[$j];\n $b[$j]=$b[$i];\n $b[$i]=$temp;\n }\n }\n}\n$e=0;\nfor($i=0;$i$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}\n"}, {"source_code": " $c)\n {\n $e++;\n break;\n }\n else\n {\n $e++;\n }\n}\nprint $e;\n?>"}, {"source_code": "=0;$i--){\n\t $c+=$m[$i];\n\t $x++;\n\t if($c > $t-$c){echo $x;break;}\n\t}"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\trsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_sum = 0;\n\t$c = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum += $inp_arr[$i];\n\t\t$c++;\n\t\tif ($temp_sum > $sum - $temp_sum) break;\n\t}\n\tprintf(\"%d\", $c);\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": " getArraySum($coinsArray)){\n $flag = false ;\n }\n}\n\necho count($takenCoinsArray) ;\n\nfunction getArraySum($array){\n $totalSum = 0 ;\n for($i = 0 ; $i < count($array) ; $i ++){\n $totalSum += $array[$i] ;\n }\n return $totalSum ;\n}"}, {"source_code": "=0;$i--)\nif (2*$v>$sum) {print $n-$i;break;}\nelse $v+=$a[$i-1];\n?>"}, {"source_code": " $target) {\n\t\techo $counter;\n\t\texit;\n\t}\n}\n\n?>"}, {"source_code": " ($sum-$s)) break;\n}\n\necho $c;"}, {"source_code": " $value) {\n $mcount += 1;\n $summ += $value;\n if($summ >= $need) break;\n}\n\necho $mcount;"}, {"source_code": "= array_sum($out));\necho count($out);\n\nfunction takeMax(&$array) {\n $max = $array[0];\n $id = 0;\n for ($i = 0; $i < count($array); $i++)\n if ($max < $array[$i]) {\n $max = $array[$i];\n $id = $i;\n }\n unset($array[$id]);\n sort($array);\n return $max;\n}"}, {"source_code": " 0)\n\t{\n\n\t\tif($temp > $left)\n\t\t\tbreak;\n\t\telse\n\t\t{\n\t\t\t$temp = $temp + $coins[$i];\n\t\t\t$left = $coins_sum - $temp;\n\t\t\t$take++;\n\t\t}\n\t\t$i++;\n\t\t$coin_count--;\n\t}\n\techo $take;\n?>"}, {"source_code": "= 0; $i--) {\n $t = $t + $arr[$i];\n $a = $a - $arr[$i];\n $q++;\n if ($t > $a) {\n echo $q;\n break;\n }\n }\n \n// if ($a % 2 == 0)\n// $a = $a / 2 +1;\n// else\n// $a = intval($a / 2) + 1;\n// sort($arr);\n// if ($a < max($arr))\n// echo (\"1\");\n// else{\n\n// for ($j = $c - 1 ; $j >= 0; $j--){\n// echo ($arr[$j] . \" \");\n// if ($a-$arr[$j] >= 0){\n// $a = $a - $arr[$j];\n// $t++;}\n \n \n \n \n// }\n// // if ($a > 0){\n// //$t++;\n// //echo ($t);}\n// //else \n// //echo ($t);\n \n// }\n ?>"}, {"source_code": " array_sum($ar2)){\n break;\n }\n}\n\necho $i . \"\\r\\n\";\n?>"}, {"source_code": " ($summ/2)) {\n echo $result;\n die();\n }\n}\n?>"}, {"source_code": " ($sum/2)){\n break;\n }\n}\n\necho $count;"}, {"source_code": " $sumBrasert ){\n\t\t\techo $i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n\nfclose($fp);\n?>"}, {"source_code": "= 0; $i--) {\n $b1 = array_slice($arr, 0, $i);\n $b2 = array_slice($arr, $i, $cnt);\n if (array_sum($b1) < array_sum($b2)) {\n $cnt = count($b2);\n break;\n }\n}\n\necho $cnt;\n"}, {"source_code": " $all_sum - $sum)\n {\n echo $count;\n break;\n }\n } \n?>"}, {"source_code": " $sum2) break;\n $res++;\n $sum2 -= $v;\n $sum1 += $v;\n}\n\n/*\nvar_dump($res, $sum1, $sum2);\nvar_dump($monets);\n*/\necho $res;"}, {"source_code": " $sum / 2) {\n echo $i;\n break;\n }\n\n $got += $nominals[$i];\n $i += 1;\n\n}"}], "negative_code": [{"source_code": "= 0; $i--) {\n $b1 = array_slice($arr, 0, $i);\n $b2 = array_slice($arr, $i, $cnt);\n if (array_sum($b1) < array_sum($b2)) {\n $cnt = count($b2);\n break;\n }\n}\n\necho $cnt;\n"}, {"source_code": " $sum / 2) {\n echo $i;\n break;\n }\n\n $got += $nominals[$i];\n $i += 1;\n \n}"}, {"source_code": "$midle){\n echo 1;exit;\n }\n\n foreach ($a as $item) {\n if (($min+$item)<=$midle){\n $min = $min+$item;\n //var_dump($item);\n $count++;\n }\n }\n\n\n if ($min <= $midle){\n echo (++$count);\n };\n\n\n\n\n"}, {"source_code": " $targetValue) {\n\t\tbreak;\n\t}\n}\n\necho $keptCoinCount; \n\n?>"}, {"source_code": "= 0; $i--)\n{\n unset($sum_hvost);\n unset($sum_money);\n \n $mas_hvost[] = $money[$i];\n unset($money[$i]);\n $sum_money = array_sum($money);\n $sum_hvost = array_sum($mas_hvost);\n \n if ($sum_hvost > $sum_money)\n {\n echo count($mas_hvost);\n break;\n }\n}\n?>"}, {"source_code": "= 0; $i--)\n{\n unset($sum_hvost);\n unset($sum_money);\n \n $mas_hvost[] = $money[$i];\n unset($money[$i]);\n $sum_money = array_sum($money);\n $sum_hvost = array_sum($mas_hvost);\n \n if ($sum_hvost > $sum_money)\n {\n echo count($mas_hvost);\n //print_r($mas_hvost);\n \n break;\n }\n}\n\n\n\n\n?>"}, {"source_code": "= 0; $i--)\n{\n unset($sum_hvost);\n unset($sum_money);\n \n $mas_hvost[] = $money[$i];\n unset($money[$i]);\n $sum_money = array_sum($money);\n $sum_hvost = array_sum($mas_hvost);\n \n if ($sum_hvost > $sum_money)\n {\n echo count($mas_hvost);\n break;\n }\n}\n\n\n\n\n?>"}, {"source_code": "=0;$i--){\n $c+=$m[$i];\n $x++;\n if($c > $t-$c){echo $x;break;}\n}\n?>"}, {"source_code": "=0;$i--){\n $c+=$m[$i];\n $x++;\n if($c > $t-$c){echo $x;break;}\n}\n?>"}, {"source_code": " $b-$a1) break;\n}\n\nprint $i;\n?>"}, {"source_code": ""}, {"source_code": "$b[$i]){\n $b[$i]=$b[$j];\n }\n }\n}\n$e=0;\nfor($i=0;$i$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}"}, {"source_code": "$b[1]||$b[0]<$b[1]))\necho \"1\";\nfor($i=0;$i$b[$i]){\n $temp=$b[$j];\n $b[$j]=$b[$i];\n $b[$i]=$temp;\n }\n }\n}\n$e=0;\nfor($i=0;$i$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}\n"}, {"source_code": "$b[$i]){\n $b[$i]=$b[$j];\n }\n }\n}\n$e=0;\nfor($i=0;$i$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}"}, {"source_code": "$b[1]||$b[0]<$b[1])\necho \"1\";\nfor($i=0;$i$b[$i]){\n $temp=$b[$j];\n $b[$j]=$b[$i];\n $b[$i]=$temp;\n }\n }\n}\n$e=0;\nfor($i=0;$i$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}\n"}, {"source_code": "$b[1]||$b[0]<$b[1])\necho \"1\";\nfor($i=0;$i$b[$i]){\n $b[$i]=$b[$j];\n }\n }\n}\n$e=0;\nfor($i=1;$i<=count($b);$i++){\n if($e>$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}\n"}, {"source_code": "$b[1]||$b[0]<$b[1])\necho \"1\";\nfor($i=0;$i$b[$i]){\n $temp=$b[$j];\n $b[$i+1]=$b[$i];\n $b[$i]=$temp;\n }\n }\n}\n$e=0;\nfor($i=0;$i$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}\n"}, {"source_code": "$b[$i]){\n $b[$i]=$b[$j];\n }\n }\n}\n$e=0;\nfor($i=0;$i$d){\n echo $i;\n break;\n }\n else\n $e+=$b[$i];\n}"}, {"source_code": " ( $sum - $sub )){\n\t\t\techo $x;\n\t\t\tbreak;\n\t\t}\n\t}"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\tarsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_sum = $sum;\n\t$pos = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum -= $inp_arr[$i];\n\t\t$pos = $i;\n\t\tif ($temp_sum < (int)$sum / 2) break;\n\t}\n\tprintf(\"%d\", $pos + 1);\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\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\tarsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_sum = 0;\n\t$pos = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum += $inp_arr[$i];\n\t\t$pos = $i;\n\t\tif ($temp_sum > $sum - $temp_sum) break;\n\t}\n\tprintf(\"%d\", $pos + 1);\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\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\tarsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_sum = $sum;\n\t$pos = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum += $inp_arr[$i];\n\t\t$pos = $i;\n\t\tif ($temp_sum > $sum - $temp_sum) break;\n\t}\n\tprintf(\"%d\", $pos + 1);\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\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\tarsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_sum = 0;\n\t$c = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum += $inp_arr[$i];;\n\t\t$c++;\n\t\tif ($temp_sum > $sum - $temp_sum) break;\n\t}\n\tprintf(\"%d\", $c);\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\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\tarsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_pos = 0;\n\t$temp_sum = $sum;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum -= $inp_arr[$i];\n\t\t$pos = $i;\n\t\tif ($temp_sum < (int)$sum / 2) break;\n\t}\n\tprintf(\"%d\", $pos + 1);\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\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\tarsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_sum = $sum;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum -= $inp_arr[$i];\n\t\t$pos = $i;\n\t\tif ($temp_sum < (int)$sum / 2) break;\n\t}\n\tprintf(\"%d\", $pos + 1);\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\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$inp_arr[] = (int)$Scanner->Scan();\n\t}\n\tarsort($inp_arr);\n\t$sum = array_sum($inp_arr);\n\t$temp_sum = $sum;\n\t$pos = 0;\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t$temp_sum -= $inp_arr[$i];\n\t\t$pos = $i;\n\t\tif ($temp_sum < $sum - $temp_sum) break;\n\t}\n\tprintf(\"%d\", $pos + 1);\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": " $target) {\n\t\techo $counter;\n\t\texit;\n\t}\n}\n\n?>"}, {"source_code": " $value) {\n $mcount += 1;\n $summ += $value;\n if($summ > $need) break;\n}\n\necho $mcount;"}, {"source_code": " 0)\n\t{\n\n\t\tif($temp > $left)\n\t\t\tbreak;\n\t\telse\n\t\t{\n\t\t\t$temp = $temp + $coins[$i];\n\t\t\t$left = $left - $temp;\n\t\t\t$take++;\n\t\t}\n\t\t$i++;\n\t\t$coin_count--;\n\t}\n\techo $take;\n?>"}, {"source_code": " 0)\n\t{\n\n\t\tif($temp > $left)\n\t\t\tbreak;\n\t\telse\n\t\t{\n\t\t\t$temp = $temp + $count[$i];\n\t\t\t$left = $left - $temp;\n\t\t\t$take++;\n\t\t}\n\t\t$i++;\n\t\t$coin_count--;\n\t}\n\techo $take;\n?>"}, {"source_code": "\n= 0; $j--){\n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n \n else ($a == 0);\n break;\n \n \n \n }\n if ($a > 0)\n echo ($t + 1);\n else \n echo ($t);\n }\n "}, {"source_code": "\n= 0; $j--){\n if ($a-$arr[$j] > 0)\n $a = $a - $arr[$j];\n $t++;\n if ($a - $arr[$j+1] > 0)\n continue;\n else if ($a - $arr[$j+1] < 0)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n if ($a > 0)\n echo ($t + 1);\n else \n echo ($t);\n }\n "}, {"source_code": "\n= 0; $j--){\n \n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n \n else if ($a == 0)\n break;\n \n \n \n }\n if ($a > 0){\n $t++;\n echo ($t);}\n else \n echo ($t);\n \n }\n "}, {"source_code": "= 0; $j--){\n $a = $a - $arr[$j];\n $t++;\n if ($a - $arr[$j+1] > 0)\n continue;\n else if ($a - $arr[$j+1] < 0)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n echo($t);"}, {"source_code": "= 0; $j--){\n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n \n else if ($a - $arr[$j+1] < 0)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n echo($t);"}, {"source_code": "= 0; $j--){\n \n if ($a-$arr[$j] >= 0){\n $a = $a - $arr[$j];\n $t++;}\n \n //else if ($a == 0)\n // break;\n \n \n \n }\n if ($a > 0){\n $t++;\n echo ($t);}\n else \n echo ($t);\n \n }\n "}, {"source_code": "= 0; $j--){\n $sum = $sum + $arr[$j];\n $cnt++;\n // $a = $a - $arr[$j];\n if ($sum > intval($a / 2)) break;\n // if ($a-$arr[$j] > 0){\n // $a = $a - $arr[$j];\n // $t++;}\n // else if ($a - $arr[$j+1] > 0)\n // continue;\n // else if ($a - $arr[$j+1] < 0)\n // $j++;\n // else ($a == 0);\n // break;\n \n \n \n }\n echo($cnt);"}, {"source_code": "\n= 0; $j--){\n \n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n \n else if ($a == 0)\n break;\n \n \n \n }\n if ($a > 0){\n $t++;\n echo ($t);}\n else \n echo ($t);\n }\n \n "}, {"source_code": "\n= 0; $i--) {\n $t = $t + $arr[$i];\n $a = $a - $arr[$i];\n if ($t > $a) {\n echo $c - $i;\n break;\n }\n }\n \n// if ($a % 2 == 0)\n// $a = $a / 2 +1;\n// else\n// $a = intval($a / 2) + 1;\n// sort($arr);\n// if ($a < max($arr))\n// echo (\"1\");\n// else{\n\n// for ($j = $c - 1 ; $j >= 0; $j--){\n// echo ($arr[$j] . \" \");\n// if ($a-$arr[$j] >= 0){\n// $a = $a - $arr[$j];\n// $t++;}\n \n \n \n \n// }\n// // if ($a > 0){\n// //$t++;\n// //echo ($t);}\n// //else \n// //echo ($t);\n \n// }\n ?>"}, {"source_code": "\n= 0; $j--){\n \n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n \n else if ($a == 0)\n break;\n \n \n \n }\n if ($a > 0){\n $t++;\n echo ($t);}\n else \n echo ($t);\n \n \n "}, {"source_code": "\n= 0; $j--){\n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n else if ($a - $arr[$j+1] > 0)\n continue;\n else if ($a - $arr[$j+1] < 0)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n if ($a > 0)\n echo ($t + 1);\n else \n echo ($t);\n }\n \n "}, {"source_code": "\n= 0; $i--) {\n $t = $t + $arr[$i];\n $a = $a - $arr[$i];\n if ($t > $a) {\n echo $c - $i;\n break;\n }\n }\n \n// if ($a % 2 == 0)\n// $a = $a / 2 +1;\n// else\n// $a = intval($a / 2) + 1;\n// sort($arr);\n// if ($a < max($arr))\n// echo (\"1\");\n// else{\n\n// for ($j = $c - 1 ; $j >= 0; $j--){\n// echo ($arr[$j] . \" \");\n// if ($a-$arr[$j] >= 0){\n// $a = $a - $arr[$j];\n// $t++;}\n \n \n \n \n// }\n// // if ($a > 0){\n// //$t++;\n// //echo ($t);}\n// //else \n// //echo ($t);\n \n// }\n "}, {"source_code": "\n= 0; $j--){\n \n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n \n else if ($a == 0)\n break;\n \n \n \n }\n if ($a > 0){\n $t++;\n echo ($t);}\n else \n echo ($t);\n \n }\n "}, {"source_code": "= 0; $j--){\n $sum = $sum + $arr[$j];\n $cnt++;\n if ($sum > $a) break;\n // if ($a-$arr[$j] > 0){\n // $a = $a - $arr[$j];\n // $t++;}\n // else if ($a - $arr[$j+1] > 0)\n // continue;\n // else if ($a - $arr[$j+1] < 0)\n // $j++;\n // else ($a == 0);\n // break;\n \n \n \n }\n echo($cnt);"}, {"source_code": "= 0; $j--){\n if ($a-$arr[$j] > 0)\n $a = $a - $arr[$j];\n $t++;\n if ($a - $arr[$j+1] > 0)\n continue;\n else if ($a - $arr[$j+1] < 0)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n echo($t);"}, {"source_code": "= 0; $j--){\n $sum = $sum + $arr[$j];\n $cnt++;\n // $a = $a - $arr[$j];\n if ($sum > $a / 2) break;\n // if ($a-$arr[$j] > 0){\n // $a = $a - $arr[$j];\n // $t++;}\n // else if ($a - $arr[$j+1] > 0)\n // continue;\n // else if ($a - $arr[$j+1] < 0)\n // $j++;\n // else ($a == 0);\n // break;\n \n \n \n }\n echo($cnt);"}, {"source_code": "\n= 0; $j--){\n \n if ($a-$arr[$j] >= 0){\n $a = $a - $arr[$j];\n $t++;}\n \n //else if ($a == 0)\n // break;\n \n \n \n }\n if ($a > 0){\n $t++;\n echo ($t);}\n else \n echo ($t);\n \n }\n "}, {"source_code": "= 0; $j--){\n $sum = $sum + $arr[$j];\n $cnt++;\n $a = $a - $arr[$j];\n if ($sum > $a) break;\n // if ($a-$arr[$j] > 0){\n // $a = $a - $arr[$j];\n // $t++;}\n // else if ($a - $arr[$j+1] > 0)\n // continue;\n // else if ($a - $arr[$j+1] < 0)\n // $j++;\n // else ($a == 0);\n // break;\n \n \n \n }\n echo($cnt);"}, {"source_code": "= 0; $j--){\n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n else if ($a - $arr[$j+1] > 0)\n continue;\n else if ($a - $arr[$j+1] < 0)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n echo($t);"}, {"source_code": "= 0; $j--){\n if ($a-$arr[$j] > 0){\n $a = $a - $arr[$j];\n $t++;}\n \n else if ($a - $arr[$j+1] < -1)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n echo($t);"}, {"source_code": "\n= 0; $j--){\n if ($a-$arr[$j] > 0)\n $a = $a - $arr[$j];\n $t++;\n if ($a - $arr[$j+1] > 0)\n continue;\n else if ($a - $arr[$j+1] < 0)\n $j++;\n else ($a == 0);\n break;\n \n \n \n }\n if ($a > 0)\n echo ($t + 1);\n else \n echo ($t);\n ?>"}, {"source_code": " ($summ/2)) {\n echo $result;\n die();\n }\n}\n?>"}, {"source_code": " ($summ/2)) {\n echo $result;\n die();\n }\n}\n?>"}, {"source_code": " $all_sum - $sum)\n {\n break;\n }\n }\n echo $count;\n?>"}, {"source_code": " $all_sum - $sum)\n {\n break;\n }\n }\n echo $count;\n?>"}, {"source_code": "= $all_sum - $sum)\n {\n break;\n }\n }\n echo $count;\n?>"}, {"source_code": " $all_sum - $sum)\n {\n echo $count;\n break;\n }\n } \n?>"}], "src_uid": "ee535e202b7662dbaa91e869c8c6cee1"} {"source_code": "", "positive_code": [{"source_code": " $x2) and ($y1 > $y2)){ \n $x3 = $x2;\n $x4 = $x1;\n $y3 = $y1;\n $y4 = $y2;\n} elseif (($x1 < $x2) and ($y1 > $y2)){ \n $x3 = $x1;\n $x4 = $x2;\n $y3 = $y2;\n $y4 = $y1;\n} elseif (($x1 > $x2) and ($y1 < $y2)){ \n $x3 = $x2;\n $x4 = $x1;\n $y3 = $y1;\n $y4 = $y2;\n} \n\n$maxx = max($x1, $x2, $x3, $x4);\n$maxy = max($y1, $y2, $y3, $y4);\n$minx = min($x1, $x2, $x3, $x4);\n$miny = min($y1, $y2, $y3, $y4);\nif (($maxx - $minx) != ($maxy - $miny)) {\n echo \"-1\";\n} else {\n echo \"$x3 $y3 $x4 $y4\";\n}\n\n?>"}, {"source_code": "$n[1])echo $n[0].\" \".($n[1]+$y).\" \".$n[2].\" \".($n[3]-$y);\n elseif($n[1]>$n[3])echo $n[0].\" \".($n[1]-$y).\" \".$n[2].\" \".($n[3]+$y);\n}\nelse echo \"-1\";\n?>"}], "negative_code": [{"source_code": ""}], "src_uid": "71dea31e1244797f916adf5f526f776e"} {"source_code": " $n1) {\n $n2 = $n1;\n $rest1 = $rest1 - $n1;\n } else {\n $n2 = $rest1;\n $rest1 = 0;\n }\n \n if ($rest1 > 4) {\n return \"-1\";\n } else if ($rest1) {\n $res .='1'; $rest1--;\n if ($rest1) {\n $res .='1'; $rest1--;\n }\n }\n \n for ($i = 0; $i < $c0; $i++) {\n $res .='0';\n if ($n1) {\n $res .='1'; $n1--;\n }\n if ($n2) {\n $res .='1'; $n2--;\n }\n }\n \n if ($rest1) { $res .='1'; $rest1--; };\n if ($rest1) { $res .='1'; $rest1--; };\n return $res;\n};\n\necho solve($c0, $c1, $res), \"\\n\";", "positive_code": [{"source_code": " $b)\n{\n $c = $a - $b;\n if($c > 1)\n {\n print \"-1\";\n }\n else\n {\n $d = \"\";\n for($x = 1; $x <= $b; $x++)\n {\n $d .= \"01\";\n }\n print $d . \"0\";\n }\n}\nelseif($a < $b)\n{\n if($a == 1)\n {\n if($b > 4)\n {\n print \"-1\";\n }\n else\n {\n if($b == 1)\n {\n print \"10\";\n }\n elseif($b == 2)\n {\n print \"101\";\n }\n elseif($b == 3)\n {\n print \"1101\";\n }\n elseif($b == 4)\n {\n print \"11011\";\n }\n }\n }\n else\n {\n $c = $a - 1;\n $d = 4 + ($c * 2);\n if($b > $d)\n {\n print \"-1\";\n }\n else\n {\n $j = floor($b / $a);\n if($j >= 2)\n {\n $e = floor($b / 2);\n $f = $b % 2;\n $g = \"\";\n $h = \"110\";\n for($x = 1; $x <= $a; $x++)\n {\n $g .= $h;\n } \n $i = $e - $a;\n if($i > 0)\n {\n print $g . \"11\";\n }\n if($f > 0)\n {\n print $g . \"1\";\n }\n if(($i == 0) && ($f == 0))\n {\n print $g;\n }\n }\n else\n {\n $e = floor($b / 2);\n $f = $b % 2;\n $g = \"\";\n $h = \"110\";\n $i = $a;\n $j = $b;\n $k = \"10\";\n $l = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($i != $j)\n {\n $g .= $h;\n }\n else\n {\n $g .= $k;\n $l = 1;\n }\n if($l == 0)\n {\n $i -= 1;\n $j -= 2;\n }\n } \n print $g;\n }\n }\n }\n}\nelseif($a == $b)\n{\n $c = \"\";\n for($x = 1; $x <= $a; $x++)\n {\n $c .= \"01\";\n }\n print $c;\n}\n?>"}], "negative_code": [{"source_code": " $n1) {\n $n2 = $n1;\n $rest1 = $rest1 - $n1;\n } else {\n $n2 = $rest1;\n $rest1 = 0;\n }\n \n if ($rest1 > 4) {\n return array(-1);\n } else if ($rest1) {\n echo '1'; $rest1--;\n if ($rest1) {\n echo '1'; $rest1--;\n }\n }\n \n for ($i = 0; $i < $c0; $i++) {\n echo '0';\n if ($n1) {\n echo '1'; $n1--;\n }\n if ($n2) {\n echo '1'; $n2--;\n }\n }\n \n if ($rest1) { echo '1'; $rest1--; };\n if ($rest1) { echo '1'; $rest1--; };\n \n //return $res;\n};\n\n$res = $solve($c0, $c1);"}], "src_uid": "854c561539596722b1dbc8f99cbdca78"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " \"++\", 1 => $ex[$x][1]);\n $replace=array_replace($ex, $rep1);\n $yes=1;\n break;\n }elseif ($ex[$x][1] == \"OO\") {\n $rep1[$x]=array(0 => $ex[$x][0], 1 => \"++\");\n $replace=array_replace($ex, $rep1);\n $yes=1;\n break;\n }\n for ($f=0; $f < $numofsets; $f++) {\n $im[]=implode(\"|\", $replace[$f]);\n }\nif ($yes == 1) {\n echo \"YES\".PHP_EOL;\n echo implode(PHP_EOL ,$im);\n}else echo \"NO\";\n?>"}, {"source_code": " $value) {\n echo $value.\"\\n\";\n }\n}else{\n echo \"NO\";\n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "e77787168e1c87b653ce1f762888ac57"} {"source_code": "$max){$r++;$max=$a[$i];}\n}\nprint $r;\n?>", "positive_code": [{"source_code": " $max)\n {\n $max = $score[$c];\n $result++;\n }\n}\nprintf(\"$result\\n\");\n?>"}, {"source_code": "$max) {\n\t\t$nice++;\n\t\t$max = $mas[$i];\n\t}\n\tif($mas[$i] < $min) {\n\t\t$nice++;\n\t\t$min = $mas[$i];\n\t}\n}\necho $nice;"}, {"source_code": "$max)\n {\n $max = $results[$i];\n $GG++;\n }\n elseif ($results[$i]<$min)\n {\n $min = $results[$i];\n $GG++;\n }\n}\necho $GG;"}, {"source_code": " $max){\n\t\t$max = $points[$i];\n\t\t$countTrue++;\n\t}\n\tif( $points[$i] < $min){\n\t\t$min = $points[$i];\n\t\t$countTrue++;\n\t}\n}\necho $countTrue;\nfclose($fp);\n?>"}, {"source_code": "$max){\n \t\t$max=$arr[$i];\n \t\t$count++;\n \t}\n \telseif ($arr[$i]<$min) {\n \t\t$min=$arr[$i];\n \t\t$count++;\n \t}\n }\n echo \"$count\";\n\n\n\n//echo $count;"}, {"source_code": " $sravnenie_plus) {\n $shock += 1;\n $sravnenie_plus = $v;\n }\n if ($v < $sravnenie_minus) {\n $shock += 1;\n $sravnenie_minus = $v;\n }\n}\n\necho $shock;"}, {"source_code": " $max){\n\t\t$a++;\n\t\t$max = $x[$i];\n\t}\n}\necho $a;\n?>"}, {"source_code": " max(array_slice($mas, 0, $i)) || $mas[$i] < min(array_slice($mas, 0, $i)))\n $k++;\n}\necho $k;\n\n\n?>"}, {"source_code": " $value) {\n if ($min > (int) $value) {\n $min = $value;\n $out ++;\n }\n\n if ($max < (int) $value) {\n $max = $value;\n $out ++;\n }\n}\n\necho $out;\n\n?>"}, {"source_code": " $max) {\n //echo 'in: '.$in[$i].' max:'.$max.\"\\n\";\n $max = $in[$i];\n $cool++;\n } \n if ($in[$i] < $min) {\n //echo 'in: '.$in[$i].' max:'.$max.\"\\n\";\n $min = $in[$i];\n $cool++;\n }\n}\n\necho $cool;\n"}, {"source_code": " $max){\n $max = $temp;\n $count++;\n }\n}\necho $count;"}, {"source_code": "$max) { $max=$cur; $res++;}\n if ($cur<$min) { $min=$cur; $res++;}\n}\necho $res;\n?>"}, {"source_code": " $c)\n {\n $e++;\n $c = $b[$x];\n }\n elseif($b[$x] < $d)\n {\n $e++;\n $d = $b[$x];\n }\n}\nprint $e;\n?>"}, {"source_code": " $max) {\n $max = $results[$i];\n $amazing++;\n }elseif($results[$i] < $min) {\n $min = $results[$i];\n $amazing++;\n }\n }\n echo $amazing;\n?>"}, {"source_code": "nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_arr = $Token->nextIntArray();\n\n\t$temp_max = $inp_arr[0];\n\t$temp_min = $inp_arr[0];\n\t$temp_c = 0;\n\t$AMAIZING = 0;\n\tforeach ($inp_arr as $as_i) {\n\t\t$temp_c++;\n\t\tif ($temp_c == 1) continue;\n\t\t\n\t\tif ($temp_max < $as_i) {\n\t\t\t$temp_max = $as_i;\n\t\t\t$AMAIZING++;\n\t\t} elseif ($temp_min > $as_i) {\n\t\t\t$temp_min = $as_i;\n\t\t\t$AMAIZING++;\n\t\t}\n\t}\n\n\tprintf(\"%d\", $AMAIZING);\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 $_\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/*\t\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}\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": " $local_max) {\n $local_max = $e;\n $magix++;\n }\n}\nfputs(STDOUT, $magix);\n"}, {"source_code": " $max) {\n\t\t$max = $number;\n\t\t$result++;\n\t}\n}\n\necho $result . PHP_EOL;"}, {"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\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$n = $dxs->G();\n$frst = $dxs->G();\n$min = $frst; $max = $frst;$ret = 0;\nfor($i=1;$i<$n;$i++){$x=$dxs->G();\n\tif($x<$min){$min = $x;$ret++;}else if($x>$max){$max=$x;$ret++;}\n}\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\necho $ret;\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": " $value) {\n $numbers[$key] = intval($value);\n}\n\n$counter = 0;\n$array = array();\n\nfor($i=0; $i $value) {\n if ($key == 0) {\n $recordhigh = $value;\n $recordlow = $value;\n }\n if ($value > $recordhigh) {\n $recordhigh = $value;\n $amazing++;\n }\n if ($value < $recordlow) {\n $recordlow = $value;\n $amazing++;\n }\n}\necho $amazing;\n?>"}], "negative_code": [{"source_code": "nextInt();\n\t$Token = new Token(rtrim(fgets(STDIN)), \" \");\n\t$inp_arr = $Token->nextIntArray();\n\n\t$temp_max = $inp_arr[1];\n\t$temp_min = $inp_arr[1];\n\t$temp_c = 0;\n\t$AMAIZING = 0;\n\tforeach ($inp_arr as $as_i) {\n\t\t$temp_c++;\n\t\tif ($temp_c == 1) continue;\n\t\t\n\t\tif ($temp_max < $as_i) {\n\t\t\t$temp_max = $as_i;\n\t\t\t$AMAIZING++;\n\t\t} elseif ($temp_min > $as_i) {\n\t\t\t$temp_min = $as_i;\n\t\t\t$AMAIZING++;\n\t\t}\n\t}\n\n\tprintf(\"%d\", $AMAIZING);\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 $_\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/*\t\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}\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": "$max)\n {\n $max=$score[$c];\n $result++;\n } \n printf ( \"min=%d max=%d score=%d\\n\" ,$min, $max, $score[$c]);\n}\nprintf (\"$result\\n\");\n?>"}, {"source_code": "$max)\n {\n $max=$score[$c];\n $result++;\n } \n}\nprintf (\"$result\\n\");\n?>"}, {"source_code": " $max){\n\t\t$a++;\n\t\t$max = $curr;\n\t}\n}\necho $a;\n?>"}, {"source_code": " $max){\n\t\t$a++;\n\t\t$max = $curr;\n\t}\n}\necho $a;\n?>"}, {"source_code": "$max){$r++;$max=$a[$i];}\n}\nprint $r;\n?>"}, {"source_code": " $max){\n $max = $temp;\n $count++;\n }\n echo $temp.'\\n';\n}\necho $count;"}, {"source_code": " $max){\n $count++;\n }\n}\necho $count;"}, {"source_code": " $max){\n $max = $temp;\n $count++;\n }\n}\necho $count;"}, {"source_code": " $local_max) {\n $local_max = $e;\n $magix++;\n }\n }\n}\nfputs(STDOUT, $magix);\n"}, {"source_code": " $local_max) {\n $local_max = $e;\n $magix++;\n }\n }\n}\nfputs(STDOUT, $magix);\n"}, {"source_code": " $local_max) {\n $local_max = $e;\n $magix++;\n }\n }\n}\nprint $magix;\n"}, {"source_code": " $local_max) {\n $local_max = $e;\n $magix++;\n }\n }\n}\nprint $magix;\n"}], "src_uid": "a61b96d4913b419f5715a53916c1ae93"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "03fcf7402397b94edd1d1837e429185d"} {"source_code": " $opt) {\n\t\t\t$opt = $F[$i][$j];\n\t\t\t$ri = $i;\n\t\t\t$rj = $j;\n\t\t}\n$result = array();\nfor ($x = 2 * $n - 2; $x > 0; $x--) {\n\t$result[$x + 1] = $rj;\n\t$tmp = $last[$x][$ri][$rj];\n\t$rj = $ri;\n\t$ri = $tmp;\n}\n$result[0] = $ri;\n$result[1] = $rj;\n\nprint(($n * $m - $opt).\"\\n\");\nfor ($i = 0; $i < $n; $i++) {\n\tfor ($j = 0; $j < $m; $j++) {\n\t\t$k = $i * 2 + $j % 2;\n\t\tprint(chr(ord('a') + $p[$k][$result[$k]][0]));\n\t}\n\tprint(\"\\n\");\n}\n\nfwrite(STDERR, (microtime(true) - $starttime).\"\\n\");\n\n?>\n", "positive_code": [{"source_code": " $opt) {\n\t\t\t$opt = $F[$i][$j];\n\t\t\t$ri = $i;\n\t\t\t$rj = $j;\n\t\t}\n$result = array();\nfor ($x = 2 * $n - 2; $x > 0; $x--) {\n\t$result[$x + 1] = $rj;\n\t$tmp = $last[$x][$ri][$rj];\n\t$rj = $ri;\n\t$ri = $tmp;\n}\n$result[0] = $ri;\n$result[1] = $rj;\n\nprint(($n * $m - $opt).\"\\n\");\nfor ($i = 0; $i < $n; $i++) {\n\tfor ($j = 0; $j < $m; $j++) {\n\t\t$k = $i * 2 + $j % 2;\n\t\tprint(chr(ord('a') + $p[$k][$result[$k]][0]));\n\t}\n\tprint(\"\\n\");\n}\n\nfwrite(STDERR, (microtime(true) - $starttime).\"\\n\");\n\n?>\n"}], "negative_code": [], "src_uid": "3d0f48efce839200f432d62ce1fe1881"} {"source_code": "", "positive_code": [{"source_code": "=0; $i-=$k) {\n $ans += 2*($arr[$i]-1);\n}\necho $ans;\n?>"}, {"source_code": "=0;$i-=$k){\n\t$ans+=2*($f[$i]-1);\n}\necho $ans;\n?>"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": " 0)\n {\n $a[$i] += $inc;\n $change += $inc;\n }\n}\necho $change . \"\\n\";\nfor ($i = 0; $i < $n; ++$i)\n{\n echo $a[$i] . \" \";\n}\n\n?>"}, {"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\tlist($daysCount, $needHour) = readStringExplodeNum($stream, ' ', true);\n\t$datesPlan = readStringExplodeNum($stream, ' ', true);\n\t$totalAddHours = 0;\n\n\tfor ($i = 1; $i < $daysCount; $i++) {\n\t\tif ($datesPlan[$i] + $datesPlan[$i - 1] < $needHour) {\n\t\t\t$addHour = $needHour - ($datesPlan[$i] + $datesPlan[$i - 1]);\n\t\t\t$datesPlan[$i]+=$addHour;\n\t\t\t$totalAddHours+=$addHour;\n\t\t}\n\t}\n\techo $totalAddHours . \"\\r\\n\";\n\techo implode(' ', $datesPlan);\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\tlist($daysCount, $needHour) = readStringExplodeNum($stream, ' ', true);\n\t$datesPlan = readStringExplodeNum($stream, ' ', true);\n\t$totalAddHours = 0;\n\t\n\tfor ($i = 0; $i < $daysCount - 1; $i++) {\n\t\tif ($datesPlan[$i] + $datesPlan[$i + 1] >= $needHour) {\n\t\t\tcontinue;\n\t\t} else {\n\t\t\tif ($i + 2 < $daysCount) {\n\t\t\t\tif ($datesPlan[$i + 1] + $datesPlan[$i + 2] >= $needHour) {\n\t\t\t\t\t$addHours = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t\t$totalAddHours+=$addHours;\n\t\t\t\t\t$datesPlan[$i]+=$addHours;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$addForRight = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t\t$addForLeft = $needHour - ($datesPlan[$i + 1] + $datesPlan[$i + 2]);\n\t\t\t\t\t$addHours = max($addForRight, $addForLeft);\n\t\t\t\t\t$totalAddHours+=$addHours;\n\t\t\t\t\t$datesPlan[$i+1]+=$addHours;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$addHours = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t$totalAddHours+=$addHours;\n\t\t\t\t$datesPlan[$i]+=$addHours;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\techo $totalAddHours . \"\\r\\n\";\n\techo implode(' ', $datesPlan);\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\tlist($daysCount, $needHour) = readStringExplodeNum($stream, ' ', true);\n\t$datesPlan = readStringExplodeNum($stream, ' ', true);\n\t$totalAddHours = 0;\n\n\tfor ($i = 0; $i < $daysCount - 1; $i++) {\n\t\tif ($datesPlan[$i] + $datesPlan[$i + 1] >= $needHour) {\n\t\t\tcontinue;\n\t\t} else {\n\t\t\tif ($i + 2 < $daysCount) {\n\t\t\t\t$addForThis = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t$addForNext = $needHour - ($datesPlan[$i + 1] + $datesPlan[$i + 2]);\n\t\t\t\tif ($datesPlan[$i + 1] + $datesPlan[$i + 2] >= $needHour) {\n\t\t\t\t\t$addHours = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t\t$totalAddHours+=$addHours;\n\t\t\t\t\t$datesPlan[$i]+=$addHours;\n\t\t\t\t} else {\n\t\t\t\t\tif ($i == 0) {\n\t\t\t\t\t\t$addForRight = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t\t\t$addForLeft = $needHour - ($datesPlan[$i + 1] + $datesPlan[$i + 2]);\n\t\t\t\t\t\t$addHours = max($addForRight, $addForLeft);\n\t\t\t\t\t\t$totalAddHours+=$addHours;\n\t\t\t\t\t\t$datesPlan[$i + 1]+=$addHours;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$addForRight = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t\t\t$addForLeft = $needHour - ($datesPlan[$i + 1] + $datesPlan[$i + 2]);\n\t\t\t\t\t\t$addHours = min($addForRight, $addForLeft);\n\t\t\t\t\t\t$totalAddHours+=$addHours;\n\t\t\t\t\t\t$datesPlan[$i + 1]+=$addHours;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$addHours = $needHour - ($datesPlan[$i] + $datesPlan[$i + 1]);\n\t\t\t\t$totalAddHours+=$addHours;\n\t\t\t\t$datesPlan[$i]+=$addHours;\n\t\t\t}\n\t\t}\n\t}\n\techo $totalAddHours . \"\\r\\n\";\n\techo implode(' ', $datesPlan);\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "src_uid": "1956e31a9694b4fd7690f1a75028b9a1"} {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = max($n, $k[count($k) - 1]);\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n}\n?>", "positive_code": [{"source_code": " $item) {\n if ($i && $item === null) {\n $n--;\n }\n $arr[$i] = $n;\n}\necho implode(' ', $arr);\n"}, {"source_code": " $item) {\n if ($i && $item === null) {\n $n--;\n }\n echo ($i ? ' ' : ('YES' . PHP_EOL)) . $n;\n}\n"}, {"source_code": " $item) {\n if ($i && $item === null) {\n $n--;\n }\n echo ($i ? ' ' : '') . $n;\n}\n"}], "negative_code": [{"source_code": " 1)\n{\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n}\nfor($x = 1; $x < count($e); $x++)\n{\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n}\nif($k[count($k) - 1] != $a)\n{\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n}\n$o = array();\n$p = 1000;\n$q = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n}\n$r = 0;\nfor($x = 0; $x < count($c); $x++)\n{\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n}\nif($r == 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(($a == 1000) && ($b == 1000) && (a == 713))\n {\n $o = array_slice($o, 100);\n print implode(\" \", $o);\n }\n else\n {\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n if(($a == 1000) && ($b == 1000))\n {\n $q2 = array_slice($q, 100, 100);\n print implode(\" \", $q2);\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n};\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n};\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO1\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": "= 0; $x--)\n {\n print $e[$x] . \" \" . $k[$x] . \"\\n\";\n }\n }\n $l = array();\n $m = array();\n $n = $k[0];\n if($e[0] > 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n if(($a == 1000) && ($b == 1000))\n {\n print array_slice($q, 100, 200);\n print implode(\" \", $q);\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n }\n}\n?>"}, {"source_code": " 1)\n{\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n}\nfor($x = 1; $x < count($e); $x++)\n{\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n}\nif($k[count($k) - 1] != $a)\n{\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n}\n$o = array();\n$p = 1000;\n$q = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n}\n$r = 0;\nfor($x = 0; $x < count($c); $x++)\n{\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n}\nif($r == 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(($a == 1000) && ($b == 1000) && (a == 713))\n {\n for($x = 0; $x < count($e); $x++)\n {\n print $e[$x] . \"-\" . $k[$x] . \"\\n\";\n }\n print implode(\" \", $o);\n }\n else\n {\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif(count($n) == 0)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n $q = array();\n $r = 1000;\n $s = 0;\n $t = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n print implode(\" \", $q);\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n};\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\\n\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n $q = array();\n $r = 1000;\n $s = 0;\n $t = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n print implode(\" \", $q);\n}\n?>"}, {"source_code": " 1)\n{\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n}\nfor($x = 1; $x < count($e); $x++)\n{\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n}\nif($k[count($k) - 1] != $a)\n{\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n}\n$o = array();\n$p = 1000;\n$q = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n}\n$r = 0;\nfor($x = 0; $x < count($c); $x++)\n{\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n}\nif($r == 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n print implode(\" \", $o);\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n if(($a == 1000) && ($b == 1000) && (a == 713))\n {\n for($x = 0; $x < count($l); $x++)\n {\n print $l[$x] . \" \" . $m[$x] . \"\\n\";\n }\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n }\n}\n?>"}, {"source_code": " 1)\n{\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n}\nfor($x = 1; $x < count($e); $x++)\n{\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n}\nif($k[count($k) - 1] != $a)\n{\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n}\n$o = array();\n$p = 1000;\n$q = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n}\n$r = 0;\nfor($x = 0; $x < count($c); $x++)\n{\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n}\nif($r == 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n if(($a == 1000) && ($b == 1000) && (a == 713))\n {\n for($x = 0; $x < count($e); $x++)\n {\n print $l[$x] . \"-\" . $m[$x] . \"\\n\";\n }\n print implode(\" \", $o);\n }\n else\n {\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n if(($a == 1000) && ($b == 1000))\n {\n $q2 = array_slice($q, 100, 100);\n print implode(\" \", $q2);\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif(count($n) == 0)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n $q = array();\n $r = 1;\n $s = 0;\n $t = 0;\n $u = 1000001;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y <= $o[$s]; $y++)\n {\n $q[count($q)] = $u;\n $u--;\n }\n $x = $y - 1;\n $s++;\n $r = $q[count($q) - 1];\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n print implode(\" \", $q);\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n if(($a == 1000) && ($b == 1000) && (a == 713))\n {\n $o = array_slice($o, 947);\n }\n else\n {\n print implode(\" \", $o);\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n if(($a == 1000) && ($b == 1000) && (a == 713))\n {\n $o = array_slice($o, 947);\n print implode(\" \", $o);\n }\n else\n {\n print implode(\" \", $o);\n }\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " 1)\n{\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n}\nfor($x = 1; $x < count($e); $x++)\n{\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n}\nif($k[count($k) - 1] != $a)\n{\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n}\n$o = array();\n$p = 1000;\n$q = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n}\n$r = 0;\nfor($x = 0; $x < count($c); $x++)\n{\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n}\nif($r == 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n print implode(\" \", $o);\n}\n?>"}, {"source_code": " 100))\n {\n print $g . \" \" . $h . \" \" . $i . \"\\n\";\n }\n if($g == 0)\n {\n $c[count($c)] = $h;\n $d[count($d)] = $i;\n }\n elseif($g == 1)\n {\n $e[count($e)] = $h;\n $f[count($f)] = $i;\n }\n}\nasort($e);\n$j = array_keys($e);\nsort($e);\n$k = array();\nfor($x = 0; $x < count($e); $x++)\n{\n $k[$x] = $f[$j[$x]];\n}\n$l = array();\n$m = array();\n$n = $k[0];\nif($e[0] > 1)\n{\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n}\nfor($x = 1; $x < count($e); $x++)\n{\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n}\nif($k[count($k) - 1] != $a)\n{\n $l[count($l)] = $k[count($k) - 1];\n $m[count($m)] = $a;\n}\n$o = array();\n$p = 1000;\n$q = 0;\nfor($x = 1; $x <= $a; $x++)\n{\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n}\n$r = 0;\nfor($x = 0; $x < count($c); $x++)\n{\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n}\nif($r == 1)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\\n\";\n print implode(\" \", $o);\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n};\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] > $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " 1)\n {\n $l[count($l)] = 1;\n $m[count($m)] = $e[0];\n }\n for($x = 1; $x < count($e); $x++)\n {\n if($e[$x] <= $n)\n {\n if($k[$x] > $n)\n {\n $n = $k[$x];\n }\n }\n elseif($e[$x] > $n)\n {\n $l[count($l)] = $n;\n $m[count($m)] = $e[$x];\n $n = $k[$x];\n }\n }\n if($k[count($k) - 1] != $a)\n {\n $l[count($l)] = max($n, $k[count($k) - 1]);\n $m[count($m)] = $a;\n }\n if(($a == 1000) && ($b == 1000) && (a == 713))\n {\n for($x = 0; $x < count($l); $x++)\n {\n print $l[$x] . \" \" . $m[$x] . \"\\n\";\n }\n }\n $o = array();\n $p = $a;\n $q = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($x == $l[$q])\n {\n for($y = $l[$q]; $y <= $m[$q]; $y++)\n {\n $o[$y] = $p;\n $p--;\n }\n $p++;\n $q++;\n $x = $y - 1;\n }\n else\n {\n $o[$x] = $p;\n }\n }\n $r = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($o[$c[$x]] <= $o[$d[$x]])\n {\n $r = 1;\n break;\n }\n }\n if($r == 1)\n {\n print \"NO\";\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $o);\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n};\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n if(($a == 1000) && ($b == 1000))\n {\n $q2 = array_slice($q, 100, 100);\n print implode(\" \", $q2);\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n};\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n print implode(\" \", $q) . \"\\n\";\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " $p)\n {\n $p = $k[$x];\n }\n }\n else\n {\n $n[count($n)] = $p;\n $o[count($o)] = $c[$x];\n $p = $k[$x];\n }\n}\nif($k[count($k) - 1] < $a)\n{\n $n[count($n)] = $k[count($k) - 1];\n $o[count($o)] = $a;\n}\nif(count($e) == 0)\n{\n print \"YES\\n\";\n $q = array_fill(0, $a, 1);\n print implode(\" \", $q);\n}\nelseif((count($n) == 0) || (count($c2) > 0))\n{\n print \"NO\";\n}\nelse\n{\n $q = array();\n $r = 1000;\n $s = 0;\n for($x = 1; $x <= $a; $x++)\n {\n if($n[$s] == $x)\n {\n for($y = $n[$s]; $y < $o[$s]; $y++)\n {\n $q[count($q)] = $r;\n $r--;\n }\n $x = $y - 1;\n $s++;\n }\n else\n {\n $q[count($q)] = $r;\n }\n }\n $t = 0;\n for($x = 0; $x < count($e); $x++)\n {\n if($q[$e[$x] - 1] <= $q[$f[$x] - 1])\n {\n $t = 1;\n break;\n }\n }\n if($t == 0)\n {\n if(($a == 1000) && ($b == 1000))\n {\n array_splice($q, 100, 200);\n print implode(\" \", $q);\n }\n else\n {\n print \"YES\\n\";\n print implode(\" \", $q);\n }\n }\n else\n {\n print \"NO\";\n }\n}\n?>"}], "src_uid": "1522d9845b4ea1a903d4c81644797983"} {"source_code": "", "positive_code": [{"source_code": "_fh = $fileHandler;}\n public function readString(){$s = trim(fgets($this->_fh));return $s;}\n public function readInt(){$d = trim(fgets($this->_fh));return (int)$d;}\n public function readArrayOfInt($separator = ' ', $indexFrom = 0){$a = [];$ind = $indexFrom;foreach (explode($separator, fgets($this->_fh)) as $item) {$a[$ind++] = (int)$item;}return $a;}\n public function readArrayOfFloat($separator = ' ', $indexFrom = 0) { $a = []; $ind = $indexFrom; foreach (explode($separator, fgets($this->_fh)) as $item) { $a[$ind++] = (float)$item; } return $a; }\n public function readArrayOfString($separator = ' ', $indexFrom = 0) { $a = []; $ind = $indexFrom; foreach (explode($separator, fgets($this->_fh)) as $item) { $a[$ind++] = $item; } return $a; }\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/* Integral. Keys preserved. By reference. */\nfunction cumsum(&$a){ $sum = 0; foreach ($a as $k => $v) { $a[$k] += $sum; $sum = $a[$k]; }}\n/* Difference. Keys preserved. By reference. */\nfunction diff(&$a){ $prev = 0; foreach ($a as $k => $v) { $buf = $a[$k]; $a[$k] -= $prev; $prev = $buf; }}\nfunction bitCount($n){ $cnt = 0; for ($j = $n; $j; $j >>= 1) { $cnt += $j & 1; } return $cnt;}\n/*****************************************/\n$ir = new InputReader();\n \n/* TASK */\n\n$ts = $ir->readInt();\n\nfor ($t=0; $t<$ts; $t++) {\n\t$s = $ir->readString();\n\t$cumsum = 0;\n\t\n\tif ($s[-1] !== 'B') {\n\t\techo \"NO\".PHP_EOL;\n\t\tcontinue;\n\t}\n\n\tfor ($i = 0; $i < strlen($s); $i++) {\n\t\t$cumsum += ($s[$i]=='A' ? 1 : -1);\n\t\t\n\t\tif ($cumsum < 0) {\n\t\t\techo \"NO\".PHP_EOL;\n\t\t\tcontinue 2;\n\t\t}\n\t}\n\t\n\techo \"YES\".PHP_EOL;\n}\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "';\r\n if ($a < $b) {\r\n echo \"NO\";\r\n $c++;\r\n break;\r\n }\r\n }\r\n } else {\r\n $y .= \"NO\\r\\n\";\r\n\r\n $c++;\r\n }\r\n if ($c == 0) {\r\n $y .= \"YES\\r\\n\";\r\n }\r\n}\r\necho $y;\r\n$end = readline();\r\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "0b9be2f076cfa13cdc76c489bf1ea416"} {"source_code": "", "positive_code": [{"source_code": "read_array();\n return $array[0];\n }\n}\n?>\nread_one();\n $a = $input_connect->read_array();\n for ($i = 0; $i < $n; $i++) {\n $num[$i] = $i;\n }\n for ($i = $n; $i < 2 * $n; $i++){\n $a[$i] = $a[$i - $n];\n $num[$i] = $num[$i - $n];\n }\n $h = -1;\n for ($j = 1; $j < $n; $j++){\n if ($n % $j != 0 || $n / $j < 3) continue;\n ++$h;\n $div[$h] = $j;\n }\n for ($i = 0; $i < $n; $i++){\n if ($a[$i] == 0) continue;\n for ($j = 0; $j <= $h; $j++){\n $k = $i + $div[$j];\n while ($a[$k] == 1 && $num[$k] != $i) $k += $div[$j];\n if ($num[$k] == $i) {\n echo \"YES\";\n die(0);\n }\n } \n }\n echo \"NO\";\n?>"}], "negative_code": [{"source_code": "read_array();\n return $array[0];\n }\n}\n?>\nread_one();\n $a = $input_connect->read_array();\n for ($i = 0; $i < $n; $i++) {\n $num[$i] = $i;\n }\n for ($i = $n; $i < 2 * $n; $i++){\n $a[$i] = $a[$i - $n];\n $num[$i] = $num[$i - $n];\n }\n $h = -1;\n for ($j = 1; $j < $n; $j++){\n if ($n % $j != 0 || $n / $j < 3) continue;\n ++$h;\n $div[$h] = $j;\n }\n for ($i = 0; $i < $n; $i++){\n if ($a[$i] == 0) continue;\n for ($j = 1; $j < $h; $j++){\n $k = $i + $div[$j];\n while ($a[$k] == 1 && $num[$k] != $i) $k += $div[$j];\n if ($num[$k] == $i) {\n echo \"YES\";\n die(0);\n }\n } \n }\n echo \"NO\";\n?>"}, {"source_code": "read_array();\n return $array[0];\n }\n}\n?>\nread_one();\n $a = $input_connect->read_array();\n for ($i = 0; $i < $n; $i++) {\n $num[$i] = $i;\n }\n for ($i = $n; $i < 2 * $n; $i++){\n $a[$i] = $a[$i - $n];\n $num[$i] = $num[$i - $n];\n }\n $h = -1;\n for ($j = 1; $j < $n; $j++){\n if ($n % $j != 0 || $n / $j < 3) continue;\n ++$h;\n $div[$h] = $j;\n }\n for ($i = 0; $i < $n; $i++){\n if ($a[$i] == 0) continue;\n for ($j = 0; $j < $h; $j++){\n $k = $i + $div[$j];\n while ($a[$k] == 1 && $num[$k] != $i) $k += $div[$j];\n if ($num[$k] == $i) {\n echo \"YES\";\n die(0);\n }\n } \n }\n echo \"NO\";\n?>"}, {"source_code": ""}], "src_uid": "d3a0402de1338a1a542a86ac5b484acc"} {"source_code": " $k) {\n array_pop($online);\n }\n } else {\n echo isset($online[$id]) ? \"YES\\n\" : \"NO\\n\";\n }\n}\n", "positive_code": [{"source_code": ""}, {"source_code": "$rep2[$online[0]]) $online[0]=$tokens[$i][1];\n\t\t\t} else {\n\t\t\tarray_push($online, $tokens[$i][1]);\n\t\t\t} \n\t\t\t//\u0401\u0431\u0430\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430\n\t\t\tfor($z=0;$z"}, {"source_code": ""}, {"source_code": "$friend[$online[0]]) $online[0]=$tokens[$i][1];\n\t\t\t} else {\n\t\t\tarray_push($online, $tokens[$i][1]);\n\t\t\t} \n\t\t\t//\u0401\u0431\u0430\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430\n\t\t\tfor($z=0;$z"}, {"source_code": "$friend[$online[0]][\"rep\"]) $online[0]=$tokens[$i][1];\n\t\t\t} else {\n\t\t\tarray_push($online, $tokens[$i][1]);\n\t\t\t} \n\t\t\t//\u0401\u0431\u0430\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430\n\t\t\tfor($z=0;$z"}, {"source_code": "$rep2[$online[0]]) $online[0]=$tokens[$i][1];\n\t\t\t} else {\n\t\t\tarray_push($online, $tokens[$i][1]);\n\t\t\t} \n\t\t\t//\u0401\u0431\u0430\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430\n\t\t\tfor($z=0;$z"}, {"source_code": "$friend[$online[0]][\"rep\"]) $online[0]=$tokens[$i][1];\n\t\t\t} else {\n\t\t\tarray_push($online, $tokens[$i][1]);\n\t\t\t} \n\t\t\t//\u0401\u0431\u0430\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430\n\t\t\tfor($z=0;$z"}, {"source_code": " $on['0']) $on['0'] = $s['1'];\n}\nelse $on[] = $s['1'];\n}\nelse\n{\nif(in_array($s['1'], $on) === TRUE) $o[] = 'YES'; else $o[] = 'NO';\n}\n}\nprint implode(\"\\n\", $o);"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "$friend[$online[0]][\"rep\"]) $online[0]=$tokens[$i][1];\n\t\t\t} else {\n\t\t\tarray_push($online, $tokens[$i][1]);\n\t\t\t} \n\t\t\t//\u0401\u0431\u0430\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430\n\t\t\tfor($z=0;$z"}], "src_uid": "7c778289806ceed506543ef816c587c9"} {"source_code": " $c)\n {\n $d = $b;\n $e = $c;\n $b = $e;\n $c = $d;\n }\n for($y = 1; $y < 100000; $y++)\n {\n $b += $y;\n if($b == $c)\n {\n print $y . \"\\n\";\n break;\n }\n elseif($b > $c + 1)\n {\n for($z = $y + 1; $z < 100000; $z++)\n {\n if(($b % 2 == 0) && ($c % 2 == 0))\n {\n print ($z - 1) . \"\\n\";\n break;\n }\n elseif(($b % 2 == 1) && ($c % 2 == 1))\n {\n print ($z - 1) . \"\\n\";\n break;\n }\n $b += $z;\n }\n break;\n }\n }\n }\n}\n?>", "positive_code": [{"source_code": "compMinSteps($arr[0], $arr[1]);\n fwrite(STDOUT, $steps.\"\\n\");\n }\n }\n\n public function compMinSteps($num1, $num2){\n if($num1 == $num2){\n return 0;\n }\n $diff = abs($num1-$num2);\n $i = 1;\n while(true){\n $sum = $i * ($i + 1) / 2;\n if($sum % 2 == $diff % 2 && $sum >= $diff){\n break;\n }\n $i++;\n }\n return $i;\n }\n}\n$nyg = new BAandB();\n$b = $nyg->main();"}], "negative_code": [{"source_code": " $c)\n {\n $d = $b;\n $e = $c;\n $b = $e;\n $c = $d;\n }\n for($y = 1; $y < 100000; $y++)\n {\n $b += $y;\n if($b == $c)\n {\n print $y . \"\\n\";\n break;\n }\n elseif($b > $c)\n {\n print ($y + 1) . \"\\n\";\n break;\n }\n }\n }\n}\n?>"}, {"source_code": "compMinSteps($arr[0], $arr[1]);\n fwrite(STDOUT, $steps.\"\\n\");\n }\n }\n //\u6bcf\u6267\u884c\u4e00\u6b65\u5c31\u4f1a\u52a01\n public function compMinSteps($num1, $num2){\n if($num1 == $num2){\n return 0;\n }\n if($num1 > $num2){\n $minNum = $num2;\n $maxNum = $num1;\n }else{\n $minNum = $num1;\n $maxNum = $num2;\n }\n $i = 1;\n while($minNum != $maxNum){\n if($minNum + $i < $maxNum){\n $minNum += $i;\n }elseif($minNum + $i > $maxNum){\n $maxNum += $i;\n }elseif($minNum + $i == $maxNum){\n break;\n }\n $i++;\n }\n return $i;\n }\n}\n$nyg = new BAandB();\n$b = $nyg->main();"}, {"source_code": "compMinSteps($arr[0], $arr[1]);\n }\n for ($i = 0; $i < $num; $i++){\n fwrite(STDOUT, $steps[$i].\"\\n\");\n }\n }\n //\u6bcf\u6267\u884c\u4e00\u6b65\u5c31\u4f1a\u52a01\n public function compMinSteps($num1, $num2){\n if($num1 == $num2){\n return 0;\n }\n if($num1 > $num2){\n $minNum = $num2;\n $maxNum = $num1;\n }else{\n $minNum = $num1;\n $maxNum = $num2;\n }\n $i = 1;\n while($minNum != $maxNum){\n if($minNum + $i < $maxNum){\n $minNum += $i;\n }elseif($minNum + $i > $maxNum){\n $maxNum += $i;\n }elseif($minNum + $i == $maxNum){\n break;\n }\n $i++;\n }\n return $i;\n }\n}\n//$nyg = new BAandB();\n//$b = $nyg->main();"}], "src_uid": "29e84addbc88186bce40d68cf124f5da"} {"source_code": "= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) == 2)\n {\n if($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) > 2)\n {\n if($g < $i[2])\n {\n continue;\n }\n elseif($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n}\nfor($x = 1; $x <= $b; $x++)\n{\n $o = $c[$x];\n $p = $d[$x];\n if((($p[0] == $p[1]) && ($p[1] == $p[2])) || ($p[1] == $p[2]))\n {\n print \"?\\n\";\n }\n else\n {\n print $o[0] . \" \" . $o[1] . \"\\n\";\n }\n}\n?>", "positive_code": [{"source_code": "= $top1) {\n $comands[$child_reg]['top2']['rang'] = $top1;\n $comands[$child_reg]['top2']['fio'] = $comands[$child_reg]['top1']['fio'];\n $comands[$child_reg]['top1']['rang'] = $child_rang;\n $comands[$child_reg]['top1']['fio'] = $child_fio;\n } else if ($child_rang >= $top2) {\n $comands[$child_reg]['top2']['rang'] = $child_rang;\n $comands[$child_reg]['top2']['fio'] = $child_fio;\n }\n}\n$result = array();\nfor ($j = 1; $j <= $reg; $j++) {\n \n if ($comands[$j][$comands[$j]['top1']['rang']] > 2) {\n echo \"?\\n\";\n } else if ( $comands[$j][$comands[$j]['top1']['rang']] == 2) {\n echo $comands[$j]['top1']['fio'] . ' ' . $comands[$j]['top2']['fio'] . \"\\n\";\n } else if ($comands[$j][$comands[$j]['top2']['rang']] == 1 ) {\n echo $comands[$j]['top1']['fio'] . ' ' . $comands[$j]['top2']['fio'] . \"\\n\";\n } else {\n echo \"?\\n\";\n }\n}\n\n\n?>"}], "negative_code": [{"source_code": "= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) == 2)\n {\n if($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) > 2)\n {\n if($g < $i[2])\n {\n continue;\n }\n elseif($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n}\nfor($x = 1; $x <= $b; $x++)\n{\n $o = $c[$x];\n $p = $d[$x];\n if(($p[0] == $p[1]) || ($p[1] == $p[2]))\n {\n print \"?\\n\";\n }\n else\n {\n print $o[0] . \" \" . $o[1] . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) == 2)\n {\n if($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) > 2)\n {\n if($g < $i[2])\n {\n continue;\n }\n elseif($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n}\nif(($a == 100000) && ($b == 10000))\n{\n $q = $d[274];\n print_r($q);\n}\nfor($x = 1; $x <= $b; $x++)\n{\n $o = $c[$x];\n $p = $d[$x];\n if(($p[0] == $p[1]) && ($p[1] == $p[2]))\n {\n print \"?\\n\";\n }\n else\n {\n print $o[0] . \" \" . $o[1] . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) == 2)\n {\n if($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) > 2)\n {\n if($g < $i[2])\n {\n continue;\n }\n elseif($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n}\nfor($x = 1; $x <= $b; $x++)\n{\n $o = $c[$x];\n $p = $d[$x];\n if(($p[0] == $p[1]) && ($p[0] == $p[2]))\n {\n print \"?\\n\";\n }\n else\n {\n print $o[0] . \" \" . $o[1] . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) == 2)\n {\n if($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) > 2)\n {\n if($g < $i[2])\n {\n continue;\n }\n elseif($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n}\nfor($x = 1; $x <= $b; $x++)\n{\n $o = $c[$x];\n $p = $d[$x];\n if(($p[0] == $p[1]) || ($p[0] == $p[2]))\n {\n print \"?\\n\";\n }\n else\n {\n print $o[0] . \" \" . $o[1] . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) == 2)\n {\n if($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) > 2)\n {\n if($g < $i[2])\n {\n continue;\n }\n elseif($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n}\nfor($x = 1; $x <= $b; $x++)\n{\n $o = $c[$x];\n $p = $d[$x];\n if(($p[0] == $p[1]) && ($p[1] == $p[2]))\n {\n print \"?\\n\";\n }\n else\n {\n print $o[0] . \" \" . $o[1] . \"\\n\";\n }\n}\n?>"}, {"source_code": "= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) == 2)\n {\n if($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n elseif(count($h) > 2)\n {\n if($g < $i[2])\n {\n continue;\n }\n elseif($g < $i[1])\n {\n $h[2] = $e;\n $i[2] = $g;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g < $i[0])\n {\n $j = $h[1];\n $k = $i[1];\n $h[1] = $e;\n $i[1] = $g;\n $h[2] = $j;\n $i[2] = $k;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n elseif($g >= $i[0])\n {\n $j = $h[0];\n $k = $i[0];\n $l = $h[1];\n $m = $i[1];\n $h[0] = $e;\n $i[0] = $g;\n $h[1] = $j;\n $i[1] = $k;\n $h[2] = $l;\n $i[2] = $m;\n $c[$f] = $h;\n $d[$f] = $i;\n }\n }\n}\nif(($a == 100000) && ($b == 10000))\n{\n $q = $d[385];\n print_r($q);\n $r = $c[385];\n print_r($r);\n}\nfor($x = 1; $x <= $b; $x++)\n{\n $o = $c[$x];\n $p = $d[$x];\n if(($p[0] == $p[1]) && ($p[1] == $p[2]))\n {\n print \"?\\n\";\n }\n else\n {\n print $o[0] . \" \" . $o[1] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 1, 'users' => array(0 => $child));\n } else {\n if (count($comands[$child_reg]['users']) == 1) {\n $comands[$child_reg]['users'][] = $child;\n\n } else {\n if ($comands[$child_reg]['can'] == 1) {\n\n $rang_1 = $comands[$child_reg]['users'][0][2] + $child_rang;\n $rang_2 = $comands[$child_reg]['users'][1][2] + $child_rang;\n if ($rang_1 == $rang_2 && $rang_1 != 1600) {\n $comands[$child_reg]['can'] = 0;\n } else if ($rang_1 >= $rang_2) {\n $comands[$child_reg]['users'][1] = $child;\n } else {\n $comands[$child_reg]['users'][0] = $child;\n }\n \n }\n \n }\n }\n \n}\n$result = array();\nfor ($j = 1; $j <= $reg; $j++) {\n if ($comands[$j]['can']) {\n $result[] = $comands[$j]['users'][0][0] . ' ' . $comands[$j]['users'][1][0];\n } else {\n $result[] = '?';\n }\n}\n\n\necho implode('\n', $result);\n\n\n?>"}, {"source_code": " 1, 'users' => array(0 => $child));\n } else {\n if (count($comands[$child_reg]['users']) == 1) {\n $comands[$child_reg]['users'][] = $child;\n\n } else {\n if ($comands[$child_reg]['can'] == 1) {\n\n $rang_1 = $comands[$child_reg]['users'][0][2] + $child_rang;\n $rang_2 = $comands[$child_reg]['users'][1][2] + $child_rang;\n if ($rang_1 == $rang_2) {\n $comands[$child_reg]['can'] = 0;\n } else if ($rang_1 > $rang_2) {\n $comands[$child_reg]['users'][1] = $child;\n } else {\n $comands[$child_reg]['users'][0] = $child;\n }\n \n }\n \n }\n }\n \n}\n$result = array();\nfor ($j = 1; $j <= $reg; $j++) {\n if ($comands[$j]['can']) {\n $result[] = $comands[$j]['users'][0][0] . ' ' . $comands[$j]['users'][1][0];\n } else {\n $result[] = '?';\n }\n}\n\n\necho implode('\n', $result);"}, {"source_code": "= $top1) {\n $comands[$child_reg]['top2']['rang'] = $top1;\n $comands[$child_reg]['top2']['fio'] = $comands[$child_reg]['top1']['fio'];\n $comands[$child_reg]['top1']['rang'] = $child_rang;\n $comands[$child_reg]['top1']['fio'] = $child_fio;\n } else if ($comands[$child_reg][$child_rang] >= $top2) {\n $comands[$child_reg]['top2'] = $comands[$child_reg][$child_rang];\n }\n}\n$result = array();\nfor ($j = 1; $j <= $reg; $j++) {\n if ($comands[$j][$comands[$j]['top1']['rang']] > 2) {\n echo \"?\\n\";\n } else if ( $comands[$j][$comands[$j]['top1']['rang']] == 2) {\n echo $comands[$j]['top1']['fio'] . ' ' . $comands[$j]['top2']['fio'] . \"\\n\";\n } else if ($comands[$j][$comands[$j]['top2']['rang']] == 1 ) {\n echo $comands[$j]['top1']['fio'] . ' ' . $comands[$j]['top2']['fio'] . \"\\n\";\n } else {\n echo \"?\\n\";\n }\n}\n\n\n?>"}, {"source_code": " 1, 'users' => array(0 => $child));\n } else {\n if (count($comands[$child_reg]['users']) == 1) {\n $comands[$child_reg]['users'][] = $child;\n\n } else {\n if ($comands[$child_reg]['can'] == 1) {\n\n $rang_1 = $comands[$child_reg]['users'][0][2] + $child_rang;\n $rang_2 = $comands[$child_reg]['users'][1][2] + $child_rang;\n if ($rang_1 == $rang_2) {\n $comands[$child_reg]['can'] = 0;\n } else if ($rang_1 > $rang_2) {\n $comands[$child_reg]['users'][1] = $child;\n } else {\n $comands[$child_reg]['users'][0] = $child;\n }\n \n }\n \n }\n }\n \n}\n \nfor ($j = 1; $j <= $reg; $j++) {\n if ($comands[$j]['can']) {\n echo $comands[$j]['users'][0][0] . ' ' . $comands[$j]['users'][1][0];\n } else {\n echo '?';\n }\n}\n\n\n\n?>"}], "src_uid": "a1ea9eb8db25289958a6f730c555362f"} {"source_code": "", "positive_code": [{"source_code": "=0; $y--) {\n\t\t\t\t\tif($x<=3 && $CV[$x][$y]==0 && $CV[$x+1][$y]==0) {\n\t\t\t\t\t\techo \"$x $y\\n\";\n\t\t\t\t\t\t$CV[$x][$y]=1;\n\t\t\t\t\t\t$CV[$x+1][$y]=1;\n\t\t\t\t\t\tgoto __erase;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor($x=4; $x>=0; $x--) {\n\t\t\t\tfor($y=1; $y<=4; $y++) {\n\t\t\t\t\tif($y<=3 && $CV[$x][$y]==0 && $CV[$x][$y+1]==0) {\n\t\t\t\t\t\techo \"$x $y\\n\";\n\t\t\t\t\t\t$CV[$x][$y]=1;\n\t\t\t\t\t\t$CV[$x][$y+1]=1;\n\t\t\t\t\t\tgoto __erase;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n__erase:\n\t\tfor($x=1; $x<=4; $x++) {\n\t\t\tif($CV[$x][1]==1 && $CV[$x][2]==1 && $CV[$x][3]==1 && $CV[$x][4]==1) {\n\t\t\t\t$CV[$x][1]=0;\n\t\t\t\t$CV[$x][2]=0;\n\t\t\t\t$CV[$x][3]=0;\n\t\t\t\t$CV[$x][4]=0;\n\t\t\t}\n\t\t\tif($CV[1][$x]==1 && $CV[2][$x]==1 && $CV[3][$x]==1 && $CV[4][$x]==1) {\n\t\t\t\t$CV[1][$x]=0;\n\t\t\t\t$CV[2][$x]=0;\n\t\t\t\t$CV[3][$x]=0;\n\t\t\t\t$CV[4][$x]=0;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " 4) {\n $i = 1;\n }\n } else {\n echo 4 . ' ' . $j . \"\\n\";\n $j = $j+2;\n if ($j > 3) {\n $j = 1;\n }\n }\n }\n \n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0);\n $a = array(\n 1 => $b,\n 2 => $b,\n 3 => $b,\n 4 => $b,\n );\n \n foreach ($m AS $v) {\n if ($v == 0) {\n g($a, 2, 1);\n } else {\n g($a, 1, 2);\n }\n foreach ($a AS $k => $v1) {\n if (array_sum($v1) == 4) {\n $a[$k] = $b; \n }\n }\n }\n \n function g(&$a, $x, $y){\n if ($x == 2) {\n for ($i = 1; $i < 4; $i++) {\n for ($j=1; $j <= 4; $j++) {\n if ($a[$i][$j] == 0 && $a[$i+1][$j] == 0) {\n $a[$i][$j] = 1;\n $a[$i+1][$j] = 1;\n echo $i . ' ' . $j . \"\\n\";\n break 2;\n }\n }\n }\n } else {\n for ($i = 1; $i <= 4; $i++) {\n for ($j=1; $j < 4; $j++) {\n if ($a[$i][$j] == 0 && $a[$i][$j+1] == 0) {\n $a[$i][$j] = 1;\n $a[$i][$j+1] = 1;\n echo $i . ' ' . $j . \"\\n\";\n break 2;\n }\n }\n }\n }\n }\n \n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0);\n $a = array(\n 1 => $b,\n 2 => $b,\n 3 => $b,\n 4 => $b,\n );\n \n foreach ($m AS $v) {\n if ($v == 0) {\n g($a, 2, 1);\n } else {\n g($a, 1, 2);\n }\n foreach ($a AS $k => $v1) {\n if (array_sum($v1) == 4) {\n $a[$k] = $b; \n }\n }\n }\n \n function g(&$a, $x, $y){\n if ($x == 2) {\n for ($i = 1; $i < 4; $i++) {\n for ($j=1; $j <= 4; $j++) {\n if ($a[$i][$j] == 0 && $a[$i+1][$j] == 0) {\n $a[$i][$j] = 1;\n $a[$i+1][$j] = 1;\n echo $i . ' ' . $j . \"\\n\";\n break 2;\n }\n }\n }\n } else {\n for ($i = 1; $i <= 4; $i++) {\n for ($j=1; $j < 4; $j++) {\n if ($a[$i][$j] == 0 && $a[$i][$j+1] == 0) {\n $a[$i][$j] = 1;\n $a[$i][$j+1] = 1;\n echo $i . ' ' . $j . \"\\n\";\n break 2;\n }\n }\n }\n }\n }\n \n?>"}, {"source_code": " 4) {\n $i = 1;\n }\n } else {\n echo 4 . ' ' . $j . \"\\n\";\n $j+2;\n if ($j > 3) {\n $j = 1;\n }\n }\n }\n \n?>"}, {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0);\n $a = array(\n 1 => $b,\n 2 => $b,\n 3 => $b,\n 4 => $b,\n );\n \n foreach ($m AS $v) {\n if ($v == 0) {\n g($a, 2, 1);\n } else {\n g($a, 1, 2);\n }\n foreach ($a AS $k => $v1) {\n if (array_sum($v1) == 4) {\n $a[$k] = $b; \n }\n }\n }\n \n function g(&$a, $x, $y){\n if ($x == 2) {\n for ($i = 1; $i < 4; $i++) {\n for ($j=1; $j <= 4; $j++) {\n if ($a[$i][$j] == 0 && $a[$i+1][$j] == 0) {\n $a[$i][$j] = 1;\n $a[$i+1][$j] = 1;\n echo $i . ' ' . $j . \"\\n\";\n break 2;\n }\n }\n }\n } else {\n for ($i = 1; $i <= 4; $i++) {\n for ($j=1; $j < 4; $j++) {\n if ($a[$i][$j] == 0 && $a[$i][$j+1] == 0) {\n $a[$i][$j] = 1;\n $a[$i][$j+1] = 1;\n echo $i . ' ' . $j . \"\\n\";\n break 2;\n }\n }\n }\n }\n }\n \n?>"}], "src_uid": "a63cdbd1009a60c0f9b52e4ffbba252e"} {"source_code": "\n"}], "negative_code": [{"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t// $b[$i] = array($a[$i], $i);\n\t\t$b[$i][0] = $a[$i];\n\t\t$b[$i][1] = $i; \n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t(double) $res = (double) $res + $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\t#echo ($res.\"\\n\");\n\tprintf(\"%.0f\\n\", $res);\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>", "positive_code": [{"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t(double) $res = (double) $res + $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\t#echo ($res.\"\\n\");\n\t#printf(\"%f\\n\", $res);\n\techo (number_format($res,0,null,'').\"\\n\");\n\t\n\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}, {"source_code": ""}, {"source_code": "0) {\n\t\t\t$c[$a[$i]]--;\n\t\t\t$xc++;\n\t\t\tif($xc==$m) {\n\t\t\t\t$px=$i+1;\n\t\t\t\techo \"$px \";\n\t\t\t\t$xc=0;\n\t\t\t\t$zc++;\n\t\t\t\tif($zc==$k-1) break;\n\t\t\t}\n\t\t}\n\t}\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, $m, $k) = $ir->readArrayOfInt(2);\n$a = $ir->readArrayOfInt($n, 1);\n\narsort($a);\n$b = [];\n$i = $m*$k;\n$s = '0';\nforeach ($a as $key=>$v) {\n\t$s = bcadd($s, $v);\n\t$b[] = $key;\n\tif (--$i<=0){\n\t\tbreak;\n\t}\n}\n\nsort($b);\necho $s.\"\\n\";\n$i=1;\n$kk = $k-1;\nforeach ($b as $key=>$v) {\n\tif ($i%$m==0 && $kk) {\n\t\techo ($v).' ';\n\t\t$kk--;\n\t}\n\t$i++;\n}\n"}, {"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t(double) $res = (double) $res + $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\t#echo ($res.\"\\n\");\n\tprintf(\"%.0f\\n\", $res);\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "0) {\n\t\t\t$xc++;\n\t\t\t$c[current($a)]--;\n\t\t}\n\t\tif($xc==$m) {\n\t\t\t$px=key($a)+1;\n\t\t\techo \"$px \";\n\t\t\t$xc=0;\n\t\t\t$zc++;\n\t\t\tif($zc==$k-1) break;\n\t\t}\n\t\tnext($a);\n\t}\n?>"}, {"source_code": "0) {\n\t\tif(array_key_exists(current($a),$c)) {\n\t\t\t//$c[current($a)]--;\n\t\t\t$xc++;\n\t\t\tif($xc==$m) {\n\t\t\t\t$px=key($a)+1;\n\t\t\t\techo \"$px \";\n\t\t\t\t$xc=0;\n\t\t\t\t$zc++;\n\t\t\t\tif($zc==$k-1) break;\n\t\t\t}\n\t\t}\n\t\tnext($a);\n\t}\n?>"}, {"source_code": ""}, {"source_code": "0) {\n\t\t\t$c[$a[$i]]--;\n\t\t\t$xc++;\n\t\t\tif($xc==$m) {\n\t\t\t\t$px=$i+1;\n\t\t\t\techo \"$px \";\n\t\t\t\t$xc=0;\n\t\t\t\t$zc++;\n\t\t\t\tif($zc==$k-1) break;\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": "0) {\n\t\t\t$c[current($a)]--;\n\t\t\t$xc++;\n\t\t\tif($xc==$m) {\n\t\t\t\t$px=key($a)+1;\n\t\t\t\techo \"$px \";\n\t\t\t\t$xc=0;\n\t\t\t\t$zc++;\n\t\t\t\tif($zc==$k-1) break;\n\t\t\t}\n\t\t}\n\t\tnext($a);\n\t}\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, $m, $k) = $ir->readArrayOfInt(2);\n$a = $ir->readArrayOfInt($n, 1);\n\narsort($a);\n$b = [];\n$i = $m*$k;\n$s = 0;\nforeach ($a as $key=>$v) {\n\t$s += $v;\n\t$b[] = $key;\n\tif (--$i<=0){\n\t\tbreak;\n\t}\n}\n\nsort($b);\necho $s.\"\\n\";\n$i=1;\n$kk = $k-1;\nforeach ($b as $key=>$v) {\n\tif ($i%$m==0 && $kk) {\n\t\techo ($v).' ';\n\t\t$kk--;\n\t}\n\t$i++;\n}\n"}, {"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t(double) $res = (double) $res + $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\t#echo ($res.\"\\n\");\n\t#printf(\"%f\\n\", $res);\n\techo number_format($res,0,null,'');\n\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}, {"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t(double) $res = (double) $res + $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\t#echo ($res.\"\\n\");\n\tprintf(\"%f\\n\", $res);\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}, {"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t$res += $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\techo ($res.\"\\n\");\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}, {"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t$res += $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\techo ($res.\"
\");\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}, {"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t#$in = fopen(\"input.txt\", \"r\");\n\t$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t(double) $res = (double) $res + $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\t#echo ($res.\"\\n\");\n\tprintf(\"%d\\n\", $res);\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}, {"source_code": " $y[1])\n\t\t\t\treturn 1;\t\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\t$res = 0;\n\t$len = 0;\n\t$c = 0;\n\n\t$in = fopen(\"input.txt\", \"r\");\n\t#$in = STDIN;\n\tfscanf($in, \"%d%d%d\", $n, $m, $k);\n\n\t$a = explode(\" \", trim(fgets($in)));\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$b[$i] = array($a[$i], $i);\n\t}\n\n\tusort($b, \"cmp\");\n\n\tfor ($i = 0; $i < $m * $k; $i++) {\n\t\t$used[$b[$i][1]] = 1;\n\t}\n\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($used[$i] == 1) {\n\t\t\t$res += $a[$i];\n\t\t\t$c++;\n\t\t}\n\t\tif ($c == $m) {\n\t\t\t$result[$len++] = $i + 1;\n\t\t\t$c = 0;\n\t\t}\n\t}\n\n\techo ($res.\"\\n\");\n\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\techo ($result[$i].\" \");\n\t}\n\t\n\n\tfclose($in);\n##############################################################################\n?>\n"}], "src_uid": "e9cf68a68b55fe075099c384cb6a7e9e"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "#include\n#include\n#include\nusing namespace std;\nint x[110], y[110], z[110];\nint n, cnt = 0;\nvoid dfs(int k)\n{\n z[k] = 1;\n for (int j = 0; j < n; j++)\n {\n if (z[j]!=1 && (x[k]==x[j] || y[k]==y[j]))\n {\n dfs(j);\n }\n \n }\n \n \n}\nint main()\n{\n cin >> n;\n for(int i = 0; i> x[i] >> y[i];\n }\n for (int i = 0; i < n; i++)\n {\n if (z[i]!=1)\n {\n dfs(i);\n cnt++;\n } \n }\n cout << cnt-1 << endl;\n return 0;\n}"}], "src_uid": "cb4dbff31d967c3dab8fe0495eb871dc"} {"source_code": "\n", "positive_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$a = $ir->readArrayOfInt($n);\n\n$cnt = 0;\n$R = 0;\n$ends = [];\n\nfor ($l=0; $l<$n; $l++) {\n\tif ($l>$R) {\n\t\t$cnt++;\n\t\t//echo \"edge: $R\\n\";\n\t}\n\t\n\t// find right position\n\tif (!isset($ends[$a[$l]])) {\n\t\t//$ends[$a[$l]] = $R;\n\t\tfor ($r=$n-1; $r>$R; $r--) {\n\t\t\tif (!isset($ends[$a[$r]])) {\n\t\t\t\t$ends[$a[$r]] = $r;\n\t\t\t}\n\t\t\t\n\t\t\tif ($a[$l] == $a[$r]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!isset($ends[$a[$l]])) {\n\t\t$ends[$a[$l]] = $R;\n\t}\n\t\n\t$R = max([$ends[$a[$l]], $R]);\n}\n\n// var_dump($ends);\n// echo \"count: \" . ($cnt+1) . \"\\n\";\n// echo \"answer: \" . (1<<$cnt) . \"\\n\";\necho bcpowmod(2, $cnt, 998244353);\n"}], "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$a = $ir->readArrayOfInt($n);\n\n$cnt = 0;\n$R = 0;\n$ends = [];\n\nfor ($l=0; $l<$n; $l++) {\n\tif ($l>$R) {\n\t\t$cnt++;\n\t\t//echo \"edge: $R\\n\";\n\t}\n\t\n\t// find right position\n\tif (!isset($ends[$a[$l]])) {\n\t\t$ends[$a[$l]] = $R;\n\t\tfor ($r=$n-1; $r>$R; $r--) {\n\t\t\tif (!isset($ends[$a[$r]])) {\n\t\t\t\t$ends[$a[$r]] = $r;\n\t\t\t}\n\t\t\t\n\t\t\tif ($a[$l] == $a[$r]) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$R = max([$ends[$a[$l]], $R]);\n}\n\n//var_dump($ends);\n//echo \"count: \" . $cnt+1 . \"\\n\";\n//echo \"answer: \" . (1<<$cnt) . \"\\n\";\necho bcpowmod(2, $cnt, 998244353);\n"}], "src_uid": "0dab2f4e70064f90fc079d8dd7a8b049"} {"source_code": "", "positive_code": [{"source_code": " 1)\n\t{\n\t\treturn max(checkAr($left), checkAr($right));\n\t}\n\treturn 1;\n}\n\nfunction getResult($inputL, $input)\n{\n\t$input = trim($input);\n\t$initialAr = explode(' ', $input);\n\tif (isArSorted($initialAr))\n\t{\n\t\treturn count($initialAr);\n\t}\n\treturn checkAr($initialAr);\n}\n\n\nfwrite(STDOUT, getResult(fgets(STDIN), fgets(STDIN)));"}, {"source_code": "$value)\n\t\t\tif($value!=$a[$key])\n\t\t\t\t$flag = false; \n\t\t\t\t\n\t\treturn $flag;\n\t}\n\t\n\t\n\tif($n > 1){\n\t\twhile($n > 1 && !is_sorted($b)){\n\t\t\t$c1 = 0;\n\t\t\t$c2 = 0;\n\t\t\t$c = 0;\n\t\t\t$a = $b;\n\t\t\t\n\t\t\t//print_r($a);\n\t\t\t\n\t\t\tfor($i = 1; $i<$n/2; $i++){\n\t\t\t\tif($a[$i] >= $a[$i-1]){ $c++; } else { if($c >= $c1) { $c1 = $c; $c = 0; } }\n\t\t\t}\n\t\t\tif($c >= $c1) { $c1 = $c; $c = 0; }\n\t\t\t\n\t\t\t$c = 0;\n\t\t\tfor($i = $n/2+1; $i<$n; $i++){\n\t\t\t\tif($a[$i] >= $a[$i-1]){ $c++; } else { if($c >= $c2) { $c2 = $c; $c = 0; } }\n\t\t\t}\n\t\t\tif($c >= $c2) { $c2 = $c; $c = 0; }\n\t\t\t\n\t\t\t$b = [];\n\t\t\t\n\t\t\tif($c2 > $c1){\n\t\t\t\tfor($i = $n/2; $i<$n; $i++){\n\t\t\t\t\t$b[] = $a[$i];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor($i = 0; $i<$n/2; $i++){\n\t\t\t\t\t$b[] = $a[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$n /= 2;\n\t\t}\n\t\t\n\t\tfwrite(STDOUT, $n);\n\t}else{\n\t\tfwrite(STDOUT, 1);\n\t}\n\n?>"}, {"source_code": " $arr[$i + 1]) {\n $sorted = false;\n }\n }\n return $sorted;\n}\n \nfunction splitArr(array $arr): int {\n $arrCount = count($arr);\n if (isSorted($arr) === true) {\n return count($arr);\n }\n $half = (int)floor($arrCount / 2);\n return max(splitArr(array_slice($arr, 0, $half)), splitArr(array_slice($arr, $half)));\n}\n \n$n = fscanf(STDIN, '%u');\n$items = explode(' ', trim(fgets(STDIN)));\necho splitArr($items);"}, {"source_code": " $arr[$i + 1]) {\n $sorted = false;\n }\n }\n return $sorted;\n}\n\nfunction splitArr(array $arr): int {\n $arrCount = count($arr);\n if (isSorted($arr) === true) {\n return count($arr);\n }\n $half = (int)floor($arrCount / 2);\n return max(splitArr(array_slice($arr, 0, $half)), splitArr(array_slice($arr, $half)));\n}\n\n$n = fscanf(STDIN, '%u');\n$items = explode(' ', trim(fgets(STDIN)));\necho splitArr($items);\n"}, {"source_code": " $arr[$i + 1]) {\n $sorted = false;\n break;\n }\n }\n return $sorted;\n}\n\nfunction splitArr(array $arr): int {\n $arrCount = count($arr);\n if (isSorted($arr) === true) {\n return count($arr);\n }\n $half = (int)floor($arrCount / 2);\n return max(splitArr(array_slice($arr, 0, $half)), splitArr(array_slice($arr, $half)));\n}\n\n$n = fscanf(STDIN, '%u');\n$items = explode(' ', trim(fgets(STDIN)));\necho splitArr($items);\n"}], "negative_code": [{"source_code": " $arr[$i + 1]) {\n $sorted = false;\n }\n }\n return $sorted;\n}\n\nfunction splitArr(array $arr): int {\n $arrCount = count($arr);\n if (isSorted($arr) === true) {\n return count($arr);\n }\n $half = (int)floor($arrCount / 2);\n return max(splitArr(array_slice($arr, 0, $half)), splitArr(array_slice($arr, $half + 1)));\n}\n\n$n = fscanf(STDIN, '%u');\n$items = explode(' ', trim(fgets(STDIN)));\necho splitArr($items);\n"}, {"source_code": " 1)\n\t{\n\t\treturn max(checkAr($left), checkAr($right));\n\t}\n\treturn 1;\n}\n\nfunction getResult($input)\n{\n\t$input = trim($input);\n\t$input = explode(\"\\n\", $input);\n\t$initialAr = explode(' ', $input[1]);\n\tif (isArSorted($initialAr))\n\t{\n\t\treturn count($initialAr);\n\t}\n\treturn checkAr($initialAr);\n}\n\nfwrite(STDOUT, getResult(fgets(STDIN)));"}, {"source_code": " 1)\n\t{\n\t\treturn max(checkAr($left), checkAr($right));\n\t}\n\treturn 1;\n}\n\nfunction getResult($inputL, $input)\n{\n\t$input = trim($input);\n\t$initialAr = explode(' ', $input[1]);\n\tif (isArSorted($initialAr))\n\t{\n\t\treturn count($initialAr);\n\t}\n\treturn checkAr($initialAr);\n}\n\n\nfwrite(STDOUT, getResult(fgets(STDIN), fgets(STDIN)));"}, {"source_code": "$value)\n\t\t\tif($value!=$a[$key])\n\t\t\t\t$flag = false; \n\t\t\t\t\n\t\treturn $flag;\n\t}\n\t\n\t\n\tif($n > 1){\n\t\twhile($n > 1 && !is_sorted($b)){\n\t\t\t$c1 = 0;\n\t\t\t$c2 = 0;\n\t\t\t$c = 0;\n\t\t\t$a = $b;\n\t\t\t\n\t\t\t//print_r($b);\n\t\t\t\n\t\t\tfor($i = 1; $i<$n/2; $i++){\n\t\t\t\tif($a[$i] >= $a[$i-1]){ $c++; } else { if($c > $c1) { $c1 = $c; $c = 0; } }\n\t\t\t}\n\t\t\t\n\t\t\tfor($i = $n/2; $i<$n; $i++){\n\t\t\t\tif($a[$i] >= $a[$i-1]){ $c++; } else { if($c > $c2) { $c2 = $c; $c = 0; } }\n\t\t\t}\n\t\t\t\n\t\t\t$b = [];\n\t\t\t\n\t\t\tif($c2 > $c1){\n\t\t\t\tfor($i = $n/2; $i<$n; $i++){\n\t\t\t\t\t$b[] = $a[$i];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor($i = 0; $i<$n/2; $i++){\n\t\t\t\t\t$b[] = $a[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$n /= 2;\n\t\t}\n\t\t\n\t\tfwrite(STDOUT, $n);\n\t}else{\n\t\tfwrite(STDOUT, 1);\n\t}\n\n?>"}, {"source_code": "$value)\n\t\t\tif($value!=$a[$key])\n\t\t\t\t$flag = false; \n\t\t\t\t\n\t\treturn $flag;\n\t}\n\t\n\t\n\tif($n > 1){\n\t\twhile($n > 1 && !is_sorted($b)){\n\t\t\t$c1 = 0;\n\t\t\t$c2 = 0;\n\t\t\t$c = 0;\n\t\t\t$a = $b;\n\t\t\t\n\t\t\t//print_r($a);\n\t\t\t\n\t\t\tfor($i = 1; $i<$n/2; $i++){\n\t\t\t\tif($a[$i] >= $a[$i-1]){ $c++; } else { if($c >= $c1) { $c1 = $c; $c = 0; } }\n\t\t\t}\n\t\t\t$c = 0;\n\t\t\tfor($i = $n/2+1; $i<$n; $i++){\n\t\t\t\tif($a[$i] >= $a[$i-1]){ $c++; } else { if($c >= $c2) { $c2 = $c; $c = 0; } }\n\t\t\t}\n\t\t\t\n\t\t\t$b = [];\n\t\t\t\n\t\t\tif($c2 > $c1){\n\t\t\t\tfor($i = $n/2; $i<$n; $i++){\n\t\t\t\t\t$b[] = $a[$i];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tfor($i = 0; $i<$n/2; $i++){\n\t\t\t\t\t$b[] = $a[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$n /= 2;\n\t\t}\n\t\t\n\t\tfwrite(STDOUT, $n);\n\t}else{\n\t\tfwrite(STDOUT, 1);\n\t}\n\n?>"}], "src_uid": "e5c68be38968fbc9677f3c1adddaff58"} {"source_code": " 1) {\n if ($x % $p == 0) {\n $x /= $p;\n $c++;\n } else {\n break;\n }\n\n }\n return $c;\n}\n\n\n$r = array_count_values($aArray);\n$r = count($r);\n\necho $r > 1 ? \"No\" : \"Yes\";", "positive_code": [{"source_code": ""}, {"source_code": " 1) {\n if ($x % $p == 0) {\n $x /= $p;\n $c++;\n } else {\n break;\n }\n\n }\n return $c;\n}\n\n\n$r = array_count_values($aArray);\n$r = count($r);\n\necho $r > 1 ? \"No\" : \"Yes\";"}, {"source_code": ""}], "negative_code": [{"source_code": " 1) {\n if ($x % $p == 0) {\n $x /= $p;\n $c++;\n } else {\n break;\n }\n\n }\n return $c;\n}\n\n$x = 0;\nfor ($i = 1; $i < $q; $i++) {\n\n if ($aArray[$i]%$t !=0) {\n $x = 1;\n break;\n }\n\n\n}\necho $x == 1 ? \"No\" : \"Yes\";"}, {"source_code": " 1) {\n $x = 0;\n if (!empty($pArray)) {\n sort($pArray);\n foreach ($pArray as $prime) {\n $x = $prime;\n }\n } else {\n $x = 1;\n }\n $sqrt = floor(sqrt($t))+1;\n for ($i = $x + 1; $i <= $sqrt; $i++) {\n $p = powCounter($t, $i);\n if ($p > 0) {\n $pArray[$i] = $p;\n $t /= pow($i, $p);\n }\n }\n if ($t2 == $t && $t != 1) {\n $pArray[$t] = 1;\n break;\n }\n $t2 = $t;\n}\nfunction powCounter($x, $p)\n{\n $c = 0;\n while ($x > 1) {\n if ($x % $p == 0) {\n $x /= $p;\n $c++;\n } else {\n break;\n }\n\n }\n return $c;\n}\n\nif (isset($pArray[2])) {\n unset($pArray[2]);\n}\nif (isset($pArray[3])) {\n unset($pArray[3]);\n}\n$x = 0;\nfor ($i = 1; $i < $q; $i++) {\n foreach ($pArray as $prime => $pow) {\n if (powCounter($aArray[$i], $prime) != $pow) {\n $x = 1;\n break;\n }\n }\n if ($x == 1) {\n break;\n }\n}\necho $x == 1 ? \"No\" : \"Yes\";"}, {"source_code": " 1) {\n $x = 0;\n if (!empty($pArray)) {\n foreach ($pArray as $prime) {\n $x = $prime;\n }\n } else {\n $x = 1;\n }\n $sqrt = floor(sqrt($t));\n for ($i = $x + 1; $i <= $sqrt; $i++) {\n $p = powCounter($t, $i);\n if ($p > 0) {\n $pArray[$i] = $p;\n $t /= pow($i, $p);\n }\n }\n if ($t2 == $t && $t != 1) {\n $pArray[$t] = 1;\n break;\n }\n $t2 = $t;\n}\nfunction powCounter($x, $p)\n{\n $c = 0;\n while ($x > 1) {\n if ($x % $p == 0) {\n $x /= $p;\n $c++;\n } else {\n break;\n }\n\n }\n return $c;\n}\n\nif (isset($pArray[2])) {\n unset($pArray[2]);\n}\nif (isset($pArray[3])) {\n unset($pArray[3]);\n}\n$x = 0;\nfor ($i = 1; $i < $q; $i++) {\n foreach ($pArray as $prime => $pow) {\n if (powCounter($aArray[$i], $prime) != $pow) {\n $x = 1;\n break;\n }\n }\n if ($x == 1) {\n break;\n }\n}\necho $x == 1 ? \"No\" : \"Yes\";"}], "src_uid": "2bb893703cbffe9aeaa0bed02f42a05c"} {"source_code": " &$value) {\n $minIteration = $key + 1;\n \n $lastIteration ++;\n if ($minIteration > $lastIteration) { $minIteration = $lastIteration; }\n \n if ($minIteration > $value) { $minIteration = $value; }\n \n $rowLength = $colCount - $key;\n if ($minIteration > $rowLength) { $minIteration = $rowLength; }\n \n $value = $lastIteration = $minIteration;\n}\n\n$result = $lastIteration = 0;\n$maxIndex = $colCount - 1;\n\nfor ($i = $maxIndex; $i >= 0; $i--) {\n $minIteration = $maxIndex - $i + 1;\n \n $lastIteration ++;\n if ($minIteration > $lastIteration) { $minIteration = $lastIteration; }\n \n if ($minIteration > $colHeight [$i]) { $minIteration = $colHeight [$i]; }\n \n $rowLength = $i + 1;\n if ($minIteration > $rowLength) { $minIteration = $rowLength; }\n \n $lastIteration = $minIteration;\n \n if ($minIteration > $result) { $result = $minIteration; }\n}\n\necho \"$result\\n\";", "positive_code": [{"source_code": " &$value) {\n $minIteration = $key + 1;\n \n $lastIteration ++;\n if ($minIteration > $lastIteration) { $minIteration = $lastIteration; }\n \n if ($minIteration > $value) { $minIteration = $value; }\n \n $rowLength = $colCount - $key;\n if ($minIteration > $rowLength) { $minIteration = $rowLength; }\n \n $value = $lastIteration = $minIteration;\n}\n\n$result = $lastIteration = 0;\n$maxIndex = $colCount - 1;\n\nfor ($i = $maxIndex; $i >= 0; $i--) {\n $minIteration = $maxIndex - $i + 1;\n \n $lastIteration ++;\n if ($minIteration > $lastIteration) { $minIteration = $lastIteration; }\n \n if ($minIteration > $colHeight [$i]) { $minIteration = $colHeight [$i]; }\n \n $rowLength = $i + 1;\n if ($minIteration > $rowLength) { $minIteration = $rowLength; }\n \n $lastIteration = $minIteration;\n \n if ($minIteration > $result) { $result = $minIteration; }\n}\n\necho \"$result\\n\";\n"}], "negative_code": [], "src_uid": "a548737890b4bf322d0f8989e5cd25ac"} {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "586a15030f4830c68f2ea1446e80028c"} {"source_code": "\")\n {\n break;\n }\n else\n {\n $e++;\n }\n }\n $f = 0;\n for($y = $b - 1; $y >= 0; $y--)\n {\n if($c[$y] == \"<\")\n {\n break;\n }\n else\n {\n $f++;\n }\n }\n $d = min($e, $f);\n print $d . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " 0; $t--) {\n $n = intval(fgets(STDIN));\n $s = fgets(STDIN);\n for ($l = 0; $l < $n && $s[$l] == '<'; $l++);\n for ($r = 0; $r < $n && $s[$n-1-$r] == '>'; $r++);\n echo min($l, $r), \"\\n\";\n}\n"}], "negative_code": [], "src_uid": "0ba97bcfb5f539c848f2cd097b34ff33"} {"source_code": "= $p - $r; $y--)\n {\n if($y == $p - $r)\n {\n $m[$y][$n] = \"+\";\n $m[$y][$n + 1] = \"-\";\n }\n else\n {\n $m[$y][$n] = \"|\";\n }\n }\n }\n else\n {\n $m[$p][$n] = \"|\";\n for($y = $p + 1; $y <= $p + $r; $y++)\n {\n if($y == $p + $r)\n {\n $m[$y][$n - 1] = \"-\";\n $m[$y][$n] = \"+\";\n }\n else\n {\n $m[$y][$n] = \"|\";\n }\n }\n for($y = $p - 1; $y >= $p - $r; $y--)\n {\n if($y == $p - $r)\n {\n $m[$y][$n - 1] = \"-\";\n $m[$y][$n] = \"+\";\n }\n else\n {\n $m[$y][$n] = \"|\";\n }\n }\n }\n if(($b[$x] == \"[\") && ($b[$x + 1] == \"[\"))\n {\n $n++;\n $o -= 2;\n }\n elseif(($b[$x] == \"[\") && ($b[$x + 1] == \"]\"))\n {\n $n += 4;\n }\n elseif(($b[$x] == \"]\") && ($b[$x + 1] == \"[\"))\n {\n $n++;\n }\n elseif(($b[$x] == \"]\") && ($b[$x + 1] == \"]\"))\n {\n $n++;\n $o += 2;\n }\n}\n$t = max($m);\nfor($x = 0; $x < count($t); $x++)\n{\n $u = $m[$x];\n $v = \"\";\n for($y = 0; $y < $n + 1; $y++)\n {\n if($u[$y] == NULL)\n {\n $v .= \" \";\n }\n else\n {\n $v .= $u[$y];\n }\n }\n print $v . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " []];\nforeach ($bracketsDepth as $position => list($bracket, $depth)) {\n if ($position > 0) {\n list($prevBracket, $prevDepth) = $bracketsDepth[$position - 1];\n if ($bracket == BRACKET_CLOSE && $prevBracket == BRACKET_OPEN) {\n $matrix[0][] = MATRIX_SPACE;\n $matrix[0][] = MATRIX_SPACE;\n $matrix[0][] = MATRIX_SPACE;\n }\n }\n $matrix[0][] = MATRIX_LINE;\n}\n\nfor($i = 1; $i <= $maxDepth; $i++) {\n $matrix[$i] = array_fill(0, count($matrix[0]), MATRIX_SPACE);\n}\n\n\n$bracketPtr = 0;\nforeach ($matrix[0] as $position => $item) {\n if ($item == MATRIX_LINE) {\n list($bracket, $depth) = $bracketsDepth[$bracketPtr];\n $row = $maxDepth + 1 - $depth;\n $matrix[$row][$position] = MATRIX_PLUS;\n if ($bracket == BRACKET_OPEN) {\n $matrix[$row][$position + 1] = MATRIX_MINUS;\n } else {\n $matrix[$row][$position - 1] = MATRIX_MINUS;\n }\n for ($i = 1; $i < $row; $i++) {\n $matrix[$i][$position] = MATRIX_LINE;\n }\n $bracketPtr++;\n }\n}\n\nfor($i = -$maxDepth; $i <= $maxDepth; $i++) {\n $ofs = abs($i);\n echo implode(\"\", $matrix[$ofs]);\n if ($i != $maxDepth) echo \"\\n\";\n}"}], "negative_code": [], "src_uid": "7d9fb64a0a324a51432fbb01b4cc2c0e"} {"source_code": " $f)\n{\n print $d[0];\n}\nelse\n{\n print $d[1];\n}\n?>", "positive_code": [{"source_code": ""}, {"source_code": "$sG)\n \techo $unique[0];\n else\n \techo $unique[1];\n}"}, {"source_code": " $value);\n \n echo $key;\n?>"}, {"source_code": "$v)\n if($v==$m) $winner=$k;\necho $winner;\n?>"}, {"source_code": "array(),\"score\"=>array());\n for($i=0;$i<$n;$i++){\n $input = strtoupper(trim(fgets(STDIN)));\n if(!in_array($input,$temp[\"value\"])){\n $temp[\"value\"][]=$input;\n $temp[\"score\"][]=0;\n }\n $temp[\"score\"][array_search($input,$temp[\"value\"])]++;\n }\n echo $temp[\"value\"][array_keys($temp[\"score\"], max($temp[\"score\"]))[0]];\n?>"}], "negative_code": [{"source_code": "$secondTeamGoal)\n\n \techo \"$unique[0]\";\n else\n \techo \"$unique[1]\";\n }\n \n//print_r($str);"}, {"source_code": "$v)\n if($v==$m) $k;\necho $k;\n?>"}], "src_uid": "e3dcb1cf2186bf7e67fd8da20c1242a9"} {"source_code": "", "positive_code": [{"source_code": "$m){echo \"NO\";break;}\n \n }\n \n ?>"}, {"source_code": ""}, {"source_code": "= $t) {\n break;\n }\n $i = $i + $arr[$i];\n}\n\necho $out;\n\n?>"}, {"source_code": ""}, {"source_code": "\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= $t) {\n break;\n }\n $i = $i + $arr[$i];\n}\n\necho $out;\n\n?>"}, {"source_code": ""}], "src_uid": "9ee3d548f93390db0fc2f72500d9eeb0"} {"source_code": " 0 && $s[$l-1] == $s[$l]) {\r\n $l--;\r\n }\r\n $r = $n - 1 - $l;\r\n $ans = $r - $l + 1;\r\n IO::pr($ans);\r\n \r\n \r\n \r\n }\r\n \r\n \r\n \r\n \r\n \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 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 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 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 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 || $x<$l) {\r\n if($s[$e] === $target ) {\r\n $e--;\r\n }\r\n\r\n if($s[$x] === $target) {\r\n $x++;\r\n }\r\n\r\n if($s[$e] !== $target && $s[$x] !== $target ){\r\n break;\r\n }\r\n\r\n\r\n }\r\n\r\n echo ($x-$e) -1 . \"\\n\";\r\n}\r\n"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "= $xk) { echo '1'.PHP_EOL; }\r\n else { echo '0'.PHP_EOL; }\r\n }\r\n}\r\n\r\n?>"}, {"source_code": "= $k[$i]).PHP_EOL;\r\n }\r\n}\r\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= $xk) { echo '1'.PHP_EOL; }\r\n else { echo '0'.PHP_EOL; }\r\n }\r\n}\r\n\r\n?>"}], "src_uid": "ccf7aba6ca9bbf39a5ec8a20ec018825"} {"source_code": " 0 && $count > 0) {\n\n $data = [];\n $i = 0;\n while (($s = fgets(STDIN)) && ($i < $floor)) {\n $data = explode(\" \", $s);\n if(count($data) !== $count) {\n echo 'window limit' . count($data) . $count;\n break;\n }\n\n $i++;\n\n for($j = 0; $j < $count; $j++) {\n if((int)$data[$j] === 1) {\n ++$isHome;\n if(($j % 2) === 0) {\n ++$j;\n }\n }\n }\n \n if($i === $floor) { break; }\n\n\n }\n\n echo $isHome . PHP_EOL;\n\n\n} else {\n echo 0;\n}\n\n"}, {"source_code": " 0) {\n $result++;\n }\n }\n}\necho $result;\n?>"}, {"source_code": ""}, {"source_code": " 0)\n $ans++;\n } \n}\necho $ans;\n?>"}], "negative_code": [{"source_code": " 0)\n $ans++;\n }\n echo $ans;\n}\n?>"}, {"source_code": " 0 && $count > 0) {\n\n $data = [];\n $i = 0;\n while (($s = fgets(STDIN)) && ($i < $floor)) {\n $data = explode(\" \", $s);\n if(count($data) !== $count) {\n echo 'window limit' . count($data) . $count;\n break;\n }\n\n $i++;\n\n for($j = 0; $j < $count; $j++) {\n if((int)$data[$j] === 1) {\n ++$isHome;\n if(($j % 2) === 0) {\n ++$j;\n }\n ++$j;\n }\n }\n\n if($i === $floor) { break; }\n }\n\n\n echo $isHome . PHP_EOL;\n\n} else {\n echo 0;\n}\n\n"}], "src_uid": "5b9aed235094de7de36247a3b2a34e0f"} {"source_code": "= 0; $i--) {\n echo $result[$i] . ' ';\n}", "positive_code": [{"source_code": "= 0; $x--)\n{\n if($x == $d)\n {\n $c[count($c)] = $b[$d];\n $d = $b[$d] - 2;\n }\n}\n$e = array_reverse($c);\nprint implode(\" \", $e);\n?>"}], "negative_code": [], "src_uid": "e25efe1020ae64d55b3257ba457f809d"} {"source_code": "", "positive_code": [{"source_code": "$v) {\nif($v[$i]!=$buf) goto out;\nelseif($one) {\n$one=0;\n$size++;\n}\n}\n}\nout:\n$size--;\necho $size;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "'; print_r($var); echo '';}\n function read_str(){return trim(fgets($GLOBALS['file']));}\n function read_array(){return explode(' ', read_str());}\n /***************************************************************/\n $n = read_str();\n $s = read_str();\n \n function compare($s1, $s2)\n {\n $s = '';\n $len = strlen($s1);\n for($i=0; $i < $len; $i++)\n {\n if($s1[$i] == $s2[$i]) $s.= $s1[$i];\n else return $s;\n }\n \n return $s;\n }\n \n for($i=2; $i<=$n; $i++)\n {\n $s2 = read_str();\n \n $s = compare($s, $s2);\n if($s==='')\n {\n echo 0; die();\n }\n } \n \n echo strlen($s);\n"}, {"source_code": "0;$i++){\n while (strpos($tmp[$i],$current )!==0 && $len>0){\n $len--;\n $current=substr($current,0,$len);\n } \n}\necho $len;\n?>"}, {"source_code": ""}, {"source_code": " \"\");\n\n$s = \"a\".trim(fgets($f));\n\n$answer = strlen($s);\nfor($i=1; $i<=$answer; $i++)\n{\n $prefix[$i] = substr($s,0, $i);\n}\n\nfor($i=1; $i<$n; $i++)\n{\n $s = \"a\".trim(fgets($f));\n while($answer>0)\n {\n if(substr($s, 0, $answer)==$prefix[$answer]) break;\n $answer--;\n }\n}\n\necho $answer-1;"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " \"\");\n\n$s = trim(fgets($f));\n\n$answer = strlen($s);\nfor($i=1; $i<=$answer; $i++)\n{\n $prefix[$i] = substr($s,0, $i);\n}\n\nfor($i=1; $i<$n; $i++)\n{\n $s = trim(fgets($f));\n while($answer>0)\n {\n if(substr($s, 0, $answer)==$prefix[$answer]) break;\n $answer--;\n }\n}\n\necho $answer;"}], "src_uid": "081b35620952bd32ce6d8ddc756e5c9d"} {"source_code": " 1)\n{\n $c[count($c)] = $d;\n}\n$e = 0;\nfor($x = 0; $x < count($c) - 1; $x++)\n{\n $f = min($c[$x], $c[$x + 1]);\n if($f > $e)\n {\n $e = $f;\n }\n}\nprint $e * 2;\n?>", "positive_code": [{"source_code": " 0);\nfor($x = 0; $x < $a - 1; $x++)\n{\n for($y = $x + 1; $y < $a; $y++)\n {\n $f = $b[$x] + $b[$y];\n $c[count($c)] = $f;\n if(($d[$f][$x + 1] != TRUE) && ($d[$f][$y + 1] != TRUE))\n {\n $d[$f][$x + 1] = TRUE;\n $d[$f][$y + 1] = TRUE;\n $e[$f]++;\n }\n }\n}\nprint max($e);\n?>", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "44619ba06ec0dc410ef598ea45a76271"} {"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}", "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}"}], "src_uid": "4d5d20fd586ddbea2adeab104a6c2aec"} {"source_code": " \"x\", \"2\" => \"x\");\r\n for($j = 1; $j <= 8; $j += 1){\r\n for($k = 1; $k <= 8; $k += 1){\r\n if ($j >= 2 && $j <= 7 && $k >= 2 && $k <= 7 && $status == false){\r\n if ($chessboard[$j][$k] == '#'){\r\n if ($chessboard[$j-1][$k-1] == '#' && \r\n $chessboard[$j+1][$k+1] == '#' &&\r\n $chessboard[$j-1][$k+1] == '#' && \r\n $chessboard[$j+1][$k-1] == '#'){\r\n $status = true;\r\n $pos[\"1\"] = $j;\r\n $pos[\"2\"] = $k;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n echo $pos[\"1\"] . ' ' . $pos[\"2\"] . PHP_EOL;\r\n}\r\n?>\r\n\r\n\r\n"}, {"source_code": " \"x\", \"2\" => \"x\");\r\n for($j = 1; $j <= 8; $j += 1){\r\n for($k = 1; $k <= 8; $k += 1){\r\n if ($j >= 2 && $j <= 7 && $k >= 2 && $k <= 7 && $status == false){\r\n if ($chessboard[$j][$k] == '#'){\r\n if ($chessboard[$j-1][$k-1] == '#' && \r\n $chessboard[$j+1][$k+1] == '#' &&\r\n $chessboard[$j-1][$k+1] == '#' && \r\n $chessboard[$j+1][$k-1] == '#'){\r\n $status = true;\r\n $pos[\"1\"] = $j;\r\n $pos[\"2\"] = $k;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n echo $pos[\"1\"];\r\n echo \" \";\r\n echo $pos[\"2\"];\r\n echo \"\\n\";\r\n}\r\n?>\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\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 $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n\r\n?>"}], "negative_code": [{"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\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\r\n?>"}, {"source_code": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}, {"source_code": "$array = [];\r\n$t = (int)fgets(STDIN);\r\nwhile ($t--) {\r\n $r1 = trim(fgets(STDIN));\r\n $r2 = trim(fgets(STDIN));\r\n $r3 = trim(fgets(STDIN));\r\n $r4 = trim(fgets(STDIN));\r\n $r5 = trim(fgets(STDIN));\r\n $r6 = trim(fgets(STDIN));\r\n $r7 = trim(fgets(STDIN));\r\n $r8 = trim(fgets(STDIN));\r\n $arr = [$r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8];\r\n\r\n $x = \"\";\r\n $mk = 0;\r\n\r\n for ($i = 1; $i < count($arr) - 1; $i++) {\r\n\r\n if ($mk != 0) {\r\n break;\r\n }\r\n if (substr_count($arr[$i], '#') == 1 and $mk == 0) {\r\n if (substr_count($arr[$i - 1], '#') == 2 and substr_count($arr[$i + 1], '#') == 2) {\r\n $x = $arr[$i];\r\n $mk++;\r\n }\r\n }\r\n }\r\n $nn = array_search($x, $arr, true) + 1;\r\n $pos = strpos($x, \"#\") + 1;\r\n $fin = $nn . ' ' . $pos;\r\n array_push($array, $fin);\r\n}\r\nforeach ($array as $key => $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": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\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": " $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\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\r\n?>"}, {"source_code": " \"x\", \"2\" => \"x\");\r\n for($j = 1; $j <= 8; $j += 1){\r\n for($k = 1; $k <= 8; $k += 1){\r\n if ($j >= 2 && $j <= 7 && $k >= 2 && $k <= 7 && $status == false){\r\n if ($chessboard[$j][$k] == '#'){\r\n if ($chessboard[$j-1][$k-1] == '#' && \r\n $chessboard[$j+1][$k+1] == '#' &&\r\n $chessboard[$j-1][$k+1] == '#' && \r\n $chessboard[$j+1][$k-1] == '#'){\r\n $status = true;\r\n $pos[\"1\"] = $j;\r\n $pos[\"2\"] = $k;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n echo $pos[\"1\"];\r\n echo \" \";\r\n echo $pos[\"2\"];\r\n echo \"\\n\";\r\n}\r\n?>\r\n\r\n\r\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "6cfd3b0a403212ec68bac1667bce9ef1"} {"source_code": " 0)\n {\n $g[$f[$y]] = TRUE;\n }\n elseif($f[$y] < 0)\n {\n $h = abs($f[$y]);\n if($g[$h] == TRUE)\n {\n $c++;\n break;\n }\n }\n }\n}\nif($c == $b)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_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 for($y = 0; $y < $b; $y++)\n {\n $f[$d[$y]]++;\n }\n $g = 0;\n $h = array_fill(0, 26, 0);\n $j = array();\n for($y = 0; $y < $c; $y++)\n {\n $j[$e[$y]]++;\n }\n $e = array_unique($e);\n sort($e);\n $i = count($e) - 1;\n for($y = $b - 1; $y >= 0; $y--)\n {\n if($y == $e[$i])\n {\n $g += $j[$e[$i]];\n $i--;\n }\n $h[$y] += $g;\n }\n for($y = 0; $y < $b; $y++)\n {\n $f[$d[$y]] += $h[$y];\n }\n print implode(\" \", $f) . \"\\n\";\n}\n?>", "positive_code": [{"source_code": "$v)\n {\n echo $v.\" \";\n }\n echo \"\\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 for($y = 0; $y < $b; $y++)\n {\n $f[$d[$y]]++;\n }\n $g = 0;\n $h = array_fill(0, 26, 0);\n $j = array();\n for($y = 0; $y < $c; $y++)\n {\n $j[$e[$y]]++;\n }\n $e = array_unique($e);\n sort($e);\n $i = count($e) - 1;\n for($y = $b - 1; $y >= 0; $y--)\n {\n if($y == $e[$i])\n {\n $g += $j[$e[$i]];\n $i--;\n }\n $h[$y] += $g;\n }\n for($y = 0; $y < 26; $y++)\n {\n $f[$d[$y]] += $h[$y];\n }\n print implode(\" \", $f) . \"\\n\";\n}\n?>"}], "src_uid": "51ea912b40b07c1ba097292ffd0cec18"} {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n // $max_beer = (2000/$mod)-1;\n\n // if($beer_count > $max_beer)\n // $beer_count=$max_beer;\n\n\n if($participant_size%$mod == 0 && $string[$participant_size-2] == $string[$participant_size-3] && $string[$participant_size-3] == $string[$participant_size-1] && $beer_count!=0)\n $beer_count -= 1;\n\n if($beer_count==398){\n // var_dump($participant_size);\n // var_dump(substr($split_text[1], $participant_size-9,20));\n echo $participant_size%$mod;\n }\n\n echo $beer_count;"}], "negative_code": [{"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == 0 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size] && $beer_count!=0)\n $beer_count -= 1;\n\n // if($beer_count==398){\n // var_dump($participant_size);\n // var_dump(substr($split_text[1], $participant_size-9,20));\n // }\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n if($beer_count>499)\n $beer_count=499;\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size] && $beer_count!=0)\n $beer_count -= 1;\n\n if($beer_count==398){\n var_dump($participant_size);\n var_dump(substr($split_text[1], $participant_size-9,20));\n }\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n if($participant_size%$mod == 0 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size-3])\n $max_beer -= 1;\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size-3] && $beer_count!=0)\n $beer_count -= 1;\n\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size] && $beer_count!=0)\n $beer_count -= 1;\n \n if($beer_count==398){\n var_dump($participant_size);\n var_dump(range($participant_size-9, $participant_size-1));\n }\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = $participant_size/$mod;\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size-3])\n $max_beer -= 1;\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count > $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == 0 && $string[$participant_size-2] == $string[$participant_size-3] && $string[$participant_size-3] == $string[$participant_size-1] && $beer_count!=0)\n $beer_count -= 1;\n\n // if($beer_count==398){\n // var_dump($participant_size);\n // var_dump(substr($split_text[1], $participant_size-9,20));\n // }\n echo $participant_size%$mod;\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size-3])\n $beer_count -= 1;\n\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count > $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == 0 && $string[$participant_size-2] == $string[$participant_size-3] && $string[$participant_size-3] == $string[$participant_size-1] && $beer_count!=0)\n $beer_count -= 1;\n\n if($beer_count==398){\n // var_dump($participant_size);\n // var_dump(substr($split_text[1], $participant_size-9,20));\n echo $participant_size%$mod;\n }\n\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size] && $beer_count!=0)\n $beer_count -= 1;\n if($beer_count==398){\n var_dump($participant_size);\n var_dump(range($participant_size-9, $participant_size-1));\n }\n // echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n // if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size-3])\n // $max_beer -= 1;\n\n if($beer_count == 398){\n var_dump($participant_size);\n var_dump($string);\n }\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n echo $beer_count;"}, {"source_code": "2000)\n $participant_size=2000;\n $beer_count=0;\n $prev_sign=\"\";\n $curr_sign=\"\";\n $string = str_split($split_text[1]);\n // var_dump($participant_size);\n for($i=0; $i<$participant_size;$i++){\n \tif($i%$mod==0){\n \t\t$prev_sign=\"\";\n \t\t$valid_flag=0;\n \t\twhile(($i%$mod) < ($mod-3) && $i<$participant_size-1)\n \t\t\t$i++;\n \t}\n\t\t$curr_sign=$string[$i];\n if($i%$mod>$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n echo $beer_count;"}, {"source_code": "500)\n $participant_size=500*$mod;\n $beer_count=0;\n $prev_sign=\"\";\n $curr_sign=\"\";\n $string = str_split($split_text[1]);\n // var_dump($participant_size);\n for($i=0; $i<$participant_size;$i++){\n \tif($i%$mod==0){\n \t\t$prev_sign=\"\";\n \t\t$valid_flag=0;\n \t\twhile(($i%$mod) < ($mod-3) && $i<$participant_size-1)\n \t\t\t$i++;\n \t}\n\t\t$curr_sign=$string[$i];\n if($i%$mod>$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = ($participant_size/$mod)-1;\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == 1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size] && $beer_count!=0)\n $beer_count -= 1;\n\n if($beer_count==398){\n var_dump($participant_size);\n var_dump(substr($split_text[1], $participant_size-9,20));\n }\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size] && $beer_count!=0)\n $beer_count -= 1;\n\n echo $beer_count;"}, {"source_code": "$mod-3){\n \tif($curr_sign==$prev_sign)\n \t\t$valid_flag=1;\n \telse{\n \t\t\t$valid_flag=0;\n \t\t\twhile(($i%$mod) != $mod-1 && $i<$participant_size-1)\n \t\t\t\t$i++;\n \t}\n }\n\n \tif(($i%$mod)==$mod-1 && $valid_flag==1){\n \t\t$beer_count++;\n \t}\n \t$prev_sign=$string[$i];\n }\n $max_beer = (2000/$mod)-1;\n\n\n if($beer_count> $max_beer)\n $beer_count=$max_beer;\n\n\n if($participant_size%$mod == $mod-1 && $string[$participant_size-1] == $string[$participant_size-2] && $string[$participant_size-2] == $string[$participant_size] && $beer_count!=0)\n $beer_count -= 1;\n\n if($beer_count==398){\n var_dump($participant_size);\n var_dump(substr($string, $participant_size-9,20));\n }\n echo $beer_count;"}], "src_uid": "5606799ab5345bb9501fa6535e5abef9"} {"source_code": " 2048)\n {\n unset($c[$y]);\n }\n }\n $d = array_sum($c);\n if($d < 2048)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n}\n?>", "positive_code": [{"source_code": "= 2048) {\n echo 'YES' . PHP_EOL;\n } else {\n echo 'NO' . PHP_EOL;\n }\n return;\n}\n \n$q = fgets($__fp);\nfor ($i = 0; $i < $q; $i++) {\n solve();\n}"}, {"source_code": " 0) printf(\"YES\\n\");\n else printf(\"NO\\n\");\n}\n"}, {"source_code": " &$c) {\n while ($c > 1) {\n @$arr_[$v * 2]++;\n $c -= 2;\n }\n unset($v, $c);\n ksort($arr_);\n }\n echo (isset($arr_[2048]) ? 'YES' : 'NO') . PHP_EOL;\n}\n"}], "negative_code": [{"source_code": " &$c) {\n while ($c > 1) {\n @$arr_[$v * 2]++;\n $c -= 2;\n }\n }\n// var_dump($arr_);\n echo (isset($arr_[2048]) ? 'YES' : 'NO') . PHP_EOL;\n}\n"}, {"source_code": " &$c) {\n while ($c > 1) {\n @$arr_[$v * 2]++;\n $c -= 2;\n }\n unset($v, $c);\n }\n unset($arr_, $v, $c);\n// var_dump($arr_);\n echo (isset($arr_[2048]) ? 'YES' : 'NO') . PHP_EOL;\n}\n"}, {"source_code": " &$c) {\n while ($c > 1) {\n @$arr_[$v * 2]++;\n $c -= 2;\n }\n unset($v, $c);\n }\n echo (isset($arr_[2048]) ? 'YES' : 'NO') . PHP_EOL;\n}\n"}], "src_uid": "b40059fe9cbdb0cc3b64c3e463900849"} {"source_code": ""}], "negative_code": [], "src_uid": "1eaff8e0ec4614753699128af74b2471"} {"source_code": "", "positive_code": [{"source_code": "$itemsNumber) {\n $eArray[$i] = array_pop($unusedNumbers);\n $c++;\n } elseif ($usedNumbers[$eArray[$i]] > 1) {\n $usedNumbers[$eArray[$i]]--;\n $eArray[$i] = array_pop($unusedNumbers);\n $c++;\n }\n}\necho implode(\" \", $eArray);", "positive_code": [{"source_code": "$itemsNumber) {\n $eArray[$i] = array_pop($unusedNumbers);\n } elseif ($usedNumbers[$eArray[$i]] > 1) {\n $usedNumbers[$eArray[$i]]--;\n $eArray[$i] = array_pop($unusedNumbers);\n }\n}\necho implode(\" \", $eArray);"}, {"source_code": "$itemsNumber || isset($usedNumbers[$eArray[$i]])) {\n $eArray[$i] = 0;\n\n }else{\n $usedNumbers[$eArray[$i]] = 1;\n }\n}\n$c = 1;\nfor ($i=0; $i<$itemsNumber; $i++) {\n if ($eArray[$i] == 0) {\n while (isset($usedNumbers[$c])) {\n $c++;\n }\n $usedNumbers[$c] = 1;\n $eArray[$i] = $c;\n }\n}\necho implode(\" \", $eArray);"}, {"source_code": " $a)\n {\n $b[$x] = $d[$f];\n $f++;\n }\n elseif($c[$b[$x]] > 1)\n {\n $c[$b[$x]]--;\n $b[$x] = $d[$f];\n $f++;\n }\n}\nprint implode(\" \", $b);\n?>"}, {"source_code": "$itemsNumber) {\n $eArray[$i] = $unusedNumbers[$c];\n $c++;\n } elseif ($usedNumbers[$eArray[$i]] > 1) {\n $usedNumbers[$eArray[$i]]--;\n $eArray[$i] = $unusedNumbers[$c];\n $c++;\n }\n}\necho implode(\" \", $eArray);"}], "negative_code": [], "src_uid": "1cfd0e6504bba7db9ec79e2f243b99b4"} {"source_code": "", "positive_code": [{"source_code": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\n$sc = new Scanner();\n$t = $sc->nextInt();\nfor($j = 0; $j < $t; $j++)\n{\n $n = $sc->nextInt();\n $s = $sc->nextInt();\n $a = array();\n $sum = 0;\n $index = 0;\n $max = 0;\n $b = false;\n for($i = 0; $i < $n; $i++)\n {\n $a[$i] = $sc->nextInt();\n if($b) continue;\n $sum += $a[$i];\n //out::println($sum);\n if($max < $a[$i])\n {\n $max = $a[$i];\n $index = $i;\n }\n if($s < $sum)\n {\n $b = true;\n // break;\n }\n }\n if($b)\n {\n out::println($index + 1);\n }\n else\n {\n out::println(\"0\");\n }\n}\n\n\n"}, {"source_code": "$arr[$id])\n {\n $id=$i;\n }\n $ans-=$arr[$i];\n\n if($ans<0)break;\n }\n if($ans>=0)\n {\n $id=-1;\n }\n echo ($id+1).\"\\n\";\n}\n\n\n?>"}], "negative_code": [{"source_code": " $e)\n {\n $e = $y + 1;\n }\n $c -= $d[$y];\n if($c <= 0)\n {\n if($d[$y + 1] < $d[$y])\n {\n print $e . \"\\n\";\n $f = 1;\n }\n else\n {\n print $y + 1 . \"\\n\";\n $f = 1;\n }\n if($f == 0)\n {\n print \"0\\n\";\n }\n break;\n }\n }\n}\n?>"}, {"source_code": " $e)\n {\n $e = $d[$y];\n $e2 = $y + 1;\n }\n $c -= $d[$y];\n if($c <= 0)\n {\n if($d[$y + 1] <= $d[$e2 - 1])\n {\n print $e2 . \"\\n\";\n $f = 1;\n }\n else\n {\n print $y + 2 . \"\\n\";\n $f = 1;\n }\n if($f == 0)\n {\n print \"0\\n\";\n }\n break;\n }\n }\n}\n?>"}, {"source_code": " $e)\n {\n $e = $d[$y];\n $e2 = $y + 1;\n }\n $c -= $d[$y];\n if($c <= 0)\n {\n if($d[$y + 1] < $d[$e2 - 1])\n {\n print $e2 . \"\\n\";\n $f = 1;\n }\n else\n {\n print $y + 1 . \"\\n\";\n $f = 1;\n }\n if($f == 0)\n {\n print \"0\\n\";\n }\n break;\n }\n }\n}\n?>"}, {"source_code": " $e)\n {\n $e = $d[$y];\n $e2 = $y + 1;\n }\n $c -= $d[$y];\n if($c <= 0)\n {\n if($d[$y + 1] <= $d[$e2 - 1])\n {\n print $e2 . \"\\n\";\n $f = 1;\n }\n else\n {\n print $y + 1 . \"\\n\";\n $f = 1;\n }\n if($f == 0)\n {\n print \"0\\n\";\n }\n break;\n }\n }\n}\n?>"}, {"source_code": " $e)\n {\n $e = $d[$y];\n $e2 = $y + 1;\n }\n $c -= $d[$y];\n if($c <= 0)\n {\n if($d[$y + 1] <= $d[$e2 - 1])\n {\n print $e2 . \"\\n\";\n $f = 1;\n }\n else\n {\n print $y + 2 . \"\\n\";\n $f = 1;\n }\n if($f == 0)\n {\n print \"0\\n\";\n }\n break;\n }\n }\n }\n}\n?>"}, {"source_code": "0)\n {\n break;\n }\n $skip=$i+1;\n }\n }\n echo $skip.\"\\n\";\n\n}\n\n\n?>"}], "src_uid": "0924971933265f4be34710149a541087"} {"source_code": "read_array();\n return $array[0];\n }\n}\n?>\nread_array();\n $n = $a[0];\n $k = $a[1];\n $t = $a[2];\n $sum = floor(($n * $k * $t) / 100);\n for ($i = 0; $i < $n; $i++){\n if ($sum == 0) echo '0 ';\n if ($sum < $k && $sum > 0) {\n echo $sum.' ';\n $sum = 0;\n };\n if ($sum >= $k) {\n echo $k.' ';\n $sum -= $k;\n }\n }\n?>", "positive_code": [{"source_code": "0 && $diff<=$pDif){\n\n $temp= 0;\n\n while($dpt<=$t){\n $temp++;\n $dpt = ($pp+$temp)/$nk*100;\n }\n $str .= ($temp-1).' ';\n $$diff = 0;\n }else{\n $str .= '0 ';\n }\n }\n\n $ts += $k ;\n}\n\n\nfwrite(STDOUT, $str.\"\\n\"); "}, {"source_code": ""}, {"source_code": " $b)\n {\n $e[$x] = $b;\n $d -= $b;\n }\n else\n {\n $e[$x] = $d;\n break;\n }\n}\nprint implode(\" \", $e);\n?>"}, {"source_code": "0){\n $j=min($k,$completed);\n $completed-=$j;\n echo $j.\" \";\n } else echo \"0 \";\n}\n?>"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": "$a[$i-2])\n {\n if($pr<>$c)\n {\n if($pr!=-1)\n {\n $ans=0;\n }\n $pr=$c;\n }\n $c=0;\n }\n else \n {\n $c++;\n }\n}\n\nif($pr<>$c)\n{\n if($pr!=-1)\n {\n $ans=0;\n }\n $pr=$c;\n}\n\nif($ans==1)\n{\n print (\"YES\");\n}\nelse\n{\n print (\"NO\");\n}\nfclose($handle);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $mx)\n $mx = $cnt;\n if($cnt < $mn)\n $mn = $cnt;\n \n $cnt = 1;\n $last = $tmp;\n } \n }\n }\n \n if($cnt > $mx)\n $mx = $cnt;\n if($cnt < $mn)\n $mn = $cnt;\n \n if($mn == $mx)\n echo \"YES\";\n else\n echo \"NO\";\n \n?>"}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": "$a[$i-2])\n {\n if($pr<>$c)\n {\n if($pr!=-1)\n {\n $ans=0;\n }\n $pr=$c;\n }\n $c=0;\n }\n else \n {\n $c++;\n }\n}\nif($ans==1)\n{\n print (\"YES\");\n}\nelse\n{\n print (\"NO\");\n}\nfclose($handle);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "= 0) {\n\t\t$curr = (int)fgets(STDIN);\n\t\tif($curr == $prev) {\n\t\t $currsiz++;\n\t\t} else {\n\t\t if($siz == -1) {\n\t\t $siz = $currsiz;\n\t\t } else {\n\t\t if($siz != $currsiz) {\n\t\t $good = 0;\n\t\t }\n\t\t }\n\t\t $siz = 1;\n\t\t $prev = $curr;\n\t\t}\n\t\t$n--;\n\t}\n if($siz == -1) {\n $siz = $currsiz;\n } else {\n if($siz != $currsiz) {\n $good = 0;\n }\n }\n\tif($good == 1) {\n\t echo(\"YES\");\n\t} else {\n\t echo(\"NO\");\n\t}\n?>"}], "src_uid": "75a00d8a614fd0bcb8504b0268a121e0"} {"source_code": "\n"}], "negative_code": [], "src_uid": "1c07882651ef6ebfc05e777d562e28b9"} {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n \n \n \n $totalWidth = 0;\n $maxHeight = 0;\n $heightArray = array();\n foreach ($dimensionsOfFriends as $key => $value) {\n $width = (int)$value[0];\n $height = (int)$value[1];\n $heightArray[] = $height;\n \n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n \n $photoSize = $totalWidth * $maxHeight;\n \n \n arsort($heightArray);\n $maxHeight1 = array_shift($heightArray);\n $maxHeight2 = array_shift($heightArray);\n \n \n $photoSizeArray = array();\n for ($i = 0; $i<$nrFriends; $i++){\n if ((int)$dimensionsOfFriends[$i][1] == $maxHeight1 && $maxHeight2 != $maxHeight1){\n $photoSizeArray[] = ($totalWidth - (int)$dimensionsOfFriends[$i][0]) * ($maxHeight2);\n } else {\n $photoSizeArray[] = ($photoSize - (int)$dimensionsOfFriends[$i][0]*$maxHeight1);\n }\n \n }\n \n \n echo implode(' ', $photoSizeArray);\n", "positive_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": " reset($h)) {\n $max = (int) $line[1];\n } else {\n $max = (int) reset($h);\n }\n echo (($w - (int) $line[0]) * $max).\" \";\n}\n?>"}, {"source_code": " 1 || $heights[$i] < $maxHeight){\n $height = $maxHeight;\n }else{\n $t = $heights[$i];\n $heights[$i] = 0;\n $height = max($heights);\n $heights[$i] = $t;\n }\n echo ($height * $width).' ';\n}\n?>"}, {"source_code": " $max1) {\n $max1 = $h[$i];\n $max1pos = $i;\n }\n}\n\nfor ($i = 0; $i < $n; $i++) {\n if (($h[$i] > $max2) && ($i != $max1pos)) {\n $max2 = $h[$i];\n }\n}\n\nfor ($i = 0; $i < $n; $i++) {\n $wtot = $wsum - $w[$i];\n $htot = 0;\n if ($h[$i] == $max1) {\n $htot = $max2;\n } else {\n $htot = $max1;\n }\n fprintf($fileOUT, $wtot * $htot . \" \");\n}\n\nfclose($fileIN);\nfclose($fileOUT);\n?>"}, {"source_code": " $wSum,\n\t\t\t'h' => $hMax\n\t\t);\n\t\t$wSum += $r[$i]['w'];\n\t\tif ($r[$i]['h'] > $hMax) {\n\t\t\t$hMax = $r[$i]['h'];\n\t\t}\n\t}\n\n\t$wSum = 0;\n\t$hMax = 0;\n\tfor($i = $n - 1; $i >= 0; $i--) {\n\t\t$rRes[$i]['w'] += $wSum;\n\t\tif ($hMax > $rRes[$i]['h']) {\n\t\t\t$rRes[$i]['h'] = $hMax;\n\t\t}\n\t\t$wSum += $r[$i]['w'];\n\t\tif ($r[$i]['h'] > $hMax) {\n\t\t\t$hMax = $r[$i]['h'];\n\t\t}\n\t}\n\n\tfor($i = 0; $i < $n; $i++) {\n\t\techo $rRes[$i]['w'] * $rRes[$i]['h'];\n\t\tif ($i != $n - 1) {\n\t\t\techo ' ';\n\t\t}\n\t}\n?>"}, {"source_code": ""}, {"source_code": "0,\"h\"=>0),array(\"id\"=>0,\"h\"=>0));\nfor($i=0;$i<$fCount;$i++)\n{\n list($w,$h)=explode(\" \",strtolower(fgets(STDIN)));\n\t$h=trim($h);\n\t$w=trim($w);\n $friends[$i]=array(\"w\"=>$w,\"h\"=>$h);\n\tif($maxH[0][\"h\"]<$h)\n\t{\n\t\t$maxH[1]=$maxH[0];\n\t\t$maxH[0]=array(\"id\"=>$i,\"h\"=>$h);\n\t}\n\telseif($maxH[1][\"h\"]<$h)\n\t{\n\t\t$maxH[1]=array(\"id\"=>$i,\"h\"=>$h);\n\t}\n\t$totalwidth+=$w;\n}\n$sizes=array();\nforeach($friends as $i=>$value)\n{\n\t$H=(($maxH[0][\"id\"]==$i)?$maxH[1][\"h\"]:$maxH[0][\"h\"]);\n $sizes[]=($totalwidth-$value[\"w\"])*$H;\n}\necho implode(\" \",$sizes);\n?>"}, {"source_code": "= $maxHeight) {\n $prevMaxHeight = $maxHeight;\n $maxHeight = $height;\n $maxHeightPointer = $pointer;\n } elseif ($height >= $prevMaxHeight) {\n $prevMaxHeight = $height;\n }\n $pointer++;\n}\n\n$f = false;\nforeach ($widths as $key => $width) {\n $height = $key == $maxHeightPointer ? $prevMaxHeight : $maxHeight;\n $square = ($sumWidth - $width) * $height;\n echo ($f ? \" \" : \"\") . $square;\n $f = true;\n}"}, {"source_code": "1 && $h2[0]==$h2[1]) || array_unique($h2)==1)\n\t$max2=$max1;\nelse{\n\t$h2=array_unique($h2);\n\tunset($h2[0]);\n\t$max2=max($h2);\n}\n\nfor ($j=0; $j < $n; $j++) {\n\tif ($h[$j]==$max1) {\n\t\techo ($sumw-$w[$j])*$max2.\" \";\n\t}\n\telse if ($h[$j]==$max2) {\n\t\techo ($sumw-$w[$j])*$max1.\" \";\n\t}\n\n\telse echo ($sumw-$w[$j])*$max1.\" \";\n}\n\n?>"}, {"source_code": "=2){\n $next_max = $max;\n break;\n }\n if ($next_max < $h[$i] && $h[$i] < $max)\n $next_max = $h[$i];\n}\nfor ($i = 0; $i<$n; $i++) {\n printf(\"%d \",($sum-$w[$i])*(($max==$h[$i])?$next_max:$max));\n}\n?>"}, {"source_code": " (int)$w,\n 'h' => (int)$h\n );\n $totalW += (int)$w;\n $h = (int)$h;\n if ( $max1 < $h ){\n $max2 = $max1;\n $max1 = $h;\n }else if( $max2 < $h ){\n $max2 = $h;\n }\n }\n\n for( $i = 0; $i < $n; $i++ ){\n if( $f[$i]['h'] == $max1 ){\n $H = $max2;\n } else {\n $H = $max1;\n }\n\n print ($totalW-$f[$i]['w'])*$H; print ' ';\n }\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $max){\n $max2 = $max;\n $max = $exp[1];\n }else if($exp[1] > $max2){\n $max2 = $exp[1];\n }\n $dat[$i] = $exp;\n}\nunset($exp);\n\nfor($i = 0; $i < $n; $i++){\n echo (($sum-$dat[$i][0])*($dat[$i][1] == $max ? $max2 : $max)).($i != $n-1 ? ' ' : '');\n}"}], "negative_code": [{"source_code": " $value) {\n $widths[$key] += $width;\n $heights[$key] = max($heights[$key], $height);\n }\n $widths[] = $sumWidth;\n $heights[] = $maxHeight;\n $sumWidth += $width;\n $maxHeight = max($maxHeight, $height);\n}\n\n$squares = [];\nforeach (array_keys($widths) as $key) {\n $squares[$key] = $widths[$key] * $heights[$key];\n}\necho implode(\" \", $squares);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\";\n}\n?>"}, {"source_code": "1) $max2=$max1;\nelse{\n\tunset($h2[0]);\n\t$max2=max($h2);\n}\n\nprint_r($h2);\n\nfor ($j=0; $j < $n; $j++) {\n\tif ($h[$j]==$max1) {\n\t\techo ($sumw-$w[$j])*$max2.\" \";\n\t}\n\telse if ($h[$j]==$max2) {\n\t\techo ($sumw-$w[$j])*$max1.\" \";\n\t}\n\n\telse echo ($sumw-$w[$j])*$max1.\" \";\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "1) {\n\t$max2=$max1=$h2[0];\n}\nelseif ($n==1) {\n\techo 0;\n\texit();\n}\nelse list($max1,$max2)=$h2;\n\nfor ($j=0; $j < $n; $j++) {\n\tif ($h[$j]==$max1) {\n\t\techo ($sumw-$w[$j])*$max2.\" \";\n\t}\n\telse if ($h[$j]==$max2) {\n\t\techo ($sumw-$w[$j])*$max1.\" \";\n\t}\n\n\telse echo ($sumw-$w[$j])*$max1.\" \";\n}\n?>"}, {"source_code": "1) $max2=$max1;\nelse{\n\tunset($h2[0]);\n\t$max2=max($h2);\n}\n\nfor ($j=0; $j < $n; $j++) {\n\tif ($h[$j]==$max1) {\n\t\techo ($sumw-$w[$j])*$max2.\" \";\n\t}\n\telse if ($h[$j]==$max2) {\n\t\techo ($sumw-$w[$j])*$max1.\" \";\n\t}\n\n\telse echo ($sumw-$w[$j])*$max1.\" \";\n}\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n if ($nrFriends == 200000) {\n $width = (int)$dimensionsOfFriends[0][0];\n $height = (int)$dimensionsOfFriends[0][1];\n $size = $width * ($nrFriends - 1) * $height;\n \n $output = array_fill(1, $nrFriends, $size);\n \n return implode(' ', $output);\n \n }\n \n $photoSizeArray = array();\n for ($i = 0; $i < $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($inputArray as $key => $value) {\n $dimensions = explode(' ', $value);\n $width = (int)$dimensions[0];\n $height = (int)$dimensions[1];\n \n if ($key != $i) {\n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n if ($nrFriends == 200000) {\n $width = (int)$dimensionsOfFriends[0][0];\n $height = (int)$dimensionsOfFriends[0][1];\n $size = $width * ($nrFriends - 1) * $height;\n \n $output = array_fill(1, $nrFriends, $size);\n \n echo implode(' ', $output);\n exit();\n }\n \n $photoSizeArray = array();\n for ($i = 0; $i < $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($dimensionsOfFriends as $key => $value) {\n $width = (int)$value[0];\n $height = (int)$value[1];\n \n if ($key != $i) {\n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n if ($nrFriends == 200000) {\n $width = (int)$dimensionsOfFriends[0][0];\n $height = (int)$dimensionsOfFriends[0][1];\n $size = $width * ($nrFriends - 1) * $height;\n \n return implode(' ', array_fill(1, $nrFriends, $size));\n \n }\n \n $photoSizeArray = array();\n for ($i = 0; $i < $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($inputArray as $key => $value) {\n $dimensions = explode(' ', $value);\n $width = (int)$dimensions[0];\n $height = (int)$dimensions[1];\n \n if ($key != $i) {\n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n if ($dimensionsOfFriends[$key][1] > $maxHeight1[1]) {\n $maxHeight1 = array($key, $dimensionsOfFriends[$key][1]);\n }\n if ($dimensionsOfFriends[$key][1] > $maxHeight2[1] && $key != $maxHeight1[0]) {\n $maxHeight2 = array($key, $dimensionsOfFriends[$key][1]);\n }\n \n }\n \n \n \n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($dimensionsOfFriends as $key => $value) {\n $width = (int)$value[0];\n $height = (int)$value[1];\n \n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n \n $photoSize = $totalWidth * $maxHeight;\n \n \n $photoSizeArray = array();\n for ($i = 0; $i<$nrFriends; $i++){\n if ((int)$dimensionsOfFriends[$i][1] == $maxHeight1[1] && $maxHeight2[1] != $maxHeight1[1]){\n $photoSizeArray[] = ($totalWidth - (int)$dimensionsOfFriends[$i][0]) * ($maxHeight2[1]);\n } else {\n $photoSizeArray[] = ($photoSize - (int)$dimensionsOfFriends[$i][0]*$maxHeight1[1]);\n }\n \n }\n \n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n if ($nrFriends == 200000) {\n $width = (int)$dimensionsOfFriends[0][0];\n $height = (int)$dimensionsOfFriends[0][1];\n $size = $width * ($nrFriends - 1) * $height;\n \n $output = array_fill(1, $nrFriends, $size);\n \n echo implode(' ', $output);\n exit();\n }\n \n $photoSizeArray = array();\n for ($i = 0; $i < $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($dimensionsOfFriends as $key => $value) {\n $dimensions = explode(' ', $value);\n $width = (int)$dimensions[0];\n $height = (int)$dimensions[1];\n \n if ($key != $i) {\n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n \n $photoSizeArray = array();\n for ($i = 0; $i <= $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($dimensionsOfFriends as $key => $value) {\n if ($key != $i) {\n $totalWidth += $value[0];\n if ($value[1] > $maxHeight) {\n $maxHeight = $value[1];\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n if ($nrFriends>5000){\n $width = (int)$dimensionsOfFriends[0][0];\n $height = (int)$dimensionsOfFriends[0][1];\n $size = $width * ($nrFriends - 1) * $height;\n\n return implode(' ', array_fill(1, $nrFriends, $size));\n\n }\n \n $photoSizeArray = array();\n for ($i = 0; $i < $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($inputArray as $key => $value) {\n $dimensions = explode(' ', $value);\n $width = (int)$dimensions[0];\n $height = (int)$dimensions[1];\n \n if ($key != $i) {\n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n if ($nrFriends = 200000) {\n $width = (int)$dimensionsOfFriends[0][0];\n $height = (int)$dimensionsOfFriends[0][1];\n $size = $width * ($nrFriends - 1) * $height;\n \n return implode(' ', array_fill(1, $nrFriends, $size));\n \n }\n \n $photoSizeArray = array();\n for ($i = 0; $i < $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($inputArray as $key => $value) {\n $dimensions = explode(' ', $value);\n $width = (int)$dimensions[0];\n $height = (int)$dimensions[1];\n \n if ($key != $i) {\n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n }\n \n if (count(array_unique($dimensionsOfFriends)) == 1){\n $width = (int)$dimensionsOfFriends[0][0];\n $height = (int)$dimensionsOfFriends[0][1];\n $size = $width * ($nrFriends - 1) * $height;\n \n return implode(' ', array_fill(0, $nrFriends, $size));\n \n }\n \n $photoSizeArray = array();\n for ($i = 0; $i < $nrFriends; $i++) {\n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($inputArray as $key => $value) {\n $dimensions = explode(' ', $value);\n $width = (int)$dimensions[0];\n $height = (int)$dimensions[1];\n \n if ($key != $i) {\n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n }\n \n $photoSizeArray[$i] = $totalWidth * $maxHeight;\n }\n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $value) {\n $dimensionsOfFriends[$key] = explode(' ', $value);\n if ($dimensionsOfFriends[$key][1] > $maxHeight1[1]) {\n $maxHeight1 = array($key, $dimensionsOfFriends[$key][1]);\n }\n if ($dimensionsOfFriends[$key][1] > $maxHeight2[1] && $key != $maxHeight1[0]) {\n $maxHeight2 = array($key, $dimensionsOfFriends[$key][1]);\n }\n \n }\n \n \n \n $totalWidth = 0;\n $maxHeight = 0;\n foreach ($dimensionsOfFriends as $key => $value) {\n $width = (int)$value[0];\n $height = (int)$value[1];\n \n $totalWidth += $width;\n if ($height > $maxHeight) {\n $maxHeight = $height;\n }\n }\n \n $photoSize = $totalWidth * $maxHeight;\n \n $photoSizeArray = array();\n for ($i = 1; $i<=$nrFriends; $i++){\n if ((int)$dimensionsOfFriends[$i][1] == $maxHeight1[1] && $maxHeight2[1] != $maxHeight1[1]){\n $photoSizeArray[] = ($totalWidth - (int)$dimensionsOfFriends[$i][0]) * ($maxHeight2[1]);\n } else {\n $photoSizeArray[] = ($photoSize - (int)$dimensionsOfFriends[$i][0]*(int)$dimensionsOfFriends[$i][1]);\n }\n \n }\n \n \n echo implode(' ', $photoSizeArray);\n"}, {"source_code": " $maxh)\n\t\t\t\t$maxh = $line[1];\n\t\t\t$wsum += $line[0];\n\t\t}\n\t}\n\t$px[$i] = $wsum * $maxh;\n}\necho implode(\" \",$px);\n?>"}], "src_uid": "e1abc81cea4395ba675cf6ca93261ae8"} {"source_code": "", "positive_code": [{"source_code": "= 0; $x--)\n{\n if($b[$a - 1] != $b[$x])\n {\n $d = $a - $x - 1;\n }\n}\nprint max($c, $d);\n?>"}], "negative_code": [{"source_code": "= 0; $x--)\n{\n if($b[$a - 1] != $b[$x])\n {\n $d = $x;\n }\n}\nprint max($c, $d);\n?>"}, {"source_code": ""}], "src_uid": "101fec8d8e169f941e71281048468121"} {"source_code": "", "positive_code": [{"source_code": "$ans1||($M[$b[$i]]==$ans1&&$M[$c[$i]]>=$ans2)){\n\t\t$ans1=$M[$b[$i]]; $ans2=$M[$c[$i]]; $where=$i+1;\n\t}\necho $where;\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": "$ans1||($M[$b[$i]]==$ans1&&$M[$c[$i]]>$ans2)){\n\t\t$ans1=$M[$b[$i]]; $ans2=$M[$c[$i]]; $where=$i+1;\n\t}\necho $where;\n?>"}, {"source_code": "$ans1||($M[$b[$i]]==$ans1&&$M[$c[$i]]>$ans2)){\n\t\t$ans1=$M[$b[$i]]; $ans2=$M[$c[$i]]; $where=$i+1;\n\t}\necho $where;\n?>"}], "src_uid": "74ddbcf74988940265985ec8c36bb299"} {"source_code": "$value)\n\t{\n\t\tif($value==1)\n\t\t {\n\t\t \t$flag=1;\n\t\t \tif($key<$min)\n\t\t \t\t$min=$key;\n\t\t }\n\t}\n\tif($flag==0)\n\t\techo \"-1\\n\";\n\telse\n\t{\n\t echo implode(array_keys($line,$min))+1;\n\t echo \"\\n\";\n\t}\n\n}", "positive_code": [{"source_code": " $aV) {\n if (count($aV) == 1) {\n if ($iMin == -1) {\n $iMin = $iValue;\n } elseif ($iValue < $iMin) {\n $iMin = $iValue;\n }\n }\n \n }\n\n return $iMin == -1 ? $iMin : current($aResults[$iMin]);\n}\n\n$t = trim(fgets(STDIN));\nwhile ($t--) {\n echo solve();\n echo \"\\n\";\n}"}, {"source_code": ""}], "negative_code": [], "src_uid": "99d2b0386d101da802ac508ef8f7325b"} {"source_code": "= $k)) {\n $m++;\n $idpos[$id[$i]] = $m;\n $mpos[$m] = $id[$i];\n }\n}\necho min($m, $k) . PHP_EOL;\nfor ($i = $m; $i > max($m - $k, 0); $i--) {\n echo $mpos[$i] . ' ';\n}", "positive_code": [{"source_code": ""}, {"source_code": " $sV){\n if(!in_array($sV,$aTest) && $k > count($aTest)){\n $aTest[] = $sV;\n } elseif(!in_array($sV,$aTest) && $k <= count($aTest)) {\n $aTest[$j] = 'a';\n $aTest[] = $sV;\n $j++;\n }\n}\n$aAnswer = [];\nfor($i = $j; $i < count($aTest); $i++){\n $aAnswer[] = $aTest[$i];\n}\necho count($aAnswer) . \"\\n\";\necho implode(\" \",array_reverse($aAnswer));\n"}, {"source_code": ""}, {"source_code": "= $k)) {\n $m++;\n $idpos[$id[$i]] = $m;\n $mpos[$m] = $id[$i];\n }\n}\n$x = min($m, $k) . PHP_EOL;\nfor ($i = $m; $i > $m - min($m, $k); $i--) {\n $x .= $mpos[$i] . ' ';\n}\necho $x;"}, {"source_code": " $aV){\n unset($res[$sK]);\n break;\n }\n $res[$v] = 1;\n }\n }\n}\necho count($res).\"\\n\";\nforeach(array_reverse($res, true) as $k => $v){\n echo $k.' ';\n}\n\n\n\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "485a1ecf8f569b85327b99382bda9466"} {"source_code": ""}], "negative_code": [], "src_uid": "162fa942bc6eeb5164b19598da2f8bef"} {"source_code": " $a[$i+1]) {\r\n $ans += 1;// 'YES';\r\n $i += 1;\r\n }\r\n }\r\n IO::pr($ans);\r\n }\r\n \r\n// $ans = 0;\r\n// list($n, $x) = IO::getArray();\r\n \r\n \r\n \r\n// $len = strlen($x);\r\n// if($len > $n) {\r\n// $ans = -1; \r\n// } elseif($len < $n) {\r\n// $maxV = maxVal($x);\r\n// if($maxV == '1') {\r\n// $ans = -1; \r\n// } else {\r\n// $ind = [0, 1];\r\n \r\n// foreach(str_split($x) as $ch) {\r\n// IO::pr($ch);\r\n// }\r\n \r\n// }\r\n \r\n// }\r\n \r\n// IO::pr($ans);\r\n \r\n// function temp($x, $$aTemp, $ans) {\r\n// while($n > strlen($x)) {\r\n// IO::pr($ans . \" \" . strlen($x) . \" \" . $x . \" \" . $maxV);\r\n// if($maxV < 9 && in_array('3', str_split($x))) {\r\n// $maxV = 3;\r\n// }\r\n// $x = bcmul($x, $maxV);\r\n// $ans++;\r\n// $maxV = IO::getMaxValue(maxVal($x) , $maxV);\r\n// }\r\n// return $ans;\r\n// }\r\nfunction maxVal($x) {\r\n $max = $x[0];\r\n for($i=1; $i $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 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 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 $p[$i]) {\r\n $iSum++;\r\n $i = $i + 1;\r\n }\r\n }\r\n echo $iSum . PHP_EOL;\r\n}\r\n"}], "negative_code": [], "src_uid": "80e21bfe08a3ef156d0404d4fe07bccd"} {"source_code": "", "positive_code": [{"source_code": " 0)\n {\n $e++;\n array_push($f, $a - $g);\n }\n print $e . \"\\n\";\n print implode(\" \", $f);\n}\n?>"}, {"source_code": "0) $b[$j]=$i-$s;\necho $j+1 .\"\\n\";\nfor ($i=0;$i<=$j;$i++) \n print $b[$i] .\" \";\n?>"}], "negative_code": [{"source_code": "0) $b[$j]=$i-$s;\necho $j+1 .\"
\";\nfor ($i=0;$i<=$j;$i++) \n print $b[$i] .\" \";\n?>"}], "src_uid": "3f320920a023c3bc10ba1525e8c89044"} {"source_code": " 0)\r\n {\r\n $c[count($c)] = $e;\r\n $e = 0;\r\n }\r\n $d++;\r\n }\r\n elseif($b[$y] == \"b\")\r\n {\r\n if($d > 0)\r\n {\r\n $c[count($c)] = $d;\r\n $d = 0;\r\n }\r\n $e++;\r\n }\r\n }\r\n if($e > 0)\r\n {\r\n $c[count($c)] = $e;\r\n $e = 0;\r\n }\r\n elseif($d > 0)\r\n {\r\n $c[count($c)] = $d;\r\n $d = 0;\r\n }\r\n $f = 0;\r\n for($y = 0; $y < count($c); $y++)\r\n {\r\n if($c[$y] < 2)\r\n {\r\n $f = 1;\r\n break;\r\n }\r\n }\r\n if($f == 0)\r\n {\r\n print \"YES\\n\";\r\n }\r\n else\r\n {\r\n print \"NO\\n\";\r\n }\r\n}\r\n?>", "positive_code": [{"source_code": " 1) {\r\n if ($a % 2 != 0 and $a % 2 != 1) {\r\n\r\n $x++;\r\n }\r\n } else {\r\n $x++;\r\n }\r\n $o = \"\";\r\n }\r\n } else {\r\n if ($str[$i + 1] == \"b\") {\r\n $h .= $str[$i];\r\n } else {\r\n $h .= $str[$i];\r\n $b = substr_count($h, \"b\");\r\n if ($b > 1) {\r\n if ($b % 2 != 0 and $b % 2 != 1) {\r\n\r\n $x++;\r\n }\r\n } else {\r\n $x++;\r\n }\r\n $h = \"\";\r\n }\r\n }\r\n }\r\n if ($x == 0) {\r\n array_push($arr2, \"YES\");\r\n } else {\r\n array_push($arr2, \"NO\");\r\n }\r\n}\r\nforeach ($arr2 as $key => $value)\r\n print($value . \"\\r\\n\");\r\n$end = readline();\r\n?>"}], "negative_code": [], "src_uid": "e95e2d21777c1d686bede1b0a5dacbf5"} {"source_code": "= $m){\n $iSumPoint = bcmul($iMaxArrayA , $m);\n} else {\n $iAb = floor($m/($k + 1));\n $iAc = $m - ($iAb)*(($k + 1));\n $iSumPoint = bcmul(($iAb*$k),$iMaxArrayA);\n $iSumPoint = bcadd($iSumPoint,bcmul($iAb,$iMaxArrayB));\n if($iAc > 0){\n $iSumPoint = bcadd($iSumPoint,bcmul($iAc,$iMaxArrayA));\n }\n}\necho $iSumPoint;\n", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $m){\n $iSumPoint = $iMaxArrayA * $m;\n} else {\n $iAb = floor($m/($k + 1));\n $iAc = $m - ($iAb)*(($k + 1));\n $iSumPoint = bcmul(($iAb*$k),$iMaxArrayA);\n $iSumPoint = bcadd($iSumPoint,bcmul($iAb,$iMaxArrayB));\n if($iAc > 0){\n $iSumPoint = bcadd($iSumPoint,bcmul($iAc,$iMaxArrayA));\n }\n}\necho $iSumPoint;\n"}, {"source_code": "= $m){\n $iSumPoint = $iMaxArrayA * $m;\n} else {\n $iAb = floor($m/($k + 1));\n $iAc = $m - ($iAb)*(($k + 1));\n $iSumPoint = bcmul(($iAb*$k),$iMaxArrayA);\n $iSumPoint = bcadd($iSumPoint,bcmul($iAb,$iMaxArrayB));\n $iSumPoint = bcadd($iSumPoint,bcmul($iAc,$iMaxArrayA));\n}\necho $iSumPoint;\n"}, {"source_code": "= $m){\n $iSumPoint = $iMaxArrayA * $m;\n} else {\n $iAb = floor($m/($k + 1));\n $iSumPoint = strval(($iAb*$k)*$iMaxArrayA);\n $iSumPoint += strval($iAb*$iMaxArrayB);\n $iAc = $m - ($iAb)*(($k + 1));\n $iSumPoint += strval($iAc*$iMaxArrayA);\n}\necho $iSumPoint;\n"}, {"source_code": "= $m){\n $iSumPoint = $iMaxArrayA * $m;\n} else {\n $iAb = floor($m/($k + 1));\n $iSumPoint = ($iAb*$k)*$iMaxArrayA;\n $iSumPoint += $iAb*$iMaxArrayB;\n}\necho $iSumPoint;\n"}, {"source_code": "= $m){\n $iSumPoint = $iMaxArrayA * $m;\n} else {\n $iAb = floor($m/($k + 1));\n $iSumPoint = ($iAb*$k)*$iMaxArrayA;\n $iSumPoint += $iAb*$iMaxArrayB;\n $iAc = $m - ($iAb)*(($k + 1));\n $iSumPoint += $iAc*$iMaxArrayA;\n}\necho $iSumPoint;\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "96dee17800e147350bd37e60f66f49dd"} {"source_code": "", "positive_code": [{"source_code": " 0) {\r\n $cn = count($ar);\r\n for($j=0; $j < $cn-1; $j++) {\r\n if(!in_array(($ar[$j] * 10 + $n[$i]), $aArray)) {\r\n $res = $ar[$j] * 10 + $n[$i];\r\n break;\r\n } else {\r\n $ar[] = $ar[$j] * 10 + $n[$i];\r\n }\r\n }\r\n }\r\n \r\n }\r\n }\r\n \r\n \r\n \r\n \r\n echo strlen(strval($res)) . \"\\n\" . $res . \"\\n\";\r\n }"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\r\n $cn = count($ar);\r\n for($j=0; $j < $cn; $j++) {\r\n if(!in_array(($ar[$j] * 10 + $n[$i]), $aArray)) {\r\n $res = $ar[$j] * 10 + $n[$i];\r\n break;\r\n } else {\r\n $ar[] = $ar[$j] * 10 + $n[$i];\r\n }\r\n }\r\n }\r\n $ar[] = $n[$i];\r\n }\r\n }\r\n \r\n \r\n \r\n \r\n echo strlen(strval($res)) . \"\\n\" . $res . \"\\n\";\r\n }"}], "src_uid": "22c0489eec3d8e290fcbcf1aeb3bb66c"} {"source_code": " $sum) { echo '1'.PHP_EOL; }\r\n}\r\n\r\n?>", "positive_code": [{"source_code": " $n ) {\r\n echo $count - $n . \"\\n\";\r\n } else {\r\n echo \"1\\n\";\r\n }\r\n \r\n}\r\n\r\n\r\n "}], "negative_code": [], "src_uid": "b5985b619652e606ac96554ecfb9346a"} {"source_code": " $k) break;\n\t\t}\n\t}\n\tif ($k1 <= $k) $count++;\n}\nfwrite($f2, $count);\nfclose($f2);"}, {"source_code": "0) {\n\t\t$cnt += $t%10==4 || $t%10==7;\n\t\t$t = intval($t/10);\n\t}\n\t$ans += $cnt <= $k;\n}\necho $ans;\n?>"}, {"source_code": "\n\n 0) {\n\t\t$count += $t%10 == 4 || $t%10 == 7;\n\t\t$t = intval($t / 10);\n\t}\n\n\t$answer += $count <= $k;\n}\n\nprintf(\"%d\", $answer);\n\n?>"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "6bb26991c9ea70e51a6bda5653de8131"} {"source_code": " count($c))\n{\n print count($c) + 1 . \"\\n\";\n print $e[0] . \" \" . implode(\" \", $c);\n}\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " count($c))\n{\n print count($c) + 1 . \"\\n\";\n print $e[0] . \" \" . implode(\" \", $c);\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " count($c))\n{\n print count($c) + 1 . \"\\n\";\n print $e[0] . \" \" . implode(\" \", $c);\n}\n?>"}, {"source_code": ""}, {"source_code": " count($c))\n{\n print count($c) + 1 . \"\\n\";\n print $e[0] . \" \" . implode(\" \", $c);\n}\n?>"}, {"source_code": " 0)\n {\n $e++;\n array_push($f, $b[$x]);\n }\n else\n {\n array_push($g, $b[$x]);\n }\n}\nif(($a == 1) || ($e == 0))\n{\n print \"0\";\n}\nelse\n{\n if(count($f) >= ($a / 2))\n {\n if(($a % 2) == 0)\n {\n print $a . \"\\n\" . implode(\" \", $b);\n }\n else\n {\n print ($a - 1) . \"\\n\" . implode(\" \", $f) . \" \" . implode(\" \", array_slice($g, 0, $a - 1 - count($f)));\n }\n }\n else\n {\n print (count($f) * 2) . \"\\n\" . implode(\" \", $f) . \" \" . implode(\" \", array_slice($g, 0, count($f)));\n }\n}\n?>"}, {"source_code": ""}], "src_uid": "6b7d6f5c07b313c57d52db6a48d3eeef"} {"source_code": " "}, {"source_code": ""}], "negative_code": [{"source_code": " 0) $happy += $sum;\n}\n\nprint $happy;\n?>", "positive_code": [{"source_code": " 0)\n {\n $d += $g;\n }\n}\nprint $d;\n?>"}, {"source_code": " 0) {\n $res += $ans;\n }\n}\necho $res;\n\n?>"}], "negative_code": [{"source_code": " 0) $happy += $sum;\n}\n\nprint $happy;\n?>"}], "src_uid": "6d7364048428c70e0e9b76ab1eb8cc34"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $n) {\n echo $g+1;\n break;\n }\n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $max)\n\t\t\t\t\t$max = $counter;\n\t\t\t\t\n\t\t\t\t$counter=0;\n\t\t\t}\n\t\t$counter++;\n\t}\n\n\techo $max+1;\n\n?>"}, {"source_code": " 1)\n{\n $y = 0;\n $z = $m - 1;\n for($x = 1; $x <= $m; $x++)\n {\n $y += $z;\n $z--;\n }\n print ($c * $w) + ($d * $v) + ($e * $u) + ($f * $t) + ($g * $s) + ($h * $r) + ($i * $q) + ($j * $p) + ($k * $o) + ($l * $n) + $y;\n}\nelse\n{\n print ($c * $w) + ($d * $v) + ($e * $u) + ($f * $t) + ($g * $s) + ($h * $r) + ($i * $q) + ($j * $p) + ($k * $o) + ($l * $n);\n}\n?>", "positive_code": [{"source_code": "1) $s+=$b[10]*($b[10]-1)/2; \nprint $s;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": "1) $s+=$b[10]*($b[10]-1)/2; \nprint $s;\n?>"}, {"source_code": "0) $pp++;\n if($v<0) $pm++;\n if($v==0) $p0++;\n}\n$r = $pp * $pm + $p0 * ($p0 - 1) / 2;\n\nprint $r.\"\\r\\n\";\nif ($n == 100000 && $c[0] == 6){ print $pp.' '.$pr.' '.$p0.\"\\r\\n\";}\n?>"}, {"source_code": "0) $pp++;\n if($v<0) $pm++;\n if($v==0) $p0++;\n}\n$r = $pp * $pm + $p0 * ($p0 - 1) / 2;\n\nif ($n == 100000){ print $pp.' '.$pr.' '.$p0.\"\\r\\n\";}\nprint $r;\n?>"}, {"source_code": "0) $pp++;\n if($v<0) $pm++;\n if($v==0) $p0++;\n}\n$r = $pp * $pm + (($p0 == 2) ? 1 : (($p0 > 2) ? ($p0 - 1) * ($p0 - 2) : 0));\n\nprint $r;\n?>"}, {"source_code": "0) $pp++;\n if($v<0) $pm++;\n if($v==0) $p0++;\n}\n$r = $pp * $pm + $p0 * ($p0 - 1) / 2;\n\nprint $r.\"\\r\\n\";\nif ($n == 100000){ print $pp.' '.$pr.' '.$p0.\"\\r\\n\";}\n?>"}, {"source_code": "0) $pp++;\n if($v<0) $pm++;\n if($v==0) $p0++;\n}\n$r = $pp * $pm + $p0 * ($p0 - 1) / 2;\n\nprint $r.\"\\r\\n\";\nif ($n == 100000 && $c[0] == 6){ print $pp.' '.$pm.' '.$p0.\"\\r\\n\";}\n?>"}, {"source_code": "0) $pp++;\n if($v<0) $pm++;\n if($v==0) $p0++;\n}\n$r = $pp * $pm + $p0 * ($p0 - 1) / 2;\n\nprint $r;\n?>"}], "src_uid": "f3dde329830d8c479b3dab9d5df8baf5"} {"source_code": ""}, {"source_code": ""}, {"source_code": " 1)\n {\n for($y = $d - 1; $y > 0; $y--)\n {\n unset($b[$x - $y]);\n }\n }\n $d = 0;\n }\n}\nfor($x = 0; $x < count($c); $x++)\n{\n if(($b[$x] == \",\") && ($b[$x + 1] != \" \"))\n {\n $b[$x] = \", \";\n }\n if(($b[$x] == \".\") && ($b[$x + 1] != \" \"))\n {\n $b[$x] = \". \";\n }\n if(($b[$x] == \"!\") && ($b[$x + 1] != \" \"))\n {\n $b[$x] = \"! \";\n }\n if(($b[$x] == \"?\") && ($b[$x + 1] != \" \"))\n {\n $b[$x] = \"? \";\n }\n}\nprint trim(implode($b));\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": " 1)\n {\n for($y = $d - 1; $y > 0; $y--)\n {\n unset($b[$x - $y]);\n }\n }\n $d = 0;\n }\n}\nfor($x = 0; $x < count($c); $x++)\n{\n if($b[$x] == \",\")\n {\n $b[$x] = \", \";\n }\n if($b[$x] == \".\")\n {\n $b[$x] = \". \";\n }\n if($b[$x] == \"!\")\n {\n $b[$x] = \"! \";\n }\n if($b[$x] == \"?\")\n {\n $b[$x] = \"? \";\n }\n}\nprint trim(implode($b));\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "8c26daa1eed2078af3b32737da0a0f84"} {"source_code": "\n"}, {"source_code": " 0) {\n\t\t[$a, $b] = array_map( 'intval', explode( \" \", fgets(STDIN) ) );\n\t\t$answer = (24 - $a) * 60 - $b;\n\t\techo \"$answer\\n\";\n\t}\n}\nmain();\n"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "f4982de28aca7080342eb1d0ff87734c"} {"source_code": "= 0; $y--)\n {\n switch($e[$y])\n {\n case \"a\": $g--;\n break;\n case \"e\": $g--;\n break;\n case \"i\": $g--;\n break;\n case \"o\": $g--;\n break;\n case \"u\": $g--;\n break;\n }\n if($g == 0)\n {\n $j = substr($e, $y);\n $h[$i] = $j;\n $i++;\n $d++;\n break;\n }\n }\n }\n}\nif($l == 1)\n{\n print \"NO\";\n}\nelse\n{\n $m = array_unique($c);\n sort($m);\n if(count($m) > 2)\n {\n print \"NO\";\n }\n elseif(count($m) == 1)\n {\n print $m[0];\n }\n elseif(count($m) == 2)\n {\n if($m[0] == \"aaaa\")\n {\n print $m[1];\n }\n else\n {\n print \"NO\";\n }\n }\n}\n?>", "positive_code": [{"source_code": "\n"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": " $value) {\n// echo $value . \"\\n\";\n//}\n//var_dump($str);\n?>\n"}], "negative_code": [{"source_code": " $value) {\n// echo $value . \"\\n\";\n//}\n//var_dump($str);\n?>\n"}, {"source_code": " $value) {\n// echo $value . \"\\n\";\n//}\n//var_dump($str);\n?>\n"}, {"source_code": " $value) {\n// echo $value . \"\\n\";\n//}\n//var_dump($str);\n?>\n"}, {"source_code": " $value) {\n// echo $value . \"\\n\";\n//}\n//var_dump($str);\n?>\n"}], "src_uid": "a17bac596b1f060209534cbffdf0f40e"} {"source_code": "$lh){\n\t\t$lh = $p[$m[$i]-1][0];\n\t}\n\telse if($p[$m[$i]-1][1]>$lh){\n\t\t$lh = $p[$m[$i]-1][1];\n\t}else{\n\t\t$t = false;\n\t\tbreak;\n\t}\n}\nif($t){\n\techo \"YES\\n\";\n}else{\n\techo \"NO\\n\";\n}", "positive_code": [{"source_code": ""}, {"source_code": " $hi){\n $sorted[$hi] = $key;\n $fi = explode(' ', $hi);\n $sorted[$fi[0]] = $key;\n $sorted[$fi[1]] = $key;\n }\n ksort($sorted);\n $i = 0;\n foreach($sorted as $order){\n if(isset($ps[$i]) && $ps[$i] == $order){\n unset($ps[$i]);\n $i++;\n }\n }\n echo empty($ps) ? \"YES\" : \"NO\";"}], "negative_code": [{"source_code": " $hi){\n $sorted[$hi] = $key;\n $fi = explode(' ', $hi);\n $sorted[$fi[0]] = $key;\n $sorted[$fi[1]] = $key;\n }\n ksort($sorted);\n $i = 0;\n foreach($sorted as $order){\n if(isset($ps[$i]) && $ps[$i] == $order){\n unset($ps[$i]);\n $i++;\n }\n }\n echo empty($ps) ? \"YES\" : \"NO\";"}], "src_uid": "a48ef749bf54d673772e09025ae806de"} {"source_code": "= 1900)\r\n {\r\n echo \"Division 1\";\r\n echo \"\\n\";\r\n }\r\n if (1600 <= $a && $a <= 1899)\r\n\r\n {\r\n echo \"Division 2\";\r\n echo \"\\n\";\r\n }\r\n if ($a >= 1400 && $a <= 1599)\r\n {\r\n echo \"Division 3\";\r\n echo \"\\n\";\r\n }\r\n if ($a <= 1399)\r\n {\r\n echo \"Division 4\";\r\n echo \"\\n\";\r\n }\r\n}", "positive_code": [{"source_code": "=1900){\r\necho 'Division 1';\r\n} else if($t > 1599 && $t <= 1899){\r\necho 'Division 2';\r\n}else if($t > 1399 && $t <= 1599){\r\nEcho 'Division 3';\r\n} else {\r\necho 'Division 4';\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}"}, {"source_code": "= 1400 && $n <= 1599) {\r\n echo \"Division 3 \\n\";\r\n }elseif($n >= 1600 && $n <= 1899 ) {\r\n echo \"Division 2 \\n\";\r\n } else {\r\n echo \"Division 1 \\n\";\r\n }\r\n \r\n }\r\n "}, {"source_code": ""}, {"source_code": " 1899]\r\n ?:[false, 2][$r > 1599]\r\n ?:[false, 3][$r > 1399]\r\n ?: 4\r\n );\r\n}"}], "negative_code": [{"source_code": "=1900){\r\necho 'Division 1';\r\n} else if($t > 1599 && $t <= 1899){\r\necho 'Division 2';\r\n}else if($t > 1399 && $t <= 1599){\r\nEcho 'Division 3';\r\n} else {\r\necho 'Division 4';\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}"}, {"source_code": "=1900){\r\necho 'Division 1';\r\n} else if($t > 1599 && $t <= 1899){\r\necho 'Division 2';\r\n}else if($t > 1399 && $t <= 1599){\r\nEcho 'Division 3';\r\n} else {\r\necho 'Division 4';\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}"}, {"source_code": "$t = Read::int();\r\necho 'Division '. $t;\r\nwhile($t--){ \r\n solve();\r\n echo '\\n';\r\n}\r\nfunction solve(){\r\n\t$t = Read::int();\r\nif($t >=1900){\r\necho 'Division 1';\r\n} else if($t > 1599 && $t <= 1899){\r\necho 'Division 2';\r\n}else if($t > 1399 && $t <= 1599){\r\nEcho 'Division 3';\r\n} else {\r\necho 'Division 4';\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}"}, {"source_code": "$t = Read::int();\r\nwhile($t--){ \r\n solve();\r\n echo '\\n';\r\n}\r\nfunction solve(){\r\n\t$t = Read::int();\r\nif($t >=1900){\r\necho 'Division 1';\r\n} else if($t > 1599 && $t <= 1899){\r\necho 'Division 2';\r\n}else if($t > 1399 && $t <= 1599){\r\nEcho 'Division 3';\r\n} else {\r\necho 'Division 4';\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}"}, {"source_code": "$t = Read::int();\r\nwhile($t--){ \r\n solve();\r\n echo '\\n';\r\n}\r\nfunction solve(){\r\n\t$t = Read::int();\r\nif($t >=1900){\r\necho 'Division 1';\r\n} else if($t <=1600 || $t >= 1899){\r\necho 'Division 2';\r\n}else if($t <= 1400 || $t >= 1599){\r\nEcho 'Division 3';\r\n} else {\r\necho 'Division 4';\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}"}, {"source_code": "$t = Read::int();\r\n solve($t);\r\n function solve($t){\r\nIf($t >=1900){\r\necho 1;\r\n} else if($t <=1600 || $t >= 1899){\r\necho 2;\r\n}else if($t <= 1400 || $t >= 1599){\r\nEcho 3;\r\n} else {\r\necho 4;\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}"}, {"source_code": "= 1900)\r\n {\r\n echo \"Division 1\";\r\n }\r\n if (1600 <= $a && $a <= 1899)\r\n\r\n {\r\n echo \"Division 2\";\r\n }\r\n if ($a >= 1400 && $a <= 1599)\r\n {\r\n echo \"Division 3\";\r\n }\r\n if ($a <= 1399)\r\n {\r\n echo \"Division 4\";\r\n }\r\n}\r\n"}, {"source_code": "= 1400 && $n <= 1599) {\r\n echo \"Division 3 /n\";\r\n }elseif($n >= 1600 && $n <= 1899 ) {\r\n echo \"Division 2 /n\";\r\n } else {\r\n echo \"Division 1 /n\";\r\n }\r\n \r\n }"}], "src_uid": "020c7b64688736ecc5e97d17df2c2605"} {"source_code": "= 0; $i --)\n {\n $sum += $in_str[$i] ;\n \n if($sum >= ($n - $i) * $x) $ans = $n - $i ;\n else break ;\n }\n \n echo $ans . \"\\n\" ;\n }\n?>", "positive_code": [{"source_code": "= $c)\n {\n $e++;\n $f += $d[$y] - $c;\n }\n else\n {\n $f -= $c - $d[$y];\n if($f >= 0)\n {\n $e++;\n }\n else\n {\n break;\n }\n }\n }\n print $e . \"\\n\";\n}\n?>"}, {"source_code": " 0; $t--){\n\tlist($n, $x) = explode(' ', trim(fgets(STDIN)));\n\t$a = explode(' ', trim(fgets(STDIN)));\n\n\techo $check($n, $x, $a).\"\\n\";\n\n}\n"}], "negative_code": [], "src_uid": "51f922bb2c51f50b5c3b55725dd7766e"} {"source_code": "", "positive_code": [{"source_code": "\n\n\n"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0; $n--) {\n\tfscanf(STDIN, \"%s\\n\", $s); \n\tif (!array_key_exists($s, $cnt)) {\n\t\t$cnt[$s] = 1;\n\t\tprint(\"OK\\n\");\n\t} else {\n\t\tprint($s.$cnt[$s].\"\\n\");\n\t\t$cnt[$s] += 1;\n\t}\n}\n?>\n"}, {"source_code": ""}, {"source_code": "\n\n"}, {"source_code": ""}, {"source_code": " 0){\n $line = str_replace($del,'',$line);\n $dataex[] = $line;\n $text = explode(\" \",$line);\n foreach($text as $txt){\n $arr_txt[] = $txt;\n $this->linex[$id] = $il;\n $this->liney[$il] = $id;\n $id++;\n }\n }\n $il++;\n }\n $this->arr_line = $dataex;\n $this->arr_txt = $arr_txt;\n }\n function G(){\n $ret = $this->arr_txt[$this->ntxt++];\n $this->nline = $this->linex[$this->ntxt];\n return $ret;\n }\n function GL(){\n $this->ntxt = $this->liney[$this->nline]+1;\n return $this->arr_line[$this->nline++];\n }\n}\n$in = new stdIn();\n$n = $in->G();\nfor($i = 0; $i<$n; $i++){\n $name = $in->G();\n $arr[$name]++;\n if($arr[$name]>1){\n echo $name.($arr[$name]-1).\"\\n\";\n }else{\n echo \"OK\\n\";\n }\n}\n?>\n"}, {"source_code": "=1)&&($n<=exp(5*log(10))))\n{// n \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd 1 \ufffd\ufffd 10^5\n\t$f=true;\n\tfor($i=1; $i<=$n; $i++)\n\t{\n\t\t$users[$i]=trim(fgets($h));\n\t\t$len=strlen($users[$i]);\n\t\tif (($len<1)||($len>32)){$f=false;} //\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd 32 \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\n\t\tfor ($j=0; $j<$len; $j++)\n\t\t{\n\t\t\tif ((ord($users[$i][$j])<97)||(ord($users[$i][$j])>122)){$f=false;}//\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\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\t}\n\t}\n\tif ($f)\n\t{\n\t\tfputs(STDOUT, \"\\n\");\n\t\t$base = array();\n\t\t\n\t\tforeach($users as $user)\n\t\t{\n\t\t\tif(!isset($base[$user]))\n\t\t\t{\n\t\t\t\t$base[$user] = 0;\n\t\t\t\tfputs(STDOUT, \"OK\");\n\t\t\t\tfputs(STDOUT, \"\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$base[$user]++;\n\t\t\t\t$name = $user . $base[$user];\n\t\t\t\tfputs(STDOUT, \"$name\");\n\t\t\t\tfputs(STDOUT, \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\t\n\t}\n}\n?>"}, {"source_code": "=1)&&($n<=exp(5*log(10))))\n{// n \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u0437 \u0434\u0438\u0430\u043f\u043e\u0437\u043e\u043d\u0430 \u043e\u0442 1 \u0434\u043e 10^5\n $f=true;\n for($i=1; $i<=$n; $i++)\n {\n $users[$i]=trim(fgets($h));\n $len=strlen($users[$i]);\n if (($len<1)||($len>32)){$f=false;} //\u0434\u043b\u0438\u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c 32 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\n for ($j=0; $j<$len; $j++)\n {\n if ((ord($users[$i][$j])<97)||(ord($users[$i][$j])>122)){$f=false;}//\u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u0447\u043d\u044b\u0445 \u0431\u0443\u043a\u0432 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0430\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430\n }\n }\n if ($f)\n {\n fputs(STDOUT, \"\\n\");\n $base = array();\n \n foreach($users as $user)\n {\n if(!isset($base[$user]))\n {\n $base[$user] = 0;\n fputs(STDOUT, \"OK\");\n fputs(STDOUT, \"\\n\");\n }\n else\n {\n $base[$user]++;\n $name = $user . $base[$user];\n fputs(STDOUT, \"$name\");\n fputs(STDOUT, \"\\n\");\n }\n }\n \n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$value)\n if(!isset($nums_kol[$value]))\n {\n $nums_kol[$value] = 0;\n echo \"OK\".\"\\n\";\n }\n else \n {\n $nums_kol[$value] += 1; \n echo $value.$nums_kol[$value].\"\\n\";\n } \n \n?>"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=0; --$i){\n if($tmp[$db[$i]]>1) $db[$i].= (--$tmp[$db[$i]]);\n else $db[$i]= \"OK\";\n }\n \n for($i=0;$i<$n;++$i){\n fputs($stdout, $db[$i]);\n if($i!=$n-1) fputs($stdout, \"\\n\");\n }\n \n?>"}, {"source_code": ""}, {"source_code": " 0; $n--){\n $nombre = trim(fgets(STDIN));\n if (array_key_exists($nombre, $db)){\n $cant = $db[$nombre];\n $db[$nombre] = $cant+1;\n echo $nombre.$cant.\"\\n\";\n }\n else{\n $db[$nombre] = 1;\n echo \"OK\\n\";\n } \n}\n?>"}, {"source_code": "\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$value)\n if(!isset($nums_kol[$value]))\n {\n $nums_kol[$value] = 1;\n echo \"OK\".\"\\n\";\n }\n else \n {\n $nums_kol[$value] += 1; \n echo $value.$nums_kol[$value].\"\\n\";\n } \n \n?>"}, {"source_code": "$value)\n if(!isset($nums_kol[$value]))\n {\n $nums_kol[$value] = 1;\n echo \"OK\".\"\\n\";\n }\n else \n {\n $nums_kol[$value] += 1; \n echo $value.$nums_kol[$value].\"\\n\";\n } \n \n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n "}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": " 0; $n--){\n $nombre = trim(fgets(STIN));\n if (array_key_exists($nombre, $db)){\n $cant = $db[$nombre];\n $db[$nombre] = $cant+1;\n echo $nombre.$cant.\"\\n\";\n }\n else{\n $db[$nombre] = 1;\n echo \"OK\\n\";\n } \n}\n?>\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\";\n\t}\n\telse{\n\t\tarray_push($name, $s);\n\t\tarray_push($index, 0);\n\t\techo \"OK
\";\n\t}\n}\n?>"}, {"source_code": ""}, {"source_code": "\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=1)&&($n<=exp(5*log(10))))\n{// n \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u0437 \u0434\u0438\u0430\u043f\u043e\u0437\u043e\u043d\u0430 \u043e\u0442 1 \u0434\u043e 10^5\n $f=true;\n for($i=1; $i<=$n; $i++)\n {\n $users[$i]=trim(fgets($h));\n $len=strlen($users[$i]);\n if (($len<1)||($len>32)){$f=false;} //\u0434\u043b\u0438\u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c 32 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\n for ($j=0; $j<$len; $j++)\n {\n if ((ord($s[$j])<97)||(ord($s[$j])>122)){$f=false;}//\u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u0447\u043d\u044b\u0445 \u0431\u0443\u043a\u0432 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0430\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430\n }\n }\n if ($f)\n {\n $base = array();\n \n foreach($users as $user)\n {\n if(!isset($base[$user]))\n {\n $base[$user] = 0;\n echo \"OK\";\n }\n else\n {\n $base[$user]++;\n echo $user . $base[$user];\n }\n }\n \n }\n}\n?>"}, {"source_code": "n = input()\nn = int(n)\nusernames = {}\nnewlist = []\nfor i in range(n):\n name = raw_input()\n if name in usernames:\n\t\tnewlist.append(name+str(usernames[name]))\n\t\tusernames[name] += 1 \n else:\n newlist.append('OK')\n\tusernames[name]=1\n \nfor name in newlist:\n print(name)\n \n"}], "src_uid": "24098df9c12d9704391949c9ff529c98"} {"source_code": ""}, {"source_code": " 1) $c++;\n if ($e[0] != $e[1] && $ob[$e[0]]) $c++;\n \n }\n \n \n \n echo $col - $c;\n \n\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$targ) {\n if ($ob[$targ] || $s[$targ] > 1) $c++;\n \n \n }\n \n \n \n echo $col - $c;\n \n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$targ) {\n if ($ob[$type] > 1) $c += $ob[$type];\n if ($ob[$type] == 1 && $targ!= $type) $c++;\n \n \n }\n \n \n \n echo $col - $c;\n \n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$targ) {\n if ($ob[$type] || $s[type] > 1) $c++;\n \n \n }\n \n \n \n echo $col - $c;\n \n\n?>"}], "src_uid": "84bd49becca69e126606d5a2f764dd91"} {"source_code": " 2)\n {\n $e .= \"?\";\n }\n elseif((count($d) == 2) && ($d[0] == \"?\"))\n {\n $e .= $d[1];\n }\n elseif((count($d) == 2) && ($d[1] == \"?\"))\n {\n $e .= $d[0];\n }\n elseif((count($d) == 2) && ($d[0] != \"?\") && ($d[1] != \"?\"))\n {\n $e .= \"?\";\n }\n elseif((count($d) == 1) && ($d[0] == \"?\"))\n {\n $e .= \"x\";\n }\n elseif((count($d) == 1) && ($d[0] != \"?\"))\n {\n $e .= $d[0];\n }\n}\nprint $e;\n?>", "positive_code": [{"source_code": " 2)\n {\n $e .= \"?\";\n }\n elseif((count($d) == 2) && ($d[0] == \"?\"))\n {\n $e .= $d[1];\n }\n elseif((count($d) == 2) && ($d[1] == \"?\"))\n {\n $e .= $d[0];\n }\n elseif((count($d) == 2) && ($d[0] != \"?\") && ($d[1] != \"?\"))\n {\n $e .= \"?\";\n }\n elseif((count($d) == 1) && ($d[0] == \"?\"))\n {\n $e .= \"x\";\n }\n elseif((count($d) == 1) && ($d[0] != \"?\"))\n {\n $e .= $d[0];\n }\n}\nprint $e;\n?>"}], "src_uid": "a51d2e6e321d7db67687a594a2b85e47"} {"source_code": " $class) {\n foreach ($class as $letter => $amount) {\n $max += $amount * ($amount - 1) / 2;\n }\n}\necho $max;\n", "positive_code": [{"source_code": " $class) {\n foreach ($class as $letter => $amount) {\n $max += $amount * ($amount - 1) / 2;\n }\n}\necho $max;\n"}, {"source_code": "2) {\n $k1= floor($i/2);\n $k2= floor(($i/2))+($i%2);\n $count1 = 0; $count2 = 0; \n if($k1>1){\n if($k1==2 ) {\n $count1 = 1;\n } else {\n $count1 = (faktorial($k1) / (faktorial($k1-2) * faktorial(2)));\n }\n }\n \n if($k2>1){\n if($k2==2) {\n $count2 = 1;\n } else {\n $count2 = (faktorial($k2) / (faktorial($k2-2) * faktorial(2)));\n }\n }\n \n \n $count+= ($count1+ $count2);\n }\n \n}\n\necho $count;\n\n?>"}, {"source_code": " 2) {\n\t\t$n1 = intdiv($num, 2);\n\t\t$n2 = $num - $n1;\n\t\t$x += perebor($n1) + perebor($n2);\n\t}\n}\necho $x;"}, {"source_code": "= $b[$s]) {\n $b[$s]++;\n } elseif (array_key_exists($s, $b) && $a[$s] < $b[$s]) {\n $a[$s]++;\n }\n }\n $summ = 0;\n foreach ($a as $sK => $aV) {\n if($aV > 1){\n for($i=1; $i<$aV; $i++){\n $summ+=$i;\n }\n }\n }\n foreach ($b as $sK => $aV) {\n if($aV > 1){\n for($i=1; $i<$aV; $i++){\n $summ+=$i;\n }\n }\n }\n echo $summ;"}, {"source_code": " 2) {\n if ($v%2) {\n $x = floor($v/2);\n $y = $x + 1;\n } else {\n $x = $v/2;\n $y = $x;\n }\n \n if ($x >= 2) {\n $j += fact($x)/(fact($x-2)*fact(2));\n }\n if ($y >= 2) {\n $j += fact($y)/(fact($y-2)*fact(2));\n }\n }\n }\n echo $j;\n function fact($n) {\n $r = 1;\n for ($i=2; $i <= $n; $i++) {\n $r = $r * $i;\n }\n return $r;\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$c = 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);\nfor($x = 1; $x <= $a; $x++)\n{\n $d = trim(fgets(STDIN));\n if($b[$d[0]] < $c[$d[0]])\n {\n $b[$d[0]]++;\n }\n else\n {\n $c[$d[0]]++;\n }\n}\n$e = 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$f = array();\n$g = 0;\n$h = 1;\nfor($x = 1; $x <= 100; $x++)\n{\n $f[$x] = $g;\n $g += $h;\n $h++;\n}\n$i = 0;\nfor($x = 0; $x < 26; $x++)\n{\n $i += $f[$b[$e[$x]]];\n $i += $f[$c[$e[$x]]];\n}\nprint $i;\n?>"}, {"source_code": " $sV){\n $aSortNames[substr($sV,0,1)][] = $sV;\n}\n$iCount = 0;\nforeach ($aSortNames as $aSortName){\n $n = count($aSortName);\n if(count($aSortName) % 2 == 0){\n $iCount += jup($n/2)*2;\n } else {\n if($n != 1){\n $a = ($n - 1)/2;\n $b = $n - $a;\n $iCount += jup($a);\n $iCount += jup($b);\n }\n }\n}\n\n\necho $iCount;\n\nfunction jup($x){\n return (($x - 1) * $x)/2;\n}"}], "negative_code": [{"source_code": " $sV){\n $aSortNames[substr($sV,0,1)][] = $sV;\n}\n$iCount = 0;\nif(count($aSortNames) == 1){\n foreach ($aSortNames as $aSortName){\n $iCount = count($aSortName) - 1;\n }\n} else {\n foreach ($aSortNames as $aSortName){\n if(count($aSortName) % 2 == 0){\n $iCount += count($aSortName)/2;\n } else {\n $iCount += (count($aSortName) -1)/2;\n }\n }\n}\n\necho $iCount;"}, {"source_code": " 2 ? ($queueLength - 1) : ceil($queueLength / 2);\n"}, {"source_code": " $class) {\n foreach ($class as $letter => $amount) {\n $max += $amount * ($amount - 1) / 2;\n }\n}\necho $max;\n"}, {"source_code": " $class) {\n foreach ($class as $letter => $amount) {\n $max += $amount * ($amount - 1) / 2;\n }\n}\nif ($max === 601) $max = 600;\necho $max;\n"}, {"source_code": " $class) {\n foreach ($class as $letter => $amount) {\n $max += $amount * ($amount - 1) / 2;\n }\n}\necho $max;\n"}, {"source_code": " $class) {\n foreach ($class as $letter => $amount) {\n ${'c' . $ci} = max(${'c' . $ci}, $amount * ($amount - 1) / 2);\n }\n}\necho $c0 + $c1;\n"}, {"source_code": " $class) {\n foreach ($class as $letter => $amount) {\n $max += $amount * ($amount - 1) / 2;\n }\n}\nif ($max === 600) $max = 601;\necho $max;\n"}, {"source_code": "2) {\n $k1= floor($i/2);\n $k2= floor(($i/2))+($i%2);\n \n if($k1>1){if($k1==2 ) {\n $count1 = 1;\n } else {\n $count1 = (faktorial($k1) / (faktorial($k1-2) * faktorial(2)));\n }}\n \n if($k2>1){\n if($k2==2) {\n $count2 = 1;\n } else {\n $count2 = (faktorial($k2) / (faktorial($k2-2) * faktorial(2)));\n }\n \n }\n \n \n $count+= ($count1+ $count2);\n }\n \n}\n\necho $count;\n\n?>"}, {"source_code": "2) {\n $k1= floor($i/2);\n $k2= floor(($i/2))+($i%2);\n $count1 = (faktorial($k1) / (faktorial($k1-2) * faktorial(2)));\n $count2 = (faktorial($k2) / (faktorial($k2-2) * faktorial(2)));\n $count+= ($count1+ $count2);\n }\n \n}\n\necho $count;\n\n?>"}, {"source_code": " 2) {\n\t\t$n1 = intdiv($num, 2);\n\t\t$n2 = $num - $n1;\n\t\t$x = perebor($n1) + perebor($n2);\n\t}\n}\necho $x;"}, {"source_code": "= $b[$s]) {\n $b[$s]++;\n } elseif (array_key_exists($s, $b) && $a[$s] < $b[$s]) {\n $a[$s]++;\n }\n }\n $summ = 0;\n foreach ($a as $sK => $aV) {\n if($aV != 1 && $aV > 2) {$summ+=$aV;} elseif($aV == 2) {$summ++;}\n }\n foreach ($b as $sK => $aV) {\n if($aV != 1 && $aV > 2) {$summ+=$aV;} elseif($aV == 2) {$summ++;}\n }\n var_dump($a, $b);\n echo $summ;"}, {"source_code": "= $b[$s]) {\n $b[$s]++;\n } elseif (array_key_exists($s, $b) && $a[$s] < $b[$s]) {\n $a[$s]++;\n }\n }\n $summ = 0;\n foreach ($a as $sK => $aV) {\n if($aV != 1 && $aV > 2) {$summ+=$aV;} elseif($aV == 2) {$summ++;}\n }\n foreach ($b as $sK => $aV) {\n if($aV != 1 && $aV > 2) {$summ+=$aV;} elseif($aV == 2) {$summ++;}\n }\n echo $summ;"}], "src_uid": "22a3561ff70b802f080feaabc4a71298"} {"source_code": "= 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n if($a % 2 != 0)\n {\n $c = $b;\n sort($c);\n $d = 0;\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] != \"-1\")\n {\n $d = 1;\n break;\n }\n }\n if($d == 0)\n {\n $b[0] = 0;\n }\n else\n {\n for($y = 0; $y < $a; $y++)\n {\n if($b[$y] == $c[$x])\n {\n $b[$y] = abs($b[$y]) - 1;\n break;\n }\n }\n }\n }\n print implode(\" \", $b);\n}\n?>", "positive_code": [{"source_code": " 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n if($a % 2 != 0)\n {\n $c = max($b);\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] == $c)\n {\n $b[$x] = abs($b[$x]) - 1;\n break;\n }\n }\n }\n print implode(\" \", $b);\n}\n?>"}, {"source_code": " 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n sort($b);\n if($a % 2 == 0)\n {\n print implode(\" \", $b);\n }\n else\n {\n $b[$a - 1] = abs($b[$a - 1]) - 1;\n print implode(\" \", $b);\n }\n}\n?>"}, {"source_code": "= 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n if($a % 2 != 0)\n {\n $c = $b;\n sort($c);\n $d = 0;\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] != \"-1\")\n {\n $d = 1;\n break;\n }\n }\n if($d != 0)\n {\n for($y = 0; $y < $a; $y++)\n {\n if($b[$y] == $c[$x])\n {\n $b[$y] = abs($b[$y]) - 1;\n break;\n }\n }\n }\n }\n print implode(\" \", $b);\n}\n?>"}, {"source_code": "= 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n if($a % 2 != 0)\n {\n $c = max($b);\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] == $c)\n {\n $b[$x] = abs($b[$x]) - 1;\n break;\n }\n }\n }\n print implode(\" \", $b);\n}\n?>"}, {"source_code": "= 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n if($a % 2 != 0)\n {\n $c = $b;\n rsort($c);\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] != \"-1\")\n {\n break;\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] == $c[$x])\n {\n $b[$x] = abs($b[$x]) - 1;\n break;\n }\n }\n }\n print implode(\" \", $b);\n}\n?>"}, {"source_code": "= 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n if($a % 2 != 0)\n {\n $c = $b;\n sort($c);\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] != \"-1\")\n {\n break;\n }\n }\n for($y = 0; $y < $a; $y++)\n {\n if($b[$y] == $c[$x])\n {\n $b[$y] = abs($b[$y]) - 1;\n break;\n }\n }\n }\n print implode(\" \", $b);\n}\n?>"}, {"source_code": "= 0)\n {\n $b[$x] = 0 - $b[$x] - 1;\n }\n }\n if($a % 2 != 0)\n {\n $c = $b;\n rsort($c);\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] != \"-1\")\n {\n break;\n }\n }\n for($y = 0; $y < $a; $y++)\n {\n if($b[$y] == $c[$x])\n {\n $b[$y] = abs($b[$y]) - 1;\n break;\n }\n }\n }\n print implode(\" \", $b);\n}\n?>"}, {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " $sum)\n {\n $currentPos++;\n $prev = $sizes[$currentPos];\n $sum += $sizes[$currentPos];\n }\n\n echo $currentPos + 1, ' ', ($app - ($sum - $prev)), PHP_EOL;\n\n }\n\n}\n\n\nfscanf($handle, \"%i %i\", $n, $a);\n\n$sizes = array_map('doubleval', explode(' ', trim(fgets($handle))));\n$posts = array_map('doubleval', explode(' ', trim(fgets($handle))));\n\ndeliverPost($sizes, $posts);"}, {"source_code": ""}], "negative_code": [{"source_code": "= 0)\n {\n $e = $x;\n break;\n }\n else\n {\n $e = $a;\n }\n}\nif($e <= $b)\n{\n for($x = 0; $x < $e; $x++)\n {\n $d += abs($c[$x]); \n }\n print $d;\n}\nelse\n{\n for($x = 0; $x < $b; $x++)\n {\n $d += abs($c[$x]); \n }\n print $d;\n}\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= 0)\n {\n $e = $x;\n break;\n }\n}\nif($e <= $b)\n{\n for($x = 0; $x < $b; $x++)\n {\n if($x < $e)\n {\n $d += abs($c[$x]);\n }\n else\n {\n $d -= abs($c[$x]);\n } \n }\n print $d;\n}\nelse\n{\n for($x = 0; $x < $b; $x++)\n {\n $d += abs($c[$x]); \n }\n print $d;\n}\n?>"}, {"source_code": "= 0)\n {\n $e = $x;\n break;\n }\n}\nif($e <= $b)\n{\n for($x = 0; $x < $e; $x++)\n {\n $d += abs($c[$x]); \n }\n print $d;\n}\nelse\n{\n for($x = 0; $x < $b; $x++)\n {\n $d += abs($c[$x]); \n }\n print $d;\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "9a56288d8bd4e4e7ef3329e102f745a5"} {"source_code": " '1',\n 5,\n 5,\n 4,\n 5,\n 6,\n 3 => '7',\n 7,\n 6,\n];\n$count = trim(fgets(STDIN));\nfor ($i = 0; $i < $count; $i++) {\n $number = trim(fgets(STDIN));\n test($number);\n}\n\nfunction test($number) {\n if ($number % 2 == 0) {\n $result = '';\n for ($j = 0; $j < $number / 2; $j++) {\n $result .= '1';\n }\n } else {\n $result = '';\n if ($number >= 3) {\n $result .= '7';\n }\n for ($j = 0; $j < $number / 2 - 2; $j++) {\n $result .= '1';\n }\n }\n echo $result . PHP_EOL;\n}\n", "positive_code": [{"source_code": " 0)\n{\n $n = fgets($stdin);\n \n $ones = floor($n / 2);\n if ($n % 2 == 1)\n {\n echo \"7\";\n $ones -= 1;\n }\n \n while($ones > 0)\n {\n echo \"1\";\n $ones -= 1;\n }\n echo \"\\n\";\n\n $t -= 1;\n}\n\nfclose($stdin);\n?>"}, {"source_code": " 3){\n for($x = 0; $x < floor($g/2) - 1; $x++){\n $d .= '1';\n }\n }\n }\n echo $d.\"\\n\";\n}\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 2) {\n if($n >= 3 && $n - 2 < 2) {\n $number = '7'.$number;\n $n -= 3;\n } elseif( $n >=2){\n $number .= '1';\n $n -= 2;\n }\n }\n \n \n echo $number .\"\\n\";\n }"}], "negative_code": [{"source_code": ""}, {"source_code": "= 2) {\n if($n >= 3 && $n - 2 < 2) {\n $number .= '7';\n $n -= 3;\n } elseif( $n >=2){\n $number .= '1';\n $n -= 2;\n }\n }\n \n \n echo $number .\"\\n\";\n }"}, {"source_code": "\n$a = $argv;\nvar_dump($a);"}, {"source_code": " '1',\n 5,\n 5,\n 4,\n 5,\n 6,\n 3 => '7',\n 7,\n 6,\n];\n$count = trim(fgets(STDIN));\nfor ($i = 0; $i < $count; $i++) {\n $number = trim(fgets(STDIN));\n if ($number % 2 == 0) {\n $result = '';\n for ($j = 0; $j < $number / 2; $j++) {\n $result .= '1';\n }\n } else {\n $result = '';\n for ($j = 0; $j < $number / 2 - 1; $j++) {\n $result .= '1';\n }\n $result .= '7';\n }\n echo $result;\n}\n"}, {"source_code": " '1',\n 5,\n 5,\n 4,\n 5,\n 6,\n 3 => '7',\n 7,\n 6,\n];\n$count = trim(fgets(STDIN));\nfor ($i = 0; $i < $count; $i++) {\n $number = trim(fgets(STDIN));\n test($number);\n}\n\nfunction test($number) {\n if ($number % 2 == 0) {\n $result = '';\n for ($j = 0; $j < $number / 2; $j++) {\n $result .= '1';\n }\n } else {\n $result = '';\n for ($j = 0; $j < $number / 2 - 2; $j++) {\n $result .= '1';\n }\n $result .= '7';\n }\n echo $result;\n}\n"}, {"source_code": " '1',\n 5,\n 5,\n 4,\n 5,\n 6,\n 3 => '7',\n 7,\n 6,\n];\n$count = trim(fgets(STDIN));\nfor ($i = 0; $i < $count; $i++) {\n $number = trim(fgets(STDIN));\n if ($number % 2 == 0) {\n $result = '';\n for ($j = 0; $j < $number / 2; $j++) {\n $result .= '1';\n }\n } else {\n $result = '';\n for ($j = 0; $j < $number / 2 - 1; $j++) {\n $result .= '1';\n }\n $result .= '7';\n }\n return $result;\n}\n"}, {"source_code": " '1',\n 5,\n 5,\n 4,\n 5,\n 6,\n 3 => '7',\n 7,\n 6,\n];\n$count = trim(fgets(STDIN));\nfor ($i = 0; $i < $count; $i++) {\n $number = trim(fgets(STDIN));\n test($number);\n}\n\nfunction test($number) {\n if ($number % 2 == 0) {\n $result = '';\n for ($j = 0; $j < $number / 2; $j++) {\n $result .= '1';\n }\n } else {\n $result = '';\n for ($j = 0; $j < $number / 2 - 2; $j++) {\n $result .= '1';\n }\n $result .= '7';\n }\n echo $result . PHP_EOL;\n}\n"}, {"source_code": "$count = trim(fgets(STDIN));\nfor ($i = 0; $i < $count; $i++) {\n $number = trim(fgets(STDIN));\n if ($number % 2 == 0) {\n $result = '';\n for ($j = 0; $j < $number / 2; $j++) {\n $result .= '1';\n }\n } else {\n $result = '';\n for ($j = 0; $j < $number / 2 - 1; $j++) {\n $result .= '1';\n }\n $result .= '7';\n }\n return $result;\n}\n"}, {"source_code": " '1',\n 5,\n 5,\n 4,\n 5,\n 6,\n 3 => '7',\n 7,\n 6,\n];\n$count = trim(fgets(STDIN));\nfor ($i = 0; $i < $count; $i++) {\n $number = trim(fgets(STDIN));\n test($number);\n}\n\nfunction test($number) {\n if ($number % 2 == 0) {\n $result = '';\n for ($j = 0; $j < $number / 2; $j++) {\n $result .= '1';\n }\n } else {\n $result = '';\n if ($number > 3) {\n $result .= '7';\n }\n for ($j = 0; $j < $number / 2 - 2; $j++) {\n $result .= '1';\n }\n }\n echo $result . PHP_EOL;\n}\n"}, {"source_code": " 3){\n for($x = 0; $x < floor($g/2); $x++){\n $d .= '1';\n }\n }\n }\n echo $d.\"\\n\";\n}\n"}], "src_uid": "07db573b0db736d798b6c18c06c32f3d"} {"source_code": "", "positive_code": [{"source_code": "$v){\n if($v==$val) $res[]=$k+1;\n }\n return $res;\n}\nfor($i=0;$i<$n;$i++){\n for($j=0;$j<$n,$j!=$i;$j++){\n if(in_array($arr[$i]+$arr[$j],$arr)){\n //$res = (array_search(($arr[$i]+$arr[$j]),$arr)+1).\" \".(array_search($arr[$i],$arr)+1).\" \".(array_search($arr[$j],$arr)+1); \n $res[]=hz($arr,$arr[$i]+$arr[$j]);\n $res[]=hz($arr,$arr[$i]);\n $res[]=hz($arr,$arr[$j]);\n break(2);\n }\n }\n}\nif(sizeof($res)!=0){\n $f1=$res[0][0];\n $f2=$res[1][0];\n $f3=(sizeof($res)>1 && $res[2][0]==$f2) ? $res[2][1] : $res[2][0];\n echo \"{$f1} {$f2} {$f3}\";\n}\nelse echo \"-1\";\n\n?> "}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": "0){\n echo ($rkey+1).' '.($i+1).' '.($k+1);\n exit;\n }\n }\n}\necho -1;\n\n?>"}, {"source_code": "0){\n echo $i.' '.$k.' '.$rkey;\n exit;\n }\n }\n}\necho -1;\n\n?>"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "94a38067fc8dd8619fa6e5873ca60220"} {"source_code": "\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}], "src_uid": "bef323e7c8651cc78c49db38e49ba53d"} {"source_code": ""}, {"source_code": "\n\n"}, {"source_code": "in));\n for($r = 1;$r <= $n*$n; $r++){\n list($i,$j) = explode(' ', trim(fgets($this->in))); \n if($vari[$i] == 0 && $varj[$j] == 0) \n { \n $vari[$i] = 1;\n $varj[$j] = 1;\n echo \"$r \";\n }\n }\n }\n}\n$c = new Codeforces();\n$c -> solve();"}, {"source_code": " $d[count($d) - 1])\n {\n $d[count($d)] = $i;\n break;\n }\n else\n {\n $h++;\n }\n }\n}\nunset($d[0]);\nsort($d);\nprint $d[count($d) - 1];\n?>", "positive_code": [{"source_code": " 0){\n $str = explode(' ', trim(fgets(STDIN)));\n if($day == 0){\n $day = $str[0];\n }else{\n $l = 1;\n while(($day + $l - $str[0]) % $str[1] != 0 || ($day + $l - $str[0]) < 0){\n\n $l++;\n }\n $day = $day + $l;\n }\n $i++;\n $line1--;\n}\necho $day;"}], "negative_code": [{"source_code": " $d[count($d) - 1])\n {\n $d[count($d)] = $g;\n break;\n }\n }\n}\nunset($d[0]);\nsort($d);\nprint $d[count($d) - 1];\n?>"}, {"source_code": " $d[count($d) - 1])\n {\n $d[count($d)] = $g;\n break;\n }\n }\n}\nunset($d[0]);\nsort($d);\nprint $d[count($d) - 1];\n?>"}, {"source_code": " $d[count($d) - 1])\n {\n $d[count($d)] = $i;\n break;\n }\n else\n {\n $h++;\n }\n }\n}\nunset($d[0]);\nsort($d);\nprint_r($d);\n?>"}, {"source_code": " 0){\n $str = explode(' ', trim(fgets(STDIN)));\n if($day == 0){\n $day = $str[0];\n }else{\n $l = 1;\n while(($day + $l - $str[0]) % $str[1] != 0){\n\n $l++;\n }\n $day = $day + $l - $str[0];\n }\n $i++;\n $line1--;\n}\necho $day;"}, {"source_code": " 0){\n $str = explode(' ', trim(fgets(STDIN)));\n if($day == 0){\n $day = $str[0];\n }else{\n $l = 1;\n while(($day + $l - $str[0]) % $str[1] != 0 && ($day + $l - $str[0]) > 0){\n\n $l++;\n }\n $day = $day + $l;\n }\n $i++;\n $line1--;\n}\necho $day;"}, {"source_code": " 0){\n $str = explode(' ', trim(fgets(STDIN)));\n if($day == 0){\n $day = $str[0];\n }else{\n $l = 1;\n while(($day + $l - $str[0]) % $str[1] != 0){\n\n $l++;\n }\n $day = $day + $l;\n }\n $i++;\n $line1--;\n}\necho $day;"}], "src_uid": "d324617c86423d86cdcb839894e00e1a"} {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$n = readNum($f);\n\t$pairs = array();\n\t$L = $R = 0;\n\t$d = array();\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$pairs[$i] = readStringExplodeNum($f, ' ', true);\n\t\t$L+=$pairs[$i][0];\n\t\t$R+=$pairs[$i][1];\n\t}\n\t$max = abs($L - $R);\n\t$maxIndex = -1;\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$dL = $L - $pairs[$i][0] + $pairs[$i][1];\n\t\t$dR = $R - $pairs[$i][1] + $pairs[$i][0];\n\t\tif (abs($dL - $dR) > $max) {\n\t\t\t$max = abs($dL - $dR);\n\t\t\t$maxIndex = $i;\n\t\t}\n\t}\n\techo $maxIndex + 1;\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": "= $k)\n{\n print \"0\";\n}\nelse\n{\n for($x = 0; $x < $a; $x++)\n {\n if($i[$x] == $k)\n {\n break;\n }\n }\n print $x + 1;\n}\n?>"}, {"source_code": "($R-$lines[$j][1]))\n {\n if(($lines[$j][0]-$lines[$j][1])<0){\n if(($major$L){\n $major=abs($lines[$j][0]-$lines[$j][1]);\n $line=$j;\n }\n };\n }elseif(($L-$lines[$j][0])<($R-$lines[$j][1])){\n if(($lines[$j][1]-$lines[$j][0])<0){\n if($major$R){\n $major=abs($lines[$j][1]-$lines[$j][0]);\n $line=$j;\n }\n };\n };\n };\n echo $line;\n exit();\n\n }else{\n for($j = 1; $j <= $num;$j++){\n if($lines[$j][0] >= $major_if_equal){\n $major_if_equal = $lines[$j][0];\n $line=$j;\n }\n }\n echo $line;\n exit();\n\n }\n\n echo abs($L-$R);\n print_r($lines);\n\n?>"}], "negative_code": [{"source_code": "($R-$lines[$j][1]))\n {\n if(($lines[$j][0]-$lines[$j][1])<0){\n if($major= $major_if_equal){\n $major_if_equal = $lines[$j][0];\n $line=$j;\n }\n }\n echo $line;\n exit();\n\n }\n\n echo abs($L-$R);\n print_r($lines);\n\n?>"}, {"source_code": "($R-$lines[$j][1]))\n {\n if(($lines[$j][0]-$lines[$j][1])<0){\n if(($major$L){\n $major=abs($lines[$j][0]-$lines[$j][1]);\n $line=$j;\n }\n };\n }elseif(($L-$lines[$j][0])<($R-$lines[$j][1])){\n if(($lines[$j][1]-$lines[$j][0])<0){\n if($major$R){\n $major=abs($lines[$j][1]-$lines[$j][0]);\n $line=$j;\n }\n };\n };\n };\n echo $line;\n exit();\n\n }else{\n for($j = 1; $j <= $num;$j++){\n if($lines[$j][0] >= $major_if_equal){\n $major_if_equal = $lines[$j][0];\n $line=$j;\n }\n }\n echo $line;\n exit();\n\n }\n\n echo abs($L-$R);\n print_r($lines);\n\n?>"}], "src_uid": "2be73aa00a13be5274cf840ecd3befcb"} {"source_code": " $j) { $s2 .= $s; $j++; }\r\n $j = 0;\r\n while ($c1 / $t1 > $j) { $t2 .= $t; $j++; } \r\n if ($s2 == $t2) { echo $s2.PHP_EOL; }\r\n else { echo -1; echo PHP_EOL;}\r\n}\r\n\r\n?>", "positive_code": [{"source_code": " $b){\r\n $a -= $b;\r\n } else {\r\n $b -= $a;\r\n }\r\n }\r\n return $a;\r\n}\r\nfunction NOK($a, $b){\r\n return abs($a * $b)/NOD($a, $b);\r\n}\r\n\r\n$q = (int)fgets(STDIN);\r\nfor($i=0;$i<$q;$i++)\r\n{\r\n\t$s = trim(fgets(STDIN));\r\n\t$t = trim(fgets(STDIN));\r\n\r\n\tif(strlen($s) > strlen($t))\r\n\t{\r\n\t\t$bigStr = $s;\r\n\t\t$litStr = $t;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$bigStr = $t;\r\n\t\t$litStr = $s;\r\n\t}\r\n\r\n\t$nok = NOK(strlen($litStr), strlen($bigStr));\r\n\t$repeat1 = round($nok / strlen($bigStr));\r\n\t$repeat2 = round($nok / strlen($litStr));\r\n\t$str1 = str_repeat($bigStr, $repeat1);\r\n\t$str2 = str_repeat($litStr, $repeat2);\r\n\tif($str1 == $str2)\r\n\t\tprint($str1.\"\\r\\n\");\r\n\telse\r\n\t\tprint(\"-1\\r\\n\");\r\n}\r\n\r\n$end = readline();\r\n?>"}, {"source_code": " $sb){\r\n $f = $a;\r\n $s = $b;\r\n $m = $sa;\r\n } else {\r\n $f = $b;\r\n $s = $a;\r\n $m = $sb;\r\n }\r\n $fs = '';\r\n $ss = '';\r\n $bool = false;\r\n $res = '';\r\n for($i = 0; $i <= $m; $i++) {\r\n $fs .= $f;\r\n $m1 = strlen($fs);\r\n for($j = 0; $j <= $m1; $j++) {\r\n $ss .= $s;\r\n if ($fs == $ss) {\r\n $bool = true;\r\n $res = $fs;\r\n break;\r\n }\r\n }\r\n $ss = '';\r\n if($bool){\r\n break;\r\n }\r\n }\r\n if($bool){\r\n echo $res.\"\\n\";\r\n } else {\r\n echo \"-1\\n\";\r\n }\r\n \r\n \r\n }\r\n \r\n?>"}], "negative_code": [{"source_code": " $t1) { \r\n $c = $s1 / $t1; $c1 = $s1 % $t1;\r\n if ($c1 != 0) { $s .= $s; }\r\n while ($j < $c) { $t2 .= $t; $j++;} \r\n if ($s == $t2) { echo $s.PHP_EOL; }\r\n else { echo -1; echo PHP_EOL;}\r\n } else {\r\n if ($s1 < $t1) {\r\n $p = $s; $s = $t; $t = $p;\r\n $s1 = strlen($s);\r\n $t1 = strlen($t);\r\n $c = $s1 / $t1; $c1 = $s1 % $t1;\r\n if ($c1 != 0) { $s .= $s; }\r\n $s1 = strlen($s);\r\n $t1 = strlen($t);\r\n $c = $s1 / $t1;\r\n while ($j < $c) { $j++; $t2 .= $t; }\r\n if ($s == $t2) { echo $s.PHP_EOL; }\r\n else { echo -1; echo PHP_EOL;}\r\n }\r\n \r\n if ($s1 == $t1) {\r\n if ($s == $t) { echo $s.PHP_EOL; }\r\n else { echo -1; echo PHP_EOL;}\r\n }\r\n \r\n }\r\n}\r\n\r\n?>"}, {"source_code": " strlen($t)) { \r\n $s1 = strlen($s);\r\n $t1 = strlen($t);\r\n $c = $s1 / $t1; $c1 = $s1 % $t1;\r\n if ($c1 != 0) { $s .= $s; }\r\n while ($j < $c) { $t2 .= $t; $j++;} \r\n if ($s == $t2) { echo $s.PHP_EOL; }\r\n else { echo -1; echo PHP_EOL;}\r\n } else {\r\n $j = 0;\r\n $p = $s; $s = $t; $t = $p;\r\n $s1 = strlen($s);\r\n $t1 = strlen($t);\r\n $c = ceil($s1 / $t1); $c1 = $s1 % $t1;\r\n if ($c1 != 0) { $s .= $s; }\r\n $s1 = strlen($s);\r\n $t1 = strlen($t);\r\n $c = ceil($s1 / $t1);\r\n $t2 = '';\r\n // while ($j < $c) { $t2 .= $t; $j++; } \r\n // echo $s.' - '.$t2;\r\n if ($s == 'aaaaaa') { echo $s.PHP_EOL; }\r\n else { echo -1; echo PHP_EOL;}\r\n }\r\n}\r\n\r\n?>"}, {"source_code": " $b){\r\n $a -= $b;\r\n } else {\r\n $b -= $a;\r\n }\r\n }\r\n return $a;\r\n}\r\nfunction NOK($a, $b){\r\n return abs($a * $b)/NOD($a, $b);\r\n}\r\n\r\n$q = (int)fgets(STDIN);\r\nfor($i=0;$i<$q;$i++)\r\n{\r\n\t$s = trim(fgets(STDIN));\r\n\t$t = trim(fgets(STDIN));\r\n\t\r\n\t$s_2 = str_repeat($s, 2);\r\n\t$t_2 = str_repeat($t, 2);\r\n\r\n\tif(strlen($s_2) > strlen($t_2))\r\n\t{\r\n\t\t$bigStr = $s_2;\r\n\t\t$litStr = $t_2;\r\n\t\t$bigStr2 = $s;\r\n\t\t$litStr2 = $t;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$litStr = $s_2;\r\n\t\t$bigStr = $t_2;\r\n\t\t$litStr2 = $s;\r\n\t\t$bigStr2 = $t;\r\n\t}\r\n\r\n\tif(stripos($bigStr, $litStr) !== FALSE)\r\n\t{\r\n\t\t$nok = NOK(strlen($litStr2), strlen($bigStr2));\r\n\t\t$repeat = round($nok / strlen($bigStr2));\r\n\t\tprint(str_repeat($bigStr2, $repeat).\"\\r\\n\");\r\n\t}\r\n\telse\r\n\t\tprint(\"-1\\r\\n\");\r\n}\r\n\r\n$end = readline();\r\n?>"}], "src_uid": "710c7211d23cf8c01fae0b476a889276"} {"source_code": "0) $ans++;\n $n1=0;\n }\n $k=$n-$ans;\n if ($k>$ans) $k=$ans;\n $ans-=$k;\n $ans-=$ans%3;\n $ans/=3;\n echo $ans+$k .\"\\n\";\n?> ", "positive_code": [{"source_code": " $p){ $im -= 2; $p += 1; }\n\n\n if($im > $p) echo $p;\n else echo $im;\n\n\n ////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n\n /////////////////////////////////////////////////////////////////////////////////////////////////\n ?>"}, {"source_code": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$n = $sc->nextInt();\n\n$cnt = [0, 0];\nfor($i = 0; $i < $n; $i++) {\n $x = $sc->nextInt();\n $cnt[$x % 2]++;\n}\n\nif($cnt[0] >= $cnt[1]) {\n out::println($cnt[1]);\n} else {\n out::println($cnt[0] + (int) (($cnt[1] - $cnt[0]) / 3));\n}\n"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": "($n-$temp))$ans=$n-$temp;\n$temp=$temp-$ans;\n$ans+=intval($temp/3);\necho $ans;\n?>"}, {"source_code": ""}, {"source_code": "= $b) { \nprintf(\"%d\", $b + ($a - $b) / 3); \n} else { \nprintf(\"%d\", $a); \n} \n?>"}, {"source_code": " $nch){\n printa($nch);\n }else{\n $nch -= $ch;\n printa($ch + floor($nch / 3));\n }\n?>"}, {"source_code": " $b )\n $c = $b;\n$ans = $c + ($a-$c)/3;\n\n\nfprintf(STDOUT, \"%d\", $ans);"}, {"source_code": ""}, {"source_code": "$even)\n $answer=$even+intdiv($odd-$even,3);\n else\n $answer=$odd;\nprint($answer);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=$odd)\n echo $odd;\n else {\n echo $even + ($odd-$even-($odd-$even)%3)/3;\n }\n ?>\n"}, {"source_code": "\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$n = $dxs->G();\n$a = array(0);\n$odd = 0;\n$even = 0;\nfor($i = 1; $i <= $n; $i++){\n if($dxs->G() % 2 == 0) $even = $even + 1;\n else $odd = $odd + 1;\n}\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n$ans = 0;\nif($even <= $odd) {\n $ans = $even;\n $odd = $odd - $even;\n while($odd >= 3) {\n $odd = $odd - 3;\n $ans = $ans + 1;\n }\n}\nelse{\n $ans = $odd;\n}\necho $ans;\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>\n"}, {"source_code": "=$d)\n{\n $n=$d;\nprintf(\"%d\\n\",$n);\n}\nelse\n{\n $n=$c;\n $d=$d-$c;\n $h=$d/3;\n $n=$n+$h;\n printf(\"%d\\n\",$n);\n}\n?>"}, {"source_code": "=$d)\n{\n $n=$d;\nprintf(\"%d\\n\",$n);\n}\nelse\n{\n $n=$c;\n $h=($d-$c)/3;\n $n=$n+$h;\n printf(\"%d\\n\",$n);\n}\n?>"}, {"source_code": " 0) $odd ++;\n else $even ++;\n}\n$mt = min($odd, $even);\n$ans = $mt;\n$odd -= $mt;\n$ans = $ans + intval(($odd / 3));\nprint $ans;\n/*\nif($even >= $odd) {\n print $odd;\n}\nelse {\n print $even + intval(($odd - $even) / 3);\n}\n*/\n\n?>\n\n"}], "negative_code": [{"source_code": "=$odd)\n echo $odd;\n else {\n echo $even + ($odd-$even)/3;\n }\n ?>\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "=$d)\n{\n $n=$d;\nprintf(\"%d\\n\",$n);\n}\nelse\n{\n $n=$c;\n $h=$d/3;\n $n=$n+$h;\n printf(\"%d\\n\",$n);\n}\n?>"}, {"source_code": "=$d)\n{\n $n=$d;\nprintf(\"%d\\n\",$n);\n}\nelse\n{\n $n=$c;\n $h=$d/2;\n $n=$n+$h;\n printf(\"%d\\n\",$n);\n}\n?>"}, {"source_code": "=$d)\n{\n $n=$d;\nprintf(\"%d\\n\",$n);\n}\nelse\n{\n $n=$c;\n $h=$d/2;\n $n=$n+$h;\n printf(\"%d\\n\",$n);\n}\n?>"}, {"source_code": " 0) $odd ++;\n else $even ++;\n}\n$mt = min($odd, $even);\n$ans = $mt;\n$odd -= $mt;\n$ans = $ans + intval(($odd / 3));\nprint $ans;\n/*\nif($even >= $odd) {\n print $odd;\n}\nelse {\n print $even + intval(($odd - $even) / 3);\n}\n*/\n\n?>\n\n"}, {"source_code": "\n\n"}, {"source_code": " 0) $odd ++;\n else $even ++;\n}\n\n$mt = min($odd, $even);\n$ans = $mt;\n$odd -= $mt;\n$ans = $ans + ($odd / 3);\nprint $ans;\n\n?>\n\n"}, {"source_code": " 0) $odd ++;\n else $even ++;\n}\n\n$mt = min($odd, $even);\n$ans = $mt;\n$odd -= $mt;\n$ans = $ans + intval(($odd / 3));\nprint $ans;\n\n?>\n\n"}, {"source_code": "\n\n"}, {"source_code": "\n\n"}, {"source_code": " 0) $odd ++;\n else $even ++;\n}\n\n$mt = min($odd, $even);\n$ans = $mt;\n$odd -= $mt;\n$ans = $ans + (int)($odd / 3);\nprint $ans;\n\n?>\n\n"}, {"source_code": " 0) $odd ++;\n else $even ++;\n}\n\n$mt = min($odd, $even);\n$ans = $mt;\n$odd -= $mt;\n$ans = $ans + (int)($odd / 3);\nprint $ans;\n\n?>\n\n"}, {"source_code": " 0) $odd ++;\n else $even ++;\n}\n/*\n$mt = min($odd, $even);\n$ans = $mt;\n$odd -= $mt;\n$ans = $ans + intval(($odd / 3));\nprint $ans;\n*/\nif($even >= $odd) {\n print $odd;\n}\nelse {\n print $even + intval(($odd - $even) / 3);\n}\n\n?>\n\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*/ $dxs = new stdIn(true);\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n\n /////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n\n $n = $dxs->G();\n $p = 0;\n $im = 0;\n for($i = 0; $i < $n; $i++){\n $x = $dxs->G();\n if($x%2) $im++;\n else $p++;\n }\n\n if($im > $p) echo $p;\n else echo $im;\n\n\n ////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n\n /////////////////////////////////////////////////////////////////////////////////////////////////\n ?>\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*/ $dxs = new stdIn(true);\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n ///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n\n /////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\n\n $n = $dxs->G();\n $p = 0;\n $im = 0;\n for($i = 0; $i < $n; $i++){\n $x = $dxs->G();\n if(x%2) $im++;\n else $p++;\n }\n\n if($im > $p) echo $p;\n else echo $im;\n\n\n ////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n\n /////////////////////////////////////////////////////////////////////////////////////////////////\n ?>\n"}, {"source_code": " $p) echo $p;\n else echo $im;\n\n\n ////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n\n /////////////////////////////////////////////////////////////////////////////////////////////////\n ?>\n"}, {"source_code": "0) $ans++;\n$count=strpos($s,\"$n1 \"); \n$s=substr_replace($s,\"\",$count,2); \nfor ($i=2; $i<=$n; $i++)\n{\n sscanf($s,\"%d\",$n1);\n $count=strpos($s,\"$n1 \");\n $s=substr_replace($s,\"\",$count,2);\n if ($n1 % 2>0) $ans++;\n $n1=0;\n}\n $k=$n-$ans;\n if ($k>$ans) $k=$ans;\n $ans-=$k;\n $ans-=$ans%3;\n $ans/=3;\n echo $ans+$k .\"\\n\";\n?> "}, {"source_code": "0) $ans++;\n$count=strpos($s,\"$n1 \"); \n$s=substr_replace($s,\"\",$count,2); \nfor ($i=2; $i<=$n; $i++)\n{\n sscanf($s,\"%d\",$n1);\n$count=strpos($s,\"$n1 \"); \n$s=substr_replace($s,\"\",$count,2); \n if ($n1 % 2>0) $ans++;\n $n1=0;\n}\n echo $ans .\"\\n\";\n?> "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$n = $sc->nextInt();\n$cnt = [0, 0];\nfor($i = 0; $i < $n; $i++) {\n $x = $sc->nextInt();\n $cnt[$x % 2]++;\n}\nout::println($cnt[0] < $cnt[1] ? $cnt[0] : $cnt[1]);\n"}, {"source_code": "pointer >= $this->count) {\n $str = trim(fgets(STDIN));\n $this->arr = explode(' ', $str);\n $this->count = count($this->arr);\n $this->pointer = 0;\n }\n $result = $this->arr[$this->pointer];\n $this->pointer++;\n return $result;\n }\n public function hasNext() {\n return $this->pointer < $this->count;\n }\n public function nextInt() {\n return (int)$this->next();\n }\n public function nextDouble() {\n return (double)$this->next();\n }\n}\n\nclass out {\n public static function println($str = \"\") {\n echo $str . PHP_EOL;\n }\n}\n\n$sc = new Scanner();\n$n = $sc->nextInt();\n\n$cnt = [0, 0];\nfor($i = 0; $i < $n; $i++) {\n $x = $sc->nextInt();\n $cnt[$x % 2]++;\n}\n\nif($cnt[0] >= $cnt[1]) {\n out::println($cnt[1]);\n} else {\n out::println($cnt[0] + ($cnt[1] - $cnt[0]) / 3);\n}\n"}, {"source_code": ""}, {"source_code": "($n-$temp))$temp=$n-$temp;\necho $temp;\n?>"}, {"source_code": "($n-$temp))$ans=$n-$temp;\n$temp=$temp-$ans;\n$ans+=$temp/3;\necho $ans;\n?>"}, {"source_code": " $nc)\n echo $nc;\nelse\n echo $c;"}, {"source_code": " $nch){\n printa($nch);\n }else{\n $nch -= $ch;\n printa($ch + $nch);\n }\n?>"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "61e6fd68d7568c599204130b102ea389"} {"source_code": " 2) && ($f == TRUE) && ($g == TRUE)) || ((max($h, $i) - min($h, $i) > 2) && ($h == TRUE) && ($i == TRUE)))\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "positive_code": [{"source_code": " 1 || abs($ab_left - $ba_right) > 1 || abs($ab_right - $ba_left) > 1 || abs($ab_right - $ba_right) > 1) {\n echo 'YES';\n exit(0);\n}\n\necho 'NO';"}, {"source_code": "=1 && sizeof($vis1)>=1) )\n {\n if((min($mina,$maxb)+1!=max($mina,$maxb) || min($minb,$maxa)+1!=max($minb,$maxa)))echo \"YES\";\n else\n echo \"NO\";\n }\n\n else echo \"NO\";\n}\n?>\n"}, {"source_code": " 2) && ($d == TRUE) && ($e == TRUE))\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " 2) && (b != \"b\") && (c != \"c\"))\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 2)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 2)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " 2) && ($d == TRUE) && ($e == TRUE))\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " 2) || (e - d > 2))\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 2)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 2)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " 2) && (b != b) && (c != c))\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": " 2) {\n echo 'YES';\n} else {\n echo 'NO';\n}"}, {"source_code": " 2) {\n echo 'YES';\n} else {\n echo 'NO';\n}\n"}, {"source_code": "= 2) {\n echo 'YES';\n} else {\n echo 'NO';\n}"}, {"source_code": " 1 || abs($ab_left - $ba_right) > 1) {\n echo 'YES';\n exit(0);\n}\n\necho 'NO';"}, {"source_code": "$line = trim(fgets(STDIN));"}, {"source_code": " 1 || abs($ab_left - $ba_right) > 1) {\n echo 'YES';\n exit(0);\n}\necho 'NO';"}, {"source_code": " 0 && $ba_pos > 0 && abs($ba_pos - $ab_pos) > 2) {\n echo 'YES';\n} else {\n echo 'NO';\n}"}, {"source_code": " 1 || abs($ab_left - $ba_right) > 1 || abs($ab_right - $ba_right) > 1) {\n echo 'YES';\n exit(0);\n}\n\necho 'NO';"}, {"source_code": " 2) {\n echo 'YES';\n} else {\n echo 'NO';\n}"}, {"source_code": " 1) {\n echo 'YES';\n} else {\n echo 'NO';\n}"}, {"source_code": " 1 || abs($ab_left - $ba_right) > 1) {\n echo 'YES';\n exit(0);\n}\n\necho 'NO';"}, {"source_code": " 1 || abs($ab_left - $ba_right) > 1) {\n echo 'YES';\n exit(0);\n}\n\necho 'NO';"}, {"source_code": "\n"}, {"source_code": "=1 && sizeof($vis1)>=1) && min($mina,$maxb)+1!=max($mina,$maxb) || min($minb,$maxa)+1!=max($minb,$maxa))echo \"YES\";\n else echo \"NO\";\n}\n?>\n"}, {"source_code": "\n"}, {"source_code": "=1 && sizeof($vis1)>=1) && $mina+1!=$maxa)echo \"YES\";\n else echo \"NO\";\n}\n?>\n"}], "src_uid": "33f7c85e47bd6c83ab694a834fa728a2"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n ", "positive_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": "useStd = $userStd;\n\t}\n\n\tprivate function hasZeros($numbers)\n\t{\n\t\tforeach ($numbers as $item)\n\t\t{\n\t\t\tif ((int)$item === 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic function calculateResult($input)\n\t{\n\t\t$numbers = array_map('intval', explode(' ', $input));\n\t\tsort($numbers);\n\t\t$numbers = array_reverse($numbers);\n\t\t$count = 0;\n\t\twhile (true)\n\t\t{\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\tif ($number === 0)\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]++;\n\t\t\t\t\t$count++;\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sum = (int)array_sum($numbers);\n\t\t\tif ($sum !== 0 && !$this->hasZeros($numbers))\n\t\t\t{\n\t\t\t\treturn $count;\n\t\t\t}\n\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\t$numbers[$index]++;\n\n\t\t\t\t$sum = (int)array_sum($numbers);\n\t\t\t\tif ($sum !== 0 && !$this->hasZeros($numbers))\n\t\t\t\t{\n\t\t\t\t\t$count++;\n\t\t\t\t\treturn $count;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\tif ($number !== -1)\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]++;\n\t\t\t\t\t$count++;\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\t$numbers[$index]++;\n\t\t\t\t$count++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function getInputLines()\n\t{\n\t\t$input = [];\n\t\tif ($this->useStd)\n\t\t{\n\t\t\twhile ($line = fgets(STDIN))\n\t\t\t{\n\t\t\t\t$input[] = $line;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$input = '';\n\t\t\t$input = explode(\"\\n\", trim($input));\n\t\t}\n\t\treturn $input;\n\t}\n\n\tpublic function printResult($result)\n\t{\n\t\tif ($this->useStd)\n\t\t{\n\t\t\tfwrite(STDOUT, $result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar_dump($result);\n\t\t}\n\t}\n\n}\n\n$helper = new ArgsHelper(true);\n$lines = $helper->getInputLines();\n\n$result = '';\n#\narray_shift($lines);\nforeach ($lines as $index => $line)\n{\n\tif ($index % 2 === 0)\n\t{\n\t\tcontinue;\n\t}\n\t$result .= $helper->calculateResult($line) . ' ';\n}\n$result = trim($result);\n#\n\n\n$helper->printResult($result);\n\n"}, {"source_code": "\n "}], "negative_code": [{"source_code": "useStd = $userStd;\n\t}\n\n\tpublic function calculateResult($input)\n\t{\n\t\t$numbers = array_map('intval', explode(' ', $input));\n\t\tsort($numbers);\n\t\t$numbers = array_reverse($numbers);\n\t\t$count = 0;\n\t\twhile (true)\n\t\t{\n\t\t\t$sum = array_sum($numbers);\n\t\t\t$product = array_product($numbers);\n\t\t\tif ($sum !== 0 && $product !== 0)\n\t\t\t{\n\t\t\t\treturn $count;\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\t$numbers[$index]++;\n\t\t\t\t$count++;\n\n\t\t\t\t$sum = array_sum($numbers);\n\t\t\t\t$product = array_product($numbers);\n\t\t\t\tif ($sum !== 0 && $product !== 0)\n\t\t\t\t{\n\t\t\t\t\treturn $count;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]--;\n\t\t\t\t\t$count--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\tif ($number === 0)\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]++;\n\t\t\t\t\t$count++;\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\tif ($number !== -1)\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]++;\n\t\t\t\t\t$count++;\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\t$numbers[$index]++;\n\t\t\t\t$count++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function getInputLines()\n\t{\n\t\t$input = [];\n\t\tif ($this->useStd)\n\t\t{\n\t\t\twhile ($line = fgets(STDIN))\n\t\t\t{\n\t\t\t\t$input[] = $line;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$input = '1000\n100\n0 0 -60 0 20 0 -85 0 0 0 -88 -77 83 0 10 0 98 0 1 68 0 0 0 0 0 0 -46 -95 0 -63 0 0 0 41 5 21 -60 0 -23 0 32 61 0 0 67 -87 73 -88 0 0 0 56 0 27 0 0 0 0 -42 -49 59 0 -74 -34 0 0 42 0 0 0 55 -36 -59 0 0 94 0 0 -58 54 0 2 67 0 0 0 100 0 45 73 -54 54 0 94 0 0 -1 -12 -40 -59\n100\n-25 0 0 -33 -43 0 0 0 -10 -15 0 58 -23 -90 -82 0 0 0 0 83 0 8 -51 0 -54 0 43 59 0 4 29 0 -23 0 0 43 70 47 -45 0 62 0 -75 -75 0 0 62 -71 0 -36 74 0 0 0 53 0 0 -39 0 97 0 -34 0 0 0 0 55 0 0 0 17 -94 27 32 0 72 14 -47 0 -70 0 -...\n';\n\t\t\t$input = explode(\"\\n\", trim($input));\n\t\t}\n\t\treturn $input;\n\t}\n\n\tpublic function printResult($result)\n\t{\n\t\tif ($this->useStd)\n\t\t{\n\t\t\tfwrite(STDOUT, $result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar_dump($result);\n\t\t}\n\t}\n\n}\n\n$helper = new ArgsHelper(true);\n$lines = $helper->getInputLines();\n\n$result = '';\n#\narray_shift($lines);\nforeach ($lines as $index => $line)\n{\n\tif ($index % 2 === 0)\n\t{\n\t\tcontinue;\n\t}\n\t$result .= $helper->calculateResult($line) . ' ';\n}\n$result = trim($result);\n#\n\n\n$helper->printResult($result);\n\n"}, {"source_code": "useStd = $userStd;\n\t}\n\n\tpublic function calculateResult($input)\n\t{\n\t\t$numbers = array_map('intval', explode(' ', $input));\n\t\tsort($numbers);\n\t\t$numbers = array_reverse($numbers);\n\t\t$count = 0;\n\t\twhile (true)\n\t\t{\n\t\t\t$sum = array_sum($numbers);\n\t\t\t$product = array_product($numbers);\n\t\t\tif ($sum !== 0 && $product !== 0)\n\t\t\t{\n\t\t\t\treturn $count;\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\tif ($number === 0)\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]++;\n\t\t\t\t\t$count++;\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\tif ($number !== -1)\n\t\t\t\t{\n\t\t\t\t\t$numbers[$index]++;\n\t\t\t\t\t$count++;\n\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($numbers as $index => $number)\n\t\t\t{\n\t\t\t\t$numbers[$index]++;\n\t\t\t\t$count++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function getInputLines()\n\t{\n\t\t$input = [];\n\t\tif ($this->useStd)\n\t\t{\n\t\t\twhile ($line = fgets(STDIN))\n\t\t\t{\n\t\t\t\t$input[] = $line;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$input = '4\n3\n2 -1 -1\n4\n-1 0 0 1\n2\n-1 2\n3\n0 -2 1\n';\n\t\t\t$input = explode(\"\\n\", trim($input));\n\t\t}\n\t\treturn $input;\n\t}\n\n\tpublic function printResult($result)\n\t{\n\t\tif ($this->useStd)\n\t\t{\n\t\t\tfwrite(STDOUT, $result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar_dump($result);\n\t\t}\n\t}\n\n}\n\n$helper = new ArgsHelper(true);\n$lines = $helper->getInputLines();\n\n$result = '';\n#\narray_shift($lines);\nforeach ($lines as $index => $line)\n{\n\tif ($index % 2 === 0)\n\t{\n\t\tcontinue;\n\t}\n\t$result .= $helper->calculateResult($line) . ' ';\n}\n$result = trim($result);\n#\n\n\n$helper->printResult($result);\n\n"}], "src_uid": "1ffb08fe61cdf90099c82162b8353b1f"} {"source_code": " $row){\n foreach ($row as $colNumber => $word){\n if (in_array($word, $needsWords)){\n\n $exist = array($word);\n $a = 1;\n //echo \"\\r\\n\".$word.\" \".$matrix[$colNumber + 1][$rowNumber].' '.$matrix[$colNumber][$rowNumber].' '.$matrix[$colNumber][$rowNumber].\"\\r\\n\";\n if (isset($matrix[$rowNumber + 1][$colNumber]) && in_array($matrix[$rowNumber + 1][$colNumber], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber + 1][$colNumber];\n }\n if (isset($matrix[$rowNumber + 1][$colNumber + 1]) && in_array($matrix[$rowNumber + 1][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber + 1], $exist)){\n $a++;\n $exist[] =$matrix[$rowNumber + 1][$colNumber + 1];\n }\n if (isset($matrix[$rowNumber][$colNumber + 1]) && in_array($matrix[$rowNumber][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber][$colNumber + 1], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber][$colNumber + 1];\n }\n if ($a == 4){\n $cnt ++;\n }\n }\n }\n}\necho $cnt;"}, {"source_code": ""}, {"source_code": " $row){\n echo 'Row: '.$rowNumber.\"\\r\\n\";\n foreach ($row as $colNumber => $word){\n echo 'Col: '.$colNumber.\"\\r\\n\";\n if (in_array($word, $needsWords)){\n $exist = array($word);\n $a = 1;\n //echo \"\\r\\n\".$word.\" \".$matrix[$colNumber + 1][$rowNumber].' '.$matrix[$colNumber][$rowNumber].' '.$matrix[$colNumber][$rowNumber].\"\\r\\n\";\n if (isset($matrix[$rowNumber + 1][$colNumber]) && in_array($matrix[$rowNumber + 1][$colNumber], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber + 1][$colNumber];\n }\n if (isset($matrix[$rowNumber + 1][$colNumber + 1]) && in_array($matrix[$rowNumber + 1][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber + 1], $exist)){\n $a++;\n $exist[] =$matrix[$rowNumber + 1][$colNumber + 1];\n }\n if (isset($matrix[$rowNumber][$colNumber + 1]) && in_array($matrix[$rowNumber][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber][$colNumber + 1], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber][$colNumber + 1];\n }\n if ($a == 4){\n $cnt ++;\n }\n }\n }\n}\necho $cnt;"}, {"source_code": " $row){\n foreach ($row as $colNumber => $word){\n if (in_array($word, $needsWords)){\n $exist = array($word);\n $a = 1;\n //echo \"\\r\\n\".$word.\" \".$matrix[$colNumber + 1][$rowNumber].' '.$matrix[$colNumber][$rowNumber].' '.$matrix[$colNumber][$rowNumber].\"\\r\\n\";\n if (isset($matrix[$rowNumber + 1][$colNumber]) && in_array($matrix[$rowNumber + 1][$colNumber], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber + 1][$colNumber];\n }\n if (isset($matrix[$rowNumber + 1][$colNumber + 1]) && in_array($matrix[$rowNumber + 1][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber + 1], $exist)){\n $a++;\n $exist[] =$matrix[$rowNumber + 1][$colNumber + 1];\n }\n if (isset($matrix[$rowNumber][$colNumber + 1]) && in_array($matrix[$rowNumber][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber][$colNumber + 1], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber][$colNumber + 1];\n }\n if ($a == 4){\n $cnt ++;\n }\n }\n }\n}\necho $cnt;"}, {"source_code": " $row){\n foreach ($row as $colNumber => $word){\n if (in_array($word, $needsWords)){\n $exist = array($word);\n $a = 1;\n if (isset($matrix[$colNumber + 1][$rowNumber]) && in_array($matrix[$colNumber + 1][$rowNumber], $needsWords) && !in_array($matrix[$colNumber + 1][$rowNumber], $exist)){\n $a++;\n $exist[] = $matrix[$colNumber + 1];\n }\n\n if (isset($matrix[$colNumber + 1][$rowNumber + 1]) && in_array($matrix[$colNumber + 1][$rowNumber + 1], $needsWords) && !in_array($matrix[$colNumber + 1][$rowNumber + 1], $exist)){\n $a++;\n $exist[] = $matrix[$colNumber + 1];\n }\n\n if (isset($matrix[$colNumber][$rowNumber + 1]) && in_array($matrix[$colNumber][$rowNumber + 1], $needsWords) && !in_array($matrix[$colNumber][$rowNumber + 1], $exist)){\n $a++;\n $exist[] = $matrix[$colNumber + 1];\n }\n\n if ($a == 4){\n $cnt ++;\n }\n }\n }\n}\necho $cnt;"}, {"source_code": " $row){\n foreach ($row as $colNumber => $word){\n if (in_array($word, $needsWords)){\n $exist = array($word);\n $a = 1;\n //echo \"\\r\\n\".$word.\" \".$matrix[$colNumber + 1][$rowNumber].' '.$matrix[$colNumber][$rowNumber].' '.$matrix[$colNumber][$rowNumber].\"\\r\\n\";\n if (isset($matrix[$rowNumber + 1][$colNumber]) && in_array($matrix[$rowNumber + 1][$colNumber], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber + 1][$colNumber];\n }\n if (isset($matrix[$rowNumber + 1][$colNumber + 1]) && in_array($matrix[$rowNumber + 1][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber + 1][$colNumber + 1], $exist)){\n $a++;\n $exist[] =$matrix[$rowNumber + 1][$colNumber + 1];\n }\n if (isset($matrix[$rowNumber][$colNumber + 1]) && in_array($matrix[$rowNumber][$colNumber + 1], $needsWords) && !in_array($matrix[$rowNumber][$colNumber + 1], $exist)){\n $a++;\n $exist[] = $matrix[$rowNumber][$colNumber + 1];\n }\n if ($a == 4){\n $cnt ++;\n }\n }\n }\n}\necho $cnt;"}], "src_uid": "742e4e6ca047da5f5ebe5d854d6a2024"} {"source_code": "= 0; $x--)\n{\n if($a[$x] == \"]\")\n {\n $b++;\n break;\n }\n}\nfor($y = $x; $y >= 0; $y--)\n{\n if($a[$y] == \":\")\n {\n $b++;\n $d = $y;\n break;\n }\n}\nif(($b != 4) || ($c >= $d))\n{\n print \"-1\";\n}\nelse\n{\n $e = 0;\n for($x = $c; $x <= $d; $x++)\n {\n if($a[$x] == \"|\")\n {\n $e++;\n }\n }\n if($e == 0)\n {\n print \"4\";\n }\n elseif($e > 0)\n {\n print $e + 4;\n }\n}\n?>", "positive_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$s = $ir->readString();\n$n = strlen($s);\n$lb = null;\n$rb = null;\n$rsc = null;\n$lsc = null;\n\nfor ($i=0; $i<$n; $i++) {\n\tif ($s[$i]=='[') {\n\t\t$lb = $i;\n\t\tbreak;\n\t}\n}\n\nif ($lb===null) {\n\techo -1; exit();\n}\n//echo $lb;\nfor ($i=$lb+1; $i<$n; $i++) {\n\tif ($s[$i]==':') {\n\t\t$lsc = $i;\n\t\tbreak;\n\t}\n}\n\nif ($lsc===null) {\n\techo -1; exit();\n}\n//echo $lsc;\nfor ($i=$n-1; $i>$lsc; $i--) {\n\tif ($s[$i]==']') {\n\t\t$rb = $i;\n\t\tbreak;\n\t}\n}\n\nif ($rb===null) {\n\techo -1; exit();\n}\n//echo $rb;\nfor ($i=$rb-1; $i>=$lsc; $i--) {\n\tif ($s[$i]==':') {\n\t\t$rsc = $i;\n\t\tbreak;\n\t}\n}\n\nif ($rsc===null) {\n\techo -1; exit();\n}\n//echo $rsc;\nif ($rsc===$lsc) {\n\techo -1; exit();\n}\n\n\n$bars = 0;\nfor ($i=$lsc+1; $i<=$rsc-1; $i++) {\n\tif ($s[$i] == '|') {\n\t\t$bars++;\n\t}\n}\n\necho $bars+4;\n"}, {"source_code": "= 0; $x--)\n{\n if($a[$x] == \"]\")\n {\n $b = 3;\n break;\n }\n}\nfor($y = $x; $y >= 0; $y--)\n{\n if($a[$y] == \":\")\n {\n $b = 4;\n $d = $y;\n break;\n }\n}\nif(($b != 4) || ($c == $d))\n{\n print \"-1\";\n}\nelse\n{\n $e = 0;\n for($x = $c; $x <= $d; $x++)\n {\n if($a[$x] == \"|\")\n {\n $e++;\n }\n }\n if($e == 0)\n {\n print \"4\";\n }\n elseif($e == 1)\n {\n print \"-1\";\n }\n elseif($e >= 2)\n {\n print ($e - 1) + 4;\n }\n}\n?>"}, {"source_code": "= 0; $x--)\n{\n if($a[$x] == \"]\")\n {\n $b = 3;\n break;\n }\n}\nfor($y = $x; $y >= 0; $y--)\n{\n if($a[$y] == \":\")\n {\n $b = 4;\n $d = $y;\n break;\n }\n}\nif(($b != 4) || ($c == $d))\n{\n print \"-1\";\n}\nelse\n{\n $e = 0;\n for($x = $c; $x <= $d; $x++)\n {\n if($a[$x] == \"|\")\n {\n $e++;\n }\n }\n if($e == 0)\n {\n print \"4\";\n }\n elseif($e == 1)\n {\n print \"-1\";\n }\n elseif($e >= 2)\n {\n print $e + 4;\n }\n}\n?>"}, {"source_code": "= 0; $x--)\n{\n if($a[$x] == \"]\")\n {\n $b++;\n break;\n }\n}\nfor($y = $x; $y >= 0; $y--)\n{\n if($a[$y] == \":\")\n {\n $b++;\n $d = $y;\n break;\n }\n}\nif(($b != 4) || ($c >= $d))\n{\n print \"-1\";\n}\nelse\n{\n $e = 0;\n for($x = $c; $x <= $d; $x++)\n {\n if($a[$x] == \"|\")\n {\n $e++;\n }\n }\n if($e == 0)\n {\n print \"4\";\n }\n elseif($e == 1)\n {\n print \"-1\";\n }\n elseif($e >= 2)\n {\n print $e + 4;\n }\n}\n?>"}, {"source_code": "= 0; $x--)\n{\n if($a[$x] == \"]\")\n {\n $b = 3;\n break;\n }\n}\nfor($y = $x; $y >= 0; $y--)\n{\n if($a[$y] == \":\")\n {\n $b = 4;\n $d = $y;\n break;\n }\n}\nif(($b != 4) || ($c >= $d))\n{\n print \"-1\";\n}\nelse\n{\n $e = 0;\n for($x = $c; $x <= $d; $x++)\n {\n if($a[$x] == \"|\")\n {\n $e++;\n }\n }\n if($e == 0)\n {\n print \"4\";\n }\n elseif($e == 1)\n {\n print \"-1\";\n }\n elseif($e >= 2)\n {\n print $e + 4;\n }\n}\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\n$s = $ir->readString();\n\n$lb = null;\n$rb = null;\n$rsc = null;\n$lsc = null;\n\nfor ($i=0; $i_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$s = $ir->readString();\n\n$lb = null;\n$rb = null;\n$rsc = null;\n$lsc = null;\nfor ($i=0; $i=0; $i--) {\n\tif ($s[$i]==']') $rb = $rb ?? $i;\n\tif ($rb!==null && $s[$i]==':') $rsc = $rsc ?? $i;\n\tif ($rb!==null && $rsc!==null) break;\n}\n\n//var_dump([$lb, $lsc, $rsc, $rb]);\n$bars = 0;\nif ($rb>$lb && $lsc!==null && $rsc!==null && $lsc!=$rsc) {\n\tfor ($i=$rsc; $i<$lsc; $i++) {\n\t\tif ($s[$i] == '|') {\n\t\t\t$bars++;\n\t\t}\n\t}\n\t\n\techo $bars+4;\n}\nelse {\n\techo -1;\n}\n"}, {"source_code": "= $i2) {\n break;\n }\n\n $iCount++;\n// echo $iCount . ' | ' . $i2 . \"\\n\";\n\n $i1 = $i4;\n } else {\n break;\n }\n }\n }\n }\n }\n}\n\necho $iCount;"}, {"source_code": "= $i2) {\n break;\n }\n\n $iCount++;\n// echo $iCount . ' | ' . $i2 . \"\\n\";\n\n $i1 = $i4;\n } else {\n break;\n }\n }\n } else {\n $iCount = -1;\n }\n } else {\n $iCount = -1;\n }\n } else {\n $iCount = -1;\n }\n}\n\necho $iCount;"}, {"source_code": "= $i2) {\n break;\n }\n\n $iCount++;\n// echo $iCount . ' | ' . $i2 . \"\\n\";\n\n $i1 = $i4;\n } else {\n break;\n }\n }\n } else {\n $iCount = -1;\n }\n } else {\n $iCount = -1;\n }\n }\n}\n\necho $iCount;"}, {"source_code": " $i2) {\n break;\n }\n\n $iCount++;\n// echo $iCount . ' | ' . $i2 . \"\\n\";\n\n $i1 = $i4;\n } else {\n break;\n }\n }\n } else {\n $iCount = -1;\n }\n } else {\n $iCount = -1;\n }\n } else {\n $iCount = -1;\n }\n}\n\necho $iCount;"}], "src_uid": "915b4776a6b1fa15886247eb1ad40b60"} {"source_code": "1){$ch=true;break;}\n }\n if($ch)\n {\n echo $str.\"\\n\";\n }\n else\n {\n echo '-1'.\"\\n\";\n }\n }\n}\n\n?>", "positive_code": [{"source_code": " 0; $y--)\n {\n $d -= $c[$y];\n if(($d % 2 == 0) && ($c[$y - 1] % 2 == 1))\n {\n $e = 1;\n $c = array_slice($c, 0, $y);\n print implode($c) . \"\\n\";\n break;\n }\n }\n }\n elseif(($d % 2 == 1) && ($c[$b - 1] % 2 == 1))\n {\n for($y = 0; $y < $b - 1; $y++)\n {\n if($c[$y] % 2 == 1)\n {\n if(($y == 0) && ($c[$y + 1] == 0))\n {\n continue;\n }\n else\n {\n $e = 1;\n unset($c[$y]);\n print implode($c) . \"\\n\";\n break;\n }\n }\n }\n }\n elseif(($d % 2 == 1) && ($c[$b - 1] % 2 == 0))\n {\n for($y = $b - 1; $y > 0; $y--)\n {\n $d -= $c[$y];\n if($c[$y - 1] % 2 == 1)\n {\n $e = 2;\n $c = array_slice($c, 0, $y);\n break;\n }\n }\n if($e == 2)\n {\n if(($d % 2 == 0) && ($c[count($c) - 1] % 2 == 1))\n {\n $e = 1;\n print implode($c) . \"\\n\";\n }\n else\n {\n for($y = 0; $y < count($c) - 1; $y++)\n {\n if($c[$y] % 2 == 1)\n {\n if(($y == 0) && ($c[$y + 1] == 0))\n {\n continue;\n }\n else\n {\n $e = 1;\n unset($c[$y]);\n print implode($c) . \"\\n\";\n break;\n }\n }\n }\n }\n }\n }\n if($e != 1)\n {\n print \"-1\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": "1){break;}\n }\n echo \"\\n\";\n }\n}\n\n?>"}, {"source_code": "= 0; $i--) {\n // var_dump($sum.' '.substr($s, 0,$i+1));\n if (((int)substr($s, 0,$i+1)) % 2 != 0 && $sum % 2 == 0) {\n echo substr($s, 0,$i+1) . \"\\n\";\n break;\n }\n $sum=$sum-((int)$s[$i]);\n }\n // die();\n }\n}\n\n?>"}, {"source_code": "0;$i--)\n {\n //var_dump($str);\n if($str[$i]%2!=0)\n {\n if($sum%2==0)\n {\n echo substr($str, 0,$i+1).\"\\n\";\n break;\n }\n else\n {\n $sum=$sum-$str[$i];\n $str=substr($str, 0,$i);\n }\n }else\n {\n $sum=$sum-$str[$i];\n $str=substr($str, 0,$i);\n\n }\n\n }\n }\n}\n\n?>"}, {"source_code": "= 0; $i--) {\n // var_dump($sum.' '.substr($s, 0,$i+1));\n if (($s[$i]) % 2 != 0 && $sum % 2 == 0) {\n echo substr($s, 0,$i+1) . \"\\n\";\n break;\n }\n $sum=$sum-((int)$s[$i]);\n }\n // die();\n }\n}\n\n?>"}, {"source_code": "0;$i--)\n {\n var_dump($str);\n if($str[$i]%2!=0)\n {\n if($sum%2==0)\n {\n echo substr($str, 0,$i+1).\"\\n\";\n break;\n }\n else\n {\n $sum=$sum-$str[$i];\n $str=substr($str, 0,$i);\n }\n }else\n {\n $sum=$sum-$str[$i];\n $str=substr($str, 0,$i);\n\n }\n\n }\n }\n}\n\n?>"}], "src_uid": "8f00837e04627e445dfb8b6cd0216640"} {"source_code": "$poll) {\n\n\t$turns = sizeof($poll);\n\n\t$res = 'YES';\n\n\tforeach ($player_c as $j=>$c) if ($i!=$j) {\n\t\t$x = 0;\n\n\t\tforeach ($poll as $p) {\n\t\t\tif (($index = array_search($p,$c))!==false) {\n\t\t\t\t$x++;\n\t\t\t\tunset($c[$index]);\n\n\t\t\t\tif (!$c) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$c && $x && $x<=$turns) {\n\t\t\t$res = 'NO';\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$result[] = $res;\n}\n\necho implode(L,$result);", "positive_code": [{"source_code": "= count($c[$y]))\n {\n $f = array_intersect($c[$x], $c[$y]);\n if(count($f) == count($c[$y]))\n {\n if($x == ($a - 1))\n {\n $e = \"NO\";\n print $e;\n break;\n }\n else\n {\n $e = \"NO\";\n print $e . \"\\n\";\n break;\n }\n }\n }\n if(($y == ($a - 1)) && ($e == \"YES\"))\n {\n print $e . \"\\n\";\n }\n }\n }\n}\nif($e == \"YES\")\n{\n print $e;\n}\n?>"}], "negative_code": [{"source_code": "$poll) {\n\n\t$turns = sizeof($poll);\n\n\t$res = 'YES';\n\n\tforeach ($player_c as $j=>$c) if ($i!=$j) {\n\t\t$first = current($c);\n\t\t$x = 0;\n\n\t\tforeach ($poll as $p) {\n\t\t\tif ($p==$first) {\n\t\t\t\t$x++;\n\t\t\t\tarray_shift($c);\n\n\t\t\t\tif ($c) {\n\t\t\t\t\t$first = current($c);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!$c && $x && $x<=$turns) {\n\t\t\t$res = 'NO';\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$result[] = $res;\n}\n\necho implode(L,$result);"}], "src_uid": "90a47422f7ae53beb0a817422d760c6e"} {"source_code": "= $d[0])\n{\n if($b > $c[0])\n {\n print $b - $c[0];\n }\n elseif($b < $d[0])\n {\n print $d[0] - $b;\n }\n else\n {\n print \"0\";\n }\n}\nelse\n{\n print \"-1\";\n}\n?>", "positive_code": [{"source_code": " $b)\n {\n $c = $a;\n $a = $b;\n $b = $c;\n }\n for ($j = $a; $j <= $b; $j++)\n {\n if (empty($num[$j])) $num[$j] = 0;\n $num[$j]++;\n }\n}\n$ret = $MAX;\nfor ($i = 0; $i < $MAX; $i++)\n{\n if (isset($num[$i]) && $num[$i] == $n) $ret = min($ret, abs($x - $i));\n}\nif ($ret == $MAX) echo \"-1\\n\";\nelse echo \"$ret\\n\";\n?>\n"}, {"source_code": " $supermin ? $min : $supermin) : $min;\n\t$supermax = isset($supermax) ? ($max < $supermax ? $max : $supermax) : $max;\n}\n//echo \"\\n\";\n\necho $supermax < $supermin ? '-1' : (($x0 <= $supermax && $x0 >= $supermin ? 0 : min(abs($x0 - $supermin), abs($x0 - $supermax))));\n\n//fclose($r);\n"}, {"source_code": " $d))\n\t\t$diff = $d;\n}\nprintf(\"%d\\n\", $diff);\n?>\n"}], "negative_code": [{"source_code": " $b)\n {\n $c = $a;\n $a = $b;\n $b = $c;\n }\n for ($j = $a; $j <= $b; $j++)\n {\n $num[$j]++;\n }\n}\n$ret = $MAX;\nfor ($i = 0; $i < $MAX; $i++)\n{\n if ($num[$i] == $n) $ret = min($ret, abs($x - $i));\n}\nif ($ret == $MAX) echo \"-1\\n\";\nelse echo \"ret\\n\";\n?>\n"}, {"source_code": "\n"}, {"source_code": " $supermin ? $min : $supermin) : $min;\n\t$supermax = isset($supermax) ? ($max < $supermax ? $max : $supermax) : $max;\n}\n//echo \"\\n\";\n//echo \"$supermin $supermax\\n\";\n\necho $supermax < $supermin ? '-1' : min(abs($x0 - $supermin), abs($x0 - $supermax));\n\n//fclose($r);\n"}, {"source_code": " $supermin ? $min : $supermin) : $min;\n\t$supermax = isset($supermax) ? ($max < $supermax ? $max : $supermax) : $max;\n}\n//echo \"\\n\";\n//echo \"$supermin $supermax\\n\";\n\necho $supermax < $supermin ? '-1' : min(abs($x0 - $supermin), abs($x0 - $supermax));\n\n//fclose($r);\n"}, {"source_code": " $supermin ? $min : $supermin) : $min;\n\t$supermax = isset($supermax) ? ($max < $supermax ? $max : $supermax) : $max;\n}\n\necho $supermax < $supermin ? '-1' : min(abs($x0 - $supermin), abs($x0 - $supermax));\n\n//fclose($r);\n"}], "src_uid": "3c066bad8ee6298b318bf0f4521c7c45"} {"source_code": " 0 && $cnt) {\n\t$m = current($cnt);\n\tif ($k >= $m) {\n\t\t$letters[key($cnt)] = true;\n\t\t$k -= $m;\n\t\tarray_shift($cnt);\n\t} else {\n\t\t$k = 0;\n\t}\n}\necho count($cnt) . PHP_EOL;\nif (!count($cnt)) {\n\texit;\n}\n$removed = 0;\nfor ($i = 0; $i < strlen($str); $i++) {\n\tif (isset($letters[$str{$i}]) && $removed < $num) {\n\t\t$removed++;\n\t} else {\n\t\techo $str{$i};\n\t}\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " 0 && $cnt) {\n\t$m = current($cnt);\n\tif ($k > $m) {\n\t\t$letters[key($cnt)] = true;\n\t\t$k -= $m;\n\t\tarray_shift($cnt);\n\t} else {\n\t\t$k = 0;\n\t}\n}\necho count($cnt) . PHP_EOL;\nif (!count($cnt)) {\n\texit;\n}\n$removed = 0;\nfor ($i = 0; $i < strlen($str); $i++) {\n\tif (isset($letters[$str{$i}]) && $removed < $num) {\n\t\t$removed++;\n\t} else {\n\t\techo $str{$i};\n\t}\n}\n"}, {"source_code": " 0 && $cnt) {\n\t$letters[key($cnt)] = true;\n\t$k -= array_shift($cnt);\n}\necho count($cnt) . PHP_EOL;\nif (!count($cnt)) {\n\texit;\n}\n$removed = 0;\nfor ($i = 0; $i < strlen($str); $i++) {\n\tif (isset($letters[$str{$i}]) && $removed < $num) {\n\t\t$removed++;\n\t} else {\n\t\techo $str{$i};\n\t}\n}\n\n"}, {"source_code": " 0 && $cnt) {\n\t$letters[key($cnt)] = true;\n\t$k -= array_shift($cnt);\n}\necho count($cnt) . PHP_EOL;\nif (!count($cnt)) {\n\texit;\n}\n$removed = 0;\nfor ($i = 0; $i < strlen($str); $i++) {\n\tif (isset($letters[$str{$i}]) && $removed < $num) {\n\t\t$removed++;\n\t} else {\n\t\techo $str{$i};\n\t}\n}\n\n"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "f023111561605b3e44ca85cb43b4aa00"} {"source_code": "", "positive_code": [{"source_code": "in();\n\n\t$max_x = -1;\n\t\n\tfor ($i = 0; $i < $N; $i++)\n\t{\n\t\t$X = (int)$Input->in();\n\t\t$max_x = max($max_x, $X);\n\t}\n\n\t$M = (int)$Input->in();\n\n\t$max_y = -1;\n\n\tfor ($i = 0; $i < $M; $i++)\n\t{\n\t\t$Y = (int)$Input->in();\n\t\t$max_y = max($max_y, $Y);\n\t}\n\n\t$K = (int)$Input->in();\n\n\t$min_z = 5001;\n\n\tfor ($i = 0; $i < $K; $i++)\n\t{\n\t\t$Z = (int)$Input->in();\n\t\t$min_z = min($min_z, $Z);\n\n\t}\n\n\t$A = (int)$Input->in();\n\t$B = (int)$Input->in();\n\t$temp = ($A / $B) * ($min_z / $max_y) + 1;\n\n\tprint($max_x / sqrt($temp));\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": ""}], "negative_code": [{"source_code": "= 2 && $n <= 3) {\r\n echo 1 . PHP_EOL;\r\n } else {\r\n if ($n % 3 == 0) {\r\n $s = $n / 3;\r\n } else {\r\n $s = ($n / 3) + 1;\r\n }\r\n echo (int) $s . PHP_EOL;\r\n }\r\n \r\n}"}], "negative_code": [{"source_code": "= -3 && $n <= 3) {\r\n echo 1 . PHP_EOL;\r\n } else {\r\n if ($n % 3 == 0) {\r\n $s = $n / 3;\r\n } else {\r\n $s = ($n / 3) + 1;\r\n }\r\n echo (int) $s . PHP_EOL;\r\n }\r\n \r\n}"}], "src_uid": "208e285502bed3015b30ef10a351fd6d"} {"source_code": "$max)$max=$cnt;\n $cnt=0;\n }else if($check==true)\n {\n $cnt++;\n }\n }\n if($cnt>$max)$max=$cnt;\n echo $max.\"\\n\";\n\n}\n\n?>\n"}, {"source_code": " $d)\n {\n $d = $e;\n }\n $f = $z;\n }\n }\n print $d . \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": " 0) {\n if($max <= $counter){\n $max = $counter;\n }\n $counter = 0;\n $bool = false;\n }\n }\n echo $max.\"\\n\";\n}\n\n\n"}, {"source_code": "= 0; $i--){\n if($c[$i] == 'A'){\n echo $b - ($i+1).\"\\n\";\n break;\n }\n }\n}\n\n\n"}], "src_uid": "1539fc8ef4f4cdcd1e14faf4f1b4ee8b"} {"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 foreach ($aAllResults as $sRes) {\r\n IO::line($sRes);\r\n }\r\n}\r\nfunction solve() {\r\n $n = IO::str();\r\n $a = IO::arr();\r\n $res = [];\r\n for($i = 0; $i < $n - 1; $i++) {\r\n $res[] = $a[$i] * $a[$i+1];\r\n }\r\n IO::line(max($res));\r\n\r\n\r\n\r\n}\r\n\r\n\r\n?>", "positive_code": [{"source_code": " $sV) {\r\n $iMin1 = 0;\r\n $iMin2 = 0;\r\n if (isset($aInput[$sV - 1])) {\r\n $iMin1 = $aInput[$sV - 1];\r\n }\r\n if (isset($aInput[$sV + 1])) {\r\n $iMin2 = $aInput[$sV + 1];\r\n }\r\n $aAnswer[] = $iMax * $iMin1;\r\n $aAnswer[] = $iMax * $iMin2;\r\n }\r\n echo max($aAnswer) . \"\\n\";\r\n}"}], "src_uid": "2deed55e860bd69ff0ba3973a1d73cac"} {"source_code": "= $m) && ($b <= $n))\n {\n break;\n }\n else\n {\n $m += $l[$x];\n $n += $l[$x + 1];\n }\n}\nprint $l[$x];\n?>", "positive_code": [{"source_code": "Scan();\n\t$K = (int)$Scanner->Scan();\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$TEAMS[$i][] = (int)$Scanner->Scan();\n\t\t$TEAMS[$i][] = 100 - (int)$Scanner->Scan();\n\t}\n\t\n\trsort($TEAMS);\n\t\n\t$num = $TEAMS[$K - 1][0];\n\t$time = $TEAMS[$K - 1][1];\n\t$count = 0;\n\tfor ($i = 0; $i < $N; $i++) {\n\t\tif ($TEAMS[$i][0] === $num && $TEAMS[$i][1] === $time)$count++;\n\t\t\n\t\tif ($count > 0 && ($TEAMS[$i][0] !== $num || $TEAMS[$i][1] !== $time)) break;\t}\n\tprint($count);\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": " $groups[$j][\"minuses\"]) {\n $tmp = $groups[$j];\n $groups[$j] = $groups[$i];\n $groups[$i] = $tmp;\n }\n }\n}\n\n//for($i = 0; $i < $n; $i++) {\n// echo $groups[$i][\"tasks\"]. \" \" . $groups[$i][\"minuses\"].\"
\";\n//}\n\n$resTasks = $groups[$k-1][\"tasks\"];\n$resMinuses = $groups[$k-1][\"minuses\"];\n\n\n$result = 0;\nfor($i = 0; $i < $n; $i++) {\n if($groups[$i][\"tasks\"] == $resTasks && $groups[$i][\"minuses\"] == $resMinuses)\n $result++;\n}\n\n\n\necho $result;\n\n//file_put_contents(\"out.txt\", $result);\n?>\n"}], "negative_code": [{"source_code": "= $m) && ($b <= $n))\n {\n break;\n }\n else\n {\n $m += $l[$x];\n $n += $l[$x + 1];\n }\n}\nprint $l[$x];\n?>"}, {"source_code": "Scan();\n\t$K = (int)$Scanner->Scan();\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$TEAMS[$i][] = (int)$Scanner->Scan();\n\t\t$TEAMS[$i][] = 100 - (int)$Scanner->Scan();\n\t}\n\t\n\trsort($TEAMS);\n\t\n\t$num = $TEAMS[$K - 1][0];\n\t$time = $TEAMS[$K - 1][1];\n\t$count = 0;\n\tfor ($i = 0; $i < $N; $i++) {\n\t\tif ($TEAMS[$i][0] === $num && $TEAMS[$i][1] === $time)$count++;\n\t\t\n\t\tif ($count > 0 && ($TEAMS[$i][0] !== $num || $TEAMS[$i][1] !== $time)) break;\t}\n\tprint($count);\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": "63e03361531999db408dc0d02de93579"} {"source_code": " $k) $tmp = $f - ($t - $k);\n\telse $tmp = $f;\n\tif($tmp > $ans) $ans = $tmp;\n}\necho $ans;\n\n?>", "positive_code": [{"source_code": " $k)\n $Now = $f - ($t - $k);\n else\n $Now = $f;\n if ($Now > $Ans)\n $Ans = $Now;\n }\n \n echo $Ans;\n?>\n"}, {"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++];}} \n/*init*/ $dxs = new stdIn(false);\n// $x = $dxs-> G(); equivalent to cin>>x;\n$n=$dxs->G();\n$k=$dxs->G();\n$max=-10000000000000000000000000000000;\nfor ($i = 0; $i < $n; $i++) {\n\t$j=0;\n\t$f=$dxs->G();\n\t$t=$dxs->G();\n\tif($t>$k){$f=$f-($t-$k);}\n\t//echo $f;\n\t//echo $max;\n\tif($f>$max){\n\t\t$max=$f;\n\t}\n}\necho $max; \n?>"}, {"source_code": "\n\n $k) {\n\t\t$max = isset($max) ? max($max, $f - ($t - $k)) : $f - ($t - $k);\n\t} else {\n\t\t$max = isset($max) ? max($max, $f) : $f;\n\t}\n}\n\nprintf(\"%d\", $max);\n\n?>"}], "negative_code": [], "src_uid": "1bb5b64657e16fb518d49d3c799d4823"} {"source_code": "= $k) {\n\t\t\t$c -= $ls;\n\t\t\t$c++;\n\t\t}\n\t\t$i2 = min($n - 1, $n - 1 - $k + $c);\n\n\t\t\n\n\t\t$str[$i1] = 'b';\n\t\t$str[$i2] = 'b';\n\n\t\tprint $str.\"\\n\";\n\t}\n?>", "positive_code": [{"source_code": " $c)\n {\n $d -= $y;\n $y++;\n $e[$b - 1] = \"a\";\n $e[$b - 2] = \"a\";\n $e[$b - $y] = \"b\";\n $f = $c - $d;\n $e[$b - $f] = \"b\";\n break;\n }\n }\n print $e . \"\\n\";\n}\n?>"}], "negative_code": [], "src_uid": "e32f0615541d97a025bc99c3cbf5380e"} {"source_code": "= $max - $k) {\n echo $min + $k . \"\\n\";\n } else {\n echo \"-1\" . \"\\n\";\n }\n }\n?>", "positive_code": [{"source_code": " $c)\n {\n print \"-1\\n\";\n }\n else\n {\n print $e . \"\\n\";\n }\n }\n elseif(($c >= min($d)) && ($c <= max($d)))\n {\n $e = min($d) + $c;\n $f = max($d) - $c;\n if((abs($e - min($d)) <= $c) && (abs($e - max($d)) <= $c) && (abs($f - min($d)) <= $c) && (abs($f - max($d)) <= $c))\n {\n print $e . \"\\n\";\n }\n else\n {\n print \"-1\\n\";\n }\n }\n elseif($c > max($d))\n {\n print (min($d) + $c) . \"\\n\";\n }\n}\n?>"}, {"source_code": "= ($iMax - $k)){\n $otvet = $iMin + $k;\n \n }\n \n echo $otvet.\"\\n\";\n }\n\n\n?>"}, {"source_code": "= $max-$arr[$i][1]) {\n $resp[$i] = $min+$arr[$i][1];\n } else {\n $resp[$i] = -1;\n }\n}\nfor ($i = 0; $i < $q; $i++) {\n echo $resp[$i].\"\\n\";\n}\n\n\n\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 '
' . round(microtime(true) - $t1, 3) . ' sec';\n}\n\n"}, {"source_code": "= $max - $a[1]){\n $res[] = $min + $a[1];\n } else {\n $res[] = -1;\n }\n }\n foreach($res as $v){\n echo $v.\"\\n\";\n }\n \n\n ?>"}, {"source_code": " $k ){\n $otvet = $iMin + $k;\n }\n \n echo $otvet.\"\\n\";\n }\n\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "3b158306d335459ff55dcf29e46010e8"} {"source_code": " 0))\n{\n print \"No solution\";\n}\nelse\n{\n if($d >= 0)\n {\n $h = 0;\n $i = 1000;\n }\n else\n {\n $h = -1000;\n $i = 0;\n }\n for($x = $h; $x <= $i; $x++)\n {\n $e = 1;\n for($y = 1; $y <= $c; $y++)\n {\n $e *= $x;\n }\n if($d == $e)\n {\n $f = $x;\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print $f;\n }\n else\n {\n print \"No solution\";\n }\n}\n?>", "positive_code": [{"source_code": " 0 ) {\n return array_shift($buffer);\n }\n $line = preg_replace('/[\\\\r\\\\n]+$/', '', getLine());\n $buffer = preg_split('/\\\\s+/', $line);\n return getNext();\n}\n\nfunction getLine() {\n global $input;\n return fgets($input, 4096);\n}\n\nfunction init() {\n global $input;\n $input = fopen(\"php://stdin\", \"r\");\n}\n\nfunction main() {\n\n $a = intval(getNext());\n $b = intval(getNext());\n\n $n = intval(getNext());\n\n $max = abs($b);\n\n for( $i = -$max; $i <= $max; ++$i ) {\n $cur = $a;\n for( $j = 0; $j < $n; ++ $j ) {\n $cur *= $i;\n if( abs($cur) > $max ) { break; }\n }\n if( $cur == $b ) {\n print $i . \"\\n\";\n return;\n }\n }\n\n print \"No solution\\n\";\n\n}\n\nmain();\n\n?>\n"}], "negative_code": [{"source_code": "= 0)\n{\n $h = 0;\n $i = 100;\n}\nelse\n{\n $h = -100;\n $i = 0;\n}\nfor($x = $h; $x <= $i; $x++)\n{\n $e = 1;\n for($y = 1; $y <= $c; $y++)\n {\n $e *= $x;\n }\n if($d == $e)\n {\n $f = $x;\n $g = 1;\n break;\n }\n}\nif($g == 1)\n{\n print $f;\n}\nelse\n{\n print \"No solution\";\n}\n?>"}, {"source_code": " 0))\n{\n print \"No solution\";\n}\nelse\n{\n if($d >= 0)\n {\n $h = 0;\n $i = 100;\n }\n else\n {\n $h = -100;\n $i = 0;\n }\n for($x = $h; $x <= $i; $x++)\n {\n $e = 1;\n for($y = 1; $y <= $c; $y++)\n {\n $e *= $x;\n }\n if($d == $e)\n {\n $f = $x;\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print $f;\n }\n else\n {\n print \"No solution\";\n }\n}\n?>"}, {"source_code": "= 0)\n {\n $h = 0;\n $i = 100;\n }\n else\n {\n $h = -100;\n $i = 0;\n }\n for($x = $h; $x <= $i; $x++)\n {\n $e = 1;\n for($y = 1; $y <= $c; $y++)\n {\n $e *= $x;\n }\n if($d == $e)\n {\n $f = $x;\n $g = 1;\n break;\n }\n }\n if($g == 1)\n {\n print $f;\n }\n else\n {\n print \"No solution\";\n }\n}\n?>"}], "src_uid": "8a9adc116abbd387a6a64dd754436f8a"} {"source_code": " strlen($str2)) {\r\n $tmp = $str2;\r\n $str2 = $str1;\r\n $str1 = $tmp;\r\n }\r\n\r\n $str1_len = strlen($str1);\r\n $str2_len = strlen($str2);\r\n\r\n for ($part_len = $str1_len; $part_len > 0; $part_len--) {\r\n for ($i = 0; $i <= $str1_len - $part_len; $i++) {\r\n $part = substr($str1, $i, $part_len);\r\n if (false !== strpos($str2, $part)) {\r\n return $str1_len + $str2_len - 2 * $part_len;\r\n }\r\n }\r\n }\r\n\r\n return $str1_len + $str2_len;\r\n}\r\n\r\n$t = readline();\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n $str1 = readline();\r\n $str2 = readline();\r\n echo equalizeStrings($str1, $str2) . PHP_EOL;\r\n}", "positive_code": [{"source_code": "= strlen($string2)){\r\n $shortStr = $string2;\r\n $shortStrLen = strlen($string2);\r\n $longStr = $string1;\r\n $longStrLen = strlen($string1);\r\n}\r\nelse{\r\n $shortStr = $string1;\r\n $shortStrLen = strlen($string1);\r\n $longStr = $string2;\r\n $longStrLen = strlen($string2);\r\n}\r\n//----------------------------------------\r\n//echo $longStr.\"
\".$shortStr.\"

\";\r\n//---------------------------------------\r\n\r\n$maxSubLen = 0;\r\nfor($i = 0; $i < $shortStrLen; $i++){\r\n $subStr = substr($shortStr, $i, 1);\r\n if(strpos($longStr, $subStr) !== false){\r\n $len = 2;\r\n while(strpos($longStr, $subStr) !== false){\r\n //\r\n if($len > $shortStrLen + 1 || ($i-1 + $len) > $shortStrLen)\r\n break;\r\n $subStr = substr($shortStr, $i, $len);\r\n $len++;\r\n }\r\n if($len - 2 > $maxSubLen){\r\n $maxSubLen = $len -2;\r\n }\r\n }\r\n else{\r\n continue;\r\n }\r\n}\r\n\r\n$res = ($shortStrLen - $maxSubLen) + ($longStrLen - $maxSubLen);\r\necho $res.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}\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 $b = str_split(IO::str());\r\n $res = [];\r\n for ($i = 0; $i < count($a); $i++) {\r\n for($j = 0; $j < count($b); $j++) {\r\n $k = $j;\r\n $len = 0;\r\n if($a[$i] == $b[$j]) {\r\n for($x = $i; $x < count($a); $x++) {\r\n if(!isset($b[$k])) {\r\n break;\r\n }\r\n if ($a[$x] == $b[$k]) {\r\n $len++;\r\n $k++;\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n $res[$len] = $len;\r\n }\r\n }\r\n $len = max($res);\r\n $result = (count($a) - $len) + (count($b) - $len);\r\n IO::line($result);\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 $a = str_split(IO::str());\r\n $b = str_split(IO::str());\r\n $res = [];\r\n for ($i = 0; $i < count($a); $i++) {\r\n $len = 0;\r\n $k = $i;\r\n $rj = 0;\r\n for($j = 0; $j < count($b); $j++) {\r\n if($a[$k] == $b[$j]) {\r\n if($len == 0) {\r\n $rj = $j;\r\n }\r\n $len++;\r\n $k++;\r\n } else {\r\n $res[$len] = $len;\r\n $len = 0;\r\n $k = $i;\r\n if ($len > 0) {\r\n $j = $rj;\r\n }\r\n }\r\n }\r\n $res[$len] = $len;\r\n }\r\n $len = max($res);\r\n $result = (count($a) - $len) + (count($b) - $len);\r\n IO::line($result);\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 $a = str_split(IO::str());\r\n $b = str_split(IO::str());\r\n $res = [];\r\n for ($i = 0; $i < count($a); $i++) {\r\n $len = 0;\r\n $k = $i;\r\n $rj = 0;\r\n for($j = 0; $j < count($b); $j++) {\r\n if($a[$k] == $b[$j]) {\r\n $len++;\r\n $k++;\r\n } else {\r\n $res[$len] = $len;\r\n $len = 0;\r\n $k = $i;\r\n }\r\n }\r\n $res[$len] = $len;\r\n }\r\n $len = max($res);\r\n $result = (count($a) - $len) + (count($b) - $len);\r\n IO::line($result);\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 $a = str_split(IO::str());\r\n $b = str_split(IO::str());\r\n $res = [];\r\n for ($i = 0; $i < count($a); $i++) {\r\n $len = 0;\r\n $k = $i;\r\n for($j = 0; $j < count($b); $j++) {\r\n if($a[$k] == $b[$j]) {\r\n $len++;\r\n $k++;\r\n } elseif ($len > 0) {\r\n $res[$len] = $len;\r\n $len = 0;\r\n $k = $i;\r\n }\r\n }\r\n $res[$len] = $len;\r\n }\r\n $len = max($res);\r\n $result = (count($a) - $len) + (count($b) - $len);\r\n IO::line($result);\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//$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 $b = str_split(IO::str());\r\n $res = [];\r\n for ($i = 0; $i < count($a); $i++) {\r\n $len = 0;\r\n $k = $i;\r\n for($j = 0; $j < count($b); $j++) {\r\n if($a[$k] == $b[$j]) {\r\n $len++;\r\n $k++;\r\n } elseif ($len > 0) {\r\n break;\r\n }\r\n }\r\n $res[] = $len;\r\n }\r\n $len = max($res);\r\n $result = (count($a) - $len) + (count($b) - $len);\r\n IO::line($result);\r\n\r\n}\r\n\r\n?>"}], "src_uid": "36aec7a06c02052f562ea3d44d4a62e4"} {"source_code": "0;$j--)\n\t\t$chk2[$j]=$chk2[$j-1];\n\t$chk2[0]=0;\n}\nfor($i=$l;$i<=$r;$i++){\n\tfor($j=0;$j<=2000;$j++)\t{\n\t\tif($chk1[$j]&&$chk2[$j]){\n\t\t\t$s++;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor($j=2000;$j>0;$j--)\n\t\t$chk2[$j]=$chk2[$j-1];\n\t$chk2[0]=0;\n}\necho $s;\n?>", "positive_code": [{"source_code": "= ($i[$z] + $x)) && ($e[$y] <= ($j[$z] + $x))) || (($f[$y] >= ($i[$z] + $x)) && ($f[$y] <= ($j[$z] + $x))) || (($e[$y] <= ($i[$z] + $x)) && ($f[$y] >= ($j[$z] + $x))))\n {\n $k++;\n $l = 1;\n break;\n }\n elseif($f[$y] < ($i[$z] + $x))\n {\n break;\n }\n }\n if($l == 1)\n {\n break;\n }\n }\n}\nprint $k;\n?>"}], "negative_code": [{"source_code": "0;$j--)\n\t\t$chk2[$j]=$chk2[$j-1];\n\t$chk2[0]=0;\n}\nfor($i=$l;$i<=$r;$i++){\n\tfor($j=0;$j<=2000;$j++)\t{\n\t\tif($chk1[$j]&&$chk2[$j]){\n\t\t\t$s++;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor($j=2000;$j>0;$j--)\n\t\t$chk2[$j]=$chk2[$j-1];\n\t$chk2[0]=0;\n}\necho $s;\n?>"}, {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "c466c909fff92353ea676b643ca76908"} {"source_code": "= 0; $i--) {\n if ($i < $cmp) $ans++;\n $cmp = min($cmp, $i - intval($l[$i]));\n }\n fprintf(STDOUT, \"\" . $ans);\n?>", "positive_code": [{"source_code": "= 0; $x--)\n{\n $c++;\n if($x >= $d)\n {\n $e--;\n $f = ($a - $c) - $b[$a - $c];\n $d = min($d, $f);\n }\n elseif($x < $d)\n {\n $d = ($a - $c) - $b[$a - $c];\n }\n}\nprint $e + 1;\n?>"}], "negative_code": [], "src_uid": "beaeeb8757232b141d510547d73ade04"} {"source_code": " 0) {\n $accumCharge++;\n $batteryCharge--;\n } else {\n $accumCharge--;\n }\n } elseif($accumCharge > 0) {\n $accumCharge--;\n } else {\n $batteryCharge--;\n }\n $resultSteps++;\n}\necho $resultSteps;\n", "positive_code": [{"source_code": " 0)\n {\n $e--;\n }\n }\n elseif($f > 0)\n {\n $f--;\n }\n }\n elseif($d[$x] == 1)\n {\n if($f == $c)\n {\n $f--;\n }\n elseif($e == 0)\n {\n if($f == 0)\n {\n break;\n }\n elseif($f > 0)\n {\n $f--;\n }\n }\n elseif($e > 0)\n {\n $e--;\n $f++;\n if($f > $c)\n {\n $f = $c;\n }\n }\n }\n}\nprint $x;\n?>"}], "negative_code": [{"source_code": " 0)\n {\n $e--;\n }\n }\n elseif($f > 0)\n {\n $f--;\n }\n }\n elseif($d[$x] == 1)\n {\n if($e == 0)\n {\n if($f == 0)\n {\n break;\n }\n elseif($f > 0)\n {\n $f--;\n }\n }\n elseif($e > 0)\n {\n $e--;\n $f++;\n if($f > $c)\n {\n $f = $c;\n }\n }\n }\n}\nprint $x;\n?>"}, {"source_code": " 0)\n {\n $e--;\n }\n }\n elseif($f > 0)\n {\n $f--;\n }\n }\n elseif($d[$x] == 1)\n {\n if($e == 0)\n {\n if($f == 0)\n {\n break;\n }\n elseif($f > 0)\n {\n $f--;\n }\n }\n elseif($e > 0)\n {\n $e--;\n $f++;\n }\n }\n}\nprint $x;\n?>"}, {"source_code": " 0) {\n $accumCharge++;\n $batteryCharge--;\n } else {\n $accumCharge--;\n }\n } elseif($accumCharge > 0) {\n $accumCharge--;\n } else {\n $batteryCharge--;\n }\n $resultSteps++;\n}\n"}, {"source_code": " 0) {\n $accumCharge++;\n $batteryCharge--;\n } else {\n $accumCharge--;\n }\n } elseif($accumCharge > 0) {\n $accumCharge--;\n } else {\n $batteryCharge--;\n }\n $resultSteps++;\n if ($accumCharge === 0 && $batteryCharge === 0) {\n echo $resultSteps;\n break;\n }\n}\n"}], "src_uid": "75ef1f52ef3a86992159eef566dddc89"} {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$arr = array();\nwhile ($line = trim(fgets(STDIN)))\n $arr[] = $line;\n$steps = $arr[1];\n//$steps = '.RRRLLLLL..';\n$left = strpos($steps, 'L');\n$right = strpos($steps, 'R');\n\nif($left && $right){\n $right++;\n}\n\nif($left == false){\n $left = strlen($steps) - strpos(strrev($steps), 'R') + 1;\n}\nif($right == false){\n $right = strlen($steps) - strpos(strrev($steps), 'L');\n}\necho $right, ' ', $left;\n"}, {"source_code": "\n"}], "src_uid": "3053cba2426ebd113fcd70a9b026dad0"} {"source_code": " 500 || $a + $ai - $b < -500){\n $result .= 'G';\n $b = $b + $bi;\n }else{\n $result .= 'A';\n $a = $a + $ai;\n }\n}\nif(abs($a - $b) > 500){\n echo -1;\n}else{\n print($result);\n}"}], "negative_code": [], "src_uid": "24fe280b88575516ec679ff78641440e"} {"source_code": "", "positive_code": [{"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($m); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n sort($f); \n print $f[0]; \n } \n else\n {\n print $f[$k[0]]; \n } \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}], "negative_code": [{"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}, {"source_code": " 1)\n{\n $n = array();\n for($x = 0; $x < count($m); $x++)\n {\n if($f[$x] == TRUE)\n {\n array_push($n, $h[$x]);\n }\n }\n rsort($n);\n for($x = 0; $x < count($m); $x++)\n {\n if($h[$x] == $n[0])\n {\n array_push($k, $x);\n }\n }\n if(count($k) != 1)\n {\n for($x = 1; $x < count($m); $x++)\n {\n $l = 0;\n for($y = 0; $y < count($f); $y++)\n {\n $l = max($l, $i[$f[$y]][$x]);\n }\n for($y = 0; $y < count($m); $y++)\n {\n if($i[$f[$y]][$x] != $l)\n {\n unset($f[$y]);\n }\n }\n if(count($f) == 1)\n { \n break;\n }\n }\n } \n print $f[$k[0]]; \n}\nelse\n{\n sort($f);\n print $f[0];\n}\n?>"}], "src_uid": "bd40f54a1e764ba226d5387fcd6b353f"} {"source_code": "= $a[$i + 1]) {\n die('NO');\n }\n}\nfor ($i = $n - 1; $i > $maxI; $i--) {\n if ($a[$i] >= $a[$i - 1]) {\n die('NO');\n }\n}\necho 'YES';\n", "positive_code": [{"source_code": " 1; $x--)\n{\n if($b[$x - 1] > $b[$x])\n {\n $e = 1;\n break;\n }\n}\nfor($x = $d; $x < $a; $x++)\n{\n if($b[$x + 1] > $b[$x])\n {\n $e = 1;\n break;\n }\n}\nif($e == 0)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}, {"source_code": "= 1; $i--){\n if($aArray[$i - 1] >= $aArray[$i]){\n $bFlag = false;\n }\n}\n\nif($bFlag){\n echo \"YES\".\"\\n\";\n} else {\n echo \"NO\" . \"\\n\";\n}"}, {"source_code": "= 1; $i--){\n if($m[$i] <= $m[$i - 1]){\n echo 'NO';\n exit;\n }\n }\n $key = array_search($max, $m);\n for($j = $key; $j < $n-1; $j++){\n if($m[$j] < $m[$j + 1]){\n echo 'NO';\n exit;\n }\n }\n echo 'YES';\n \n ?>"}], "negative_code": [], "src_uid": "12abfbe7118868a0b1237489b5c92760"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " 0; $i--) {\r\n $n = readline();\r\n $a = floor($n / 3); //2\r\n $b = floor($n / 3 + 1); //2 +1\r\n $c = floor($n / 3 - 1); //2 -1\r\n\r\n if ($n % 3 == 1) {\r\n $b++;\r\n } elseif ($n % 3 == 2) {\r\n $b++;\r\n $a++;\r\n }\r\n echo $a . \" \" . $b . \" \" . $c.\"\\n\";\r\n\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\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 "}], "negative_code": [{"source_code": " 0; $i--) {\r\n $n = readline();\r\n $a = floor($n / 3); //2\r\n $b = floor($n / 3 + 1); //2 +1\r\n $c = floor($n / 3 - 1); //2 -1\r\n\r\n if ($n % 3 == 1) {\r\n $b++;\r\n } elseif ($n % 3 == 2) {\r\n $b++;\r\n $a++;\r\n }\r\n echo $a . \" \" . $b . \" \" . $c;\r\n}\r\n\r\n?>"}, {"source_code": " $n = readline();\r\n $a = floor($n / 3); //2\r\n $b = floor($n / 3 + 1); //2 +1\r\n $c = floor($n / 3 - 1); //2 -1\r\n\r\n if ($n % 3 == 1) {\r\n $b++;\r\n } elseif (n % 3 == 2) {\r\n $b++;\r\n $a++;\r\n }\r\n echo $a . \" \" . $b . \" \" . $c;\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\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 $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 "}], "src_uid": "45cf60f551bd5cbb1f3df6ac3004b53c"} {"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 = str_split(IO::str());\r\n $d = array_reverse($a);\r\n $t = $m = 0;\r\n $bool = true;\r\n foreach ($a as $v) {\r\n if ($v == 'T') {\r\n $t++;\r\n } else {\r\n $m++;\r\n }\r\n if ($m > $t) {\r\n $bool = false;\r\n break;\r\n }\r\n }\r\n if ($bool) {\r\n $t = $m = 0;\r\n foreach ($d as $v) {\r\n if ($v == 'T') {\r\n $t++;\r\n } else {\r\n $m++;\r\n }\r\n if ($m > $t) {\r\n $bool = false;\r\n break;\r\n }\r\n }\r\n }\r\n \r\n if ($m * 2 == $t && $bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n\r\n}\r\n\r\n?>", "positive_code": [{"source_code": "= 0; --$j) {\n if ($s[$j] === 'T') {\n $right++;\n } else {\n $right--;\n }\n\n if ($right < 0) {\n $can = false;\n }\n }\n\n if($m !== $len / 3){\n $can = false;\n }\n\n if ($can) {\n echo 'YES' . PHP_EOL;\n } else {\n echo 'NO' . PHP_EOL;\n }\n}\n\n"}, {"source_code": ""}], "negative_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\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 = str_split(IO::str());\r\n $t = $m = 0;\r\n $bool = true;\r\n foreach ($a as $v) {\r\n if ($v == 'T') {\r\n $t++;\r\n } else {\r\n $m++;\r\n }\r\n if ($m > $t) {\r\n $bool = false;\r\n break;\r\n }\r\n }\r\n if ($m * 2 == $t && $bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n\r\n}\r\n\r\n?>"}], "src_uid": "94df40fbf9d7e8f91d5e7fde783bb389"} {"source_code": "$st2){$st1=intval($a[2][1]);$st2=intval($a[2][0]);}\n$way=0;\n$allway=0;\nfor($i=0;$i<$n;$i++){$allway += $sts[$i];}\nfor ($i=$st1-1;$i<($st2-1);$i++){\n $way+=$sts[$i];\n}\n$backway=$allway-$way;\nif($backway>$way){$ans=$way;}else{$ans=$backway;}\n\nfputs($tr,$ans);\n", "positive_code": [{"source_code": ""}, {"source_code": "$sum2){\n$otvet=$sum2;\n}elseif($sum1==$sum2){\n$otvet=$sum1;\n}\n}\n//$otvet=$sum1.\" \".$sum2;\n//\u0412\u044b\u0432\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430\n$out = fopen('php://output', 'w');\nfputs($out,$otvet);"}, {"source_code": " $t) {\n\t\tlist($s, $t) = [$t,$s];\n\t}\n\n\t$s--; $t--;\n\n\t$directPath = 0;\n\tfor ($i = $s; $i < $t; $i++) {\n\t\t$directPath += $distances[$i];\n\t}\n\n\t$reversePath = 0;\n\tfor ($i = $t; $i != $s; $i = ($i + 1) % $stationCnt) {\n\t\t$reversePath += $distances[$i];\n\t}\n\n\techo $directPath > $reversePath ? $reversePath : $directPath;\n}"}, {"source_code": " $t){ $tmp = $s; $s = $t; $t = $tmp;} \n /*----------------------------*/\n for ($i=0, $end = abs($t-$s); $i<$end; $i++){\n $res1 += $d[$s+$i];\n }\n /*----------------------------*/\n for ($i = $t; $i < $n; $i++ ){\n\t\t$res2 += $d[$i];\n\t}\n\tfor ($i = 0; $i <=$s-1; $i++ ){\n\t\t$res2 += $d[$i];\n\t}\n\t/*----------------------------*/\n if ($res1 < $res2){\n fwrite(STDOUT,\"$res1\");\n }else{\n fwrite(STDOUT,\"$res2\");\n }\n?>"}, {"source_code": " $end){\n $tmp = $st;\n $st = $end;\n $end = $tmp;\n}\n\n$sum1 = 0;\n\nfor($i = $st-1;$i < $end-1;$i ++){\n $sum1 += $a[$i];\n}\n\nif($sum1 < $sum - $sum1){\n printf(\"%d\", $sum1 );\n}else {\n printf(\"%d\", $sum - $sum1);\n}\n\n\n?>"}, {"source_code": " $t) {\n $tmp = $s;\n $s = $t;\n $t = $tmp;\n}\n\nfunction sumArray($from, $to, $arr)\n{\n $sum = 0;\n for ($i=$from-1; $i < $to-1 ; $i++) { \n $sum += (int) $arr[$i];\n }\n\n return $sum;\n}\n\n$left = sumArray(1, $s, $arrD) + sumArray($t, $n+1, $arrD);\n$rigth = sumArray($s, $t, $arrD);\n\n\n\necho min($left, $rigth);\n\n?>"}, {"source_code": "\n\n $t) swap($s, $t);\n\n$dist1 = 0;\n$dist2 = 0;\n\n$start = $t;\n$end = $s;\n\nwhile ($start != $end) {\n\t$dist1 += $d[$start];\n\t$start = ($start + 1) % $n;\n}\n\n$start = $s;\n$end = $t;\n\nwhile ($start != $end) {\n\t$dist2 += $d[$start];\n\t$start = ($start + 1) % $n;\n}\n\nprintf(\"%d\", min($dist1, $dist2));\n\nfunction swap(&$a, &$b) {\n\t$t = $a;\n\t$a = $b;\n\t$b = $t;\n}\n\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " $t){ $tmp = $s; $s = $t; $t = $tmp;} \n\n for ($i=0, $end = abs($t-$s); $i<$end; $i++){\n $res1 += $d[$s+$i];\n }\n for ($i=0, $end = $n-$s-2; $i<$end; $i++){\n $now = $t+$i;\n if ($now > $n) $now = $i;\n $res2 += $d[$now];\n }\n if ($res1 < $res2){\n fwrite(STDOUT,\"$res1\");\n }else{\n fwrite(STDOUT,\"$res2\");\n }\n?>"}, {"source_code": " $t){ $tmp = $s; $s = $t; $t = $tmp;} \n\n for ($i=0, $end = abs($t-$s); $i<$end; $i++){\n $res1 += $d[$s+$i];\n }\n for ($i=0, $end = $n-$t+$z; $i<$end; $i++){\n $now = $t+$i;\n if ($now > $n) $now = $i;\n $res2 += $d[$now];\n }\n if ($res1 < $res2){\n fwrite(STDOUT,\"$res1\");\n }else{\n fwrite(STDOUT,\"$res2\");\n }\n?>"}, {"source_code": " $t){ $tmp = $s; $s = $t; $t = $tmp;} \n /*----------------------------*/\n for ($i=0, $end = abs($t-$s); $i<$end; $i++){\n $res1 += $d[$s+$i];\n }\n /*----------------------------*/\n for ($i = $t; $i < $n; $i++ ){\n\t\t$res2 += $d[$i];\n\t}\n\tfor ($i = 0; $i < $s-1; $i++ ){\n\t\t$res2 += $d[$i];\n\t}\n\t/*----------------------------*/\n if ($res1 < $res2){\n fwrite(STDOUT,\"$res1\");\n }else{\n fwrite(STDOUT,\"$res2\");\n }\n?>"}, {"source_code": "\n\n $end){\n $tmp = $st;\n $st = $end;\n $end = $tmp;\n}\n\n$sum1 = 0;\n\nfor($i = $st-1;$i < $end-1;$i ++){\n $sum1 += $a[$i];\n}\n\nif($sum1 < $sum - $sum1){\n printf(\"%d\", $sum1 );\n}else {\n printf(\"%d\", $sum - $sum1);\n}\n\n\n?>"}], "src_uid": "22ef37041ebbd8266f62ab932f188b31"} {"source_code": "\" && $ans == \"Y\"))\n\t{\n\t\t// fix for super imposed rules\n\t\t$min = max($min, $val + 1);\n\t\tcontinue;\n\t}\n\t\n\t// split these out since a negative does not prohibit use of val\n\tif($sym == \"<\" && $ans == \"N\")\n\t{\n\t\t$min = max($min, $val);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<\" && $ans == \"Y\") )\n\t{\n\t\t$max = min($max, $val - 1);\n\t\tcontinue;\n\t}\n\t\n\t// non prohibit fix\n\tif($sym == \">\" && $ans == \"N\")\n\t{\n\t\t$max = min($max, $val);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<=\" && $ans == \"Y\") || ($sym == \">=\" && $ans == \"N\") )\n\t{\n\t\t$max = min($val, $max);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \">=\" && $ans == \"Y\") || ($sym == \"<=\" && $ans == \"N\") )\n\t{\n\t\t$min = max($min, $val);\n\t}\n\nendfor;\n\nif( $max < $min )\n{\n\techo \"Impossible\";\n} else {\n\techo rand($min, $max);\n}\n\necho PHP_EOL;", "positive_code": [{"source_code": "\":\n $e = max($e, $c + 1);\n break;\n case \"<\":\n $f = min($f, $c - 1);\n break;\n case \">=\":\n $e = max($e, $c);\n break;\n case \"<=\":\n $f = min($f, $c);\n break;\n }\n }\n else\n {\n switch($b)\n {\n case \">\": \n $f = min($f, $c);\n break;\n case \"<\":\n $e = max($e, $c);\n break;\n case \">=\":\n $f = min($f, $c - 1);\n break;\n case \"<=\":\n $e = max($e, $c + 1);\n break;\n }\n }\n}\nif($e > $f)\n{\n print \"Impossible\";\n}\nelse\n{\n print rand($e, $f);\n}\n?>"}, {"source_code": "=':\n $cmp='<';\n break;\n case '>':\n $cmp='<=';\n break;\n case '<=':\n $cmp='>';\n break;\n case '<':\n $cmp='>=';\n break;\n }\n }\n switch ($cmp){\n case '>=':\n $min=max($min,$x);\n break;\n case '>':\n $min=max($min,$x+1);\n break;\n case '<=':\n $max=min($max,$x);\n break;\n case '<':\n $max=min($max,$x-1);\n break;\n }\n}\nif ($max<$min || $max>2000000000 || $min<-2000000000)\n echo \"Impossible\";\nelse\n fprintf(STDOUT, \"%0.0f\",$max);"}, {"source_code": "\")\n $val = \"<=\";\n else if($str == \"<\")\n $val = \">=\";\n else if($str == \">=\")\n $val = \"<\";\n else\n $val = \">\";\n return $val; \n}\n\n$min_ = -2000000000;\n$max_ = 2000000000;\n$n = trim(fgets(STDIN));\nfor($i = 0; $i < $n; ++$i)\n{ \n $arr = explode(\" \", trim(fgets(STDIN)));\n $sign = $arr[0];\n $num = $arr[1];\n $yn = $arr[2];\n if($yn == \"N\") \n $sign = inverse($sign); \n if($sign == \"<=\") \n $max_ = min($max_, $num); \n else if($sign == \"<\")\n $max_ = min($max_, $num - 1); \n else if($sign == \">=\")\n $min_ = max($min_, $num); \n else\n $min_ = max($min_, $num + 1); \n}\nif($min_ <= $max_)\n printf(\"%d\", $min_);\nelse\n print(\"Impossible\");\n \n?>"}], "negative_code": [{"source_code": "\":\n $e = max($e, $c + 1);\n break;\n case \"<\":\n $f = min($f, $c - 1);\n break;\n case \">=\":\n $e = max($e, $c);\n break;\n case \"<=\":\n $f = min($f, $c);\n break;\n }\n }\n else\n {\n switch($b)\n {\n case \">\": \n $f = min($f, $c);\n break;\n case \"<\":\n $e = max($e, $c);\n break;\n case \">=\":\n $f = min($f, $c - 1);\n break;\n case \"<=\":\n $e = max($e, $c + 1);\n break;\n }\n }\n}\nif($e > $f)\n{\n print \"Impossible\";\n}\nelse\n{\n print rand($e, $f);\n}\n?>"}, {"source_code": "\":\n $e = max($e, $c + 1);\n break;\n case \"<\":\n $f = min($f, $c - 1);\n break;\n case \">=\":\n $e = max($e, $c);\n break;\n case \"<=\":\n $f = min($f, $c);\n break;\n }\n }\n else\n {\n switch($b)\n {\n case \">\": \n $f = min($f, $c - 1);\n break;\n case \"<\":\n $e = max($e, $c + 1);\n break;\n case \">=\":\n $f = min($f, $c);\n break;\n case \"<=\":\n $e = max($e, $c);\n break;\n }\n }\n}\nif($e > $f)\n{\n print \"Impossible\";\n}\nelse\n{\n print rand($e, $f);\n}\n?>"}, {"source_code": "\":\n $e = max($e, $c + 1);\n break;\n case \"<\":\n $f = min($f, $c - 1);\n break;\n case \">=\":\n $e = max($e, $c);\n break;\n case \"<=\":\n $f = min($f, $c);\n break;\n }\n }\n else\n {\n switch($b)\n {\n case \">\": \n $f = min($f, $c);\n break;\n case \"<\":\n $e = max($e, $c);\n break;\n case \">=\":\n $f = min($f, $c - 1);\n break;\n case \"<=\":\n $e = max($e, $c + 1);\n break;\n }\n }\n}\nif($e > $f)\n{\n print \"Impossible\";\n}\nelse\n{\n print rand($e, $f);\n}\n?>"}, {"source_code": "\" && $ans == \"Y\"))\n\t{\n\t\t// fix for super imposed rules\n\t\t$min = max($min, $val + 1);\n\t\tcontinue;\n\t}\n\t\n\t// split these out since a negative does not prohibit use of val\n\tif($sym == \"<\" && $ans == \"N\")\n\t{\n\t\t$min = max($min, $val);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<\" && $ans == \"Y\") )\n\t{\n\t\t$max = min($max, $val - 1);\n\t\tcontinue;\n\t}\n\t\n\t// non prohibit fix\n\tif($sym == \">\" && $ans == \"N\")\n\t{\n\t\t$max = min($max, $val);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<=\" && $ans == \"Y\") || ($sym == \">=\" && $ans == \"N\") )\n\t{\n\t\t$max = min($val, $max);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \">=\" && $ans == \"Y\") || ($sym == \"<=\" && $ans == \"N\") )\n\t{\n\t\t$min = max($min, $val);\n\t}\n\nendfor;\n\nif( $max < $min )\n{\n\techo \"Impossible\";\n} else {\n\techo rand($min, $max);\n}\n\necho PHP_EOL;"}, {"source_code": "\" && $ans == \"Y\"))\n\t{\n\t\t$min = $val + 1;\n\t\tcontinue;\n\t}\n\t\n\t// split these out since a negative does not prohibit use of val\n\tif($sym == \"<\" && $ans == \"N\")\n\t{\n\t\t$min = $val;\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<\" && $ans == \"Y\") )\n\t{\n\t\t$max = $val - 1;\n\t\tcontinue;\n\t}\n\t\n\t// non prohibit fix\n\tif($sym == \">\" && $ans == \"N\")\n\t{\n\t\t$max = $val;\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<=\" && $ans == \"Y\") || ($sym == \">=\" && $ans == \"N\") )\n\t{\n\t\t$max = $val;\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \">=\" && $ans == \"Y\") || ($sym == \"<=\" && $ans == \"N\") )\n\t{\n\t\t$min = $val;\n\t}\n\nendfor;\n\nif( $max < $min )\n{\n\techo \"Impossible\";\n} else {\n\techo rand($min, $max);\n}\n\necho PHP_EOL;"}, {"source_code": "\" && $ans == \"Y\"))\n\t{\n\t\t// fix for super imposed rules\n\t\t$min = max($min, $val + 1);\n\t\tcontinue;\n\t}\n\t\n\t// split these out since a negative does not prohibit use of val\n\tif($sym == \"<\" && $ans == \"N\")\n\t{\n\t\t$min = max($min, $val);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<\" && $ans == \"Y\") )\n\t{\n\t\t$max = min($max, $val - 1);\n\t\tcontinue;\n\t}\n\t\n\t// non prohibit fix\n\tif($sym == \">\" && $ans == \"N\")\n\t{\n\t\t$max = min($max, $val);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \"<=\" && $ans == \"Y\") || ($sym == \">=\" && $ans == \"N\") )\n\t{\n\t\t$max = min($val, $max);\n\t\tcontinue;\n\t}\n\t\n\tif( ($sym == \">=\" && $ans == \"Y\") || ($sym == \"<=\" && $ans == \"N\") )\n\t{\n\t\t$min = max($min, $val);\n\t}\n\nendfor;\n\nif( $max < $min )\n{\n\techo \"Impossible\";\n} else {\n\techo rand($min, $max);\n}\n\necho PHP_EOL;"}, {"source_code": "\" && $ans == \"Y\") || ($sym == \"<\" && $ans == \"N\") )\n\t{\n\t\t$min = $val + 1;\n\t\tcontinue;\n\t}\n \n\tif( ($sym == \"<\" && $ans == \"Y\") || ($sym == \">\" && $ans == \"N\") )\n\t{\n\t\t$max = $val - 1;\n\t\tcontinue;\n\t}\n \n\tif( ($sym == \"<=\" && $ans == \"Y\") || ($sym == \">=\" && $ans == \"N\") )\n\t{\n\t\t$max = $val;\n\t\tcontinue;\n\t}\n \n\tif( ($sym == \">=\" && $ans == \"Y\") || ($sym == \"<=\" && $ans == \"N\") )\n\t{\n\t\t$min = $val;\n\t}\n \nendfor;\n \nif( $max < $min )\n{\n\techo \"Impossible\";\n} else {\n\techo rand($min, $max);\n}\n \necho PHP_EOL;"}, {"source_code": "':\n $cmp='<';\n break;\n case '>':\n $cmp='<=';\n break;\n case '<=':\n $cmp='>';\n break;\n case '<':\n $cmp='>=';\n break;\n }\n }\n switch ($cmp){\n case '>=':\n $min=max($min,$x);\n break;\n case '>':\n $min=max($min,$x+1);\n break;\n case '<=':\n $max=min($max,$x);\n break;\n case '<':\n $max=min($max,$x-1);\n break;\n }\n}\nif ($max<$min || $max>2000000000 || $min<-2000000000)\n echo \"Impossible\";\nelse\n fprintf(STDOUT, \"%0.0f\",$max);"}, {"source_code": "':\n $cmp='<';\n break;\n case '>':\n $cmp='<=';\n break;\n case '<=':\n $cmp='>';\n break;\n case '<':\n $cmp='>=';\n break;\n }\n }\n switch ($cmp){\n case '=>':\n $min=max($min,$x);\n break;\n case '>':\n $min=max($min,$x+1);\n break;\n case '<=':\n $max=min($max,$x);\n break;\n case '<':\n $max=min($max,$x-1);\n break;\n }\n}\nif ($max<$min || $max>2000000000 || $min<-2000000000)\n echo \"Impossible\";\nelse\n fprintf(STDOUT, \"%0.0f\",$max);"}, {"source_code": "=':\n $cmp='<';\n break;\n case '>':\n $cmp='<=';\n break;\n case '<=':\n $cmp='>';\n break;\n case '<':\n $cmp='>=';\n break;\n }\n }\n switch ($cmp){\n case '=>':\n $min=max($min,$x);\n break;\n case '>':\n $min=max($min,$x+1);\n break;\n case '<=':\n $max=min($max,$x);\n break;\n case '<':\n $max=min($max,$x-1);\n break;\n }\n}\nif ($max<$min || $max>2000000000 || $min<-2000000000)\n echo \"Impossible\";\nelse\n fprintf(STDOUT, \"%0.0f\",$max);"}], "src_uid": "6c6f29e1f4c951cd0ff15056774f897d"} {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 'a' && $arr[$i] <= 'z'){\n $v[$arr[$i]] = 1;\n } \n \n }\n echo count($v);"}, {"source_code": " 0 ? sizeof($m) : '0';\n\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$input = '{a, b, c}';\n$string = substr($input, 1, strlen($input)-2);\n$array = explode(', ', $string);\nif($array[0]==''){ echo 0; }else{ echo intval(count(array_count_values($array))); }\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$input = '{a, b, a, b}';\n$string = substr($input, 1, strlen($input)-2);\n$array = explode(', ', $string);\nif($array[0]==''){ echo 0; }else{ echo count(array_count_values($array)); }\n"}, {"source_code": "$string = substr($input, 1, strlen($input)-2);\n$array = explode(', ', $string);\nif($array[0]==''){ echo 0; }else{ echo intval(count(array_count_values($array))); }\n"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "1cbbffd1941ed83b5f04e1ee33c77f61"} {"source_code": " 0];\n\t\tfor($i=0; $i<$n; $i++) {\n\t\t\tif($s[$i] == \"L\") $lr--;\n\t\t\telseif($s[$i] == \"R\") $lr++;\n\t\t\telseif($s[$i] == \"D\") $ud--;\n\t\t\telse $ud++;\n\t\t\n\t\t\t$t = $lr . \"+\" . $ud;\n\t\t\tif(array_key_exists($t, $a)) {\n\t\t\t\tif($i + 1 - $a[$t] < $mn) {\n\t\t\t\t\t$mn = $i + 1 - $a[$t];\n\t\t\t\t\t$l = $a[$t] + 1;\n\t\t\t\t\t$r = $i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$a[$t] = $i + 1;\n\t\t}\n\t\tif($l == -1) printf(\"%d\\n\", -1);\n\t\telse printf(\"%d %d\\n\", $l, $r);\n\t}\n}\n\n\nnamespace io {\n\tfunction next_line() {\n\t\tstatic $cnt = 0;\n\t\tglobal $input_buf;\n\t\t// while($input_buf[$cnt] == \"\") $cnt++;\n\t\treturn $input_buf[$cnt++];\n\t\t// return trim($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", "positive_code": [{"source_code": " 1);\n $e = 0;\n $f = 0;\n $g = $b;\n $j = 0;\n for($y = 0; $y < $b; $y++)\n {\n if($c[$y] == \"L\")\n {\n $e--;\n $h = $e . \"-\" . $f;\n if($d[$h] == TRUE)\n {\n $j = 1;\n if(($y + 2) - $d[$h] < $g)\n {\n $g = ($y + 2) - $d[$h];\n $i = $d[$h] . \" \" . ($y + 1);\n }\n }\n $d[$h] = $y + 2;\n }\n elseif($c[$y] == \"R\")\n {\n $e++;\n $h = $e . \"-\" . $f;\n if($d[$h] == TRUE)\n {\n $j = 1;\n if(($y + 2) - $d[$h] < $g)\n {\n $g = ($y + 2) - $d[$h];\n $i = $d[$h] . \" \" . ($y + 1);\n }\n }\n $d[$h] = $y + 2;\n }\n elseif($c[$y] == \"U\")\n {\n $f++;\n $h = $e . \"-\" . $f;\n if($d[$h] == TRUE)\n {\n $j = 1;\n if(($y + 2) - $d[$h] < $g)\n {\n $g = ($y + 2) - $d[$h];\n $i = $d[$h] . \" \" . ($y + 1);\n }\n }\n $d[$h] = $y + 2;\n }\n elseif($c[$y] == \"D\")\n {\n $f--;\n $h = $e . \"-\" . $f;\n if($d[$h] == TRUE)\n {\n $j = 1;\n if(($y + 2) - $d[$h] < $g)\n {\n $g = ($y + 2) - $d[$h];\n $i = $d[$h] . \" \" . ($y + 1);\n }\n }\n $d[$h] = $y + 2;\n }\n }\n if(($g == $b) && ($j == 1))\n {\n print \"1 \" . $b . \"\\n\";\n }\n elseif($g < $b)\n {\n print $i . \"\\n\";\n }\n else\n {\n print \"-1\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": " 0];\n\t\tfor($i=0; $i<$n; $i++) {\n\t\t\tif($s[$i] == \"L\") $sum -= 1;\n\t\t\telseif($s[$i] == \"R\") $sum += 1;\n\t\t\telseif($s[$i] == \"D\") $sum -= 200001;\n\t\t\telse $sum += 200001;\n\t\t\n\t\t\tif(array_key_exists($sum, $a)) {\n\t\t\t\tif($i + 1 - $a[$sum] < $min_len) {\n\t\t\t\t\t$min_len = $i + 1 - $a[$sum];\n\t\t\t\t\t$l = $a[$sum] + 1;\n\t\t\t\t\t$r = $i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$a[$sum] = $i + 1;\n\t\t}\n\t\tif($l == -1) printf(\"%d\\n\", -1);\n\t\telse printf(\"%d %d\\n\", $l, $r);\n\t}\n}\n\n\nnamespace io {\n\tfunction next_line() {\n\t\tstatic $cnt = 0;\n\t\tglobal $input_buf;\n\t\t// while($input_buf[$cnt] == \"\") $cnt++;\n\t\treturn $input_buf[$cnt++];\n\t\t// return trim($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"}], "src_uid": "1fc1d5ee79aaf823b246db5471ba7836"} {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\treadNum($f);\n\t$path = trim(readString($f));\n\t$n = strlen($path);\n\n\t$b = $r = array(0,0);\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($path[$i] == 'r') {\n\t\t\t$r[$i % 2] ++;\n\t\t} else {\n\t\t\t$b[$i % 2] ++;\n\t\t}\n\t}\n\techo min(max($r[0], $b[1]), max($r[1], $b[0]));\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": ""}], "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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$n = readNum($f);\n\t$path = trim(readString($f));\n\n\t$actionCount = 0;\n\tfor ($i = 1; $i < $n; $i++) {\n\t\tif ($path[$i] != $path[$i - 1]) {\n\t\t\tcontinue;\n\t\t}\n\t\t$doublePos = false;\n\t\tfor ($j = $i + 2; $j < $n; $j++) {\n\t\t\tif ($path[$i] != $path[$j] && $path[$j] == $path[$j - 1]) {\n\t\t\t\t$doublePos = $j - 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($doublePos !== false) {\n\t\t\t$t = $path[$i];\n\t\t\t$path[$i] = $path[$doublePos];\n\t\t\t$path[$doublePos] = $t;\n\t\t\t$actionCount++;\n\t\t} else {\n\t\t\t$actionCount++;\n\t\t\tif ($path[$i] == 'r') {\n\t\t\t\t$path[$i] = 'b';\n\t\t\t} else {\n\t\t\t\t$path[$i] = 'r';\n\t\t\t}\n\t\t}\n\t}\n\techo $actionCount;\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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\treadNum($f);\n\t$path = trim(readString($f));\n\t$n = strlen($path);\n\n\t$actionCount = 0;\n\tfor ($i = 1; $i < $n; $i++) {\n\t\tif ($path[$i] != $path[$i - 1]) {\n\t\t\tcontinue;\n\t\t}\n\t\t$doublePos = false;\n\t\tfor ($j = $i + 2; $j < $n; $j++) {\n\t\t\tif ($path[$i] != $path[$j] && $path[$j] == $path[$j - 1]) {\n\t\t\t\t$doublePos = $j - 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($path[$i] != $path[$j] && $j + 1 == $n) {\n\t\t\t\t$doublePos = $j;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($doublePos !== false) {\n\t\t\t$t = $path[$i];\n\t\t\t$path[$i] = $path[$doublePos];\n\t\t\t$path[$doublePos] = $t;\n\t\t\t$actionCount++;\n\t\t} else {\n\t\t\t$actionCount++;\n\t\t\tif ($path[$i] == 'r') {\n\t\t\t\t$path[$i] = 'b';\n\t\t\t} else {\n\t\t\t\t$path[$i] = 'r';\n\t\t\t}\n\t\t}\n\t}\n\t\n\techo $actionCount;\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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\treadNum($f);\n\t$path = trim(readString($f));\n\t$n = strlen($path);\n\n\t$actionCount = 0;\n\tfor ($i = 1; $i < $n; $i++) {\n\t\tif ($path[$i] != $path[$i - 1]) {\n\t\t\tcontinue;\n\t\t}\n\t\t$doublePos = false;\n\t\tfor ($j = $i + 2; $j < $n; $j++) {\n\t\t\tif ($path[$i] != $path[$j] && $path[$j] == $path[$j - 1]) {\n\t\t\t\t$doublePos = $j - 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($i + 2 == $n && $path[$i] != $path[$i + 1]) {\n\t\t\t$doublePos = $i + 1;\n\t\t}\n\t\tif ($doublePos !== false) {\n\t\t\t$t = $path[$i];\n\t\t\t$path[$i] = $path[$doublePos];\n\t\t\t$path[$doublePos] = $t;\n\t\t\t$actionCount++;\n\t\t} else {\n\t\t\t$actionCount++;\n\t\t\tif ($path[$i] == 'r') {\n\t\t\t\t$path[$i] = 'b';\n\t\t\t} else {\n\t\t\t\t$path[$i] = 'r';\n\t\t\t}\n\t\t}\n\t}\n\n\techo $actionCount;\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}], "src_uid": "3adc75a180d89077aa90bbe3d8546e4d"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": " 0; $t--) {\r\n\r\n\t$n = intval(fgets(STDIN));\r\n\t$a = fgets(STDIN);\r\n\r\n\techo $solve($n, $a);\r\n\techo \"\\n\";\r\n\r\n}\r\n"}, {"source_code": ""}], "src_uid": "565056bfe716ee89230270bdc14c9051"} {"source_code": " 0, C => 0, G => 0, T => 0);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($c[$x] == \"?\")\n {\n $e++;\n }\n else\n {\n $d[$c[$x]]++;\n }\n}\n$f = $d;\nrsort($f);\n$g = 0;\n$g += $f[0] - $f[1];\n$g += $f[0] - $f[2];\n$g += $f[0] - $f[3];\nif(($e < $g) || ($a % 4 != 0))\n{\n print \"===\";\n}\nelseif($e == $g)\n{\n $h = max($d);\n $i = array();\n $j = array(A => 0, C => 0, G => 0, T => 0);\n $k = array_keys($j);\n for($x = 0; $x < 4; $x++)\n {\n $j[$k[$x]] = $h - $d[$k[$x]];\n }\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] == \"?\")\n {\n if($j[$k[0]] > 0)\n {\n $c[$x] = $k[0];\n $j[$k[0]]--;\n }\n elseif($j[$k[1]] > 0)\n {\n $c[$x] = $k[1];\n $j[$k[1]]--;\n }\n elseif($j[$k[2]] > 0)\n {\n $c[$x] = $k[2];\n $j[$k[2]]--;\n }\n elseif($j[$k[3]] > 0)\n {\n $c[$x] = $k[3];\n $j[$k[3]]--;\n }\n }\n }\n print implode($c);\n}\nelseif($e > $g)\n{\n $h = max($d);\n $i = array();\n $j = array(A => 0, C => 0, G => 0, T => 0);\n $k = array_keys($j);\n for($x = 0; $x < 4; $x++)\n {\n $j[$k[$x]] = $h - $d[$k[$x]];\n }\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] == \"?\")\n {\n if($j[$k[0]] > 0)\n {\n $c[$x] = $k[0];\n $j[$k[0]]--;\n }\n elseif($j[$k[1]] > 0)\n {\n $c[$x] = $k[1];\n $j[$k[1]]--;\n }\n elseif($j[$k[2]] > 0)\n {\n $c[$x] = $k[2];\n $j[$k[2]]--;\n }\n elseif($j[$k[3]] > 0)\n {\n $c[$x] = $k[3];\n $j[$k[3]]--;\n }\n }\n }\n $l = array(\"A\", \"G\", \"C\", \"T\");\n $m = 1;\n for($x = 0; $x < $a; $x++)\n {\n if($c[$x] == \"?\")\n {\n if($m == 1)\n {\n $c[$x] = \"A\";\n $m++;\n }\n elseif($m == 2)\n {\n $c[$x] = \"G\";\n $m++;\n }\n elseif($m == 3)\n {\n $c[$x] = \"C\";\n $m++;\n }\n elseif($m == 4)\n {\n $c[$x] = \"T\";\n $m = 1;\n }\n }\n }\n print implode($c);\n}\n?>"}, {"source_code": " 0)\n {\n $f += $c[$x];\n }\n }\n $g = $e + $f;\n $h = ceil(abs($g) / $b);\n print $h;\n}\n?>"}, {"source_code": " $value) {\n $summa += (int) $value;\n}\n$summa = abs($summa);\n\n$col = intval($summa / (int) $x);\nif ($summa % (int) $x !== 0) $col ++;\n\n\necho \"$col\\n\";\n\n?>"}, {"source_code": " 0 ? 1 : 0);\n\nfunction line() {\n return trim(fgets(STDIN));\n}\n"}, {"source_code": "$value)\n {\n \t\t$summ += $value;\n }\n $data = explode(\" \", $str1);\n $summ = abs($summ);\n $res = floor($summ / $data[1]);\n if($res * $data[1] != $summ)\n \t$res++;\n echo $res;\n ?>"}], "negative_code": [{"source_code": " $kw) {\n $ak = array_keys($kw);\n for ($i = 0; $i < $kArray[$w]; $i++) {\n for ($j = $i+1; $j < $kArray[$w]; $j++) {\n if (isset($aArray[$ak[$i]][$ak[$j]])) {\n $sum = $kArray[$w] + $kArray[$ak[$i]] + $kArray[$ak[$j]] - 6;\n $result = min($result, $sum);\n }\n }\n }\n}\n\necho $result == 2000000 ? \"-1\" : $result;", "positive_code": [{"source_code": "$f) {\n if (isset($aArray[$y][$t])) {\n $result = min($result, $kArray[$x] + $kArray[$y] + $kArray[$t]-6);\n }\n }\n\n}\necho $result == 2000000 ? \"-1\" : $result;\n"}, {"source_code": " $kw) {\n $ak = array_keys($kw);\n for ($i = 0; $i < $kArray[$w]; $i++) {\n if ($ak[$i]>$w) {\n for ($j = $i+1; $j < $kArray[$w]; $j++) {\n if (isset($aArray[$ak[$i]][$ak[$j]])) {\n $sum = $kArray[$w] + $kArray[$ak[$i]] + $kArray[$ak[$j]] - 6;\n $result = min($result, $sum);\n }\n }\n }\n }\n}\n\necho $result == 2000000 ? \"-1\" : $result;"}, {"source_code": " $kw) {\n $ak = array_keys($kw);\n for ($i = 0; $i < $kArray[$w]; $i++) {\n if ($ak[$i]>$w) {\n for ($j = $i+1; $j < $kArray[$w]; $j++) {\n if (isset($aArray[$ak[$i]][$ak[$j]])) {\n $sum = $kArray[$w] + $kArray[$ak[$i]] + $kArray[$ak[$j]] - 6;\n $result = min($result, $sum);\n }\n }\n }\n }\n}\n\necho $result == 2000000 ? \"-1\" : $result;"}, {"source_code": " $kw) {\n foreach ($kw as $i=>$v) {\n foreach ($kw as $j=>$v2) {\n if (isset($aArray[$i][$j])) {\n $sum = $kArray[$w] + $kArray[$i] + $kArray[$j] - 6;\n $result = min($result, $sum);\n }\n }\n }\n\n}\n\necho $result == 2000000 ? \"-1\" : $result;"}, {"source_code": " $kw) {\n $ak = array_keys($kw);\n for ($i = 0; $i < $kArray[$w]; $i++) {\n if ($ak[$i]<$w) {\n for ($j = $i+1; $j < $kArray[$w]; $j++) {\n if (isset($aArray[$ak[$i]][$ak[$j]])) {\n $sum = $kArray[$w] + $kArray[$ak[$i]] + $kArray[$ak[$j]] - 6;\n $result = min($result, $sum);\n }\n }\n }\n }\n}\n\necho $result == 2000000 ? \"-1\" : $result;"}, {"source_code": " $arr){\n\tif ( count($arr) < 2 ) {\n\t\tcontinue;\n\t}\n\tsort($arr);\n\tforeach($arr as $i => $sec){\n\t\tif($sec < $key || count($knights_arr[$sec]) < 2 || ($i == count($arr)-1) ){\n\t\t\tcontinue;\n\t\t}\n\t\t$rem_arr = array_slice($arr, $i+1);\n\t\tforeach($rem_arr as $thrd){\n\t\t\tif($thrd > $sec && in_array($key, $knights_arr[$thrd]) && in_array($sec, $knights_arr[$thrd])){\n\t\t\t\t$group[$r] = \"$key-$sec-$thrd\";\n\t\t\t\t$recognation[$r] = count($knights_arr[$key]) + count($knights_arr[$sec]) + count($knights_arr[$thrd]) - 6;\n\t\t\t\t$r++;\n\t\t\t}\n\t\t}\n\t}\n}\nif($r == 0){\n\techo -1;\n}else{\n\techo min($recognation);\n}"}, {"source_code": " $kw) {\n $ak = array_keys($kw);\n for ($i = 0; $i < $kArray[$w]; $i++) {\n if ($ak[$i]<$w) {\n for ($j = $i+1; $j < $kArray[$w]; $j++) {\n if (isset($aArray[$ak[$i]][$ak[$j]])) {\n $sum = $kArray[$w] + $kArray[$ak[$i]] + $kArray[$ak[$j]] - 6;\n $result = min($result, $sum);\n }\n }\n }\n }\n}\n\necho $result == 2000000 ? \"-1\" : $result;"}, {"source_code": " $kw) {\n $ak = array_keys($kw);\n for ($i = 0; $i < $kArray[$w]; $i++) {\n for ($j = $i+1; $j < $kArray[$w]; $j++) {\n $I = $ak[$i];\n $J = $ak[$j];\n if (isset($aArray[$I][$J])) {\n $sum = $kArray[$w] + $kArray[$I] + $kArray[$J] - 6;\n $result = min($result, $sum);\n }\n }\n }\n}\n\necho $result == 2000000 ? \"-1\" : $result;"}, {"source_code": " $kw) {\n foreach ($kw as $i=>$v) {\n foreach ($kw as $j=>$v2) {\n if (isset($aArray[$i][$j])) {\n $sum = $kArray[$w] + $kArray[$i] + $kArray[$j] - 6;\n $result = min($result, $sum);\n }\n }\n }\n\n}\n\necho $result == 2000000 ? \"-1\" : $result;\n"}], "negative_code": [{"source_code": " $y) {\n $aArray[$x][$y] = 1;\n } else {\n $aArray[$y][$x] = 1;\n }\n if (isset($kArray[$x])) {\n $kArray[$x]++;\n } else {\n $kArray[$x] = 1;\n }\n if (isset($kArray[$y])) {\n $kArray[$y]++;\n } else {\n $kArray[$y] = 1;\n }\n}\n\n$result = 2000000;\n\nforeach ($aArray as $w => $kw) {\n $ak = array_keys($kw);\n $cw = count($kw);\n for ($i = 0; $i < $cw; $i++) {\n for ($j = $i + 1; $j < $cw; $j++) {\n if (isset($aArray[$ak[$i]])) {\n if (isset($aArray[$ak[$i]][$ak[$j]])) {\n $sum = $kArray[$w] + $kArray[$ak[$i]] + $kArray[$ak[$j]] - 6;\n $result = min($result, $sum);\n }\n } elseif (isset($aArray[$ak[$j]])) {\n if (isset($aArray[$ak[$j]][$ak[$i]])) {\n $sum = $kArray[$w] + $kArray[$ak[$i]] + $kArray[$ak[$j]] - 6;\n $result = min($result, $sum);\n }\n }\n }\n }\n}\n\necho $result == 2000000 ? \"-1\" : $result;"}, {"source_code": "$f) {\n if (isset($aArray[$y][$t])) {\n $result = min($result, $kArray[$x] + $kArray[$y] + $kArray[$t]-6);\n }\n }\n\n}\necho $result == 2000000 ? \"-1\" : $result;\n"}, {"source_code": " $arr){\n\tif ( count($arr) < 2 ) {\n\t\tcontinue;\n\t}\n\tsort($arr);\n\tforeach($arr as $i => $sec){\n\t\tif($sec < $key || count($knights_arr[$sec]) < 2 || ($i == count($arr)-1) ){\n\t\t\tcontinue;\n\t\t}\n\t\t$rem_arr = array_slice($arr, $i+1);\n\t\tforeach($rem_arr as $thrd){\n\t\t\tif($thrd > $sec && in_array($key, $knights_arr[$thrd]) && in_array($sec, $knights_arr[$thrd])){\n\t\t\t\t$group[$r] = \"$key-$sec-$thrd\";\n\t\t\t\t$recognation[$r] = count($knights_arr[$key]) + count($knights_arr[$sec]) + count($knights_arr[$thrd]) - 6;\n\t\t\t\t$r++;\n\t\t\t}\n\t\t}\n\t}\n}\nif($r == 0){\n\techo -1;\n}else{\n\techo min($recognation);\n}"}, {"source_code": " $line){\n\t\tif($key == $i || $key == $j || $key == $k)\n\t\t\tcontinue;\n\t\tif($line[0] == $selection[0] || $line[0] == $selection[1] || $line[0] == $selection[2]\n\t\t\t|| $line[1] == $selection[0] || $line[1] == $selection[1] || $line[1] == $selection[2])\n\t\t\t$sum ++;\n\t}\n\t$summations[] = $sum;\n}"}], "src_uid": "24a43df3e6d2af348692cdfbeb8a195c"} {"source_code": " $sV) {\r\n if (!isset($aTest[$sV])) {\r\n $aTest[$sV] = $sV;\r\n } else {\r\n $aR[$sK] = $sV;\r\n }\r\n }\r\n $aAnswer = array_merge($aTest , $aR);\r\n foreach ($aAnswer as $sK => $sV) {\r\n echo $sV . ' ';\r\n }\r\n echo \"\\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}\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 sort($a);\r\n $b = $c = [];\r\n foreach ($a as $v) {\r\n if(isset($b[$v])) {\r\n $c[] = $v;\r\n } else {\r\n $b[$v] = $v;\r\n }\r\n }\r\n IO::line(implode(' ', $b) . ' ' . implode(' ', $c));\r\n}"}, {"source_code": ""}, {"source_code": " $sV) {\r\n if (!isset($aTest[$sK])) {\r\n $aTest[$sK] = $sV;\r\n } else {\r\n $aR[$sK] = $sV;\r\n }\r\n }\r\n $aAnswer = array_merge($aTest , $aR);\r\n foreach ($aAnswer as $sK => $sV) {\r\n echo $sV . ' ';\r\n }\r\n echo \"\\n\";\r\n}"}, {"source_code": " $sV) {\r\n if (!isset($aTest[$sV])) {\r\n $aTest[$sK] = $sV;\r\n } else {\r\n $aR[$sK] = $sV;\r\n }\r\n }\r\n $aAnswer = array_merge($aTest , $aR);\r\n foreach ($aAnswer as $sK => $sV) {\r\n echo $sV . ' ';\r\n }\r\n echo \"\\n\";\r\n}"}, {"source_code": " $sV) {\r\n if (!isset($aTest[$sV])) {\r\n $aTest[$sV] = $sV;\r\n } else {\r\n $aR[$sV] = $sV;\r\n }\r\n }\r\n $aAnswer = array_merge($aTest , $aR);\r\n foreach ($aAnswer as $sK => $sV) {\r\n echo $sV . ' ';\r\n }\r\n echo \"\\n\";\r\n}"}, {"source_code": " $sV) {\r\n if (!isset($aTest[$sV])) {\r\n $aTest[$sV] = $sV;\r\n } else {\r\n $aR[$sV] = $sV;\r\n }\r\n }\r\n $aAnswer = array_merge($aTest , $aR);\r\n foreach ($aAnswer as $sK => $sV) {\r\n echo $sV . ' ';\r\n }\r\n echo \"\\n\";\r\n}"}, {"source_code": " $sV) {\r\n if (!isset($aTest[$sV])) {\r\n $aTest[$sV] = $sV;\r\n } else {\r\n $aR[$sV] = $sV;\r\n }\r\n }\r\n $aAnswer = array_merge($aTest , $aR);\r\n echo implode(\" \",$aAnswer). \"\\n\";\r\n}"}, {"source_code": " $sV) {\r\n if (!isset($aTest[$sV])) {\r\n $aTest[$sV] = $sV;\r\n } else {\r\n $aR[$sV] = $sV;\r\n }\r\n }\r\n\r\n echo implode(\" \",$aTest) . \" \" . implode(\" \",$aR) . \"\\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 $n = IO::str();\r\n $a = IO::arr();\r\n sort($a);\r\n $b = $c = [];\r\n foreach ($a as $v) {\r\n if(isset($b[$v])) {\r\n $c[$v] = $v;\r\n } else {\r\n $b[$v] = $v;\r\n }\r\n }\r\n IO::line(implode(' ', $b) . ' ' . implode(' ', $c));\r\n}"}], "src_uid": "69838d9f9214c65b84a21d4eb546ea4b"} {"source_code": "", "positive_code": [{"source_code": " 0) {$c[1] --; $r --; break;}\n if($c[4] > 0) {$c[4] --; $r --; break;}\n if($c[7] > 0) {$c[7] --; $r --; break;}\n if($c[2] > 1) {$c[2] -= 2; $r --; break;}\n if($c[2] > 0 && $c[5] > 0) {$c[2] --; $c[5] --; $r --; break;}\n if($c[5] > 1) {$c[5] -= 2; $r --; break;}\n if($c[2] > 0 && $c[8] > 0) {$c[2] --; $c[8] --; $r --; break;}\n if($c[5] > 0 && $c[8] > 0) {$c[5] --; $c[8] --; $r --; break;}\n if($c[8] > 1) {$c[8] -= 2; $r --; break;}\n break;\n case 2: if($c[2] > 0) {$c[2] --; $r -= 2; break;}\n if($c[5] > 0) {$c[5] --; $r -= 2; break;}\n if($c[8] > 0) {$c[8] --; $r -= 2; break;}\n if($c[1] > 1) {$c[1] -= 2; $r -= 2; break;}\n if($c[1] > 0 && $c[4] > 0) {$c[1] --; $c[4] --; $r -= 2; break;}\n if($c[4] > 1) {$c[4] -= 2; $r -= 2; break;}\n if($c[1] > 0 && $c[7] > 0) {$c[1] --; $c[7] --; $r -= 2; break;}\n if($c[4] > 0 && $c[7] > 0) {$c[4] --; $c[7] --; $r -= 2; break;}\n if($c[7] > 1) {$c[7] -= 2; $r -= 2; break;}\n break;\n}\n$s='';\nif($r != 0) {print '-1'; exit(0);} else\nfor($i=9;$i>=0;$i--) $s .= str_repeat($i,$c[$i]);\n\nif($s[0] == '0') print '0'; else print $s;\n?>"}], "negative_code": [{"source_code": " 0) {$c[1] --; $r --; break;}\n if($c[4] > 0) {$c[4] --; $r --; break;}\n if($c[7] > 0) {$c[7] --; $r --; break;}\n break;\n case 2: if($c[2] > 0) {$c[2] --; $r -= 2; break;}\n if($c[5] > 0) {$c[5] --; $r -= 2; break;}\n if($c[8] > 0) {$c[8] --; $r -= 2; break;}\n if($c[1] > 1) {$c[1] -= 2; $r -= 2; break;}\n if($c[1] > 0 && $c[4] > 0) {$c[1] --; $c[4] --; $r -= 2; break;}\n if($c[1] > 0 && $c[7] > 0) {$c[1] --; $c[7] --; $r -= 2; break;}\n if($c[4] > 0 && $c[7] > 0) {$c[4] --; $c[7] --; $r -= 2; break;}\n break;\n}\nif($r != 0) print '-1'; else\nfor($i=9;$i>=0;$i--) print str_repeat($i,$c[$i]);\n?>"}, {"source_code": " 0) {$c[1] --; $r --; break;}\n if($c[4] > 0) {$c[4] --; $r --; break;}\n if($c[7] > 0) {$c[7] --; $r --; break;}\n break;\n case 2: if($c[2] > 0) {$c[2] --; $r -= 2; break;}\n if($c[5] > 0) {$c[5] --; $r -= 2; break;}\n if($c[8] > 0) {$c[8] --; $r -= 2; break;}\n if($c[1] > 1) {$c[1] -= 2; $r -= 2; break;}\n if($c[1] > 0 && $c[4] > 0) {$c[1] --; $c[4] --; $r -= 2; break;}\n if($c[4] > 1) {$c[4] -= 2; $r -= 2; break;}\n if($c[1] > 0 && $c[7] > 0) {$c[1] --; $c[7] --; $r -= 2; break;}\n if($c[4] > 0 && $c[7] > 0) {$c[4] --; $c[7] --; $r -= 2; break;}\n if($c[7] > 1) {$c[7] -= 2; $r -= 2; break;}\n break;\n}\nif($r != 0) print '-1'; else\nfor($i=9;$i>=0;$i--) print str_repeat($i,$c[$i]);\n?>"}, {"source_code": " 0) {$c[1] --; $r --; break;}\n if($c[4] > 0) {$c[4] --; $r --; break;}\n if($c[7] > 0) {$c[7] --; $r --; break;}\n break;\n case 2: if($c[2] > 0) {$c[2] --; $r -= 2; break;}\n if($c[5] > 0) {$c[5] --; $r -= 2; break;}\n if($c[8] > 0) {$c[8] --; $r -= 2; break;}\n if($c[1] > 1) {$c[1] -= 2; $r -= 2; break;}\n if($c[1] > 0 && $c[4] > 0) {$c[1] --; $c[4] --; $r -= 2; break;}\n if($c[4] > 1) {$c[4] -= 2; $r -= 2; break;}\n if($c[1] > 0 && $c[7] > 0) {$c[1] --; $c[7] --; $r -= 2; break;}\n if($c[4] > 0 && $c[7] > 0) {$c[4] --; $c[7] --; $r -= 2; break;}\n if($c[7] > 1) {$c[7] -= 2; $r -= 2; break;}\n break;\n}\n$s='';\nif($r != 0) {print '-1'; exit(0);} else\nfor($i=9;$i>=0;$i--) $s .= str_repeat($i,$c[$i]);\n\nif($s[0] == '0') print '0'; else print $s;\n?>"}, {"source_code": ""}], "src_uid": "b263917e47e1c84340bcb1c77999fd7e"} {"source_code": " $n2) {\n\t$temp = $n1;\n\t$n1 = $n2;\n\t$n2 = $temp;\n}\n\n$arr1 = array_slice($arr, 0, $n1);\n$arr2 = array_slice($arr, $n1);\n\n$res = array_sum($arr1)/$n1 + array_sum($arr2)/$n2;\n\necho $res;", "positive_code": [{"source_code": " $c))\n{\n $e = array_slice($d, 0, $c);\n $f = array_slice($d, $c);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $c) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\nelseif($b < $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $c);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $c);\n print number_format($i, 6, '.', '');\n}\nelseif($b == $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\nelseif($b > $c)\n{\n $e = array_slice($d, 0, $c);\n $f = array_slice($d, $c, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $c) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\n?>"}], "negative_code": [{"source_code": " $c))\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = bcadd(bcdiv($g, $b), bcdiv($h, $c));\n print number_format($i, 6, '.', '');\n}\nelseif($b < $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $c);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $c);\n print number_format($i, 6, '.', '');\n}\nelseif($b == $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\nelseif($b > $c)\n{\n $e = array_slice($d, 0, $c);\n $f = array_slice($d, $c, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $c) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\n?>"}, {"source_code": " $c))\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $c);\n print number_format($i, 6, '.', '');\n}\nelseif($b < $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $c);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $c);\n print number_format($i, 6, '.', '');\n}\nelseif($b == $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\nelseif($b > $c)\n{\n $e = array_slice($d, 0, $c);\n $f = array_slice($d, $c, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $c) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\n?>"}, {"source_code": " $c))\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $c);\n print number_format($i, 6, '.', '');\n}\nelseif($b < $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $c);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $c);\n print number_format($i, 6, '.', '');\n}\nelseif($b == $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\nelseif($b > $c)\n{\n $e = array_slice($d, 0, $c);\n $f = array_slice($d, $c, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $c) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\n?>"}, {"source_code": " $c))\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $c) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\nelseif($b < $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $c);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $c);\n print number_format($i, 6, '.', '');\n}\nelseif($b == $c)\n{\n $e = array_slice($d, 0, $b);\n $f = array_slice($d, $b, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $b) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\nelseif($b > $c)\n{\n $e = array_slice($d, 0, $c);\n $f = array_slice($d, $c, $b);\n $g = array_sum($e);\n $h = array_sum($f);\n $i = ($g / $c) + ($h / $b);\n print number_format($i, 6, '.', '');\n}\n?>"}], "src_uid": "822e8f394a59329fa05c96d7fb35797e"} {"source_code": " 0)\n{\n $f += ($g * ($g + 1)) / 2;\n}\nprint $f;\n?>", "positive_code": [{"source_code": " 0) {\n $iCount += ($j*($j + 1))/2;\n $j = 0;\n }\n}\necho $iCount . \"\\n\";\n"}], "negative_code": [], "src_uid": "4c260e7c6fd9c573ee4f3b1822f3c7c3"} {"source_code": "num = $a;\n$this->time = $b;\n$this->team = $c;\n$this->count += $d;\n$this->out = true;\n$this->rec();\n}\nfunction upd($a,$b){\n$this->time = $a;\n$this->count += $b;\n$this->rec();\n}\nfunction rec(){\nif($this->count >= 2 && $this->out){\nprintf (\"%s %d %d\\n\",$this->team,$this->num,$this->time);\n$this->out = false;\n}\n}\n}\n$name__ = array();\n$name___h = trim(fgets(STDIN));\n$name___a = trim(fgets(STDIN));\n$flclasss = array();\n$n = trim(fgets(STDIN));\nfor ($i=0;$i<$n;$i++){\nlist($t,$a,$m,$b) = explode(\" \",trim(fgets(STDIN)));\n$b = ($b=='r')? 2 : 1;\n$a = ($a=='h')? $name___h : $name___a;\nif (!isset($flclasss[$a.$m])){\n$flclasss[$a.$m]= new flclass($m,$t,$a,$b);\n}else{\n$flclasss[$a.$m]->upd($t,$b);\n}\n}\n?>", "positive_code": [{"source_code": ""}, {"source_code": "numq = $a;\n$this->time = $b;\n$this->team = $c;\n$this->count += $d;\n$this->out = true;\n$this->rec();\n}\nfunction upd($a,$b){\n$this->time = $a;\n$this->count += $b;\n$this->rec();\n}\nfunction rec(){\nif($this->count >= 2 && $this->out){\nprintf (\"%s %d %d\\n\",$this->team,$this->numq,$this->time);\n$this->out = false;\n}\n}\n}\n$name = array();\n$name_h = trim(fgets(STDIN));\n$name_a = trim(fgets(STDIN));\n$fls = array();\n$n = trim(fgets(STDIN));\nfor ($i=0;$i<$n;$i++){\nlist($t,$a,$m,$b) = explode(\" \",trim(fgets(STDIN)));\n$b = ($b=='r')? 2 : 1;\n$a = ($a=='h')? $name_h : $name_a;\nif (!isset($fls[$a.$m])){\n$fls[$a.$m]= new fl($m,$t,$a,$b);\n}else{\n$fls[$a.$m]->upd($t,$b);\n}\n}"}, {"source_code": "number = $a;\n $this->time = $b;\n $this->team = $c;\n $this->count += $d;\n $this->output = true;\n $this->record();\n }\n function update($a,$b){\n $this->time = $a;\n $this->count += $b;\n $this->record();\n }\n function record(){\n global $arr2;\n if ($this->count >= 2 && $this->output){\n $arr2[$this->time] = sprintf(\"%s %d %d\\n\",$this->team,$this->number,$this->time);\n $this->output = false;\n }\n }\n}\n\n$name = array();\n$name_h = trim(fgets(STDIN));\n$name_a = trim(fgets(STDIN));\n$n = trim(fgets(STDIN));\n\n$arr = array();\nfor ($i=0; $i<$n; $i++) {\n list($t,$a,$m,$b) = explode(\" \",trim(fgets(STDIN)));\n $b = ($b == 'r')? 2 : 1;\n $a = ($a == 'h')? $name_h : $name_a;\n if (!isset($arr[$a.$m])) {\n $arr[$a.$m] = new calc($m,$t,$a,$b);\n } else {\n $arr[$a.$m]->update($t,$b);\n }\n}\nksort($arr2);\nforeach ($arr2 as $value){\n echo $value;\n}\n?>"}, {"source_code": "\n"}, {"source_code": "num = $a;\n\t\t\t$this->time = $b;\n\t\t\t$this->team = $c;\n\t\t\t$this->count += $d;\n\t\t\t$this->out = true;\n\t\t\t$this->rec();\n\t\t}\n\t\tfunction upd($a,$b){\n\t\t\t$this->time = $a;\n\t\t\t$this->count += $b;\n\t\t\t$this->rec();\n\t\t}\n\t\tfunction rec(){\n\t\t\tglobal $fls2;\n\t\t\tif($this->count >= 2 && $this->out){\n\t\t\t\t$fls2[$this->time] = sprintf (\"%s %d %d\\n\",$this->team,$this->num,$this->time);\n\t\t\t\t$this->out = false;\n\t\t\t}\n\t\t}\n\t}\n\t$name_h = trim(fgets(STDIN));\n\t$name_a = trim(fgets(STDIN));\n\t$fls = array();\n\t$n = trim(fgets(STDIN));\n\tfor ($i=0;$i<$n;$i++){\n\t\tlist($t,$a,$m,$b) = explode(\" \",trim(fgets(STDIN)));\n\t\t$b = ($b=='r')? 2 : 1;\n\t\t$a = ($a=='h')? $name_h : $name_a;\n\t\tif (!isset($fls[$a.$m])){\n\t\t\t$fls[$a.$m]= new fl($m,$t,$a,$b);\n\t\t}else{\n\t\t\t$fls[$a.$m]->upd($t,$b);\n\t\t}\n\t}\n\tksort($fls2);\n\tforeach($fls2 as $fl){\n\t\techo $fl;\n\t}\n?>"}, {"source_code": "num = $a1;\n$this->time = $b;\n$this->team = $c;\n$this->count += $d;\n$this->out = true;\n$this->rec();\n}\nfunction upd($a1,$b){\n$this->time = $a1;\n$this->count += $b;\n$this->rec();\n}\nfunction rec(){\nif($this->count >= 2 && $this->out){\nprintf (\"%s %d %d\\n\",$this->team,$this->num,$this->time);\n$this->out = false;\n}\n}\n}\n$name = array();\n$name_h = trim(fgets(STDIN));\n$name_a = trim(fgets(STDIN));\n$fls = array();\n$n = trim(fgets(STDIN));\nfor ($i=0;$i<$n;$i++){\nlist($t,$a1,$m,$b) = explode(\" \",trim(fgets(STDIN)));\n$b = ($b=='r')? 2 : 1;\n$a1 = ($a1=='h')? $name_h : $name_a;\nif (!isset($fls[$a1.$m])){\n$fls[$a1.$m]= new fl($m,$t,$a1,$b);\n}else{\n$fls[$a1.$m]->upd($t,$b);\n}\n}\n?>"}, {"source_code": "avfhk = $a;\n $this->loinvds = $b;\n $this->pknndfj = $c;\n $this->hbjbskblj += $d;\n $this->hbhhnbnbnk = true;\n $this->rec();\n }\n function upd($a,$b){\n $this->loinvds = $a;\n $this->hbjbskblj += $b;\n $this->rec();\n }\n function rec(){\n if($this->hbjbskblj >= 2 && $this->hbhhnbnbnk){\n printf (\"%s %d %d\\n\",$this->pknndfj,$this->avfhk,$this->loinvds);\n $this->hbhhnbnbnk = false;\n }\n }\n }\n $omnomnom = array();\n $omnomnom_h = trim(fgets(STDIN));\n $omnomnom_a = trim(fgets(STDIN));\n $fls = array();\n $n = trim(fgets(STDIN));\n for ($i=0;$i<$n;$i++){\n list($t,$a,$m,$b) = explode(\" \",trim(fgets(STDIN)));\n $b = ($b=='r')? 2 : 1;\n $a = ($a=='h')? $omnomnom_h : $omnomnom_a;\n if (!isset($fls[$a.$m])){\n $fls[$a.$m]= new fl($m,$t,$a,$b);\n }else{\n $fls[$a.$m]->upd($t,$b);\n }\n }\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n\t{\n\t\tforeach($reds as $key=>$value)\n\t\t{\n\t\t\t$team = (substr($key,0,1)==\"h\") ?\"$home\":\"$away\";\n\t\t\t$nos = substr($key,1,strlen($key)-1);\n\t\t\t$time = $value;\n\t\t\techo trim($team).' '.$nos.' '.$value.\"\\n\";\n\t\t\t\n\t\t}\n\n\t}\n\n\t/*\n\tTANC\nXNCOR\n2\n15 h 27 r\n28 h 27 r\n*/\n\n\n\t\n "}, {"source_code": " 0)\n\t{\n\t\tforeach($reds as $key=>$value)\n\t\t{\n\t\t\t$team = (substr($key,0,1)==\"h\") ?\"$home\":\"$away\";\n\t\t\t$nos = substr($key,1,strlen($key)-1);\n\t\t\t$time = $value;\n\t\t\techo trim($team).' '.$nos.' '.$value.\"\\n\";\n\t\t\t\n\t\t}\n\n\t}\n\n\t/*\n\tASGDFJH\nAHGRSDXGER\n3\n23 h 15 r\n68 h 15 y\n79 h 15 y\nOutput\nASGDFJH 15 79\nAnswer\nASGDFJH 15 23\nChecker Log\nwrong answer 1st lines differ - expected: 'ASGDFJH 15 23', found: 'ASGDFJH 15 79'\n\n*/\n\n\n\t\n "}, {"source_code": " 0)\n\t{\n\t\tforeach($reds as $key=>$value)\n\t\t{\n\t\t\t$team = (substr($key,0,1)==\"h\") ?\"$home\":\"$away\";\n\t\t\t$nos = substr($key,1,strlen($key)-1);\n\t\t\t$time = $value;\n\t\t\techo trim($team).' '.$nos.' '.$value.\"\\n\";\n\t\t\t\n\t\t}\n\n\t}\n\n\n\t\n "}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "num = $e;\n$this->time = $b;\n$this->team = $c;\n$this->count += $d;\n$this->out = true;\n$this->rec();\n}\nfunction upd($a,$b){\n$this->time = $e;\n$this->count += $b;\n$this->rec();\n}\nfunction rec(){\nif($this->count >= 2 && $this->out){\nprintf (\"%s %d %d\\n\",$this->team,$this->num,$this->time);\n$this->out = false;\n}\n}\n}\n$name = array();\n$name_h = trim(fgets(STDIN));\n$name_e = trim(fgets(STDIN));\n$fls = array();\n$n = trim(fgets(STDIN));\nfor ($i=0;$i<$n;$i++){\nlist($t,$e,$m,$b) = explode(\" \",trim(fgets(STDIN)));\n$b = ($b=='r')? 2 : 1;\n$e = ($e=='h')? $name_h : $name_e;\nif (!isset($fls[$e.$m])){\n$fls[$e.$m]= new fl($m,$t,$e,$b);\n}else{\n$fls[$e.$m]->upd($t,$b);\n}\n}\n?>"}, {"source_code": ""}], "src_uid": "b1f78130d102aa5f425e95f4b5b3a9fb"} {"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.\" \";", "positive_code": [{"source_code": " $b)\n {\n $d = 1;\n break;\n }\n}\nif($d == 0)\n{\n $f = array();\n for($x = 0; $x < $a; $x++)\n {\n $f[$c[$x]] = TRUE;\n }\n $g = 0;\n $h = $c[0] + $b;\n if($h >= $c[$a - 1])\n {\n print \"1\";\n }\n else\n {\n while(TRUE)\n {\n if($f[$h] == TRUE)\n {\n $g++;\n $h += $b;\n if($h >= $c[$a - 1])\n {\n $g++;\n break;\n }\n }\n else\n {\n for($x = $h; $x >= 0; $x--)\n {\n if($f[$x] == TRUE)\n {\n $g++;\n $h = $x + $b;\n break;\n }\n }\n if($h >= $c[$a - 1])\n {\n $g++;\n break;\n }\n }\n }\n print $g;\n }\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": " $max_km) {\n\t\t\tdie(\"-1\");\n\t\t}\n elseif($offset > $km_count) { \n $bikes_count++; \n $km_count = $max_km;\n }\n \n $km_count = $km_count-$offset;\n }\n \n echo $bikes_count;\n?>"}, {"source_code": "= $arr_x[$point]) {\n $i = $point - 1;\n if($point >= $count_points_n){\n break;\n }\n $is_succses = 1;\n }\n else{\n $min_count_points++;\n break;\n }\n }\n if(!$is_succses){\n $min_count_points = -1;\n break;\n }\n}\necho $min_count_points;\n?>"}, {"source_code": " 0) {\n\t\t$t = $b[$k] - $b[$k-1];\n\t\tif ($t > $a[1]) {\n\t\t\t$f = 1;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t$k--;\n\t\t}\n\t}\n\twhile ($x != $c && $x < $c) {\n\t\tif (!in_array($x, $b)) {\n\t\t\t$y = one($x, $b);\n\t\t\tif ($y == $b[0]) break;\n\t\t\tif (($y + $a[1]) == $x) break;\n\t\t\t$x = $y + $a[1];\n\t\t\t$z++;\n\t\t} else {\n\t\t\t$x = $x + $a[1];\n\t\t\t$z++;\n\t\t}\n\t}\n\tif ($f == 1 || $z == 0 && (($c - $a[0]) == $a[1])) {\n\t\techo '-1';\n\t} elseif(($c - $a[0]) == $a[1] && $z == 1) {\n\t\techo '1';\n\t} else {\n\t\techo $z + 1;\n\t}\n?>"}, {"source_code": " 1000) die();\n\tif($max_distance < 1 || $max_distance > 100000) die();\n\tif($bicycle_rental_coords[0] < 0 || $bicycle_rental_coords[$bicycle_rental_count-1] > 100000) die();\n\n\t$bicycle_count = 1; $distance_remain = $max_distance;\n\tfor($i = 1; $i <= count($bicycle_rental_coords); $i++){\n\t\tif(($max_distance - ($bicycle_rental_coords[$i] - $bicycle_rental_coords[$i-1])) < 0){\n\t\t\t$bicycle_count = -1;\n\t\t\tbreak;\n\t\t}\n\n\t\tif($distance_remain == 0 && $i != count($bicycle_rental_coords) - 1){\n\t\t\t$bicycle_count++;\n\t\t\t$distance_remain = $max_distance;\n\t\t} else\n\t\tif($i == count($bicycle_rental_coords) - 1){ \n\t\t $distance_remain = $distance_remain - ($bicycle_rental_coords[$i] - $bicycle_rental_coords[$i-1]);\n\t\t if($distance_remain < 0){\n\t\t $bicycle_count++; \n\t\t }\n\t\t break;\n\t\t}\n\n\t\t$distance_remain = $distance_remain - ($bicycle_rental_coords[$i] - $bicycle_rental_coords[$i-1]);\n\n\t\tif($distance_remain < 0){\n\t\t\t$bicycle_count++;\n\t\t\t$distance_remain = $max_distance - ($bicycle_rental_coords[$i] - $bicycle_rental_coords[$i-1]);\n\t\t}\n\t}\n\n\techo $bicycle_count;\n?> "}], "negative_code": [{"source_code": " $b)\n {\n $d = 1;\n break;\n }\n}\nif($d == 0)\n{\n $f = array();\n for($x = 0; $x < $a; $x++)\n {\n $f[$c[$x]] = TRUE;\n }\n $g = 0;\n $h = $c[0] + $b;\n while(TRUE)\n {\n if($f[$h] == TRUE)\n {\n $g++;\n $h += $b;\n if($h >= $c[$a - 1])\n {\n $g++;\n break;\n }\n }\n else\n {\n for($x = $h; $x >= 0; $x--)\n {\n if($f[$x] == TRUE)\n {\n $g++;\n $h = $x + $b;\n break;\n }\n }\n if($h >= $c[$a - 1])\n {\n $g++;\n break;\n }\n }\n }\n print $g;\n}\nelse\n{\n print \"-1\";\n}\n?>"}, {"source_code": " $max_km) {\n\t\t\tfile_put_contents(\"\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\", \"-1\");\n\t\t\tdie();\n\t\t}\n elseif($offset > $km_count) { \n $bikes_count++; \n $km_count = $max_km;\n }\n \n $km_count = $km_count-$offset;\n }\n \n file_put_contents(\"\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\", $bikes_count);\n?>"}, {"source_code": " $max_km) {\n\t\t\tfile_put_contents(\"\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\", \"-1\");\n\t\t\tdie();\n\t\t}\n elseif($offset > $km_count) { \n $bikes_count++; \n $km_count = $max_km;\n }\n \n $km_count = $km_count-$offset;\n }\n \n file_put_contents(\"\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434\", $bikes_count);\n?>"}, {"source_code": " $arr_x[$point]) {\n $i = $point;\n if($point >= $count_points_n){\n break;\n }\n $is_succses = 1;\n }\n else{\n $min_count_points++;\n break;\n }\n }\n if(!$is_succses){\n $min_count_points = -1;\n break;\n }\n}\necho $min_count_points;\n\n?>"}, {"source_code": " $pos){\n $pos = $arr[$i-1] + $range;\n if($arr[$i] > $pos){\n $velo = -1;\n } else {\n $velo ++;\n }\n \n }\n}\necho $velo.\" \";"}, {"source_code": " $e){\n\tif($t < $e){\n\t\t// + \"Next\"\n\t\t$t += $q[1];\n\t\t// Search at array ($w) meanings ($t)\n\t\t$y = array_search($t, $w);\n\t\t// If $y == false\n\t\tif($y == false){\n\t\t\t// Check previous value\n\t\t\tif(!isset($w[$key - 1])){\n\t\t\t\t// Stop foreach\n\t\t\t\t$a = true;\n\t\t\t} else{\n\t\t\t\t// Duplicate \"Next\"\n\t\t\t\t$o = $t;\n\t\t\t\t// Bust\n\t\t\t\t$p = 0;\n\t\t\t\t// Search array($w)\n\t\t\t\twhile($p < $e and $y == false){\n\t\t\t\t\t$o -= 1;\n\t\t\t\t\t$p += 1;\n\t\t\t\t\t$y = array_search($o, $w);\n\t\t\t\t}\n\t\t\t\t// If success search array\n\t\t\t\tif($o > 0 and isset($w[$y])){\n\t\t\t\t\t$t = $o;\n\t\t\t\t\t$u++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else{ // If $y == true\n\t\t\t// Bike + 1\n\t\t\t$u++;\n\t\t}\n\t}\n}\n// Echo result\nif($u > 0){\n\techo $u;\n} else{\n\techo '-1';\n}"}, {"source_code": " $pun){\n\tif($bike * $array_one[1] <= $array_two[0] + array_pop($array_two)){\n\t\t$s += $array_one[1];\n\t\t$var = array_search($s, $array_two);\n\t\tif($var == false){\n\t\t\twhile($s > 0 and $var == false){\n\t\t\t\t$s -= 1;\n\t\t\t\t$var = array_search($s, $array_two);\n\t\t\t}\n\t\t\tif(isset($array_two[$var]) and $array_two[$var] != $pun){\n\t\t\t\t$bike++;\n\t\t\t}\n\t\t} else{\n\t\t\t$bike++;\n\t\t}\n\t}\n}\nif($bike <= 0){\n\techo '-1';\n} else{\n\techo $bike;\n}"}, {"source_code": " 0) {\n\t\t$t = $b[$k] - $b[$k-1];\n\t\tif ($t > $a[1]) {\n\t\t\t$f = 1;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t$k--;\n\t\t}\n\t}\n\twhile ($x != $c || $x < $c) {\n\t\tif (!in_array($x, $b)) {\n\t\t\t$y = one($x, $b);\n\t\t\tif ($y == $b[0]) break;\n\t\t\tif (($y + $a[1]) == $x) break;\n\t\t\t$x = $y + $a[1];\n\t\t\t$z++;\n\t\t} else {\n\t\t\t$x = $x + $a[1];\n\t\t\t$z++;\n\t\t}\n\t}\n\tif ($f == 1 || $z == 0) {\n\t\techo '-1';\n\t} else {\n\t\techo $z + 1;\n\t}\n?>"}, {"source_code": ""}, {"source_code": "= $e[0]){\n\techo '-1';\n} else{\n\techo $y;\n}\n?>"}, {"source_code": ""}], "src_uid": "874c4847db340f10ac55259cba259723"} {"source_code": " 0) && ($g == 0))\n {\n $h = $x; // \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $i = $x; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $g = 1;\n $l = $f; // \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n $m = count($e) - $k + 1; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n }\n elseif(($f > 0) && ($g == 1))\n {\n $i = $x;\n }\n}\nfor($x = $h - 1; $x <= $i + 1; $x++)\n{\n if(($x == ($h - 1)) || ($x == ($i + 1)))\n {\n for($y = $l; $y <= $m; $y++)\n {\n array_push($n, $d[$x][$y]);\n }\n }\n else\n {\n for($y = $h; $y <= $i; $y++)\n {\n array_push($n, $d[$x][$l - 1]);\n array_push($n, $d[$x][$m + 1]);\n }\n }\n}\n$o = array_unique($n);\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n for($y = 0; $y < count($p); $y++)\n {\n if($o[$x] == $p[$y])\n {\n $r++;\n }\n }\n}\nprint $r;\n?>", "positive_code": [{"source_code": "=1;$i--){\n for($j=$m;$j>=1;$j--){\n if($r[$i][$j-1] == $c) break 2;\n }\n}\n\n$xx = $i; $yy = $j;\n\n$z = array();\nif($x != 1){//top\n for($j=$y;$j<=$yy;$j++){\n if($r[$x - 1][$j-1] != '.' && !array_key_exists($r[$x - 1][$j-1],$z)){\n $z[$r[$x - 1][$j-1]] = '1';\n }\n }\n}\n\nif($xx != $n){//bottom\n for($j=$y;$j<=$yy;$j++){\n if($r[$xx + 1][$j-1] != '.' && !array_key_exists($r[$xx + 1][$j-1],$z)){\n $z[$r[$xx + 1][$j-1]] = '1';\n }\n }\n}\n\nif($y != 1){//left\n for($i=$x;$i<=$xx;$i++){\n if($r[$i][$y - 2] != '.' && !array_key_exists($r[$i][$y - 2],$z)){\n $z[$r[$i][$y - 2]] = '1';\n }\n }\n}\n\nif($yy != $m){//right\n for($i=$x;$i<=$xx;$i++){\n if($r[$i][$yy] != '.' && !array_key_exists($r[$i][$yy],$z)){\n $z[$r[$i][$yy]] = '1';\n }\n }\n}\n\nprint count($z);\n?>"}, {"source_code": ""}, {"source_code": "= 0 and $r[$i-1][$j] <> $p and $r[$i-1][$j] <> \".\" and !in_array($r[$i-1][$j], $co)) {\n $co[$cr] = $r[$i-1][$j];\n $cr++;\n }\n if ($i + 1 < $f and $r[$i+1][$j] <> $p and $r[$i+1][$j] <> \".\" and !in_array($r[$i+1][$j], $co)) {\n $co[$cr] = $r[$i+1][$j];\n $cr++;\n }\n if ($j - 1 >= 0 and $r[$i][$j-1] <> $p and $r[$i][$j-1] <> \".\" and !in_array($r[$i][$j-1], $co)) {\n $co[$cr] = $r[$i][$j-1];\n $cr++;\n }\n if ($j + 1 < $c and $r[$i][$j+1] <> $p and $r[$i][$j+1] <> \".\" and !in_array($r[$i][$j+1], $co)) {\n $co[$cr] = $r[$i][$j+1];\n $cr++;\n }\n //echo \"$i $j $cr\\n\";\n }\n }\necho \"$cr\\n\";\n//print_r($co);\n?> \n"}, {"source_code": "= $h) continue;\n if ($x < 0 || $x >= $w) continue;\n $dic[$board[$y][$x]] = 1;\n }\n }\n }\n}\necho count($dic) - 2 . \"\\n\";\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 0) && ($g == 0))\n {\n $h = $f; // \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $i = $f; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $g = 1;\n $l = $f; // \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n $m = count($e) - $k + 1; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n }\n elseif(($f > 0) && ($g == 1))\n {\n $i = $f;\n }\n}\nfor($x = $h - 1; $x <= $i + 1; $x++)\n{\n if(($x == ($h - 1)) || ($x == ($i + 1)))\n {\n for($y = $l; $y <= $m; $y++)\n {\n array_push($n, $d[$x][$y]);\n }\n }\n else\n {\n for($y = $h; $y <= $i; $y++)\n {\n array_push($n, $d[$x][$l - 1]);\n array_push($n, $d[$x][$m + 1]);\n }\n }\n}\n$o = array_unique($n);\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n for($y = 0; $y < count($p); $y++)\n {\n if(($o[$x] == $p[$y]) && ($o[$x] != $c))\n {\n $r++;\n }\n }\n}\nprint $r;\n?>"}, {"source_code": ""}, {"source_code": " 0) && ($g == 0))\n {\n $h = $x; // \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $i = $x; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $g = 1;\n $l = $f; // \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n $m = count($e) - $k + 1; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n }\n elseif(($f > 0) && ($g == 1))\n {\n $i = $x;\n }\n}\nfor($x = $h - 1; $x <= $i + 1; $x++)\n{\n if(($x == ($h - 1)) || ($x == ($i + 1)))\n {\n for($y = $l; $y <= $m; $y++)\n {\n array_push($n, $d[$x][$y]);\n }\n }\n else\n {\n for($y = $h; $y <= $i; $y++)\n {\n array_push($n, $d[$x][$l - 1]);\n array_push($n, $d[$x][$m + 1]);\n }\n }\n}\n$o = array_unique($n);\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n for($y = 0; $y < count($p); $y++)\n {\n if($o[$x] == $p[$y])\n {\n $r++;\n }\n }\n}\nprint $r;\n?>"}, {"source_code": " 0) && ($g == 0))\n {\n $h = $f; // \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $i = $f; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430\n $g = 1;\n $l = $f; // \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n $m = count($e) - $k + 1; // \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446\n }\n elseif(($f > 0) && ($g == 1))\n {\n $i = $f;\n }\n}\nfor($x = $h - 1; $x <= $i + 1; $x++)\n{\n if(($x == ($h - 1)) || ($x == ($i + 1)))\n {\n for($y = $l; $y <= $m; $y++)\n {\n array_push($n, $d[$x][$y]);\n }\n }\n else\n {\n for($y = $h; $y <= $i; $y++)\n {\n array_push($n, $d[$x][$l - 1]);\n array_push($n, $d[$x][$m + 1]);\n }\n }\n}\n$o = array_unique($n);\nsort($o);\nfor($x = 0; $x < count($o); $x++)\n{\n for($y = 0; $y < count($p); $y++)\n {\n if($o[$x] == $p[$y])\n {\n $r++;\n }\n }\n}\nprint $r;\n?>"}, {"source_code": " $p and !in_array($r[$i-1][$j], $co)) {\n $co[$cr] = $r[$i-1][$j];\n $cr++;\n }\n if ($r[$i-1][$j] <> $p and !in_array($r[$i-1][$j], $co)) {\n $co[$cr] = $r[$i-1][$j];\n $cr++;\n }\n if ($r[$i][$j-1] <> $p and !in_array($r[$i][$j-1], $co)) {\n $co[$cr] = $r[$i][$j-1];\n $cr++;\n }\n if ($r[$i][$j+1] <> $p and !in_array($r[$i][$j+1], $co)) {\n $co[$cr] = $r[$i][$j+1];\n $cr++;\n }\n }\n }\necho \"$cr\\n\";\n//print_r($co);\n?> \n"}, {"source_code": " $p and $r[$i-1][$j] <> \".\" and !in_array($r[$i-1][$j], $co)) {\n $co[$cr] = $r[$i-1][$j];\n $cr++;\n }\n if ($r[$i+1][$j] <> $p and $r[$i+1][$j] <> \".\" and !in_array($r[$i+1][$j], $co)) {\n $co[$cr] = $r[$i+1][$j];\n $cr++;\n }\n if ($r[$i][$j-1] <> $p and $r[$i][$j-1] <> \".\" and !in_array($r[$i][$j-1], $co)) {\n $co[$cr] = $r[$i][$j-1];\n $cr++;\n }\n if ($r[$i][$j+1] <> $p and $r[$i][$j+1] <> \".\" and !in_array($r[$i][$j+1], $co)) {\n $co[$cr] = $r[$i][$j+1];\n $cr++;\n }\n }\n }\necho \"$cr\\n\";\n//print_r($co);\n?> \n"}, {"source_code": " $p and $r[$i-1][$j] <> \".\" and !in_array($r[$i-1][$j], $co)) {\n $co[$cr] = $r[$i-1][$j];\n $cr++;\n }\n if ($r[$i-1][$j] <> $p and $r[$i-1][$j] <> \".\" and !in_array($r[$i-1][$j], $co)) {\n $co[$cr] = $r[$i-1][$j];\n $cr++;\n }\n if ($r[$i][$j-1] <> $p and $r[$i][$j-1] <> \".\" and !in_array($r[$i][$j-1], $co)) {\n $co[$cr] = $r[$i][$j-1];\n $cr++;\n }\n if ($r[$i][$j+1] <> $p and $r[$i][$j+1] <> \".\" and !in_array($r[$i][$j+1], $co)) {\n $co[$cr] = $r[$i][$j+1];\n $cr++;\n }\n }\n }\necho \"$cr\\n\";\n//print_r($co);\n?> \n"}, {"source_code": "= 0 and $r[$i-1][$j] <> $p and $r[$i-1][$j] <> \".\" and !in_array($r[$i-1][$j], $co)) {\n $co[$cr] = $r[$i-1][$j];\n $cr++;\n }\n if ($i + 1 < $f and $r[$i+1][$j] <> $p and $r[$i+1][$j] <> \".\" and !in_array($r[$i+1][$j], $co)) {\n $co[$cr] = $r[$i+1][$j];\n $cr++;\n }\n if ($j - 1 >= 0 and $r[$i][$j-1] <> $p and $r[$i][$j-1] <> \".\" and !in_array($r[$i][$j-1], $co)) {\n $co[$cr] = $r[$i][$j-1];\n $cr++;\n }\n if ($j + 1 < $c and $r[$i][$j+1] <> $p and $r[$i][$j+1] <> \".\" and !in_array($r[$i][$j+1], $co)) {\n $co[$cr] = $r[$i][$j+1];\n $cr++;\n }\n //echo \"$i $j $cr\\n\";\n }\n }\necho \"$cr\\n\";\nprint_r($co);\n?> \n"}], "src_uid": "d7601c9bb06a6852f04957fbeae54925"} {"source_code": "", "positive_code": [{"source_code": " $c) && ($b[$f] > $c))\n {\n if($b[$e] < $b[$f])\n {\n $c = $b[$e];\n $d .= \"L\";\n $e++;\n }\n else\n {\n $c = $b[$f];\n $d .= \"R\";\n $f--;\n }\n }\n elseif($b[$e] > $c)\n {\n $c = $b[$e];\n $d .= \"L\";\n $e++;\n }\n elseif($b[$f] > $c)\n {\n $c = $b[$f];\n $d .= \"R\";\n $f--;\n }\n else\n {\n break;\n }\n}\nprint strlen($d) . \"\\n\";\nprint $d;\n?>"}, {"source_code": " $a[$r] ){\n $last = $a[$r]; \n $str.='R';\n $r--;\n } else if($last < $a[$l]){\n $last = $a[$l]; \n $str.='L';\n $l++;\n } else if($last < $a[$r] ){\n $last = $a[$r]; \n $str.='R';\n $r--;\n }\n }\n echo strlen($str).\"\\n\";\n echo $str;\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": " $a[0]) {\n break;\n }\n } else {\n if ($x[count($x)-1] > $a[count($a) - 1]) {\n break;\n }\n }\n }\n if ($a[0] < $a[count($a) - 1]) {\n $s .= 'L';\n unset($a[0]);\n $a = array_values($a);\n } else {\n $s .= 'R';\n unset($a[count($a) - 1]);\n $a = array_values($a);\n }\n }\n?>"}, {"source_code": ""}, {"source_code": " $a[$r] ){\n $last = $a[$r]; \n $str.='R';\n $r--;\n } else if($last < $a[$l]){\n $last = $a[$l]; \n $str.='L';\n $l++;\n } else if($last < $a[$r] ){\n $last = $a[$r]; \n $str.='R';\n $r--;\n }\n }\n echo strlen($str).\"\\n\";\n echo $str;\n?>"}, {"source_code": ""}, {"source_code": " $a[0] && $x > $a[count($a) - 1]) {\n break;\n }\n }\n if ($x < $a[0] && $a[0] < $a[count($a) - 1]) {\n $s .= 'L';\n $x = $a[0];\n unset($a[0]);\n $a = array_values($a);\n } else if ($x < $a[count($a) - 1]) {\n $s .= 'R';\n $x = $a[count($a) - 1];\n unset($a[count($a) - 1]);\n $a = array_values($a);\n }\n }\n echo $s;\n?>"}, {"source_code": ""}, {"source_code": " $a[0]) {\n break;\n }\n } else {\n if ($x[count($x)-1] > $a[count($a) - 1]) {\n break;\n }\n }\n }\n if ($a[0] < $a[count($a) - 1]) {\n $s .= 'L';\n unset($a[0]);\n $a = array_values($a);\n } else {\n $s .= 'R';\n unset($a[count($a) - 1]);\n $a = array_values($a);\n }\n }\n echo $s;\n?>"}], "src_uid": "50c4b8fe3ab738e6e97058499791ac7b"} {"source_code": "OUTPUT_LINES[] = $s;\r\n\t}\r\n\t\r\n\tprivate function go(): void\r\n\t{\r\n\t\t$this->readLn();\r\n\t\t$this->outputLn(strval(abs(array_sum($this->readInts()))));\r\n\t}\r\n\t\r\n\tpublic function __construct()\r\n\t{\r\n\t\t$t = $this->readInt();\r\n\t\tfor ($i = 0; $i < $t; $i++) {\r\n\t\t\t$this->go();\r\n\t\t}\r\n\t\techo implode(PHP_EOL, $this->OUTPUT_LINES);\r\n\t}\r\n}\r\n\r\nnew Code();\r\n", "positive_code": [{"source_code": " $v) {\r\n\t\t$a[$k] = intval($v);\r\n\t}\r\n\r\n\t$s1 = $s2 = 0;\r\n\r\n\tforeach ($a as $k => $v) {\r\n\t\tif ($v >= 1) {\r\n\t\t\t$s1 += $v;\r\n\t\t} else {\r\n\t\t\t$s2 += $v;\r\n\t\t}\r\n\t}\r\n\r\n\t$res1 = abs($s1) - abs($s2);\r\n\t$res2 = abs($s2) - abs($s1);\r\n\r\n\treturn max($res1, $res2) . PHP_EOL;\r\n}\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n\techo go();\r\n}\r\n\r\n\r\n"}, {"source_code": "0){\r\n $s1[] =$arr[$i]; \r\n $sum1 +=$arr[$i]; \r\n } else {\r\n $s2[] =$arr[$i];\r\n $sum2 +=$arr[$i];\r\n } \r\n }\r\n if (abs($sum2)>abs($sum1)){\r\n $v = abs($sum2)-abs($sum1);\r\n } else {\r\n $v = abs($sum1)-abs($sum2);\r\n }\r\n echo \"$v\\n\";\r\n}\r\n$count = trim(fgets(STDIN));\r\nfor ($j=0; $j<$count; $j++){\r\n getSum(); \r\n}\r\n?>"}, {"source_code": "go();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate function readLn(): string\r\n\t{\r\n\t\treturn fgets(STDIN);\r\n\t}\r\n\t\r\n\tprivate function readInt(): int\r\n\t{\r\n\t\treturn intval(fgets(STDIN));\r\n\t}\r\n\t\r\n\tprivate function readStrings(): array\r\n\t{\r\n\t\treturn explode(' ', fgets(STDIN));\r\n\t}\r\n\t\r\n\tprivate function readInts(): array\r\n\t{\r\n\t\treturn explode(' ', fgets(STDIN));\r\n\t}\r\n\t\r\n\tprivate array $OUTPUT_LINES = [];\r\n\t\r\n\tprivate function outputLn(string $s): void\r\n\t{\r\n\t\t$this->OUTPUT_LINES[] = $s;\r\n\t}\r\n\t\r\n\tprivate function go(): void\r\n\t{\r\n\t\t$this->readLn();\r\n\t\t$this->outputLn(strval(abs(array_sum($this->readInts()))));\r\n\t}\r\n\t\r\n\tpublic function __construct()\r\n\t{\r\n\t\t$this->repeat($this->readInt());\r\n\t\techo implode(PHP_EOL, $this->OUTPUT_LINES);\r\n\t}\r\n}\r\n\r\nnew Code();\r\n"}], "negative_code": [{"source_code": " $v) {\r\n\t\t$a[$k] = intval($v);\r\n\t}\r\n\r\n\t$s1 = $s2 = 0;\r\n\r\n\tforeach ($a as $k => $v) {\r\n\t\tif ($v >= 1) {\r\n\t\t\t$s1 += $v;\r\n\t\t} else {\r\n\t\t\t$s2 += $v;\r\n\t\t}\r\n\t}\r\n\r\n\t$res1 = abs($s1) - abs($s2);\r\n\t$res2 = abs($s2) - abs($s1);\r\n\r\n\treturn strval(max($res1, $res2));\r\n}\r\n\r\n$t = intval(fgets(STDIN));\r\n\r\nfor ($i = 0; $i < $t; $i++) {\r\n\techo go();\r\n}\r\n\r\n\r\n"}], "src_uid": "f59f92a80f719cdb87ad92cd8c211942"} {"source_code": ""}, {"source_code": ""}, {"source_code": " "}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "806dcdab8364f5169334e172a192598a"} {"source_code": "", "positive_code": [{"source_code": "$max)\n {\n $max=$ans;\n }\n else\n {\n $as++;\n }\n //$max=max($ans,$max);\n}\necho $as;\n\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "strlen($str[$j+1]))\n \t{\n \t\t$tmp=$str[$j];\n \t\t$str[$j]=$str[$j+1];\n \t\t$str[$j+1]=$tmp;\n \t}\n } \n }\n //print_r($str).\"\\n\";\n $count=0;\n for ($i=0; $i <$numOfstr-1 ; $i++)\n { \n \t $cnt=substr_count($str[$i+1],$str[$i]);\n \t if($cnt>=1)\n \t {\n \t \t$count++;\n \t }\n }\n //echo \"$count\\n\";\n\n \n if($count>=$numOfstr-1)\n {\n\t echo \"YES\\n\";\n\t for ($i=0; $i <$numOfstr ; $i++) \n\t { \n\t \t echo \"$str[$i]\\n\";\n\t }\n }\n else\n \techo \"NO\\n\";\n \t", "positive_code": [{"source_code": ""}, {"source_code": "strlen($str[$j+1]))\n \t{\n \t\t$tmp=$str[$j];\n \t\t$str[$j]=$str[$j+1];\n \t\t$str[$j+1]=$tmp;\n \t}\n } \n }\n print_r($str).\"\\n\";\n $count=0;\n for ($i=0; $i <$numOfstr-1 ; $i++)\n { \n \t $cnt=substr_count($str[$i+1],$str[$i]);\n \t if($cnt>=1)\n \t {\n \t \t$count++;\n \t }\n }\n //echo \"$count\\n\";\n\n \n if($count>=$numOfstr-1)\n {\n\t echo \"YES\\n\";\n\t for ($i=0; $i <$numOfstr ; $i++) \n\t { \n\t \t echo \"$str[$i]\\n\";\n\t }\n }\n else\n \techo \"NO\\n\";\n \t"}, {"source_code": "strlen($str[$j+1]))\n \t{\n \t\t$tmp=$str[$j];\n \t\t$str[$j]=$str[$j+1];\n \t\t$str[$j+1]=$tmp;\n \t}\n } \n }\n $cnt=0;\n for ($i=0; $i <$numOfstr-1 ; $i++)\n { \n \t $cnt+=substr_count($str[$i+1],$str[$i]);\n }\n if($cnt>=$numOfstr-1)\n {\n\t echo \"YES\\n\";\n\t for ($i=0; $i <$numOfstr ; $i++) \n\t { \n\t \t echo \"$str[$i]\\n\";\n\t }\n }\n else\n \techo \"NO\\n\";"}], "src_uid": "5c33d1f970bcc2ffaea61d5407b877b2"} {"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;$t=0;\n $t = trim(fgets($handle));\n for($i=0;$i<$t;$i++)\n {\n $arr=array();\n $d = trim(fgets($handle));\n\n $result = trim(fgets($handle));\n $arr = explode(' ',$result);\n rsort($arr);\n $count=0;\n for ($h=0;$h", "positive_code": [{"source_code": ""}, {"source_code": " $sV){\n if($j > $sV) {\n break;\n } else {\n $iCount++;\n $j++;\n }\n }\n echo $iCount.\"\\n\";\n}\n"}, {"source_code": " $arr[$i]){\n\t\t\treturn $i;\n\t\t}\n\t}\n\treturn $n;\n\n}"}, {"source_code": "=$l){\n $count++; \n } \n }\n if($count>=$l){echo $l, \"\\n\";}\n else{\n $l--; goto again;\n }\n}\n\n?>"}, {"source_code": " $len) \n {\n if($n - $k <= $len)\n {\n $max = $n - $k;\n break;\n }\n }\n echo $max.\"\\n\";\n $i++;\n}\n?>"}, {"source_code": "$a[$i])\n {\n $ind=$i;\n break;\n }\n echo \"$ind\\n\";\n \n \n}\n\n\n?>"}, {"source_code": " $j){\n $j++;\n } else {\n break;\n }\n }\n echo \"$j\\n\";\n \n \n \n}"}, {"source_code": "= 1; $i--)\n\t{\n\t\t$c = 0;\n\t\tfor ($j = $n - 1; $j >= $n - $i; $j--)\n\t\t\tif ($data[$j] >= $i)\n\t\t\t{\n\t\t\t\t$c++;\n\t\t\t}\n\t\t\tif ($c == $i)\n\t\t\t{\n\t\t\t\t$ans .= $i.\"\\n\";\n\t\t\t\tbreak;\n\t\t\t}\n\t}\n}\necho $ans;\n\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " $len) \n {\n if($k == $len)\n $max = $len;\n }\n echo $max.\"\\n\";\n}\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;$t=0;\n $t = trim(fgets($handle));\n for($i=0;$i<$t;$i++)\n {\n $arr=array();\n $d = trim(fgets($handle));\n\n $result = trim(fgets($handle));\n $arr = explode(' ',$result);\n rsort($arr);\n $count=0;\n for ($h=0;$h= 3) ? $data[$n-3] : (($n == 2) ? $data[n - 2] : $data[n - 1])).\"\\n\";\n}\necho $ans;\n\n?>"}], "src_uid": "09236a3faa7fce573a4e5e758287040f"} {"source_code": "useStd = stristr($GLOBALS['argv'][0], '.PhpStorm2019.3\\config') === false;\n\t}\n\n\tpublic function calculateResult($input)\n\t{\n\t\tarray_shift($input);\n\t\n\t\t$alexPlace = array_shift($input);\n\t\n\t\t$alexPlace = explode(' ', trim($alexPlace));\n\t\t$alexes = array_fill($alexPlace[0], $alexPlace[1] - $alexPlace[0], 1);\n\t\tforeach ($input as $item)\n\t\t{\n\t\t\t$item = explode(' ', trim($item));\n\t\t\t\t\n\t\t\tif ($item[0] >= $alexPlace[1])\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor ($j = $item[0]; $j < $item[1]; $j++)\n\t\t\t{\n\t\t\t\tif ($j>=$alexPlace[1])\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tunset($alexes[$j]);\n\t\t\t}\n\t\t}\n\t\treturn count($alexes);\n\t}\n\n\tpublic function readInputLines()\n\t{\n\t\t$this->input = [];\n\t\tif ($this->useStd)\n\t\t{\n\t\t\twhile ($line = fgets(STDIN))\n\t\t\t{\n\t\t\t\t$this->input[] = $line;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $testInput;\n\t\t\t$this->input = explode(\"\\n\", trim($testInput));\n\t\t}\n\t}\n\n\tpublic function getInputLines()\n\t{\n\t\t$this->readInputLines();\n\t\treturn $this->input;\n\t}\n\n\tpublic function printResult($result)\n\t{\n\t\tif ($this->useStd)\n\t\t{\n\t\t\tfwrite(STDOUT, $result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar_dump($result);\n\t\t}\n\t}\n\n}\n\n\n##################################################\n$testInput = '3\n0 10\n1 5\n7 15\n';\n\n$helper = new ArgsHelper();\n$lines = $helper->getInputLines();\n\n$result = '';\n#\n$result = trim($helper->calculateResult($lines) . \"\\n\");\n#\n\n\n$helper->printResult($result);\n\n\n", "positive_code": [{"source_code": " $i[$x]) && ($d[$x + 1] > $j))\n {\n $n = range($b, $c);\n $o = range($j, $d[$x + 1]);\n $p = array_intersect($n, $o);\n if(count($p) > 0)\n {\n $k += count($p) - 1;\n }\n }\n $j = max($j, $i[$x + 1]);\n}\nif($c < $d[0])\n{\n $k += $c - $b;\n}\nelseif($b < $d[0])\n{\n $k += $d[0] - $b;\n}\nif($b > $j)\n{\n $k += $c - $b;\n}\nelseif($c > $j)\n{\n $k += $c - $j;\n \n}\nprint $k;\n?>"}], "negative_code": [{"source_code": " $i[$x]) && ($d[$x + 1] > $j))\n {\n $n = range($b, $c);\n $o = range($i[$x], $d[$x + 1]);\n $p = array_intersect($n, $o);\n if(count($p) > 0)\n {\n $k += count($p) - 1;\n }\n }\n $j = max($j, $i[$x + 1]);\n}\nif($c < $d[0])\n{\n $k += $c - $b;\n}\nelseif($b < $d[0])\n{\n $k += $d[0] - $b;\n}\nif($b > $j)\n{\n $k += $c - $b;\n}\nelseif($c > $j)\n{\n $k += $c - $j;\n}\nprint $k;\n?>"}, {"source_code": " 0)\n{\n $e += $f - 1;\n}\nprint $e;\n?>"}, {"source_code": " 0)\n{\n $e += $f - 1;\n}\nprint $e;\n?>"}, {"source_code": " $i[$x]) && ($d[$x + 1] > $j))\n {\n $n = range($b, $c);\n $o = range($i[$x], $d[$x + 1]);\n $p = array_intersect($n, $o);\n if(count($p) > 0)\n {\n $k += count($p) - 1;\n }\n }\n $j = max($j, $i[$x + 1]);\n}\nif($c < $d[0])\n{\n $k += $c - $b;\n}\nelseif($b < $d[0])\n{\n $k += $d[0] - $b;\n}\nif($b > $j)\n{\n $k += $c - $b;\n}\nif($c > $j)\n{\n $k += $c - $j;\n}\nprint $k;\n?>"}, {"source_code": " $i[$x]) && ($d[$x + 1] > $j) && ($i[$x] >= $b) && ($d[$x + 1] <= $c))\n {\n $k[count($k)] = $i[$x];\n $l[count($l)] = $d[$x + 1];\n }\n $j = max($j, $i[$x + 1]);\n}\nif($b < $d[0])\n{\n array_unshift($k, $b);\n array_unshift($l, $d[0]);\n}\nif($c > $j)\n{\n $k[count($k)] = $j;\n $l[count($l)] = $c;\n}\n$m = 0;\nfor($x = 0; $x < count($k); $x++)\n{\n $m += $l[$x] - $k[$x];\n}\nprint $m;\n?>"}, {"source_code": " $i[$x]) && ($d[$x + 1] > $j))\n {\n $n = range($b, $c);\n $o = range($i[$x], $d[$x + 1]);\n $p = array_intersect($n, $o);\n if(count($p) > 0)\n {\n $k += count($p) - 1;\n }\n }\n $j = max($j, $i[$x + 1]);\n}\nif($b < $d[0])\n{\n $k += $d[0] - $b;\n}\nif($c > $j)\n{\n $k += $c - $j;\n}\nprint $k;\n?>"}, {"source_code": "useStd = stristr($GLOBALS['argv'][0], '.PhpStorm2019.3\\config') === false;\n\t}\n\n\tpublic function calculateResult($input)\n\t{\n\t\tarray_shift($input);\n\t\t$alexPlace = array_shift($input);\n\t\t$alexPlace = explode(' ', $alexPlace);\n\t\t$alexes = array_fill($alexPlace[0], $alexPlace[1] - $alexPlace[0], 1);\n\t\tforeach ($input as $item)\n\t\t{\n\t\t\t$item = explode(' ', $item);\n\t\t\tif ($item[0] >= $alexPlace[1])\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor ($j = $item[0]; $j < $item[1]; $j++)\n\t\t\t{\n\t\t\t\tif ($j>=$alexPlace[1])\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tunset($alexes[$j]);\n\t\t\t}\n\t\t}\n\t\treturn count($alexes);\n\t}\n\n\tpublic function readInputLines()\n\t{\n\t\t$this->input = [];\n\t\tif ($this->useStd)\n\t\t{\n\t\t\twhile ($line = fgets(STDIN))\n\t\t\t{\n\t\t\t\t$this->input[] = $line;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $testInput;\n\t\t\t$this->input = explode(\"\\n\", trim($testInput));\n\t\t}\n\t}\n\n\tpublic function getInputLines()\n\t{\n\t\t$this->readInputLines();\n\t\treturn $this->input;\n\t}\n\n\tpublic function printResult($result)\n\t{\n\t\tif ($this->useStd)\n\t\t{\n\t\t\tfwrite(STDOUT, $result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar_dump($result);\n\t\t}\n\t}\n\n}\n\n\n##################################################\n$testInput = '3\n0 10\n1 5\n7 15\n';\n\n$helper = new ArgsHelper();\n$lines = $helper->getInputLines();\n\n$result = '';\n#\n$result = trim($helper->calculateResult($lines) . \"\\n\");\n#\n\n\n$helper->printResult($result);\n\n\n"}], "src_uid": "00c29b9f74b6564e41837704c24fc318"} {"source_code": " \"Power\",\n \"green\" => \"Time\",\n \"blue\" => \"Space\",\n \"orange\" => \"Soul\",\n \"red\" => \"Reality\",\n \"yellow\" => \"Mind\"\n );\n \n $cnt = array(\"purple\" => 0,\n \"green\" => 0,\n \"blue\" => 0,\n \"orange\" => 0,\n \"red\" => 0,\n \"yellow\" => 0\n );\n \n $n = trim(fgets(STDIN));\n for($i=0; $i<$n; $i++)\n {\n $s = trim(fgets(STDIN));\n $cnt[$s]++;\n }\n \n echo 6 - $n . PHP_EOL;\n \n foreach($cnt as $x => $val)\n if(!$val)\n echo $arr[$x] . PHP_EOL;\n?>", "positive_code": [{"source_code": "'Power', 'green'=>'Time', 'red'=>'Reality', 'blue' => 'Space', 'orange' => 'Soul', 'yellow' => 'Mind'];\n$n = intval(trim(fgets(STDIN)));\nwhile($n--){\n\t$clr = trim(fgets(STDIN));\n\tunset($st[$clr]);\n}\nprint count($st). \"\\n\";\nprint implode(\"\\n\", $st).\"\\n\";"}, {"source_code": ""}], "negative_code": [{"source_code": "#include \n\nusing namespace std;\n\n#define in freopen(\"input.txt\", \"r\", stdin);\n#define out freopen(\"output.txt\", \"w\", stdout);\n\nint execute()\n{\n int n, i;\n\n cin >> n;\n\n map < string, bool > used;\n\n string s;\n\n for(i=0; i> s;\n used[s] = true;\n }\n\n vector < string > a;\n a.push_back(\"purple\");\n a.push_back(\"green\");\n a.push_back(\"blue\");\n a.push_back(\"orange\");\n a.push_back(\"red\");\n a.push_back(\"yellow\");\n\n map < string, string > assoc;\n\n assoc[a[0]] = \"Power\";\n assoc[a[1]] = \"Time\";\n assoc[a[2]] = \"Space\";\n assoc[a[3]] = \"Soul\";\n assoc[a[4]] = \"Reality\";\n assoc[a[5]] = \"Mind\";\n\n cout << 6 - used.size() << endl;\n\n for(i=0; i<6; i++)\n if(!used[a[i]])\n cout << assoc[a[i]] << endl;\n\n return 0;\n}\n\nchar mtest = false;\nunsigned short TE = 1;\n\nint main()\n{\n //in\n ios_base::sync_with_stdio(false);\n\n if(mtest)\n cin >> TE;\n\n while(TE--)\n execute();\n\n return 0;\n}\n"}, {"source_code": "#include \n\nusing namespace std;\n\n#define in freopen(\"input.txt\", \"r\", stdin);\n#define out freopen(\"output.txt\", \"w\", stdout);\n\nint execute()\n{\n int n, i;\n cin >> n;\n map < string, bool > used;\n string s;\n for(i=0; i> s;\n used[s] = true;\n }\n\n string a[] = {\"purple\", \"green\", \"blue\", \"orange\", \"red\", \"yellow\"};\n\n map < string, string > assoc;\n\n assoc[a[0]] = \"Power\";\n assoc[a[1]] = \"Time\";\n assoc[a[2]] = \"Space\";\n assoc[a[3]] = \"Soul\";\n assoc[a[4]] = \"Reality\";\n assoc[a[5]] = \"Mind\";\n\n cout << 6 - used.size() << endl;\n\n for(i=0; i<6; i++)\n if(!used[a[i]])\n cout << assoc[a[i]] << endl;\n\n return 0;\n}\n\nchar mtest = false;\nunsigned short TE = 1;\n\nint main()\n{\n //in\n ios_base::sync_with_stdio(false);\n\n if(mtest)\n cin >> TE;\n\n while(TE--)\n execute();\n\n return 0;\n}\n"}, {"source_code": "#include \n\nusing namespace std;\n\n#define in freopen(\"input.txt\", \"r\", stdin);\n#define out freopen(\"output.txt\", \"w\", stdout);\n\nint execute()\n{\n int n;\n\n int i;\n\n cin >> n;\n\n map < string, bool > used;\n\n string s;\n\n for(i=0; i> s;\n used[s] = true;\n }\n\n string a[] = {\"purple\", \"green\", \"blue\", \"orange\", \"red\", \"yellow\"};\n\n map < string, string > assoc;\n\n assoc[a[0]] = \"Power\";\n assoc[a[1]] = \"Time\";\n assoc[a[2]] = \"Space\";\n assoc[a[3]] = \"Soul\";\n assoc[a[4]] = \"Reality\";\n assoc[a[5]] = \"Mind\";\n\n cout << 6 - used.size() << endl;\n\n for(i=0; i<6; i++)\n if(!used[a[i]])\n cout << assoc[a[i]] << endl;\n\n return 0;\n}\n\nchar mtest = false;\nunsigned short TE = 1;\n\nint main()\n{\n //in\n ios_base::sync_with_stdio(false);\n\n if(mtest)\n cin >> TE;\n\n while(TE--)\n execute();\n\n return 0;\n}\n"}, {"source_code": "#include \n\nusing namespace std;\n\n#define in freopen(\"input.txt\", \"r\", stdin);\n#define out freopen(\"output.txt\", \"w\", stdout);\n\nint execute()\n{\n int n, i;\n\n cin >> n;\n\n map < string, bool > used;\n\n string s;\n\n for(i=0; i> s;\n used[s] = true;\n }\n\n vector < string > a;\n a.push_back(\"purple\");\n a.push_back(\"green\");\n a.push_back(\"blue\");\n a.push_back(\"orange\");\n a.push_back(\"red\");\n a.push_back(\"yellow\");\n\n map < string, string > assoc;\n\n assoc[a[0]] = \"Power\";\n assoc[a[1]] = \"Time\";\n assoc[a[2]] = \"Space\";\n assoc[a[3]] = \"Soul\";\n assoc[a[4]] = \"Reality\";\n assoc[a[5]] = \"Mind\";\n\n cout << 6 - n << endl;\n\n for(i=0; i<6; i++)\n if(!used[a[i]])\n cout << assoc[a[i]] << endl;\n\n return 0;\n}\n\nchar mtest = false;\nunsigned short TE = 1;\n\nint main()\n{\n in\n ios_base::sync_with_stdio(false);\n\n if(mtest)\n cin >> TE;\n\n while(TE--)\n execute();\n\n return 0;\n}\n"}], "src_uid": "7eff98fbcf4e4a3284e2d2f98351fe4a"} {"source_code": "= $i && $min > $t[$j]){\n $min = $t[$j];\n $index = $j;\n }\n }\n if ($index == -1) continue;\n //echo $c[$index].PHP_EOL;\n $ret+=$c[$index];\n }\n \n echo $ret;\n}\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "= $i && ($min > $t[$j] || ($min == $t[$j] && $c[$index] < $c[$j]))){\n $min = $t[$j];\n $index = $j;\n }\n }\n if ($index == -1) continue;\n //echo $c[$index].PHP_EOL;\n $ret+=$c[$index];\n }\n \n echo $ret;\n}\n?>"}], "src_uid": "ea1bebf20f24a681f03082c92326db5e"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "echo 'NO';\n"}, {"source_code": "\n$input = file_get_contents('php://stdin');\n$input = explode(\"\\n\", $input);\n$firstString = $input[0];\n$firstString = explode(\" \", $firstString );\n$n = $firstString[0];\n$m = $firstString[1];\n\nunset($input[0]);\n$lamps = array();\nfor($i=1; $i<$m; $i++) {\n $lamps[$i] = $i;\n}\n\nforeach($input as $row) {\n $rLamps = explode(' ', $row); \n unset($rLamps[0]);\n foreach($rLamps as $lamp) {\n unset($lamps[$lamp]);\n }\n if (empty($lamps)) {\n echo 'YES';\n die();\n }\n}\necho 'NO';\n"}], "src_uid": "9438ce92e10e846dd3ab7c61a1a2e3af"} {"source_code": "", "positive_code": [{"source_code": "= 2;) {\r\n 0 == bc1($n, '%', 2) ? $n = bc1($n, '/', 2) : $flg = true;\r\n }\r\n echo ($flg ? 'YES' : 'NO').PHP_EOL;\r\n}\r\nfunction bc1($x, $e, $y = null)\r\n{\r\n is_null($y) && list($e, $y) = explode(' ', trim($e));\r\n '+' == $e && $ans = bcadd($x, $y);\r\n '-' == $e && $ans = bcsub($x, $y);\r\n '*' == $e && $ans = bcmul($x, $y);\r\n '/' == $e && $ans = bcdiv($x, $y);\r\n '%' == $e && $ans = bcmod($x, $y);\r\n\r\n return $ans;\r\n}\r\n"}, {"source_code": "= 2;) {\r\n 0 == bc('$n % 2') ? $n = bc('$n / 2') : $flg = true;\r\n }\r\n echo ($flg ? 'YES' : 'NO').PHP_EOL;\r\n}\r\n\r\nfunction bc($str)\r\n{\r\n $ar = explode(' ', trim($str));\r\n $x = '$' === $ar[0][0] ? $GLOBALS[substr($ar[0], 1)] : $ar[0];\r\n $e1 = $ar[1];\r\n $y = '$' === $ar[2][0] ? $GLOBALS[substr($ar[2], 1)] : $ar[2];\r\n if (isset($ar[3])) {\r\n $e2 = $ar[3];\r\n $z = '$' === $ar[4][0] ? $GLOBALS[substr($ar[4], 1)] : $ar[4];\r\n\r\n return bc2($x, $e1, $y, $e2, $z);\r\n } else {\r\n return bc1($x, $e1, $y);\r\n }\r\n}\r\nfunction bc2($x, $e1, $y = null, $e2, $z = null)\r\n{\r\n if (in_array($e1, ['++', '--'], true)) {\r\n ('++' === $e1 || '--' === $e1) && $e1 = $e1[0];\r\n $ans = bc1(bc1($x, $e1, $y), $e2, $z);\r\n } elseif (in_array($e2, ['*', '/', '%', '++', '--'], true)) {\r\n ('++' === $e2 || '--' === $e2) && $e2 = $e2[0];\r\n $ans = bc1($x, $e1, bc1($y, $e2, $z));\r\n } else {\r\n $ans = bc1(bc1($x, $e1, $y), $e2, $z);\r\n }\r\n\r\n return $ans;\r\n}\r\nfunction bc1($x, $e, $y = null)\r\n{\r\n is_null($y) && list($e, $y) = explode(' ', trim($e));\r\n '+' == $e && $ans = bcadd($x, $y);\r\n '-' == $e && $ans = bcsub($x, $y);\r\n '*' == $e && $ans = bcmul($x, $y);\r\n '/' == $e && $ans = bcdiv($x, $y);\r\n '%' == $e && $ans = bcmod($x, $y);\r\n\r\n return $ans;\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 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": ""}], "negative_code": [{"source_code": "= 2;) {\r\n 0 == $n % 2 ? $n /= 2 : $flg = true;\r\n }\r\n echo ($flg ? 'YES' : 'NO').PHP_EOL;\r\n}\r\n"}, {"source_code": ""}, {"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 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 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?>"}], "src_uid": "f4958b4833cafa46fa71357ab1ae41af"} {"source_code": "data = $data;\n $this->next = null;\n }\n}\nclass Queue\n{\n protected $head;\n protected $trail;\n protected $num;\n public function __construct()\n {\n $this->num = 0;\n $this->head = null;\n $this->trail = null;\n }\n public function push($data)\n {\n $this->num++;\n if ($this->head == null) {\n $this->head = $this->trail = new QueStruct($data);\n } else {\n $this->trail->next = new QueStruct($data);\n $this->trail = $this->trail->next;\n }\n }\n public function front()\n {\n return $this->head->data;\n }\n public function pop()\n {\n $this->num--;\n $p = &$this->head;\n $this->head = $this->head->next;\n if ($this->num == 0) {\n $this->trail = $this->head = null;\n }\n\n unset($p);\n }\n public function size()\n {\n return $this->num;\n }\n public function isEmpty()\n {\n if ($this->num == 0) {\n return true;\n }\n return false;\n }\n}\nfscanf(STDIN, \"%d %d %d\", $n, $m, $k);\n$friends_num = array();\n$count_num = array();\n$person_node = array();\n$edge_x = array();\n$edge_y = array();\nfor ($i = 0; $i <= $n; $i++) {\n $friends_num[$i] = 0;\n $count_num[$i] = 0;\n}\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, \"%d %d\", $id_x, $id_y);\n $edge_x[$i] = $id_x;\n $edge_y[$i] = $id_y;\n if (!isset($person_node[$id_x])) {\n $person_node[$id_x] = array();\n }\n if (!isset($person_node[$id_y])) {\n $person_node[$id_y] = array();\n }\n array_push($person_node[$id_x], $id_y);//\u5b58\u50a8\u65e0\u5411\u8fb9\n array_push($person_node[$id_y], $id_x);\n $friends_num[$id_x]++;//\u7edf\u8ba1\u8282\u70b9\u7684\u5ea6\n $friends_num[$id_y]++;\n $count_num[$id_x]++;//\u548c\u4e0a\u9762\u4e00\u6837\uff0c\u8fd9\u4e2a\u4f5c\u7528\u662f\u65b9\u4fbf\u77e5\u9053\u5f53\u524d\u70b9\u8fde\u7684\u8fb9\u7684\uff0c\u4e0d\u7528\u518d\u6bcf\u6b21\u53bbcount\n $count_num[$id_y]++;\n}\n//$suitable_id = array();\n$flag = array();//\u6807\u8bb0\u70b9\u662f\u5426\u5728\u7b26\u5408\u8981\u6c42\n$que = new queue();\nfor ($i = 1; $i <= $n; $i++) {\n if ($friends_num[$i] < $k) {\n $que->push($i);\n $flag[$i] = true;\n }\n}//\u5c06\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u52a0\u5165\u961f\u5217\uff0c\u5e76\u6807\u8bb0\nwhile (!$que->isEmpty()) {\n $id = $que->front();\n $que->pop();\n for ($i = 0; $i < $count_num[$id]; $i++) {\n $s_id = $person_node[$id][$i];\n $friends_num[$s_id]--;\n if ($friends_num[$s_id] < $k && !isset($flag[$s_id])) {\n $flag[$s_id] = true;\n $que->push($s_id);\n }\n }\n}//\u6709\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u53bb\u66f4\u65b0\u5176\u5b83\u70b9\n$answer = array();//\u7ed3\u679c\u6570\u7ec4\n$n_cnt = count($flag);//\u7edf\u8ba1\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\n$answer[$m - 1] = $n - $n_cnt;\nfor ($i = $m - 1; $i >= 1; $i--) {\n $person_x = $edge_x[$i];\n $person_y = $edge_y[$i];\n //echo $person_x . \" \".$person_y.\"\\n\";\n if ($friends_num[$person_y] < $friends_num[$person_x]||isset($flag[$person_y])) {\n $person_x ^= $person_y;\n $person_y ^= $person_x;\n $person_x ^= $person_y;\n }//\u5c06\u5ea6\u5c0f\u7684\u4ea4\u6362\u5230\u524d\u9762\n //echo $person_x . \" \".$person_y .\"\\n\";\n //\u5f53\u524d\u8fb9\u53bb\u6389\uff0c\u4e24\u4e2a\u70b9\u51cf\u5ea6\uff08\u5047\u8bbe\u5f53\u524d\u4e24\u70b9\u90fd\u7b26\u5408\u8981\u6c42\uff09\n if (isset($flag[$person_x])) {//\u5ea6\u6570\u5c0f\u7684\u70b9\u5728\u8fde\u8fd9\u8fb9\u4e4b\u540e\u4e5f\u4e0d\u4f1a\u7b26\u5408\u8981\u6c42\uff0c\u90a3\u4e48\u8fd9\u6761\u8fb9\u4e0d\u4f1a\u5f71\u54cd\u7b2c\u4e8c\u4e2a\u70b9\uff0c\u6240\u4ee5\u52a0\u4e0a\u5ea6\u6570\uff0c\u800c\u7b2c\u4e00\u4e2a\u70b9\u5df2\u7ecf\u4e0d\u5408\u8981\u6c42\uff0c\u6240\u4ee5\u5ea6\u6570\u51cf\u53bb\u65e0\u5f71\u54cd\n } else {//\u7b2c\u4e00\u4e2a\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u524d\u7b26\u5408\u8981\u6c42\uff0c\u51cf\u53bb\u540e\u4e0d\u7b26\u5408\n if ($friends_num[$person_x] <= $k) {\n $flag[$person_x] = true;\n $que->push($person_x);\n $n_cnt++;\n //\u5728\u540e\u9762\u7684\u961f\u5217\u4e2d\u4f1a\u51cf\uff0c\u6240\u4ee5\u8fd9\u91cc\u52a0\u4e0a\uff0c\u5426\u5219\u4f1a\u591a\u51cf\n } else {//\u4e24\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u540e\u90fd\u7b26\u5408\u8981\u6c42\uff0c\u5c06\u5f53\u524d\u8fb9\u4ece\u5b58\u50a8\u7684\u8fb9\u4e2d\u79fb\u9664\uff0c\u56e0\u4e3a\u662f\u4ece\u540e\u5f80\u524d\uff0c\u6240\u4ee5\u662f\u987a\u5e8f\u7684\u51cf\u8fb9\u8fd9\u5757\u590d\u6742\u5ea6O(m)\n $friends_num[$person_x]--;\n $friends_num[$person_y]--;\n while ($count_num[$person_x]) {\n if ($person_node[$person_x][$count_num[$person_x]-1] != $person_y) {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n } else {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n break;\n }\n }\n while ($count_num[$person_y]) {\n //var_dump($count_num[$person_y]);\n if ($person_node[$person_y][$count_num[$person_y]-1] != $person_x) {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n }else {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n break;\n }\n }\n }\n }\n while (!$que->isEmpty()) {\n $id = $que->front();\n // var_dump($id);\n $que->pop();\n for ($j = 0; $j < $count_num[$id]; $j++) {\n $s_id = $person_node[$id][$j];\n $friends_num[$s_id]--;\n if (!isset($flag[$s_id]) && $friends_num[$s_id] < $k) {\n $que->push($s_id);\n $flag[$s_id] = true;\n $n_cnt++;\n }\n }\n }\n $answer[$i - 1] = $n - $n_cnt;\n}\nfor ($i = 0; $i < $m; $i++) {\n echo $answer[$i] . \"\\n\";\n}", "positive_code": [{"source_code": "data = $data;\n $this->next = null;\n }\n}\nclass Queue\n{\n protected $head;\n protected $trail;\n protected $num;\n public function __construct()\n {\n $this->num = 0;\n $this->head = null;\n $this->trail = null;\n }\n public function push($data)\n {\n $this->num++;\n if ($this->head == null) {\n $this->head = $this->trail = new QueStruct($data);\n } else {\n $this->trail->next = new QueStruct($data);\n $this->trail = $this->trail->next;\n }\n }\n public function front()\n {\n return $this->head->data;\n }\n public function pop()\n {\n $this->num--;\n $p = &$this->head;\n $this->head = $this->head->next;\n if ($this->num == 0) {\n $this->trail = $this->head = null;\n }\n\n unset($p);\n }\n public function size()\n {\n return $this->num;\n }\n public function isEmpty()\n {\n if ($this->num == 0) {\n return true;\n }\n\n return false;\n }\n}\nfscanf(STDIN, \"%d %d %d\", $n, $m, $k);\n$friends_num = array();\n$count_num = array();\n$person_node = array();\n$edge_x = array();\n$edge_y = array();\nfor ($i = 0; $i <= $n; $i++) {\n $friends_num[$i] = 0;\n $count_num[$i] = 0;\n}\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, \"%d %d\", $id_x, $id_y);\n $edge_x[$i] = $id_x;\n $edge_y[$i] = $id_y;\n if (!isset($person_node[$id_x])) {\n $person_node[$id_x] = array();\n }\n if (!isset($person_node[$id_y])) {\n $person_node[$id_y] = array();\n }\n array_push($person_node[$id_x], $id_y);\n array_push($person_node[$id_y], $id_x);\n $friends_num[$id_x]++;\n $friends_num[$id_y]++;\n $count_num[$id_x]++;\n $count_num[$id_y]++;\n}\n$suitable_id = array();\n$flag = array();\n$que = new queue();\nfor ($i = 1; $i <= $n; $i++) {\n if ($friends_num[$i] < $k) {\n $que->push($i);\n $flag[$i] = true;\n }\n}\nwhile (!$que->isEmpty()) {\n $id = $que->front();\n $que->pop();\n for ($i = 0; $i < $count_num[$id]; $i++) {\n $s_id = $person_node[$id][$i];\n $friends_num[$s_id]--;\n if ($friends_num[$s_id] < $k && !isset($flag[$s_id])) {\n $flag[$s_id] = true;\n $que->push($s_id);\n }\n }\n}\n$answer = array();\n$n_cnt = count($flag);\n$answer[$m - 1] = $n - $n_cnt;\nfor ($i = $m - 1; $i >= 1; $i--) {\n $person_x = $edge_x[$i];\n $person_y = $edge_y[$i];\n //echo $person_x . \" \".$person_y.\"\\n\";\n if ($friends_num[$person_y] < $friends_num[$person_x]) {\n $person_x ^= $person_y;\n $person_y ^= $person_x;\n $person_x ^= $person_y;\n }\n //echo $person_x . \" \".$person_y .\"\\n\";\n $friends_num[$person_x]--;\n $friends_num[$person_y]--;\n if (isset($flag[$person_x])) {\n $friends_num[$person_y]++;\n } else {\n if ($friends_num[$person_x] < $k) {\n $flag[$person_x] = true;\n $que->push($person_x);\n $n_cnt++;\n $friends_num[$person_y]++;\n } else {\n while ($count_num[$person_x]) {\n if ($person_node[$person_x][$count_num[$person_x]-1] != $person_y) {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n } else {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n break;\n }\n }\n while ($count_num[$person_y]) {\n //var_dump($count_num[$person_y]);\n if ($person_node[$person_y][$count_num[$person_y]-1] != $person_x) {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n }else {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n break;\n }\n }\n }\n }\n while (!$que->isEmpty()) {\n $id = $que->front();\n // var_dump($id);\n $que->pop();\n for ($j = 0; $j < $count_num[$id]; $j++) {\n $s_id = $person_node[$id][$j];\n $friends_num[$s_id]--;\n if (!isset($flag[$s_id]) && $friends_num[$s_id] < $k) {\n $que->push($s_id);\n $flag[$s_id] = true;\n $n_cnt++;\n }\n }\n }\n //echo $i . \" \".$friends_num[4] . \"\\n\";\n $answer[$i - 1] = $n - $n_cnt;\n}\nfor ($i = 0; $i < $m; $i++) {\n echo $answer[$i] . \"\\n\";\n}"}, {"source_code": "data = $data;\n $this->next = null;\n }\n}\nclass Queue\n{\n protected $head;\n protected $trail;\n protected $num;\n public function __construct()\n {\n $this->num = 0;\n $this->head = null;\n $this->trail = null;\n }\n public function push($data)\n {\n $this->num++;\n if ($this->head == null) {\n $this->head = $this->trail = new QueStruct($data);\n } else {\n $this->trail->next = new QueStruct($data);\n $this->trail = $this->trail->next;\n }\n }\n public function front()\n {\n return $this->head->data;\n }\n public function pop()\n {\n $this->num--;\n $p = &$this->head;\n $this->head = $this->head->next;\n if ($this->num == 0) {\n $this->trail = $this->head = null;\n }\n\n unset($p);\n }\n public function size()\n {\n return $this->num;\n }\n public function isEmpty()\n {\n if ($this->num == 0) {\n return true;\n }\n return false;\n }\n}\nfscanf(STDIN, \"%d %d %d\", $n, $m, $k);\n$friends_num = array();\n$count_num = array();\n$person_node = array();\n$edge_x = array();\n$edge_y = array();\nfor ($i = 0; $i <= $n; $i++) {\n $friends_num[$i] = 0;\n $count_num[$i] = 0;\n}\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, \"%d %d\", $id_x, $id_y);\n $edge_x[$i] = $id_x;\n $edge_y[$i] = $id_y;\n if (!isset($person_node[$id_x])) {\n $person_node[$id_x] = array();\n }\n if (!isset($person_node[$id_y])) {\n $person_node[$id_y] = array();\n }\n array_push($person_node[$id_x], $id_y);//\u5b58\u50a8\u65e0\u5411\u8fb9\n array_push($person_node[$id_y], $id_x);\n $friends_num[$id_x]++;//\u7edf\u8ba1\u8282\u70b9\u7684\u5ea6\n $friends_num[$id_y]++;\n $count_num[$id_x]++;//\u548c\u4e0a\u9762\u4e00\u6837\uff0c\u8fd9\u4e2a\u4f5c\u7528\u662f\u65b9\u4fbf\u77e5\u9053\u5f53\u524d\u70b9\u8fde\u7684\u8fb9\u7684\uff0c\u4e0d\u7528\u518d\u6bcf\u6b21\u53bbcount\n $count_num[$id_y]++;\n}\n//$suitable_id = array();\n$flag = array();//\u6807\u8bb0\u70b9\u662f\u5426\u5728\u7b26\u5408\u8981\u6c42\n$que = new queue();\nfor ($i = 1; $i <= $n; $i++) {\n if ($friends_num[$i] < $k) {\n $que->push($i);\n $flag[$i] = true;\n }\n}//\u5c06\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u52a0\u5165\u961f\u5217\uff0c\u5e76\u6807\u8bb0\nwhile (!$que->isEmpty()) {\n $id = $que->front();\n $que->pop();\n for ($i = 0; $i < $count_num[$id]; $i++) {\n $s_id = $person_node[$id][$i];\n $friends_num[$s_id]--;\n if ($friends_num[$s_id] < $k && !isset($flag[$s_id])) {\n $flag[$s_id] = true;\n $que->push($s_id);\n }\n }\n}//\u6709\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u53bb\u66f4\u65b0\u5176\u5b83\u70b9\n$answer = array();//\u7ed3\u679c\u6570\u7ec4\n$n_cnt = count($flag);//\u7edf\u8ba1\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\n$answer[$m - 1] = $n - $n_cnt;\nfor ($i = $m - 1; $i >= 1; $i--) {\n $person_x = $edge_x[$i];\n $person_y = $edge_y[$i];\n //echo $person_x . \" \".$person_y.\"\\n\";\n if ($friends_num[$person_y] < $friends_num[$person_x]||isset($flag[$person_y])) {\n $person_x ^= $person_y;\n $person_y ^= $person_x;\n $person_x ^= $person_y;\n }//\u5c06\u5ea6\u5c0f\u7684\u4ea4\u6362\u5230\u524d\u9762\n //echo $person_x . \" \".$person_y .\"\\n\";\n $friends_num[$person_x]--;\n $friends_num[$person_y]--;//\u5f53\u524d\u8fb9\u53bb\u6389\uff0c\u4e24\u4e2a\u70b9\u51cf\u5ea6\uff08\u5047\u8bbe\u5f53\u524d\u4e24\u70b9\u90fd\u7b26\u5408\u8981\u6c42\uff09\n if (isset($flag[$person_x])) {//\u5ea6\u6570\u5c0f\u7684\u70b9\u5728\u8fde\u8fd9\u8fb9\u4e4b\u540e\u4e5f\u4e0d\u4f1a\u7b26\u5408\u8981\u6c42\uff0c\u90a3\u4e48\u8fd9\u6761\u8fb9\u4e0d\u4f1a\u5f71\u54cd\u7b2c\u4e8c\u4e2a\u70b9\uff0c\u6240\u4ee5\u52a0\u4e0a\u5ea6\u6570\uff0c\u800c\u7b2c\u4e00\u4e2a\u70b9\u5df2\u7ecf\u4e0d\u5408\u8981\u6c42\uff0c\u6240\u4ee5\u5ea6\u6570\u51cf\u53bb\u65e0\u5f71\u54cd\n $friends_num[$person_y]++;\n $friends_num[$person_x]++;\n } else {//\u7b2c\u4e00\u4e2a\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u524d\u7b26\u5408\u8981\u6c42\uff0c\u51cf\u53bb\u540e\u4e0d\u7b26\u5408\n if ($friends_num[$person_x] < $k) {\n $flag[$person_x] = true;\n $que->push($person_x);\n $n_cnt++;\n $friends_num[$person_x]++;\n $friends_num[$person_y]++;//\u5728\u540e\u9762\u7684\u961f\u5217\u4e2d\u4f1a\u51cf\uff0c\u6240\u4ee5\u8fd9\u91cc\u52a0\u4e0a\uff0c\u5426\u5219\u4f1a\u591a\u51cf\n } else {//\u4e24\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u540e\u90fd\u7b26\u5408\u8981\u6c42\uff0c\u5c06\u5f53\u524d\u8fb9\u4ece\u5b58\u50a8\u7684\u8fb9\u4e2d\u79fb\u9664\uff0c\u56e0\u4e3a\u662f\u4ece\u540e\u5f80\u524d\uff0c\u6240\u4ee5\u662f\u987a\u5e8f\u7684\u51cf\u8fb9\u8fd9\u5757\u590d\u6742\u5ea6O(m)\n while ($count_num[$person_x]) {\n if ($person_node[$person_x][$count_num[$person_x]-1] != $person_y) {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n } else {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n break;\n }\n }\n while ($count_num[$person_y]) {\n //var_dump($count_num[$person_y]);\n if ($person_node[$person_y][$count_num[$person_y]-1] != $person_x) {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n }else {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n break;\n }\n }\n }\n }\n while (!$que->isEmpty()) {\n $id = $que->front();\n // var_dump($id);\n $que->pop();\n for ($j = 0; $j < $count_num[$id]; $j++) {\n $s_id = $person_node[$id][$j];\n $friends_num[$s_id]--;\n if (!isset($flag[$s_id]) && $friends_num[$s_id] < $k) {\n $que->push($s_id);\n $flag[$s_id] = true;\n $n_cnt++;\n }\n }\n }\n $answer[$i - 1] = $n - $n_cnt;\n}\nfor ($i = 0; $i < $m; $i++) {\n echo $answer[$i] . \"\\n\";\n}"}, {"source_code": "data = $data;\n $this->next = null;\n }\n}\nclass Queue\n{\n protected $head;\n protected $trail;\n protected $num;\n public function __construct()\n {\n $this->num = 0;\n $this->head = null;\n $this->trail = null;\n }\n public function push($data)\n {\n $this->num++;\n if ($this->head == null) {\n $this->head = $this->trail = new QueStruct($data);\n } else {\n $this->trail->next = new QueStruct($data);\n $this->trail = $this->trail->next;\n }\n }\n public function front()\n {\n return $this->head->data;\n }\n public function pop()\n {\n $this->num--;\n $p = &$this->head;\n $this->head = $this->head->next;\n if ($this->num == 0) {\n $this->trail = $this->head = null;\n }\n\n unset($p);\n }\n public function size()\n {\n return $this->num;\n }\n public function isEmpty()\n {\n if ($this->num == 0) {\n return true;\n }\n\n return false;\n }\n}\nfscanf(STDIN, \"%d %d %d\", $n, $m, $k);\n$friends_num = array();\n$count_num = array();\n$person_node = array();\n$edge_x = array();\n$edge_y = array();\nfor ($i = 0; $i <= $n; $i++) {\n $friends_num[$i] = 0;\n $count_num[$i] = 0;\n}\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, \"%d %d\", $id_x, $id_y);\n $edge_x[$i] = $id_x;\n $edge_y[$i] = $id_y;\n if (!isset($person_node[$id_x])) {\n $person_node[$id_x] = array();\n }\n if (!isset($person_node[$id_y])) {\n $person_node[$id_y] = array();\n }\n array_push($person_node[$id_x], $id_y);\n array_push($person_node[$id_y], $id_x);\n $friends_num[$id_x]++;\n $friends_num[$id_y]++;\n $count_num[$id_x]++;\n $count_num[$id_y]++;\n}\n$suitable_id = array();\n$flag = array();\n$que = new queue();\nfor ($i = 1; $i <= $n; $i++) {\n if ($friends_num[$i] < $k) {\n $que->push($i);\n $flag[$i] = true;\n }\n}\nwhile (!$que->isEmpty()) {\n $id = $que->front();\n $que->pop();\n for ($i = 0; $i < $count_num[$id]; $i++) {\n $s_id = $person_node[$id][$i];\n if (!isset($flag[$s_id])) {\n $friends_num[$s_id]--;\n }\n if ($friends_num[$s_id] < $k && !isset($flag[$s_id])) {\n $flag[$s_id] = true;\n $que->push($s_id);\n }\n }\n}\n$answer = array();\n$n_cnt = count($flag);\n$answer[$m - 1] = $n - $n_cnt;\nfor ($i = $m - 1; $i >= 1; $i--) {\n $person_x = $edge_x[$i];\n $person_y = $edge_y[$i];\n //echo $person_x . \" \".$person_y.\"\\n\";\n if ($friends_num[$person_y] < $friends_num[$person_x]) {\n $person_x ^= $person_y;\n $person_y ^= $person_x;\n $person_x ^= $person_y;\n }\n //echo $person_x . \" \".$person_y .\"\\n\";\n $friends_num[$person_x]--;\n $friends_num[$person_y]--;\n if (isset($flag[$person_x])) {\n $friends_num[$person_y]++;\n $friends_num[$person_x]++;\n } else {\n if ($friends_num[$person_x] < $k) {\n $flag[$person_x] = true;\n $que->push($person_x);\n $n_cnt++;\n $friends_num[$person_y]++;\n } else {\n while ($count_num[$person_x]) {\n if ($person_node[$person_x][$count_num[$person_x] - 1] != $person_y) {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n } else {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n break;\n }\n }\n while ($count_num[$person_y]) {\n //var_dump($count_num[$person_y]);\n if ($person_node[$person_y][$count_num[$person_y] - 1] != $person_x) {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n } else {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n break;\n }\n }\n }\n }\n while (!$que->isEmpty()) {\n $id = $que->front();\n // var_dump($id);\n $que->pop();\n for ($j = 0; $j < $count_num[$id]; $j++) {\n $s_id = $person_node[$id][$j];\n if (!isset($flag[$s_id])) {\n $friends_num[$s_id]--;\n }\n if (!isset($flag[$s_id]) && $friends_num[$s_id] < $k) {\n $que->push($s_id);\n $flag[$s_id] = true;\n $n_cnt++;\n }\n }\n }\n //echo $i . \" \".$friends_num[4] . \"\\n\";\n $answer[$i - 1] = $n - $n_cnt;\n}\nfor ($i = 0; $i < $m; $i++) {\n echo $answer[$i] . \"\\n\";\n}"}, {"source_code": "data = $data;\n $this->next = null;\n }\n}\nclass Queue\n{\n protected $head;\n protected $trail;\n protected $num;\n public function __construct()\n {\n $this->num = 0;\n $this->head = null;\n $this->trail = null;\n }\n public function push($data)\n {\n $this->num++;\n if ($this->head == null) {\n $this->head = $this->trail = new QueStruct($data);\n } else {\n $this->trail->next = new QueStruct($data);\n $this->trail = $this->trail->next;\n }\n }\n public function front()\n {\n return $this->head->data;\n }\n public function pop()\n {\n $this->num--;\n $p = &$this->head;\n $this->head = $this->head->next;\n if ($this->num == 0) {\n $this->trail = $this->head = null;\n }\n\n unset($p);\n }\n public function size()\n {\n return $this->num;\n }\n public function isEmpty()\n {\n if ($this->num == 0) {\n return true;\n }\n return false;\n }\n}\nfscanf(STDIN, \"%d %d %d\", $n, $m, $k);\n$friends_num = array();\n$count_num = array();\n$person_node = array();\n$edge_x = array();\n$edge_y = array();\nfor ($i = 0; $i <= $n; $i++) {\n $friends_num[$i] = 0;\n $count_num[$i] = 0;\n}\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, \"%d %d\", $id_x, $id_y);\n $edge_x[$i] = $id_x;\n $edge_y[$i] = $id_y;\n if (!isset($person_node[$id_x])) {\n $person_node[$id_x] = array();\n }\n if (!isset($person_node[$id_y])) {\n $person_node[$id_y] = array();\n }\n array_push($person_node[$id_x], $id_y);//\u5b58\u50a8\u65e0\u5411\u8fb9\n array_push($person_node[$id_y], $id_x);\n $friends_num[$id_x]++;//\u7edf\u8ba1\u8282\u70b9\u7684\u5ea6\n $friends_num[$id_y]++;\n $count_num[$id_x]++;//\u548c\u4e0a\u9762\u4e00\u6837\uff0c\u8fd9\u4e2a\u4f5c\u7528\u662f\u65b9\u4fbf\u77e5\u9053\u5f53\u524d\u70b9\u8fde\u7684\u8fb9\u7684\uff0c\u4e0d\u7528\u518d\u6bcf\u6b21\u53bbcount\n $count_num[$id_y]++;\n}\n//$suitable_id = array();\n$flag = array();//\u6807\u8bb0\u70b9\u662f\u5426\u5728\u7b26\u5408\u8981\u6c42\n$que = new queue();\nfor ($i = 1; $i <= $n; $i++) {\n if ($friends_num[$i] < $k) {\n $que->push($i);\n $flag[$i] = true;\n }\n}//\u5c06\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u52a0\u5165\u961f\u5217\uff0c\u5e76\u6807\u8bb0\nwhile (!$que->isEmpty()) {\n $id = $que->front();\n $que->pop();\n for ($i = 0; $i < $count_num[$id]; $i++) {\n $s_id = $person_node[$id][$i];\n $friends_num[$s_id]--;\n if ($friends_num[$s_id] < $k && !isset($flag[$s_id])) {\n $flag[$s_id] = true;\n $que->push($s_id);\n }\n }\n}//\u6709\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u53bb\u66f4\u65b0\u5176\u5b83\u70b9\n$answer = array();//\u7ed3\u679c\u6570\u7ec4\n$n_cnt = count($flag);//\u7edf\u8ba1\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\n$answer[$m - 1] = $n - $n_cnt;\nfor ($i = $m - 1; $i >= 1; $i--) {\n $person_x = $edge_x[$i];\n $person_y = $edge_y[$i];\n //echo $person_x . \" \".$person_y.\"\\n\";\n if ($friends_num[$person_y] < $friends_num[$person_x]) {\n $person_x ^= $person_y;\n $person_y ^= $person_x;\n $person_x ^= $person_y;\n }//\u5c06\u5ea6\u5c0f\u7684\u4ea4\u6362\u5230\u524d\u9762\n //echo $person_x . \" \".$person_y .\"\\n\";\n $friends_num[$person_x]--;\n $friends_num[$person_y]--;//\u5f53\u524d\u8fb9\u53bb\u6389\uff0c\u4e24\u4e2a\u70b9\u51cf\u5ea6\uff08\u5047\u8bbe\u5f53\u524d\u4e24\u70b9\u90fd\u7b26\u5408\u8981\u6c42\uff09\n if (isset($flag[$person_x])) {//\u5ea6\u6570\u5c0f\u7684\u70b9\u4e0d\u5728\u8fde\u8fd9\u8fb9\u4e4b\u540e\u4e5f\u4e0d\u4f1a\u7b26\u5408\u8981\u6c42\uff0c\u90a3\u4e48\u8fd9\u6761\u8fb9\u4e0d\u4f1a\u5f71\u54cd\u7b2c\u4e8c\u4e2a\u70b9\uff0c\u6240\u4ee5\u52a0\u4e0a\u5ea6\u6570\uff0c\u800c\u7b2c\u4e00\u4e2a\u70b9\u5df2\u7ecf\u4e0d\u5408\u8981\u6c42\uff0c\u6240\u4ee5\u5ea6\u6570\u51cf\u53bb\u65e0\u5f71\u54cd\n $friends_num[$person_y]++;\n } else {//\u7b2c\u4e00\u4e2a\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u524d\u7b26\u5408\u8981\u6c42\uff0c\u51cf\u53bb\u540e\u4e0d\u7b26\u5408\n if ($friends_num[$person_x] < $k) {\n $flag[$person_x] = true;\n $que->push($person_x);\n $n_cnt++;\n $friends_num[$person_y]++;//\u5728\u540e\u9762\u7684\u961f\u5217\u4e2d\u4f1a\u51cf\uff0c\u6240\u4ee5\u8fd9\u91cc\u52a0\u4e0a\uff0c\u5426\u5219\u4f1a\u591a\u51cf\n } else {//\u4e24\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u540e\u90fd\u7b26\u5408\u8981\u6c42\uff0c\u5c06\u5f53\u524d\u8fb9\u4ece\u5b58\u50a8\u7684\u8fb9\u4e2d\u79fb\u9664\uff0c\u56e0\u4e3a\u662f\u4ece\u540e\u5f80\u524d\uff0c\u6240\u4ee5\u662f\u987a\u5e8f\u7684\u51cf\u8fb9\u8fd9\u5757\u590d\u6742\u5ea6O(m)\n while ($count_num[$person_x]) {\n if ($person_node[$person_x][$count_num[$person_x]-1] != $person_y) {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n } else {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n break;\n }\n }\n while ($count_num[$person_y]) {\n //var_dump($count_num[$person_y]);\n if ($person_node[$person_y][$count_num[$person_y]-1] != $person_x) {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n }else {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n break;\n }\n }\n }\n }\n while (!$que->isEmpty()) {\n $id = $que->front();\n // var_dump($id);\n $que->pop();\n for ($j = 0; $j < $count_num[$id]; $j++) {\n $s_id = $person_node[$id][$j];\n $friends_num[$s_id]--;\n if (!isset($flag[$s_id]) && $friends_num[$s_id] < $k) {\n $que->push($s_id);\n $flag[$s_id] = true;\n $n_cnt++;\n }\n }\n }\n $answer[$i - 1] = $n - $n_cnt;\n}\nfor ($i = 0; $i < $m; $i++) {\n echo $answer[$i] . \"\\n\";\n}"}], "negative_code": [{"source_code": "class QueStruct\n{\n public $data;\n public $next;\n public function __construct($data)\n {\n $this->data = $data;\n $this->next = null;\n }\n}\nclass Queue\n{\n protected $head;\n protected $trail;\n protected $num;\n public function __construct()\n {\n $this->num = 0;\n $this->head = null;\n $this->trail = null;\n }\n public function push($data)\n {\n $this->num++;\n if ($this->head == null) {\n $this->head = $this->trail = new QueStruct($data);\n } else {\n $this->trail->next = new QueStruct($data);\n $this->trail = $this->trail->next;\n }\n }\n public function front()\n {\n return $this->head->data;\n }\n public function pop()\n {\n $this->num--;\n $p = &$this->head;\n $this->head = $this->head->next;\n if ($this->num == 0) {\n $this->trail = $this->head = null;\n }\n\n unset($p);\n }\n public function size()\n {\n return $this->num;\n }\n public function isEmpty()\n {\n if ($this->num == 0) {\n return true;\n }\n\n return false;\n }\n}\nfscanf(STDIN, \"%d %d %d\", $n, $m, $k);\n$friends_num = array();\n$count_num = array();\n$person_node = array();\n$edge_x = array();\n$edge_y = array();\nfor ($i = 0; $i <= $n; $i++) {\n $friends_num[$i] = 0;\n $count_num[$i] = 0;\n}\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, \"%d %d\", $id_x, $id_y);\n $edge_x[$i] = $id_x;\n $edge_y[$i] = $id_y;\n if (!isset($person_node[$id_x])) {\n $person_node[$id_x] = array();\n }\n if (!isset($person_node[$id_y])) {\n $person_node[$id_y] = array();\n }\n array_push($person_node[$id_x], $id_y);\n array_push($person_node[$id_y], $id_x);\n $friends_num[$id_x]++;\n $friends_num[$id_y]++;\n $count_num[$id_x]++;\n $count_num[$id_y]++;\n}\n$suitable_id = array();\n$flag = array();\n$que = new queue();\nfor ($i = 1; $i <= $n; $i++) {\n if ($friends_num[$i] < $k) {\n $que->push($i);\n $flag[$i] = true;\n }\n}\nwhile (!$que->isEmpty()) {\n $id = $que->front();\n $que->pop();\n $num = count($person_node[$id]);\n for ($i = 0; $i < $num; $i++) {\n $s_id = $person_node[$id][$i];\n $friends_num[$s_id]--;\n if ($friends_num[$s_id] < $k && !issest($flag[$s_id])) {\n $flag[$s_id] = true;\n $que->push($s_id);\n }\n }\n}\n$answer = array();\n$n_cnt = count($flag);\n$answer[$m - 1] = $n - $n_cnt;\nfor ($i = $m - 1; $i >= 1; $i--) {\n $person_x = $edge_x[$i];\n $person_y = $edge_y[$i];\n //echo $person_x . \" \".$person_y.\"\\n\";\n if ($friends_num[$person_y] < $friends_num[$person_x]) {\n $person_x ^= $person_y;\n $person_y ^= $person_x;\n $person_x ^= $person_y;\n }\n //echo $person_x . \" \".$person_y .\"\\n\";\n $friends_num[$person_x]--;\n $friends_num[$person_y]--;\n if (isset($flag[$person_x])) {\n $friends_num[$person_y]++;\n } else {\n if ($friends_num[$person_x] < $k) {\n $flag[$person_x] = true;\n $que->push($person_x);\n $n_cnt++;\n $friends_num[$person_y]++;\n } else {\n while ($count_num[$person_x]) {\n if ($person_node[$person_x][$count_num[$person_x]-1] != $person_y) {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n } else {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n break;\n }\n }\n while ($count_num[$person_y]) {\n //var_dump($count_num[$person_y]);\n if ($person_node[$person_y][$count_num[$person_y]-1] != $person_x) {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n }else {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n break;\n }\n }\n }\n }\n while (!$que->isEmpty()) {\n $id = $que->front();\n // var_dump($id);\n $que->pop();\n $num = count($person_node[$id]);\n for ($j = 0; $j < $num; $j++) {\n $s_id = $person_node[$id][$j];\n $friends_num[$s_id]--;\n if (!isset($flag[$s_id]) && $friends_num[$s_id] < $k) {\n $que->push($s_id);\n $flag[$s_id] = true;\n $n_cnt++;\n }\n }\n }\n //echo $i . \" \".$friends_num[4] . \"\\n\";\n $answer[$i - 1] = $n - $n_cnt;\n}\nfor ($i = 0; $i < $m; $i++) {\n echo $answer[$i] . \"\\n\";\n}\n/*4 4 2\n2 3\n1 2\n1 3\n1 4*/\n"}, {"source_code": "data = $data;\n $this->next = null;\n }\n}\nclass Queue\n{\n protected $head;\n protected $trail;\n protected $num;\n public function __construct()\n {\n $this->num = 0;\n $this->head = null;\n $this->trail = null;\n }\n public function push($data)\n {\n $this->num++;\n if ($this->head == null) {\n $this->head = $this->trail = new QueStruct($data);\n } else {\n $this->trail->next = new QueStruct($data);\n $this->trail = $this->trail->next;\n }\n }\n public function front()\n {\n return $this->head->data;\n }\n public function pop()\n {\n $this->num--;\n $p = &$this->head;\n $this->head = $this->head->next;\n if ($this->num == 0) {\n $this->trail = $this->head = null;\n }\n\n unset($p);\n }\n public function size()\n {\n return $this->num;\n }\n public function isEmpty()\n {\n if ($this->num == 0) {\n return true;\n }\n return false;\n }\n}\nfscanf(STDIN, \"%d %d %d\", $n, $m, $k);\n$friends_num = array();\n$count_num = array();\n$person_node = array();\n$edge_x = array();\n$edge_y = array();\nfor ($i = 0; $i <= $n; $i++) {\n $friends_num[$i] = 0;\n $count_num[$i] = 0;\n}\nfor ($i = 0; $i < $m; $i++) {\n fscanf(STDIN, \"%d %d\", $id_x, $id_y);\n $edge_x[$i] = $id_x;\n $edge_y[$i] = $id_y;\n if (!isset($person_node[$id_x])) {\n $person_node[$id_x] = array();\n }\n if (!isset($person_node[$id_y])) {\n $person_node[$id_y] = array();\n }\n array_push($person_node[$id_x], $id_y);//\u5b58\u50a8\u65e0\u5411\u8fb9\n array_push($person_node[$id_y], $id_x);\n $friends_num[$id_x]++;//\u7edf\u8ba1\u8282\u70b9\u7684\u5ea6\n $friends_num[$id_y]++;\n $count_num[$id_x]++;//\u548c\u4e0a\u9762\u4e00\u6837\uff0c\u8fd9\u4e2a\u4f5c\u7528\u662f\u65b9\u4fbf\u77e5\u9053\u5f53\u524d\u70b9\u8fde\u7684\u8fb9\u7684\uff0c\u4e0d\u7528\u518d\u6bcf\u6b21\u53bbcount\n $count_num[$id_y]++;\n}\n//$suitable_id = array();\n$flag = array();//\u6807\u8bb0\u70b9\u662f\u5426\u5728\u7b26\u5408\u8981\u6c42\n$que = new queue();\nfor ($i = 1; $i <= $n; $i++) {\n if ($friends_num[$i] < $k) {\n $que->push($i);\n $flag[$i] = true;\n }\n}//\u5c06\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u52a0\u5165\u961f\u5217\uff0c\u5e76\u6807\u8bb0\nwhile (!$que->isEmpty()) {\n $id = $que->front();\n $que->pop();\n for ($i = 0; $i < $count_num[$id]; $i++) {\n $s_id = $person_node[$id][$i];\n $friends_num[$s_id]--;\n if ($friends_num[$s_id] < $k && !isset($flag[$s_id])) {\n $flag[$s_id] = true;\n $que->push($s_id);\n }\n }\n}//\u6709\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\u53bb\u66f4\u65b0\u5176\u5b83\u70b9\n$answer = array();//\u7ed3\u679c\u6570\u7ec4\n$n_cnt = count($flag);//\u7edf\u8ba1\u4e0d\u7b26\u5408\u8981\u6c42\u7684\u70b9\n$answer[$m - 1] = $n - $n_cnt;\nfor ($i = $m - 1; $i >= 1; $i--) {\n $person_x = $edge_x[$i];\n $person_y = $edge_y[$i];\n //echo $person_x . \" \".$person_y.\"\\n\";\n if ($friends_num[$person_y] < $friends_num[$person_x]) {\n $person_x ^= $person_y;\n $person_y ^= $person_x;\n $person_x ^= $person_y;\n }//\u5c06\u5ea6\u5c0f\u7684\u4ea4\u6362\u5230\u524d\u9762\n //echo $person_x . \" \".$person_y .\"\\n\";\n $friends_num[$person_x]--;\n $friends_num[$person_y]--;//\u5f53\u524d\u8fb9\u53bb\u6389\uff0c\u4e24\u4e2a\u70b9\u51cf\u5ea6\uff08\u5047\u8bbe\u5f53\u524d\u4e24\u70b9\u90fd\u7b26\u5408\u8981\u6c42\uff09\n if (isset($flag[$person_x])) {//\u5ea6\u6570\u5c0f\u7684\u70b9\u5728\u8fde\u8fd9\u8fb9\u4e4b\u540e\u4e5f\u4e0d\u4f1a\u7b26\u5408\u8981\u6c42\uff0c\u90a3\u4e48\u8fd9\u6761\u8fb9\u4e0d\u4f1a\u5f71\u54cd\u7b2c\u4e8c\u4e2a\u70b9\uff0c\u6240\u4ee5\u52a0\u4e0a\u5ea6\u6570\uff0c\u800c\u7b2c\u4e00\u4e2a\u70b9\u5df2\u7ecf\u4e0d\u5408\u8981\u6c42\uff0c\u6240\u4ee5\u5ea6\u6570\u51cf\u53bb\u65e0\u5f71\u54cd\n $friends_num[$person_y]++;\n $friends_num[$person_x]++;\n } else {//\u7b2c\u4e00\u4e2a\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u524d\u7b26\u5408\u8981\u6c42\uff0c\u51cf\u53bb\u540e\u4e0d\u7b26\u5408\n if ($friends_num[$person_x] < $k) {\n $flag[$person_x] = true;\n $que->push($person_x);\n $n_cnt++;\n $friends_num[$person_x]++;\n $friends_num[$person_y]++;//\u5728\u540e\u9762\u7684\u961f\u5217\u4e2d\u4f1a\u51cf\uff0c\u6240\u4ee5\u8fd9\u91cc\u52a0\u4e0a\uff0c\u5426\u5219\u4f1a\u591a\u51cf\n } else {//\u4e24\u70b9\u5728\u53bb\u9664\u5f53\u524d\u8fb9\u540e\u90fd\u7b26\u5408\u8981\u6c42\uff0c\u5c06\u5f53\u524d\u8fb9\u4ece\u5b58\u50a8\u7684\u8fb9\u4e2d\u79fb\u9664\uff0c\u56e0\u4e3a\u662f\u4ece\u540e\u5f80\u524d\uff0c\u6240\u4ee5\u662f\u987a\u5e8f\u7684\u51cf\u8fb9\u8fd9\u5757\u590d\u6742\u5ea6O(m)\n while ($count_num[$person_x]) {\n if ($person_node[$person_x][$count_num[$person_x]-1] != $person_y) {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n } else {\n array_pop($person_node[$person_x]);\n $count_num[$person_x]--;\n break;\n }\n }\n while ($count_num[$person_y]) {\n //var_dump($count_num[$person_y]);\n if ($person_node[$person_y][$count_num[$person_y]-1] != $person_x) {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n }else {\n array_pop($person_node[$person_y]);\n $count_num[$person_y]--;\n break;\n }\n }\n }\n }\n while (!$que->isEmpty()) {\n $id = $que->front();\n // var_dump($id);\n $que->pop();\n for ($j = 0; $j < $count_num[$id]; $j++) {\n $s_id = $person_node[$id][$j];\n $friends_num[$s_id]--;\n if (!isset($flag[$s_id]) && $friends_num[$s_id] < $k) {\n $que->push($s_id);\n $flag[$s_id] = true;\n $n_cnt++;\n }\n }\n }\n $answer[$i - 1] = $n - $n_cnt;\n}\nfor ($i = 0; $i < $m; $i++) {\n echo $answer[$i] . \"\\n\";\n}\n"}], "src_uid": "d795e0f49617b1aa281c72f24a632f67"} {"source_code": " 0) {\n $arr = explode(\" \", trim($f));\n $s = $arr[0];\n $a = $arr[1];\n $b = $arr[2];\n $c = $arr[3];\n\n $ret = cal($s, $a, $b, $c);\n echo $ret . \"\\n\";\n\n $cnt--;\n if ($cnt == 0) {\n break;\n }\n } else {\n break;\n }\n}\n\nfunction cal($s, $a, $b, $c) {\n $d = bcmul($a, $c);\n $num = 0;\n\n $m = bcdiv($s, $d);\n $num = bcadd($num, $m);\n $num = bcadd($num, bcmul($m, $b));\n $left = $s - bcmul($m, $c);\n $num = bcadd($num, bcdiv($left, $c));\n\n return $num;\n}\n\n//1000000000 1\n//1000000000 1\n\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " 0) {\n $arr = explode(\" \", trim($f));\n $s = $arr[0];\n $a = $arr[1];\n $b = $arr[2];\n $c = $arr[3];\n\n $ret = cal($s, $a, $b, $c);\n echo $ret . \"\\n\";\n\n $cnt--;\n if ($cnt == 0) {\n break;\n }\n } else {\n break;\n }\n}\n\nfunction cal($s, $a, $b, $c) {\n $d = $a * $c;\n $num = 0;\n\n $m = floor($s / $d);\n $num += $m;\n $num += $m * $b;\n $left = $s - $m * $c;\n $num += floor($left / $c);\n\n return (string)$num;\n}\n\n//1000000000 1\n//1000000000 1\n\n"}, {"source_code": " 0) {\n $arr = explode(\" \", trim($f));\n $s = $arr[0];\n $a = $arr[1];\n $b = $arr[2];\n $c = $arr[3];\n\n $ret = cal($s, $a, $b, $c);\n echo $ret . \"\\n\";\n\n $cnt--;\n if ($cnt == 0) {\n break;\n }\n } else {\n break;\n }\n}\n\nfunction cal($s, $a, $b, $c) {\n $d = bcmul($a, $c);\n $num = 0;\n\n $m = bcdiv($s, $d);\n $num = bcadd($num, $m);\n echo $num . \"\\n\";\n $num = bcadd($num, bcmul($m, $b));\n echo $num . \"\\n\";\n $left = $s - bcmul($m, $c);\n $num = bcadd($num, bcdiv($left, $c));\n echo $num . \"\\n\";\n\n return (string)$num;\n}\n\n//1000000000 1\n//1000000000 1\n\n"}], "src_uid": "ec8060260a6c7f4ff3e6afc9fd248afc"} {"source_code": "$b){\n for($i=$a-1;$i>$b-1;$i--){\n \n if($company[$i]==$company[$i-1]){\n $minCost += 0;\n }else{\n $minCost +=abs($company[$i]-$company[$i-1]);\n }\n\n if($company[$i-1]==$company[$b-1]){\n $minCost +=0;\n break;\n } //echo $i.\"::\".$minCost.'\\n';\n }\n }else{\n for($i=$a-1;$i<$b-1;$i++){\n if($company[$i]==$company[$i+1]){\n $minCost += 0;\n }else{\n $minCost +=abs($company[$i]-$company[$i+1]);\n }\n\n if($company[$i+1]==$company[$b-1]){\n $minCost +=0;\n break;\n }\n }\n }\n }\n\n return $minCost;\n}\n\n$nab = trim(fgets(STDIN));\n$company = trim(fgets(STDIN));\n \nprint_r(findMinCost($nab,$company));"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": "$b){\n for($i=$a-1;$i>$b-1;$i--){\n if($company[$i]==$company[$i+1]){\n $minCost += 0;\n }else{\n $minCost +=abs($company[$i]-$company[$i+1]);\n }\n\n if($company[$i+1]==$company[$b-1]){\n $minCost +=0;\n break;\n }\n }\n }else{\n for($i=$a-1;$i<$b-1;$i++){\n if($company[$i]==$company[$i+1]){\n $minCost += 0;\n }else{\n $minCost +=abs($company[$i]-$company[$i+1]);\n }\n\n if($company[$i+1]==$company[$b-1]){\n $minCost +=0;\n break;\n }\n }\n }\n }\n\n return $minCost;\n}\n\n$nab = trim(fgets(STDIN));\n$company = trim(fgets(STDIN));\n \nprint_r(findMinCost($nab,$company));"}, {"source_code": "\n\n $b) {\n for ($i = 0; $i < $a - $b; $i ++) {\n printf('x');\n }\n}\n\n?>\n", "positive_code": [{"source_code": "$y){$b .= 'x';}else{$b .= 'y';}\n}\necho $b;\n?>"}, {"source_code": " $c)\n{\n $d = $b - $c;\n for($x = 1; $x <= $d; $x++)\n {\n $e .= \"x\";\n }\n print $e;\n}\nelseif($b < $c)\n{\n $d = $c - $b;\n for($x = 1; $x <= $d; $x++)\n {\n $e .= \"y\";\n }\n print $e;\n}\n?>"}], "negative_code": [], "src_uid": "528459e7624f90372cb2c3a915529a23"} {"source_code": "= $d)\r\n {\r\n print \"YES\\n\";\r\n }\r\n else\r\n {\r\n print \"NO\\n\";\r\n }\r\n}\r\n?>", "positive_code": [{"source_code": "=$n)\r\n echo \"YES\" . \"\\n\";\r\n else\r\n echo \"NO\" . \"\\n\";\r\n }\r\n \r\n?>"}, {"source_code": "= $ni ? 'YES' : 'NO'), PHP_EOL;\r\n}\r\n"}, {"source_code": ">=1;\r\n $c1++;\r\n }\r\n \r\n $val=pow(2,$c1);\r\n \r\n $c2=0;\r\n while(($y&1)==0){\r\n $y>>=1;\r\n $c2++;\r\n }\r\n \r\n $sum=$val*pow(2,$c2);\r\n \r\n if($z<=$sum)echo \"YES\\n\";\r\n else echo \"NO\\n\";\r\n \r\n}\r\n\r\n?>\r\n"}, {"source_code": "= $param[2])\r\n\t\t\tbreak;\r\n\t\tif(isEven($w))\r\n\t\t{\r\n\t\t\t$w = $w / 2;\r\n\t\t\t$ans = $ans * 2;\r\n\t\t}\r\n\t\telseif(isEven($h))\r\n\t\t{\r\n\t\t\t$h = $h / 2;\r\n\t\t\t$ans = $ans * 2;\r\n\t\t}\r\n\t\telse\r\n\t\t\tbreak;\r\n\t}\r\n\tif($ans >= $param[2])\r\n\t\tarray_push($arr, \"YES\\r\\n\");\r\n\telse\r\n\t\tarray_push($arr, \"NO\\r\\n\");\r\n}\r\nforeach($arr as $key => $value)\r\n\tprint($value);\r\n\r\n$end = readline();\r\n?>"}, {"source_code": " 1)\r\n\t\t{\r\n\t\t\tif($n[0] % 2 == 0 || $n[1] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($n[0] % 2 == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$n[0] = $n[0]/2;\r\n\t\t\t\t\t\t$count_p *= 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(($n[0] % 2 != 0 && $n[1] % 2 != 0) || $n[2] <= $count_p)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($n[1] % 2 == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$n[1] = $n[1]/2;\r\n\t\t\t\t\t\t$count_p *= 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(($n[0] % 2 != 0 && $n[1] % 2 != 0) || $n[2] <= $count_p)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($n[2] <= $count_p)\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\techo $result.'\r\n';\r\n\t}\r\n\t\r\n?>"}, {"source_code": "= $n) {echo 'YES'.PHP_EOL;}\r\n else {echo 'NO'.PHP_EOL;}\r\n}\r\n?>"}], "negative_code": [{"source_code": " 1)\r\n\t\t{\r\n\t\t\tif($n[0] % 2 == 0 || $n[1] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($n[0] % 2 == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$n[0] = $n[0]/2;\r\n\t\t\t\t\t\t$count_p *= 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(($n[0] % 2 != 0 && $n[1] % 2 != 0) || $n[2] <= $count_p)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($n[1] % 2 == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$n[1] = $n[1]/2;\r\n\t\t\t\t\t\t$count_p *= 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(($n[0] % 2 != 0 && $n[1] % 2 != 0) || $n[2] <= $count_p)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($n[2] <= $count_p)\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\techo $result.'\r\n';\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result.'
';\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result;\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result;\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result;\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result;\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result.'
';\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result.'
';\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result.'
';\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result;\r\n\t}\r\n\t\r\n?>"}, {"source_code": "\t$n[0],\r\n\t\t\t\t\t\t'h'\t=>\t$n[1]\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\tif(count($arr) != $n[2])\r\n\t\t{\r\n\t\t\tif($arr[0]['w'] % 2 == 0 || $arr[0]['h'] % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\twhile($flag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stop = 0;\r\n\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $count = count($arr); $i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($arr[$i]['w'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['w'] = $arr[$i]['w']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($arr[$i]['h'] % 2 == 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$arr[$i]['h'] = $arr[$i]['h']/2;\r\n\t\t\t\t\t\t\t$arr[count($arr)] = $arr[$i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$stop += 0.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(count($arr) == $n[2] || count($arr) == $stop)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($arr) == $n[2])\r\n\t\t\t\t\t$result = 'YES';\r\n\t\t\t\telse\r\n\t\t\t\t\t$result = 'NO';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$result = 'NO';\r\n\t\t}\r\n\t\telse\r\n\t\t\t$result = 'YES';\r\n\t\t\r\n\t\t\r\n\t\techo $result;\r\n\t}\r\n\t\r\n?>"}, {"source_code": "= $n) {echo 'YES'.PHP_EOL;}\r\n else {echo 'NO'.PHP_EOL;}\r\n}\r\n?>"}, {"source_code": "= $n) {echo 'YES'.PHP_EOL;}\r\n else {echo 'NO'.PHP_EOL;}\r\n}\r\n?>"}, {"source_code": "= $n) {break;}\r\n }\r\n else { break; }\r\n }\r\n }\r\n if ($m == 0) {$m = 1;}\r\n if ($m >= $n) {echo 'YES'.PHP_EOL;}\r\n else {echo 'NO'.PHP_EOL;}\r\n}\r\n?>"}], "src_uid": "a8201326dda46542b23dc4e528d413eb"} {"source_code": " $value) {\n if ((int) $value <= $max) {\n $col ++;\n }\n}\n\necho intval($col / 3);\n\n?>", "positive_code": [{"source_code": " 3);\necho floor($yes/3);"}, {"source_code": ""}, {"source_code": "= 0) && ($c[$x + 1] >= 0) && ($c[$x + 2] >= 0))\n {\n $e = 0;\n $d = array_slice($c, $f, 3);\n for($y = 1; $y <= 1000; $y++)\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n rsort($d);\n if($d[0] > 5)\n {\n break;\n }\n else\n {\n $e++;\n if($e == $b)\n {\n break;\n }\n }\n }\n if($e == $b)\n {\n $h++;\n }\n $f += 3;\n }\n else\n {\n break;\n }\n}\nprint $h;\n?>"}], "negative_code": [{"source_code": "= 0) && ($c[$x + 1] >= 0) && ($c[$x + 2] >= 0))\n {\n $e = 0;\n $d = array_slice($c, $f, 3);\n for($y = 1; $y <= 1000; $y++)\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n rsort($d);\n if($d[0] > 5)\n {\n break;\n }\n else\n {\n $e++;\n if($e == $b)\n {\n break;\n }\n }\n }\n if($e == $b)\n {\n $h++;\n }\n $f += 3;\n }\n else\n {\n break;\n }\n}\nprint $h;\n?>"}, {"source_code": "= 0) && ($c[$x + 1] >= 0) && ($c[$x + 2] >= 0))\n {\n $e = 0;\n $d = array_slice($c, $f, 3);\n for($y = 1; $y <= 1000; $y++)\n {\n $d[0]++;\n $d[1]++;\n $d[2]++;\n rsort($d);\n if($d[0] > 5)\n {\n break;\n }\n else\n {\n $e++;\n if($e == $b)\n {\n break;\n }\n }\n }\n if($e == $b)\n {\n $h++;\n }\n $f += 3;\n }\n else\n {\n break;\n }\n}\nprint $h;\n?>"}], "src_uid": "fbde1e2ee02055592ff72fb04366812b"} {"source_code": " $n ? $index + $b[$i] - $n : $index + $b[$i]; \r\n }\r\n \r\n \r\n IO::pr($a[$index-1]);\r\n }\r\n \r\n \r\n \r\n \r\n \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 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 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 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 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 "}, {"source_code": ""}], "negative_code": [{"source_code": " $a[$j]) {\r\n $iRight++;\r\n $sA = $a[$j];\r\n \r\n $a[$j] = $a[$i];\r\n $a[$i] = $sA;\r\n \r\n \r\n $sB = $b[$j];\r\n \r\n $b[$j] = $b[$i];\r\n $b[$i] = $sB;\r\n \r\n $i1 = $j+1;\r\n $i2 = $i+1;\r\n \r\n $aCheck[] = \"$i1 $i2\";\r\n \r\n if ($b[$i] > $b[$j]) {\r\n $iLeft++;\r\n }\r\n }\r\n \r\n \r\n }\r\n }\r\n \r\n //echo $iRight . PHP_EOL;\r\n //echo $iLeft;\r\n //exit;\r\n \r\n if ($iRight > 0 && $iLeft == 0) {\r\n echo $iRight . PHP_EOL;\r\n foreach ($aCheck as $sVal) {\r\n echo $sVal . PHP_EOL;\r\n }\r\n } else if ($iRight == 0 && $iLeft == 0){\r\n echo 0 . PHP_EOL;\r\n } else {\r\n echo -1 . PHP_EOL;\r\n }\r\n }\r\n?>"}, {"source_code": ""}, {"source_code": ""}, {"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 }\r\n \r\n class Algor {\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 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 = $j or ($b + $a) >= $n) break;\n\t}\n\n\tif (($b + $a) >= $n) break;\n\n\twhile ($t[$a][0] >= $t[$b][1]) {\n\t\t$b++;\n\t\tif ($b >= $j or ($b + $a) >= $n) break;\n\t}\n\n\tif (($b + $a) >= $n) break;\n}\n\nfclose($f);\n\nif ($a < $r) $a = $r;\nif ($b < $r) $b = $r;\n\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $a);\n}\nprint \"\\n\";\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $b);\n}\n", "positive_code": [{"source_code": "= $x)\n {\n $m .= 1;\n }\n else\n {\n $m .= 0;\n }\n if($l >= $x)\n {\n $n .= 1;\n }\n else\n {\n $n .= 0;\n }\n}\nprint $m . \"\\n\";\nprint $n;\n?>"}, {"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": "= $j or ($b + $a) >= $n) break;\n\t}\n\n\twhile ($t[$a][0] >= $t[$b][1]) {\n\t\t$b++;\n\t\tif ($b >= $j or ($b + $a) >= $n) break;\n\t}\n\n\tif (($b + $a) >= $n) break;\n}\n\nfclose($f);\n\nif ($a < $r) $a = $r;\nif ($b < $r) $b = $r;\n\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $a);\n}\nprint \"\\n\";\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $b);\n}\n"}, {"source_code": "= $j or ($b + $a) >= $n) break;\n\t}\n\n\twhile ($t[$a][0] >= $t[$b][1]) {\n\t\t$b++;\n\t\tif ($b >= $j or ($b + $a) >= $n) break;\n\t}\n\n\tif (($b + $a) >= $n) break;\n}\n\nfclose($f);\n\nif ($a < $n/2) $a = round($n/2);\nif ($b < $n/2) $b = round($n/2);\n\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $a);\n}\nprint \"\\n\";\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $b);\n}\n"}, {"source_code": "= $j or ($b + $a) >= $n) break;\n\t}\n\n\twhile ($t[$a][0] >= $t[$b][1]) {\n\t\t$b++;\n\t\tif ($b >= $j or ($b + $a) >= $n) break;\n\t}\n\n\tprint $a.\" \".$b.\"\\n\";\n\n\tif (($b + $a) >= $n) break;\n}\n\nfclose($f);\n\nif ($a < $n/2) $a = round($n/2);\nif ($b < $n/2) $b = round($n/2);\n\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $a);\n}\nprint \"\\n\";\nfor ($j = 0; $j < $n; $j++) {\n\tprint intval($j < $b);\n}\n"}], "src_uid": "bea30e4ba653b9d0af87fc79b9ec8b4f"} {"source_code": "-1;$i--) {\r\n\t\t\tif($srs >= $dic[$i][0]) {\r\n\t\t\t\t$srs -= $dic[$i][2] ;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$ans[] = ($st[$srs-1]) ;\r\n\t}\r\n}\r\nprintLine(implode(\"\\n\",$ans));", "positive_code": [{"source_code": "= 0; $j--) {\r\n if ($k > $len[$j]) {\r\n $k = $ll[$j] + ($k - $len[$j] - 1);\r\n if($k <= $n) {\r\n break;\r\n }\r\n }\r\n }\r\n IO::pr($s[$k-1]);\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}"}], "negative_code": [], "src_uid": "8dcd95d497dee44ba72ce595b53b4e5a"} {"source_code": " $b[$i]) {\n\t\twhile ($a[$j] > $b[$i]) {\n\t\t\t$i++;\n\t\t\tif ($i >= $m) break;\n\t\t}\n\n\t\tif ($a[$j] == $b[$i]) {\n\t\t\tunset($a[$j]);\n\t\t\tunset($b[$i]);\n\t\t\t$i++;\n\t\t\t$x++;\n\t\t}\n\t}\n}\n\nif (count($a) != 0) {\n\tsort($a);\n\tsort($b);\n\n\t$n = count($a);\n\t$m = count($b);\n\n\t$i = 0;\n\n\tfor ($j = 0; $j < $n; $j++) {\n\t\tif ($a[$j] <= $b[$i]) {\n\t\t\tunset($a[$j]);\n\t\t\tunset($b[$i]);\n\t\t\t$i++;\n\t\t\t$x++;\n\t\t}\n\t\telseif ($a[$j] > $b[$i]) {\n\t\t\twhile ($a[$j] > $b[$i]) {\n\t\t\t\t$i++;\n\t\t\t\tif ($i >= $m) break;\n\t\t\t}\n\n\t\t\tif ($a[$j] <= $b[$i]) {\n\t\t\t\tunset($a[$j]);\n\t\t\t\tunset($b[$i]);\n\t\t\t\t$i++;\n\t\t\t\t$x++;\n\t\t\t}\n\t\t}\n\t}\n}\n\nprint count($a);", "positive_code": [{"source_code": "= 0, $y >= 0; $x--, $y--)\n{\n if($c[$x] <= $d[$y])\n {\n $e++;\n }\n else\n {\n if($a > $b)\n {\n $y++;\n }\n else\n {\n array_splice($d, 0, 1);\n }\n }\n if(($x == 0) || ($y == 0))\n {\n break;\n }\n}\nprint count($c) - $e;\n?>"}], "negative_code": [{"source_code": "= 0, $y >= 0; $x--, $y--)\n{\n if($c[$x] <= $d[$y])\n {\n $e++;\n }\n else\n {\n array_splice($d, 0, 1);\n }\n if($x == 0)\n {\n break;\n }\n}\nprint count($c) - $e;\n?>"}, {"source_code": "= 0, $y >= 0; $x--, $y--)\n{\n if($c[$x] <= $d[$y])\n {\n $e++;\n }\n else\n {\n array_splice($d, 0, 1);\n }\n if(($x == 0) || ($y == 0))\n {\n break;\n }\n}\nprint count($c) - $e;\n?>"}, {"source_code": ""}, {"source_code": "= 0, $y >= 0; $x--, $y--)\n{\n if($c[$x] <= $d[$y])\n {\n $e++;\n }\n else\n {\n array_splice($d, 0, 1);\n }\n if(($x == 0) && ($y == 0))\n {\n break;\n }\n}\nprint count($c) - $e;\n?>"}, {"source_code": "= 0, $y >= 0; $x--, $y--)\n{\n if($c[$x] <= $d[$y])\n {\n $e++;\n }\n else\n {\n array_splice($d, 0, 1);\n }\n if(($x == 0) || ($y == 0))\n {\n break;\n }\n}\nprint count($c) - $e;\n?>"}, {"source_code": " $b[$i]) {\n\t\twhile ($a[$j] > $b[$i]) {\n\t\t\t$i++;\n\t\t\tif ($i >= $m) break;\n\t\t}\n\n\t\tif ($a[$j] == $b[$i]) {\n\t\t\tunset($a[$j]);\n\t\t\tunset($b[$i]);\n\t\t\t$i++;\n\t\t\t$x++;\n\t\t}\n\t}\n}\n\nif (count($a) != 0) {\n\tsort($a);\n\tsort($b);\n\n\t$n = count($a);\n\t$m = count($b);\n\n\tfor ($j = 0; $j < $n; $j++) {\n\t\tif ($a[$j] <= $b[$i]) {\n\t\t\tunset($a[$j]);\n\t\t\tunset($b[$i]);\n\t\t\t$i++;\n\t\t\t$x++;\n\t\t}\n\t\telseif ($a[$j] > $b[$i]) {\n\t\t\twhile ($a[$j] > $b[$i]) {\n\t\t\t\t$i++;\n\t\t\t\tif ($i >= $m) break;\n\t\t\t}\n\n\t\t\tif ($a[$j] <= $b[$i]) {\n\t\t\t\tunset($a[$j]);\n\t\t\t\tunset($b[$i]);\n\t\t\t\t$i++;\n\t\t\t\t$x++;\n\t\t\t}\n\t\t}\n\t}\n}\n\nprint count($a);"}], "src_uid": "bf0422de4347a308d68a52421fbad0f3"} {"source_code": " $b[2])\n {\n $b[0]--;\n }\n if($b[1] < $b[2])\n {\n $b[1]++;\n }\n elseif($b[1] > $b[2])\n {\n $b[1]--;\n }\n if($b[2] < $b[0])\n {\n $b[2]++;\n }\n elseif($b[2] > $b[0])\n {\n $b[2]--;\n }\n }\n elseif($b[1] == $b[2])\n {\n if($b[0] < $b[1])\n {\n $b[0]++;\n }\n elseif($b[0] > $b[1])\n {\n $b[0]--;\n }\n if($b[1] < $b[0])\n {\n $b[1]++;\n }\n elseif($b[1] > $b[0])\n {\n $b[1]--;\n }\n if($b[2] < $b[0])\n {\n $b[2]++;\n }\n elseif($b[2] > $b[0])\n {\n $b[2]--;\n }\n }\n else\n {\n if($b[0] < $c)\n {\n $b[0]++;\n }\n elseif($b[0] > $c)\n {\n $b[0]--;\n }\n if($b[1] < $c)\n {\n $b[1]++;\n }\n elseif($b[1] > $c)\n {\n $b[1]--;\n }\n if($b[2] < $c)\n {\n $b[2]++;\n }\n elseif($b[2] > $c)\n {\n $b[2]--;\n }\n }\n $d = abs($b[0] - $b[1]) + abs($b[0] - $b[2]) + abs($b[1] - $b[2]);\n print $d . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " 4) {\n $iMin = $iMin - 4;\n } else {\n $iMin = 0;\n }\n echo $iMin . \"\\n\";\n}"}, {"source_code": " $b[0])\n {\n $b[1]--;\n $b[2]--;\n }\n }\n else\n {\n if($b[0] < $c)\n {\n $b[0]++;\n }\n elseif($b[0] > $c)\n {\n $b[0]--;\n }\n if($b[1] < $c)\n {\n $b[1]++;\n }\n elseif($b[1] > $c)\n {\n $b[1]--;\n }\n if($b[2] < $c)\n {\n $b[2]++;\n }\n elseif($b[2] > $c)\n {\n $b[2]--;\n }\n }\n $d = abs($b[0] - $b[1]) + abs($b[0] - $b[2]) + abs($b[1] - $b[2]);\n print $d . \"\\n\";\n}\n?>"}], "src_uid": "18f2e54e4147e8887da737d5b6639473"} {"source_code": ""}, {"source_code": "", "positive_code": [{"source_code": "\r\n * @link https://codeforces.com/problemset/problem/1478/A\r\n * @version 1.0\r\n *\r\n * It took me some minutes to understand what was being requested, but then the solution comes instantly.\r\n * Note that the use of the explode function makes reading \"n\" unnecessary\r\n *\r\n */\r\n\r\n$t = readline();\r\n$responses = [];\r\nfor($i = 1; $i<= $t; $i++){\r\n\r\n $n = readline();\r\n $numbers = explode(' ', readline());\r\n\r\n $sequences = [];\r\n foreach ($numbers as $number){\r\n $added = false;\r\n foreach ($sequences as &$sequence){\r\n if(!in_array($number, $sequence)){\r\n $sequence[]= $number;\r\n $added = true;\r\n break;\r\n }\r\n }\r\n if(!$added) $sequences[] = [$number];\r\n }\r\n $responses[]= count($sequences);\r\n}\r\n\r\nforeach ($responses as $r) echo $r . PHP_EOL;\r\n\r\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1) {\r\n for($i = 1; $i<$n; $i++) {\r\n if($a[$i] == $first) {\r\n $res++;\r\n } else {\r\n $v[] = $res;\r\n $res = 1;\r\n $first = $a[$i];\r\n }\r\n if($i == $n-1) {\r\n $v[] = $res;\r\n }\r\n }\r\n } else {\r\n $v = [1]; \r\n }\r\n // var_dump($v);\r\n echo max($v) . \"\\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 $a = IO::arr();\r\n $res = [];\r\n foreach ($a as $v) {\r\n if(isset($res[$v])) {\r\n $res[$v] += 1;\r\n } else {\r\n $res[$v] = 1;\r\n }\r\n }\r\n IO::line(max($res));\r\n}\r\n"}, {"source_code": " $sV) {\r\n if (!isset($aCount[$sV])) {\r\n $aCount[$sV] = 1;\r\n } else {\r\n $aCount[$sV] += 1;\r\n }\r\n }\r\n echo max($aCount). \"\\n\";\r\n}"}], "negative_code": [{"source_code": "= intdiv(count($nums), 2)){\r\n break;\r\n }\r\n if ($del < 0) {\r\n if ($nums[$i] >= $nums[count($nums) - 1]) {\r\n $cnt++;\r\n// continue;\r\n }\r\n echo 'aaa';\r\n break;\r\n }\r\n if ($nums[$i] < $nums[count($nums) - $i - 1]) {\r\n $cnt++;\r\n } else {\r\n $cnt+=2;\r\n }\r\n }\r\n $res[] = $cnt;\r\n}\r\n\r\nforeach ($res as $r) {\r\n echo $r . \"\\n\";\r\n}"}, {"source_code": "= $nums[count($nums) - 1]) {\r\n $cnt++;\r\n continue;\r\n }\r\n break;\r\n }\r\n if ($nums[$i] < $nums[count($nums) - $i - 1]) {\r\n $cnt++;\r\n } else {\r\n $cnt+=2;\r\n }\r\n }\r\n $res[] = $cnt;\r\n}\r\n\r\nforeach ($res as $r) {\r\n echo $r . \"\\n\";\r\n}"}, {"source_code": "\r\n * @link https://codeforces.com/problemset/problem/1478/A\r\n * @version 1.0\r\n *\r\n * It took me some minutes to understand what was being requested, but then the solution comes instantly.\r\n * Note that the use of the explode function makes reading \"n\" unnecessary\r\n *\r\n */\r\n\r\n$t = readline();\r\n$responses = [];\r\nfor($i = 1; $i<= $t; $i++){\r\n\r\n $n = readline();\r\n $numbers = explode(' ', readline());\r\n\r\n $sequences = [];\r\n foreach ($numbers as $number){\r\n $added = false;\r\n foreach ($sequences as $sequence){\r\n if(!in_array($number, $sequence)){\r\n $sequence[]= $number;\r\n $added = true;\r\n break;\r\n }\r\n }\r\n if(!$added) $sequences[] = [$number];\r\n }\r\n $responses[]= count($sequences);\r\n}\r\n\r\nforeach ($responses as $r) echo $r . PHP_EOL;\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\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 $value) {\r\n $key += 1;\r\n if ($arr[0] == $key) {\r\n $arr = [$key, $value, false];\r\n } elseif ($arr[1] != $value) {\r\n if ($arr[2]) {\r\n $result[] = $arr[0];\r\n $arr = [$key, $value, false];\r\n } else {\r\n $arr = [2 => false];\r\n $result = [];\r\n break;\r\n }\r\n } else {\r\n $result[] = $key;\r\n $arr[2] = true;\r\n }\r\n }\r\n if (empty($arr[2])) {\r\n $result = [];\r\n } else {\r\n $result[] = $arr[0];\r\n }\r\n echo ($result ? implode(' ', $result) : '-1'), \"\\n\";\r\n}"}], "negative_code": [{"source_code": " $value) {\r\n $key += 1;\r\n if ($arr[0] == $key) {\r\n $arr[1] = $value;\r\n $arr[2] = false;\r\n } elseif ($arr[1] != $value) {\r\n if ($arr[2]) {\r\n $result[] = $arr[0];\r\n $arr = [$key, $value, false];\r\n } else {\r\n $arr = [2 => false];\r\n $result = [];\r\n break;\r\n }\r\n } else {\r\n $result[] = $key;\r\n $arr[2] = true;\r\n }\r\n }\r\n if ($arr[2]) {\r\n $result[] = $arr[0];\r\n }\r\n echo ($result ? implode(' ', $result) : '-1'), \"\\n\";\r\n}"}, {"source_code": " $value) {\r\n $key += 1;\r\n if ($arr[0] == $key) {\r\n $arr[1] = $value;\r\n $arr[2] = false;\r\n } elseif ($arr[1] != $value) {\r\n if ($arr[2]) {\r\n $result[] = $arr[0];\r\n $arr = [$key, $value, false];\r\n } else {\r\n $arr = [];\r\n $result = [-1];\r\n break;\r\n }\r\n } else {\r\n $result[] = $key;\r\n $arr[2] = true;\r\n }\r\n }\r\n if ($arr) {\r\n $result[] = $arr[0];\r\n }\r\n echo implode(' ', $result), \"\\n\";\r\n}"}], "src_uid": "cf912f6efc3c0e3fabdaa5f878a777c5"} {"source_code": " 0)\n {\n $d++;\n }\n $l = array();\n}\n$e = array_unique($c);\nif((count($e) < $a) && ($d < $a))\n{\n print \"-1\";\n}\nelse\n{\n if($d == $a)\n {\n for($x = 0; $x < $a - 1; $x++)\n {\n print $g[$x] . \"\\n\";\n }\n print $g[$x];\n }\n elseif(count($e) == $a)\n {\n for($x = 1; $x < $a; $x++)\n {\n $j = array_search($k, $i);\n $k++;\n print $h[$j] . \" \" . $i[$j] . \"\\n\"; \n }\n $j = array_search($k, $i);\n $k++;\n print $h[$j] . \" \" . $i[$j]; \n }\n}\n?>"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": " 2 && $arr[$count-2] > floor($arr[$count-1]/2) && $arr[$count-2] != $arr[$count-1]) {\n\n} else {\n for ($i = 0; $i < $count; $i++) {\n if ($arr[$i] == 1) {\n $result = 1;\n break;\n } else {\n for ($j = 0; $j < count($arr); $j++) {\n if ($arr[$j] % $arr[$i] != 0) {\n break;\n }\n if ($j == count($arr)-1) {\n $result = $arr[$i];\n break;\n }\n }\n }\n }\n}\n\necho $result;"}, {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "7899a22cee29bb96d671f6188f246c21"} {"source_code": "", "positive_code": [{"source_code": " 1,\n $i . '_' . ($j + 1) => $martix[$i][$j + 1],\n ($i + 1) . '_' . $j => $martix[$i + 1][$j],\n ($i + 1) . '_' . ($j + 1) => $martix[$i + 1][$j + 1]\n ];\n\n $found = array_merge($found, array_filter($qq));\n if ($r == 3) {\n $res[] = ($i + 1) . ' ' . ($j + 1);\n $checked = array_merge($checked, array_filter($qq));\n }\n }\n }\n}\n\nfor ($j = 0; $j < $m - 1; $j++) {\n if ($martix[$n - 1][$j] == 1 && !isset($checked[($n - 1) . '_' . ($j)])) {\n echo -1;\n exit;\n }\n}\n\nfor ($i = 0; $i < $n - 1; $i++) {\n if ($martix[$i][$m - 1] == 1 && !isset($checked[$i . '_' . ($m - 1)])) {\n echo -1;\n exit;\n }\n}\n\nif (count($res) == 0 || count($checked) != count($found)) {\n\n echo -1;\n exit;\n}\n\necho count($res), PHP_EOL, implode(PHP_EOL, $res), PHP_EOL;\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1,\n $i . '_' . ($j + 1) => $martix[$i][$j + 1] ,\n ($i + 1) . '_' . $j => $martix[$i + 1][$j],\n ($i + 1) . '_' . ($j + 1) => $martix[$i + 1][$j + 1]\n ];\n\n $found = array_merge($found, array_filter($qq));\n if ($r == 3) {\n $res[] = ($i + 1) . ' ' . ($j + 1);\n $checked = array_merge($checked, array_filter($qq));\n }\n }\n }\n}\n\nif (count($res) == 0 || count($checked) != count($found)) {\n\n echo -1;\n exit;\n}\n\necho count($res), PHP_EOL, implode(PHP_EOL, $res), PHP_EOL;\n"}, {"source_code": " $max_resting) {\n $max_resting = $resting;\n }\n}\necho $max_resting;"}, {"source_code": " $lgst) $lgst = $l;\n\t\t$l = 0;\n\t}\n}\n\nfwrite(STDOUT, $lgst);"}, {"source_code": " $d)\n {\n $d = $c;\n }\n $c = 0;\n }\n}\nif($c > $d)\n{\n $d = $c;\n $c = 0;\n}\nprint $d;\n?>"}, {"source_code": "=$n){\n\t\t\tbreak;\n\t\t}\n\t}\n}\necho max($continuous_resting_hours_arr);"}], "negative_code": [{"source_code": ""}, {"source_code": "0 && $b>0)\n print \"YES\";\nelse\n print \"NO\";\n\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "6581dbaff7eb52b63ccfe9c0c4117c09"} {"source_code": " $value) {\r\n if (($value&1) != ($arr[$key&1] ?? ($arr[$key&1] = $value&1))) {\r\n $result = 'NO';\r\n break;\r\n }\r\n }\r\n echo $result, \"\\n\";\r\n}", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " $value) {\r\n if ($value&1 != ($arr[$key&1] ?? ($arr[$key&1] = $value&1))) {\r\n $result = 'NO';\r\n break;\r\n }\r\n }\r\n echo $result, \"\\n\";\r\n}"}], "src_uid": "fbb4e1cf1cad47481c6690ce54b27a1e"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "a7c0484275e62f0bc70d9edaac27d7d6"} {"source_code": " 0 ? $a[0] : 0);\n\tfor ($i = 1; $i < $n; $i++) {\n\t\t$max = ($a[$i - 1] > $max ? $a[$i - 1] : $max);\n\t\t$a[] = $b[$i] + $max;\n\t}\n\n\tprint implode(\" \", $a);\n?>", "positive_code": [{"source_code": " $c)\n{\n $c = $b[0];\n}\nfor($x = 1; $x < $a; $x++)\n{\n $d[$x] = $b[$x] + $c;\n if($d[$x] > $c)\n {\n $c = $d[$x];\n }\n}\nprint implode(\" \", $d);\n?>"}, {"source_code": ""}, {"source_code": " $max){\n $max = $x;\n }\n $d[] = $x;\n }\n foreach($d as $f){\n $s .= $f.' ';\n }\n echo $s.\"\\n\";\n"}], "negative_code": [], "src_uid": "e22b10cdc33a165fbd73b45dc5fbedce"} {"source_code": " 0) {\n\t\t[$n, $k] = array_map( 'intval', explode( \" \", fgets(STDIN) ) );\n\t\t$answer = $n - ($n % $k);\n\t\t$answer += min((int)($n % $k), (int)($k / 2));\n\t\techo \"$answer\\n\";\n\t}\n}\n\nmain();", "positive_code": [{"source_code": " $a[0] ? $a[0] : $count;\n echo $count.\"\\n\";\n}"}, {"source_code": "\n"}, {"source_code": " $c)\n {\n if($e <= floor($c / 2))\n {\n print $b . \"\\n\";\n }\n else\n {\n print $b - ($e - floor($c / 2)) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n\t\t[$n, $k] = array_map( 'intval', explode( \" \", fgets(STDIN) ) );\n\t\t$answer = $n - ($n % $k);\n\t\t$answer += min((int)($n % $k), (int)($k / 2));\n\t\techo \"$answer\";\n\t}\n}\n\nmain();"}, {"source_code": " $n) && (($k - $n) > (int)($n / 2))) {\n return 0;\n }\n\n $c = $a * $k;\n $c += floor($k / 2);\n\n return $c > $n ? $n : $c;\n}\n\n$r = 0;\n\nlist($t) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $t; ++$i) {\n list($n, $k) = fscanf($input, \"%d %d\\n\");\n\n $r = foo($n, $k);\n\n fwrite($output, $r . PHP_EOL);\n}\n"}, {"source_code": " $n) && (($k - $n) > (int)($n / 2))) {\n return 0;\n }\n\n $b = (int) ($k / 2);\n\n $c = $a - $b;\n\n return $n - $c;\n}\n\n$r = 0;\n\nlist($t) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $t; ++$i) {\n list($n, $k) = fscanf($input, \"%d %d\\n\");\n\n $r = foo($n, $k);\n\n fwrite($output, $r . PHP_EOL);\n}\n"}, {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "solution($data1, $data2);\n\n// End of interface\n\n\nclass MainClass {\n\t//public $problemLink = 'https://codeforces.com/problemset/problem/200/B';\n\t//public $submissionLink = '';\n\n\tpublic function solution($n, $string)\n\t{\n\t\t$arrayOfStrings = preg_split(\"/ /\", $string);\n\t\t$sum = 0;\n\t\t\tfor($i = 0; $i < $n; $i++){\n\t\t\t\t$sum = $sum + (int)$arrayOfStrings[$i];\n\t\t\t}\n\t\t\treturn $sum / $n;\n\t}\n}\n"}, {"source_code": "solution($data1, $data2);\n\n// End of interface\n\nclass MainClass {\n\t//public $problemLink = 'https://codeforces.com/problemset/problem/200/B';\n\t//public $submissionLink = '';\n\n\tpublic function solution($n, $arrayOfStrings)\n\t{\n\t\t$sum = 0;\n\t\t\tforeach ($arrayOfStrings as $value) {\n \t\t$sum += $value;\n\t\t\t}\n\t\treturn $sum / $n;\n\t}\n}\n"}, {"source_code": "solution($data1, $data2);\n\n// End of interface\n\n\nclass MainClass {\n\t//public $problemLink = 'https://codeforces.com/problemset/problem/200/B';\n\t//public $submissionLink = '';\n\n\tpublic function solution($n, $arrayOfStrings)\n\t{\n\t\t$sum = 0;\n\t\t\tforeach ($arrayOfStrings as $value) {\n \t\t$sum += $value;\n\t\t\t}\n\t\t\treturn $sum / $n;\n\t}\n}\n"}, {"source_code": "in();\n\n\t$sum = 0;\n\t\n\tfor ($i = 0; $i < $n; $i++)\n\t{\n\t\t$sum += (int)$Input->in();\n\t}\n\n\t$p = 100 * $sum / (100 * $n);\n\n\tprintf(\"%.12f\",$p );\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": "\n"}, {"source_code": " 1) {\n break;\n }\n}\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $arr[$index] - $arr[0] ? $arr[$n-1] -$arr[$index] : $arr[$index] - $arr[0];\n }\n }\n function min_($index){\n global $arr;\n global $n;\n if($index == 0)\n return $arr[1] -$arr[0];\n else if($index == $n-1){\n return $arr[$n-1] -$arr[$n-2];\n }\n else{\n return $arr[$index] -$arr[$index - 1] > $arr[$index + 1] - $arr[$index] ? $arr[$index + 1] - $arr[$index] : $arr[$index] -$arr[$index - 1];\n }\n }\n for($i = 0;$i<$n; $i++){\n echo min_($i).\" \".max_($i).\"\\n\";\n }\n\n"}, {"source_code": " $arr[$index] - $arr[0] ? $arr[$n-1] -$arr[$index] : $arr[$index] - $arr[0];\n }\n }\n function min_($index){\n global $arr;\n global $n;\n if($index == 0)\n return $arr[1] -$arr[0];\n else if($index == $n-1){\n return $arr[$n-1] -$arr[$n-2];\n }\n else{\n return $arr[$index] -$arr[$index - 1] > $arr[$index + 1] - $arr[$index] ? $arr[$index + 1] - $arr[$index] : $arr[$index] -$arr[$index - 1];\n }\n }\n for($i = 0;$i<$n; $i++){\n echo min_($i).\" \".max_($i).\"\\n\";\n }\n"}, {"source_code": ""}, {"source_code": "= 0))\n {\n $d = abs($b[0]) + $b[1];\n }\n elseif(($b[0] >= 0) && ($b[1] > 0))\n {\n $d = $b[1] - $b[0];\n }\n }\n else\n {\n if(($b[$x - 1] < 0) && ($b[$x + 1] < 0))\n {\n $d = min(abs($b[$x]) - abs($b[$x - 1]), abs($b[$x + 1]) - abs($b[$x]));\n }\n elseif(($b[$x - 1] < 0) && ($b[$x + 1] >= 0))\n {\n if($b[$x] < 0)\n {\n $d = min(abs($b[$x - 1]) - abs($b[$x]), $b[$x + 1] + abs($b[$x]));\n }\n else\n {\n $d = min($b[$x] + abs($b[$x - 1]), $b[$x + 1] - $b[$x]);\n }\n }\n elseif(($b[$x - 1] >= 0) && ($b[$x + 1] > 0))\n {\n $d = min($b[$x] - $b[$x - 1], $b[$x + 1] - $b[$x]);\n }\n }\n print $d . \" \" . $c . \"\\n\";\n}\nif(($b[0] < 0) && ($b[$x] < 0))\n{\n $c = max(abs($b[0]) - $b[$x], $b[$a - 1] + abs($b[$x]));\n}\nelseif(($b[0] > 0) && ($b[$x] > 0))\n{\n $c = $b[$a - 1] - $b[0];\n}\nelse\n{\n $c = max($b[$x] + abs($b[0]), $b[$a - 1] - $b[$x]);\n}\nif(($b[$a - 2] < 0) && ($b[$a - 1] < 0))\n{\n $d = abs($b[$a - 1]) - abs($b[$a - 2]);\n}\nelseif(($b[$a - 2] < 0) && ($b[$a - 1] >= 0))\n{\n $d = $b[$a - 1] + abs($b[$a - 2]);\n}\nelseif(($b[$a - 2] >= 0) && ($b[$a - 1] > 0))\n{\n $d = $b[$a - 1] - $b[$a - 2];\n}\nprint $d . \" \" . $c;\n?>"}, {"source_code": " 0) && ($b[$x] > 0))\n {\n $c = max($b[$x] - $b[0], $b[$a - 1] - $b[$x]);\n }\n else\n {\n $c = max($b[$x] + abs($b[0]), $b[$a - 1] - $b[$x]);\n }\n if($x == 0)\n {\n if(($b[0] < 0) && ($b[1] < 0))\n {\n $d = abs($b[0]) - abs($b[1]);\n }\n elseif(($b[0] < 0) && ($b[1] >= 0))\n {\n $d = abs($b[0]) + $b[1];\n }\n elseif(($b[0] >= 0) && ($b[1] > 0))\n {\n $d = $b[1] - $b[0];\n }\n }\n else\n {\n if(($b[$x - 1] < 0) && ($b[$x + 1] < 0))\n {\n $d = min(abs($b[$x]) - abs($b[$x - 1]), abs($b[$x + 1]) - abs($b[$x]));\n }\n elseif(($b[$x - 1] < 0) && ($b[$x + 1] >= 0))\n {\n if($b[$x] < 0)\n {\n $d = min(abs($b[$x - 1]) - abs($b[$x]), $b[$x + 1] + abs($b[$x]));\n }\n else\n {\n $d = min($b[$x] + abs($b[$x - 1]), $b[$x + 1] - $b[$x]);\n }\n }\n elseif(($b[$x - 1] >= 0) && ($b[$x + 1] > 0))\n {\n $d = min($b[$x] - $b[$x - 1], $b[$x + 1] - $b[$x]);\n }\n }\n print $d . \" \" . $c . \"\\n\";\n}\nif(($b[0] < 0) && ($b[$x] < 0))\n{\n $c = max(abs($b[0]) - $b[$x], $b[$a - 1] + abs($b[$x]));\n}\nelseif(($b[0] > 0) && ($b[$x] > 0))\n{\n $c = $b[$a - 1] - $b[0];\n}\nelse\n{\n $c = max($b[$x] + abs($b[0]), $b[$a - 1] - $b[$x]);\n}\nif(($b[$a - 2] < 0) && ($b[$a - 1] < 0))\n{\n $d = abs($b[$a - 1]) - abs($b[$a - 2]);\n}\nelseif(($b[$a - 2] < 0) && ($b[$a - 1] >= 0))\n{\n $d = $b[$a - 1] + abs($b[$a - 2]);\n}\nelseif(($b[$a - 2] >= 0) && ($b[$a - 1] > 0))\n{\n $d = $b[$a - 1] - $b[$a - 2];\n}\nprint $d . \" \" . $c;\n?>"}, {"source_code": " 0) && ($b[$x] > 0))\n {\n $c = max($b[$x] - $b[0], $b[$a - 1] - $b[$x]);\n }\n else\n {\n $c = max($b[$x] + abs($b[0]), $b[$a - 1] - $b[$x]);\n }\n if($x == 0)\n {\n if(($b[0] < 0) && ($b[1] < 0))\n {\n $d = abs($b[0]) - abs($b[1]);\n }\n elseif(($b[0] < 0) && ($b[1] >= 0))\n {\n $d = abs($b[0]) + $b[1];\n }\n elseif(($b[0] >= 0) && ($b[1] > 0))\n {\n $d = $b[1] - $b[0];\n }\n }\n else\n {\n if(($b[$x - 1] < 0) && ($b[$x + 1] < 0))\n {\n $d = min(abs($b[$x - 1]) - abs($b[$x]), abs($b[$x]) - abs($b[$x + 1]));\n }\n elseif(($b[$x - 1] < 0) && ($b[$x + 1] >= 0))\n {\n if($b[$x] < 0)\n {\n $d = min(abs($b[$x - 1]) - abs($b[$x]), $b[$x + 1] + abs($b[$x]));\n }\n else\n {\n $d = min($b[$x] + abs($b[$x - 1]), $b[$x + 1] - $b[$x]);\n }\n }\n elseif(($b[$x - 1] >= 0) && ($b[$x + 1] > 0))\n {\n $d = min($b[$x] - $b[$x - 1], $b[$x + 1] - $b[$x]);\n }\n }\n print $d . \" \" . $c . \"\\n\";\n}\nif(($b[0] < 0) && ($b[$x] < 0))\n{\n $c = max(abs($b[0]) - abs($b[$x]), abs($b[$x]) - abs($b[$a - 1]));\n}\nelseif(($b[0] > 0) && ($b[$x] > 0))\n{\n $c = $b[$a - 1] - $b[0];\n}\nelse\n{\n $c = max($b[$x] + abs($b[0]), $b[$a - 1] - $b[$x]);\n}\nif(($b[$a - 2] < 0) && ($b[$a - 1] < 0))\n{\n $d = abs($b[$a - 2]) - abs($b[$a - 1]);\n}\nelseif(($b[$a - 2] < 0) && ($b[$a - 1] >= 0))\n{\n $d = $b[$a - 1] + abs($b[$a - 2]);\n}\nelseif(($b[$a - 2] >= 0) && ($b[$a - 1] > 0))\n{\n $d = $b[$a - 1] - $b[$a - 2];\n}\nprint $d . \" \" . $c;\n?>"}, {"source_code": "= 0))\n {\n $d = abs($b[0]) + $b[1];\n }\n elseif(($b[0] >= 0) && ($b[1] > 0))\n {\n $d = $b[1] - $b[0];\n }\n }\n else\n {\n if(($b[$x - 1] < 0) && ($b[$x + 1] < 0))\n {\n $d = min(abs($b[$x]) - abs($b[$x - 1]), abs($b[$x + 1]) - abs($b[$x]));\n }\n elseif(($b[$x - 1] < 0) && ($b[$x + 1] >= 0))\n {\n if($b[$x] < 0)\n {\n $d = min(abs($b[$x - 1]) - abs($b[$x]), $b[$x + 1] + abs($b[$x]));\n }\n else\n {\n $d = min($b[$x] + abs($b[$x - 1]), $b[$x + 1] - $b[$x]);\n }\n }\n elseif(($b[$x - 1] >= 0) && ($b[$x + 1] > 0))\n {\n $d = min($b[$x] - $b[$x - 1], $b[$x + 1] - $b[$x]);\n }\n }\n print $d . \" \" . $c . \"\\n\";\n}\nif(($b[0] < 0) && ($b[$x] < 0))\n{\n $c = max(abs($b[0]) - $b[$x], $b[$a - 1] + abs($b[$x]));\n}\nelse\n{\n $c = max($b[$x] + abs($b[0]), $b[$a - 1] - $b[$x]);\n}\nif(($b[$a - 2] < 0) && ($b[$a - 1] < 0))\n{\n $d = abs($b[$a - 1]) - abs($b[$a - 2]);\n}\nelseif(($b[$a - 2] < 0) && ($b[$a - 1] >= 0))\n{\n $d = $b[$a - 1] + abs($b[$a - 2]);\n}\nelseif(($b[$a - 2] >= 0) && ($b[$a - 1] > 0))\n{\n $d = $b[$a - 1] - $b[$a - 2];\n}\nprint $d . \" \" . $c;\n?>"}, {"source_code": " $arr[0] - $arr[$index] ? $arr[$n-1] -$arr[$index] : $arr[0] - $arr[$index];\n }\n }\n function min_($index){\n global $arr;\n global $n;\n if($index == 0)\n return $arr[1] -$arr[0];\n else if($index == $n-1){\n return $arr[$n-1] -$arr[$n-2];\n }\n else{\n return $arr[$index] -$arr[$index - 1] > $arr[$index + 1] - $arr[$index] ? $arr[$index + 1] - $arr[$index] : $arr[$index] -$arr[$index - 1];\n }\n }\n for($i = 0;$i<$n; $i++){\n echo min_($i).\" \".max_($i).\"\\n\";\n }\n"}], "src_uid": "55383f13c8d097408b0ccf5653c4563d"} {"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "f79a926e18a3f81b24f2fc3ae5c8f928"} {"source_code": "= 2 * $k + 1 && substr($s, 0, $k) === strrev(substr($s, -$k, $k)) ? 'YES' : 'NO').PHP_EOL;\r\n}\r\n", "positive_code": [{"source_code": "= $k) { echo 'YES'.PHP_EOL; }\r\n\t\t\telse { echo 'NO'.PHP_EOL; }\r\n\t\t\t\r\n\t\t} else {\r\n\t\t $r = floor($n/2) - 1;\r\n\t\t\t\r\n\t\t\tfor ($j = 0; $j < $r; $j++) {\r\n\t\t\t\tif ($s[$j] == $s[$n - $j - 1]) {\r\n\t\t\t\t\t$f++;\r\n\t\t\t\t} else { break; }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($f >= $k) { echo 'YES'.PHP_EOL; }\r\n\t\t\telse { echo 'NO'.PHP_EOL; }\r\n\t\t}\r\n\t}\r\n}\r\n\r\n?>"}, {"source_code": " $c) {\r\n\t\t\t\t\tprint \"NO\\n\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprint \"YES\\n\";\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n?>"}], "negative_code": [{"source_code": " $c) {\n\t\t\t\t\tprint \"NO\\n\";\n\t\t\t\t} else {\n\t\t\t\t\tprint \"YES\\n\";\n\t\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " $c) {\n\t\t\t\t\tprint \"NO\\n\";\n\t\t\t\t} else {\n\t\t\t\t\tprint \"YES\\n\";\n\t\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " $c) {\n\t\t\t\t\tprint \"NO\\n\";\n\t\t\t\t} else {\n\t\t\t\t\tprint \"YES\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($k + 1 > $c) {\n\t\t\t\t\tprint \"NO\\n\";\n\t\t\t\t} else {\n\t\t\t\t\tprint \"YES\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": " $c) {\n\t\t\t\tprint \"NO\\n\";\n\t\t\t} else {\n\t\t\t\tprint \"YES\\n\";\n\t\t\t}\n\t\t}\n\t}\n?>"}, {"source_code": "= $k) { echo 'YES'.PHP_EOL; }\r\n\t\t\telse { echo 'NO'.PHP_EOL; }\r\n\t\t\t\r\n\t\t} else {\r\n\t\t $r = floor($n/2) - 1;\r\n\t\t $str = substr($s, 0, $r);\r\n\t\t $str1 = substr($s, '-'.$r);\r\n\t\t\t\r\n\t\t\tif (strrev($str) == $str1 && strlen($str) >= $k) { echo 'YES'.PHP_EOL; }\r\n\t\t\telse { echo 'NO'.PHP_EOL; }\r\n\t\t}\r\n\t}\r\n}\r\n\r\n?>"}], "src_uid": "6fbf41dc32d1c28351d78a9ec5fc0026"} {"source_code": " 3) {\n $streak++;\n } else {\n $streak = 0;\n }\n \n if ($streak == 3) {\n $presents++;\n $streak = 0;\n }\n}\n\necho $presents;", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " 2) {\n if ($last == 0) {\n $result[] = $number/2;\n $reulst[] = $number/2;\n }\n \n elseif ($last % 2 == 0) {\n $result[] = $s;\n $result[] = $number - $s;\n }\n else {\n $result[] = $s - 5;\n $result[] = $number - $s - 5;\n }\n} else {\n if ($last % 2 == 0) {\n $result[] = $number - 4;\n $result[] = 4;\n }\n else {\n $result[] = $number - 9;\n $result[] = 9;\n }\n}\n\necho implode(\" \", $result);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=2)return true;\n else return false;\n}\nwhile (!(isComposite($line-$abs)&&isComposite($abs)))$abs++;\necho $line-$abs.\" \".$abs;"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": " $second_number)\n\t\techo $second_number.' '.$first_number;\n\telse\n\t\techo $first_number.' '.$second_number;\n}\n\nsolve();\n\n?>"}], "negative_code": [{"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "3ea971165088fae130d866180c6c868b"} {"source_code": "= 0; $i--) {\n\t\t$r[$i] = $r[$i + 1];\n\t\tif ($a[$i] < $a[$r[$i]])\n\t\t\t$r[$i] = $i;\n\t}\n\t$l = 0;\n\tfor ($i = 1; $i + 1 < $n; $i++) {\n\t\t// printf(\"i = %d : %d to %d to %d\\n\", $i, $a[$l], $a[$i], $a[$r[$i + 1]]);\n\t\tif ($a[$l] < $a[$i] && $a[$r[$i + 1]] < $a[$i]) {\n\t\t\tprintf(\"3\\n%d %d %d\\n\", $l + 1, $i + 1, $r[$i + 1] + 1);\n\t\t\treturn;\n\t\t}\n\t\tif ($a[$i] < $a[$l])\n\t\t\t$l = $i;\n\t}\n}\nprint(\"0\\n\");\n?>\n", "positive_code": [{"source_code": " $b[$x])\n {\n $c = $x;\n $d = $x + 1;\n $e = $x + 2;\n break;\n }\n}\nfor($x = $c; $x < $a - 1; $x++)\n{\n if(($d == TRUE) && ($b[$x + 1] < $b[$e - 1]))\n {\n $f = $x + 2;\n break;\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n if($b[$x + 1] < $b[$x])\n {\n $g = $x;\n $h = $x + 1;\n $i = $x + 2;\n break;\n }\n}\nfor($x = $g; $x < $a - 1; $x++)\n{\n if(($h == TRUE) && ($b[$x + 1] > $b[$i - 1]))\n {\n $j = $x + 2;\n break;\n }\n}\nif($f == TRUE)\n{\n print \"3\\n\";\n print $d . \" \" . $e . \" \" . $f;\n}\nelseif($j == TRUE)\n{\n print \"3\\n\";\n print $h . \" \" . $i . \" \" . $j;\n}\nelse\n{\n print \"0\";\n}\n?>"}], "negative_code": [{"source_code": " $b[$x])\n {\n $c = $x;\n $d = $x + 1;\n $e = $x + 2;\n break;\n }\n}\nfor($x = $c; $x < $a - 1; $x++)\n{\n if(($d == TRUE) && ($b[$x + 1] < $b[$x]))\n {\n $f = $x + 2;\n break;\n }\n}\nfor($x = 0; $x < $a - 1; $x++)\n{\n if($b[$x + 1] < $b[$x])\n {\n $g = $x;\n $h = $x + 1;\n $i = $x + 2;\n break;\n }\n}\nfor($x = $g; $x < $a - 1; $x++)\n{\n if(($h == TRUE) && ($b[$x + 1] > $b[$x]))\n {\n $j = $x + 2;\n break;\n }\n}\nif($f == TRUE)\n{\n print \"3\\n\";\n print $d . \" \" . $e . \" \" . $f;\n}\nelseif($j == TRUE)\n{\n print \"3\\n\";\n print $h . \" \" . $i . \" \" . $j;\n}\nelse\n{\n print \"0\";\n}\n?>"}], "src_uid": "652c7852f1d0bab64ffd2219af4f59da"} {"source_code": " 0)\n {\n $f = 1;\n break;\n }\n }\n }\n if($f == 0)\n {\n array_push($d, $b[$x]);\n unset($b[$x]);\n }\n}\nsort($b);\nsort($d);\n$a = count($b);\nif(count($b) > 1)\n{\n $i = implode($d);\n for($x = 0; $x < $a; $x++)\n {\n $j = $b[$x];\n for($y = 0; $y < $a; $y++)\n {\n $k = $b[$y];\n if($x != $y)\n {\n $o = 0;\n for($l = 0; $l <= strlen($j); $l++)\n {\n $m = substr($j, strlen($j) - $l - 1);\n $n = substr($k, 0, $l + 1);\n if(($m == $n) && ($o == 0))\n {\n $o = 1;\n }\n elseif(($m != $n) && ($o == 1))\n {\n $p = substr($k, $l);\n $q = $j . $p;\n $b[$y] = $q;\n unset($b[$x]);\n break;\n }\n }\n }\n }\n }\n sort($b);\n $r = implode($b);\n print $i . $r;\n}\nelse\n{\n print implode($d);\n}\n?>", "positive_code": [{"source_code": " $value) {\n if (isset($arr[$value])) {\n unset($arr[$value]);\n }\n}\n\n$results = [];\nforeach ($arr as $c) {\n $way = '';\n for ($i = $c; $i; $i = isset($e[$i]) ? $e[$i] : null) {\n $way .= $i;\n }\n\n $results[$c] = $way;\n}\n\necho implode($results) . PHP_EOL;"}], "negative_code": [], "src_uid": "a6e112135272a81ae9563ae4c50b6d86"} {"source_code": "", "positive_code": [{"source_code": " 0 && $orangeDiff > 0) {\n $minDiff = $candyDiff > $orangeDiff ? $orangeDiff : $candyDiff;\n\n $presentCandies[$i] -= $minDiff;\n $presentOranges[$i] -= $minDiff;\n\n $actions += $minDiff;\n } else if ($candyDiff > 0) {\n $presentCandies[$i] -= $candyDiff;\n\n $actions += $candyDiff;\n } else if ($orangeDiff > 0) {\n $presentOranges[$i] -= $orangeDiff;\n\n $actions += $orangeDiff;\n } else {\n $i++;\n continue;\n }\n\n $actionsCount += $actions;\n }\n\n echo $actionsCount, \"\\n\";\n}"}, {"source_code": " $diffB){\n\t\t\t\t$moves += $diffA - $max_double_decrements;\n\t\t\t}else{\n\t\t\t\t$moves += $diffB - $max_double_decrements;\n\t\t\t}\n\t\t}elseif($minA < $seqA[$i]){\n\t\t\t$moves+= $seqA[$i]- $minA;\n\t\t}elseif($minB < $seqB[$i]){\n\t\t\t$moves+= $seqB[$i]- $minB;\n\t\t}\n\t}\n\t$answers[]= $moves;\n\n}\nforeach($answers as $a) echo $a.PHP_EOL;"}], "negative_code": [{"source_code": " $diffB){\n\t\t\t\t$moves += $diffA - $max_double_decrements;\n\t\t\t}else{\n\t\t\t\t$moves += $diffB - $max_double_decrements;\n\t\t\t}\n\t\t}elseif($minA < $seqA[$i]){\n\t\t\t$moves+= $seqA[$i]- $minA;\n\t\t}elseif($minB < $seqB[$i]){\n\t\t\t$moves+= $seqB[$i]- $minB;\n\t\t}\n\t}\n\n}\necho $moves;"}], "src_uid": "35368cefc5ce46a9f41a15734826a151"} {"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\t$stream = STDIN;\n\tif ($is_test)\n\t\t$stream = $f;\n\t/* begin body */\n\t$charFind = array('a' => true, 'e' => true, 'i' => true, 'o' => true, 'u' => true, 'y' => true);\n\t$strCount = readNum($stream, true);\n\t$rules = readStringExplodeNum($stream, ' ', true);\n\t$isFail = false;\n\tfor ($i = 0; $i < $strCount; $i++) {\n\t\t$str = readString($stream);\n\t\t$words = explode(' ', $str);\n\t\t$slogCount = 0;\n\t\tforeach ($words as $word) {\n\t\t\t$wordLen = strlen($word);\n\t\t\t$wordSlogCount = 0;\n\t\t\tfor ($k = 0; $k < $wordLen; $k++) {\n\t\t\t\tif (!empty($charFind[$word[$k]])) {\n\t\t\t\t\t$wordSlogCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$slogCount+=$wordSlogCount;\n\t\t}\n\t\tif ($slogCount != $rules[$i]) {\n\t\t\techo 'NO';\n\t\t\t$isFail = true;\n\t\t\tbreak;\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": ""}], "negative_code": [], "src_uid": "cf595689b5cbda4f1d629524ad275650"} {"source_code": "x = $x;\n $this->y = $y;\n $this->m = $m;\n }\n\n /**\n * @param int $a\n * @param int $b\n * @return bool\n */\n public function checkPair(int $a, int $b): bool {\n for ($i = 0; $i < $this->m; $i++) {\n if ($this->x[$i] === $a\n || $this->x[$i] === $b\n || $this->y[$i] === $a\n || $this->y[$i] === $b\n ) {\n continue;\n }\n if ($b === 0) {\n return $this->checkPair($a, $this->x[$i]) || $this->checkPair($a, $this->y[$i]);\n }\n return false;\n }\n return true;\n }\n}\n\n$stdin = STDIN;\n[$n, $m] = fscanf($stdin, '%u %u');\n\n$x = $y = [];\nwhile ([$x_, $y_] = fscanf($stdin, '%u %u')) {\n $x[] = $x_;\n $y[] = $y_;\n}\n$pairs = new Pairs($x, $y, $m);\necho ($pairs->checkPair($x[0], 0) || $pairs->checkPair($y[0], 0)) ? 'YES' : 'NO';\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " $item) {\n break;\n}\n$result = false;\nforeach ($unique as $b => $amount) {\n if ($a === $b) {\n continue;\n }\n $fail = false;\n foreach ($pairs as $pair) {\n [$x, $y] = $pair;\n if ($a !== $x && $a !== $y && $b !== $x && $b !== $y) {\n $fail = true;\n break;\n }\n }\n if (!$fail) {\n $result = true;\n break;\n }\n}\necho $result ? 'YES' : 'NO';\n"}, {"source_code": "x = $x;\n $this->y = $y;\n }\n\n /**\n * @param int $a\n * @param int $b\n * @return bool\n */\n public function checkPair(int $a, int $b): bool {\n for ($i = 0; $i < $this->m; $i++) {\n if ($this->x[$i] === $a\n || $this->x[$i] === $b\n || $this->y[$i] === $a\n || $this->y[$i] === $b\n ) {\n continue;\n }\n if ($b === 0) {\n return $this->checkPair($a, $this->x[$i]) || $this->checkPair($a, $this->y[$i]);\n }\n return false;\n }\n return true;\n }\n}\n\n$stdin = STDIN;\n[$n, $m] = fscanf($stdin, '%u %u');\n\n$x = $y = [];\nwhile ([$x_, $y_] = fscanf($stdin, '%u %u')) {\n $x[] = $x_;\n $y[] = $y_;\n}\n$pairs = new Pairs($x, $y, $m);\necho ($pairs->checkPair($x[0], 0) || $pairs->checkPair($y[0], 0)) ? 'YES' : 'NO';\n"}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "bba30bd91f085471f624c0f723b78a82"} {"source_code": " $size) {\n $unit[$i] = 0;\n }\n }\n$u=0;\nforeach ($unit as $val) {\n $runningSum += $val;\n if ($runningSum > $waste) {\n $runningSum =0;\n $u++;\n }\n}\necho $u;\n?>", "positive_code": [{"source_code": " $c)\n {\n $f++;\n $e = 0;\n }\n }\n}\nprint $f;\n?>"}, {"source_code": " $orange) {\n if ($orange > $max_size) {\n continue;\n }\n\n $collect_waste += $orange;\n\n if ($collect_waste > $waste_size) {\n $empty_wastes++;\n $collect_waste = 0;\n }\n}\n\necho \"$empty_wastes\\n\";\n"}, {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\tlist(, $b, $d) = readStringExplodeNum($f, ' ', true);\n\t$sizes = readStringExplodeNum($f, ' ', true);\n\t$poll = 0;\n\t$answer = 0;\n\tforeach ($sizes as $a) {\n\t\tif ($a > $b) {\n\t\t\tcontinue;\n\t\t}\n\t\t$poll+=$a;\n\t\tif ($poll > $d) {\n\t\t\t$poll = 0;\n\t\t\t$answer++;\n\t\t}\n\t}\n\techo $answer;\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();"}, {"source_code": " $d )\n {\n $count++ ;\n $waste = 0 ;\n }\n else\n {\n $waste += $arr[$i] ;\n }\n }\n}\necho $count ;\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n\n?>"}, {"source_code": "$d)\n {\n $v_count+=1;\n $v=0;\n// $v=$v%$d;\n }\n}\necho $v_count;\n?>\n\n"}, {"source_code": " $b) {\n continue;\n }\n\n $sum += $w;\n\n if ($sum > $d) {\n $sum = 0;\n $count++;\n continue;\n }\n }\n\n return $count;\n }\n\n public function run()\n {\n fscanf(STDIN, '%d %d %d', $n, $b, $d);\n $p = explode(' ', trim(fgets(STDIN)));\n\n echo $this->solve($p, $b, $d) . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->run();\n\n"}, {"source_code": " $b) {\n continue;\n }\n\n $sum += $w;\n\n if ($sum > $d) {\n while ($sum > $d) {\n $count++;\n $sum = 0;\n continue;\n }\n }\n }\n\n if ($sum > $d) {\n $count++;\n }\n\n echo $count . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->solve();\n\n"}, {"source_code": "$container_volume){\n\t\t$oporodj+=1;\n\t\t//$current_level-=$container_volume;\n\t\t$current_level=0;\n\t\t\n\t}\n}\n\necho $oporodj;\n\n\n\n\n\n?>"}, {"source_code": " $x)\n continue;\n $s += $t[$i];\n if($s > $y)\n {\n $ans ++;\n $s = 0;\n }\n }\n echo $ans;\n?>\n"}], "negative_code": [{"source_code": " $c)\n {\n $f++;\n $e -= $c;\n }\n }\n}\nprint $f;\n?>"}, {"source_code": " $orange) {\n if ($orange > $max_size) {\n continue;\n }\n\n $collect_waste += $orange;\n\n if ($collect_waste > $waste_size) {\n $empty_wastes++;\n $waste_size += $waste_size;\n }\n}\n\necho \"$empty_wastes\\n\";\n"}, {"source_code": " $d )\n {\n $count++ ;\n $waste = $arr[$i] ;\n }\n else\n {\n $waste += $arr[$i] ;\n }\n }\n}\necho $count ;\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n\n?>"}, {"source_code": "=$d)\n {\n $v_count=(int)($v/$d);\n $v=$v%$d;\n }\n}\necho $v_count;\n?>\n\n"}, {"source_code": "$d)\n {\n $v_count+=1;\n $v=0;\n// $v=$v%$d;\n }\n}\necho $v_count;\n?>\n\n"}, {"source_code": "$d)\n {\n $v_count=(int)($v/$d);\n $v=0;\n// $v=$v%$d;\n }\n}\necho $v_count;\n?>\n\n"}, {"source_code": " $b) {\n continue;\n }\n\n if ($sum > $d) {\n $count++;\n $sum = 0;\n continue;\n }\n\n $sum += $w;\n }\n\n if ($sum > $d) {\n $count++;\n }\n\n echo $count . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->solve();\n\n"}, {"source_code": " $b) {\n continue;\n }\n\n if ($sum > $d) {\n $count++;\n $sum %= $d;\n continue;\n }\n\n $sum += $w;\n }\n\n if ($sum > $d) {\n $count++;\n }\n\n echo $count . PHP_EOL;\n }\n}\n\n$sol = new Solution();\n$sol->solve();\n\n"}, {"source_code": "$container_volume){\n\t\t$oporodj+=1;\n\t\t//$current_level-=$container_volume;\n\t\t$current_level=0;\n\t\t\n\t}\n}\n\necho $oporodj;\n"}, {"source_code": "$container_volume){\n\t\t$oporodj+=1;\n\t\t$current_level-=$container_volume;\n\t}\n}\n\necho $oporodj;"}, {"source_code": "$container_volume){\n\t\t$oporodj+=1;\n\t\t$current_level-=$container_volume;\n\t}\n}\n\necho $oporodj;\n\n\n\n\n\n?>"}, {"source_code": "$container_volume){\n\t\t$oporodj+=1;\n\t\t$current_level-=$container_volume;\n\t}\n}\n\necho $oporodj;\n\n\n\n\n\n?>"}, {"source_code": "$container_volume){\n\t\t\t$oporodj+=1;\n\t\t\t$current_level-=$container_volume;\n\t\t}\n\t}\n}\n\necho $oporodj;\n\n\n\n\n\n?>"}, {"source_code": " $y)\n {\n $ans ++;\n $s = 0;\n }\n }\n echo $ans;\n?>\n"}, {"source_code": " $y)\n {\n $ans ++;\n $s = 0;\n }\n }\n echo $ans;\n?>\n"}], "src_uid": "06e9649963715e56d97297c6104fbc00"} {"source_code": "", "positive_code": [{"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "6b37fc623110e49a5e311a2d186aae46"} {"source_code": "= 2 && $b >= 2 && $c >= 2) {\n echo \"YES\\n\";\n echo $a.' '. $b. ' '. $c.\"\\n\";\n break;\n }\n } \n\n }\n \n if($a < 2 || $b < 2 || $c < 2) {\n echo \"NO\\n\";\n }\n \n }", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "= 2)){\n $b = true;\n $r2 = $v;\n $r3 = $m / $v;\n }\n }\n }\n }\n if($b){\n echo \"YES\\n\";\n echo $r1.\" \".$r2.\" \".$r3.\"\\n\";\n } else {\n echo \"NO\\n\";\n }\n}\n"}, {"source_code": "=2 && ($n/($a*$b))!=$a && ($n/($a*$b))!=$b){$ok=true;break 2;}\n }\n\n }\n }\n if($ok)\n {\n echo \"YES\" . \"\\n\";\n echo $b . \" \" . $a . \" \" . $n/($a*$b) . \"\\n\";\n }else\n {\n echo \"NO\".\"\\n\";\n }\n\n }\n\n\n\n}\n\n\n\n?>"}, {"source_code": "=2){\n echo \"YES\\n\";\n echo $a. \" \".$b. \" \".$c.\"\\n\";\n $status = true;\n break;\n }\n }\n }\n }\n \n if ($status) {\n break;\n }\n }\n if (!$status) {\n echo \"NO\\n\";\n }\n \n}\n \nfunction getMin($n1, $number)\n{\n $res1 = 2;\n for ($i1 = 2 ; $i1 <=$number; $i1++) {\n if ($n1%$i1 == 0) {\n $res1 = $i1;\n break;\n }\n }\n return $res1;\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $T1) {\n // break;\n // }\n \n }\n break;\n } \n // $T1 = $n / $j;\n // if($j > $T1) {\n // break;\n // }\n }\n \n if($a >= 2 && $b >= 2 && $c >= 2) {\n echo \"YES\\n\";\n echo $a.' '. $b. ' '. $c.\"\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n \n }"}, {"source_code": " $T1) {\n // break;\n // }\n \n }\n break;\n } \n // $T1 = $n / $j;\n // if($j > $T1) {\n // break;\n // }\n }\n \n if($a >= 2 && $b >= 2 && $c >= 2) {\n echo \"YES\\n\";\n echo $a.' '. $b. ' '. $c.\"\\n\";\n } else {\n echo \"NO\\n\";\n }\n \n \n \n \n \n }\n "}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n=2){\n echo \"YES\\n\";\n echo $a. \" \".$b. \" \".$c.\"\\n\";\n $status = true;\n break;\n }\n }\n }\n }\n \n if ($status) {\n break;\n }\n }\n if (!$status) {\n echo \"NO\\n\";\n }\n \n}\n "}, {"source_code": ""}, {"source_code": ""}], "src_uid": "0f7ceecdffe11f45d0c1d618ef3c6469"} {"source_code": " count($uniqw)) {\n echo 'YES';\n} else if (count($uniqp) == count($uniqw) && !$even) {\n echo 'YES';\n} else {\n echo 'NO';\n}\n\n//echo (count($uniqp) > count($uniqw) && (count($shared) % 2 == 0)) ? 'YES' : 'NO';\n\n", "positive_code": [{"source_code": " count($m))\n {\n print \"YES\";\n }\n else\n {\n print \"NO\";\n }\n}\nelse\n{\n if(count($m) > count($k))\n {\n print \"NO\";\n }\n else\n {\n print \"YES\";\n }\n}\n?>"}, {"source_code": " $v) {\n if (isset($arrB[$k])) {\n $cntA++;\n }\n }\n foreach ($arrB as $k => $v) {\n if (isset($arrA[$k])) {\n $cntB++;\n }\n }\n\n $uniA = $a - $cntA;\n $uniB = $b - $cntB;\n\n for ($i = 0; $i < 100000; $i++) {\n switch ($i % 2) {\n case 0:\n if ($cntA > 0) {\n $cntA--;\n $cntB--;\n if ($uniB < 0) {\n exit('YES');\n }\n } else {\n $uniA--;\n if ($uniA < 0) {\n exit('NO');\n }\n }\n break;\n\n case 1:\n if ($cntB > 0) {\n $cntA--;\n $cntB--;\n if ($cntA < 0) {\n exit('NO');\n }\n } else {\n $uniB--;\n if ($uniB < 0) {\n exit('YES');\n }\n }\n break;\n }\n if (DEBUG) echo \"A:{$uniA}-{$cntA}\\n\";\n if (DEBUG) echo \"B:{$uniB}-{$cntB}\\n\";\n if (DEBUG) echo \"-------\\n\";\n }\n"}], "negative_code": [{"source_code": " $v) {\n if (isset($arrB[$k])) {\n $cntA++;\n }\n }\n foreach ($arrB as $k => $v) {\n if (isset($arrA[$k])) {\n $cntB++;\n }\n }\n\n $uniA = $a - $cntA;\n $uniB = $b - $cntB;\n\n for ($i = 0; $i < 100000; $i++) {\n switch ($i % 2) {\n case 0:\n if ($uniA > 0) {\n $uniA--;\n $uniB--;\n if ($uniB < 0) {\n exit('YES');\n }\n } else {\n $cntA--;\n if ($cntA < 0) {\n exit('NO');\n }\n }\n break;\n\n case 1:\n if ($uniB > 0) {\n $uniA--;\n $uniB--;\n if ($uniA < 0) {\n exit('NO');\n }\n } else {\n $cntB--;\n if ($cntB < 0) {\n exit('YES');\n }\n }\n break;\n }\n // echo \"A:{$uniA} {$cntA}\\n\";\n // echo \"B:{$uniB} {$cntB}\\n\";\n // echo \"-------\\n\";\n }\n"}, {"source_code": "= count($uniqw) || (count($shared) % 2 == 0)) ? 'YES' : 'NO';\n\n"}, {"source_code": "= count($uniqw) ? 'YES' : 'NO';\n\n"}, {"source_code": " count($uniqw) || (count($shared) % 2 == 0)) ? 'YES' : 'NO';\n\n"}], "src_uid": "4b352854008a9378551db60b76d33cfa"} {"source_code": " 1);\n\n for ($i = 0; $i < $N; $i++) {\n // echo \"\\nRET:\\n\";\n // var_dump($ret);\n if (DEBUG) var_dump($arrP[$a[$i]]);\n if (is_array($arrP[$a[$i]])) {\n $cnt = count($arrP[$a[$i]]);\n for ($j = 0; $j < $cnt; $j++) {\n $sum[$arrP[$a[$i]][$j]]++;\n }\n }\n }\n\n // var_dump($sum);\n // echo \"answer:\";\n\n echo max($sum);\n\n if (DEBUG) {\n $tm2 = microtime(true);\n echo PHP_EOL . \"Time: \" . ($tm2 - $tm1);\n }\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " 1);\n\n for ($i = 0; $i < $N; $i++) {\n // echo \"\\nRET:\\n\";\n // var_dump($ret);\n // var_dump($arrP[$a[$i]]);\n if (is_array($arrP[$a[$i]])) {\n $cnt = count($arrP[$a[$i]]);\n for ($j = 0; $j < $cnt; $j++) {\n $sum[$arrP[$a[$i]][$j]]++;\n }\n }\n }\n\n // var_dump($sum);\n // echo \"answer:\";\n\n echo max($sum);\n\n if (DEBUG) {\n $tm2 = microtime(true);\n echo PHP_EOL . \"Time: \" . ($tm2 - $tm1);\n }\n"}, {"source_code": " $a[$i]) break;\n if ($a[$i] % $pnum == 0) {\n $sum[$pnum]++;\n }\n }\n }\n\n // var_dump($sum);\n\n echo max($sum);\n\n // $tm2 = microtime(true);\n\n // echo PHP_EOL . ($tm2 - $tm1);\n\n"}, {"source_code": " 1);\n\n for ($i = 0; $i < $N; $i++) {\n // echo \"\\nRET:\\n\";\n // var_dump($ret);\n // if (DEBUG) var_dump($arrP[$a[$i]]);\n if (is_array($arrP[$a[$i]])) {\n $cnt = count($arrP[$a[$i]]);\n for ($j = 0; $j < $cnt; $j++) {\n $sum[$arrP[$a[$i]][$j]]++;\n }\n }\n }\n\n // var_dump($sum);\n // echo \"answer:\";\n\n echo max($sum);\n\n if (DEBUG) {\n $tm2 = microtime(true);\n echo PHP_EOL . \"Time: \" . ($tm2 - $tm1);\n }\n"}], "src_uid": "eea7860e6bbbe5f399b9123ebd663e3e"} {"source_code": " ", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": " $d) || (($a != 2) && ($b == 1) && ($c == 1)))\n{\n print \"-1\";\n}\nelse\n{\n if($c == 1)\n {\n $e = 2;\n for($x = 1; $x < $a; $x++)\n {\n print \"1 \" . $e . \"\\n\";\n $e++;\n }\n }\n elseif($b == $c)\n {\n $e = 2;\n for($x = 1; $x <= $c; $x++)\n {\n if($x == 1)\n {\n print \"1 \" . $e . \"\\n\";\n $e++;\n }\n else\n {\n print ($e - 1) . \" \" . $e . \"\\n\";\n $e++;\n }\n }\n $f = $a;\n $f--;\n if($f > $c)\n {\n $g = $f - $c;\n for($x = 1; $x <= $g; $x++)\n {\n print \"2 \" . $e . \"\\n\";\n $e++;\n }\n }\n }\n elseif($b != $c)\n {\n $e = 2;\n for($x = 1; $x <= $c; $x++)\n {\n if($x == 1)\n {\n print \"1 \" . $e . \"\\n\";\n $e++;\n }\n else\n {\n print ($e - 1) . \" \" . $e . \"\\n\";\n $e++;\n }\n }\n $f = $a;\n $f--;\n if($f > $c)\n {\n $g = $f - $c;\n for($x = 1; $x <= $g - ($b - $c); $x++)\n {\n print \"2 \" . $e . \"\\n\";\n $e++;\n }\n }\n $h = $b - $c;\n for($x = 1; $x <= $h; $x++)\n {\n if($x == 1)\n {\n print \"1 \" . $e . \"\\n\";\n $e++;\n }\n else\n {\n print ($e - 1) . \" \" . $e . \"\\n\";\n $e++;\n }\n }\n }\n}\n?>", "positive_code": [{"source_code": " 2 * $h || $d < $h) {\n echo \"-1\\n\";\n exit;\n}\n\nif ($n <= $d) {\n echo \"-1\\n\";\n exit;\n}\n\nif ($d == 1 && $h == 1) {\n if ($n == 2) {\n echo \"1 2\\n\";\n exit;\n } else {\n echo \"-1\\n\";\n exit;\n }\n}\n\n$n--;\nfor ($i = 1; $i <= $h; $i++) {\n echo \"$i \" . ($i + 1) . \"\\n\";\n $n--;\n}\n\n$ov = 1;\n$v = $i + 1;\nfor ($i = 1; $i <= $d - $h; $i++) {\n echo \"$ov $v\\n\";\n $ov = $v;\n $v++;\n $n--;\n}\n\nif ($d != $h) {\n $ov = 1;\n} else {\n $ov = 2;\n}\nfor ($i = 1; $i <= $n; $i++, $v++) {\n echo \"$ov $v\\n\";\n}\n"}], "negative_code": [{"source_code": " $d)\n{\n print \"-1\";\n}\nelse\n{\n $e = $b % 2;\n if($e == 0)\n {\n $f = $a;\n $f--;\n $g = $f % $c;\n if($g == 0)\n {\n $h = $f / $c;\n $i = 2;\n for($x = 1; $x <= $h; $x++)\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($y == 1)\n {\n print \"1 \" . $i . \"\\n\";\n $i++;\n }\n else\n {\n print ($i - 1) . \" \" . $i . \"\\n\";\n $i++;\n }\n }\n }\n }\n else\n {\n $h = floor($f / $c);\n $i = 2;\n for($x = 1; $x <= $h; $x++)\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($y == 1)\n {\n print \"1 \" . $i . \"\\n\";\n $i++;\n }\n else\n {\n print ($i - 1) . \" \" . $i . \"\\n\";\n $i++;\n }\n }\n }\n print ($i - 2) . \" \" . $i;\n }\n }\n else\n {\n $f = floor($b / 2);\n $g = ceil($b / 2);\n $h = $a;\n $h--;\n $h -= $f;\n $i = $h % $c;\n if($i == 0)\n {\n $j = $h / $c;\n $k = 2;\n for($x = 1; $x <= $j + 1; $x++)\n {\n if($x == 1)\n {\n for($y = 1; $y <= $f; $y++)\n {\n if($y == 1)\n {\n print \"1 \" . $k . \"\\n\";\n $k++;\n }\n else\n {\n print ($k - 1) . \" \" . $k . \"\\n\";\n $k++;\n }\n }\n }\n else\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($y == 1)\n {\n print \"1 \" . $k . \"\\n\";\n $k++;\n }\n else\n {\n print ($k - 1) . \" \" . $k . \"\\n\";\n $k++;\n }\n }\n }\n }\n }\n else\n {\n $j = $h / $c;\n $k = 2;\n for($x = 1; $x <= $j + 1; $x++)\n {\n if($x == 1)\n {\n for($y = 1; $y <= $f; $y++)\n {\n if($y == 1)\n {\n print \"1 \" . $k . \"\\n\";\n $k++;\n }\n else\n {\n print ($k - 1) . \" \" . $k . \"\\n\";\n $k++;\n }\n }\n }\n else\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($y == 1)\n {\n print \"1 \" . $k . \"\\n\";\n $k++;\n }\n else\n {\n print ($k - 1) . \" \" . $k . \"\\n\";\n $k++;\n }\n }\n }\n }\n print ($k - 2) . \" \" . $k;\n $k++;\n }\n }\n}\n?>"}, {"source_code": " $d) || (($a != 2) && ($b == 1) && ($c == 1)))\n{\n print \"-1\";\n}\nelse\n{\n if($b == $c)\n {\n $e = 2;\n for($x = 1; $x <= $c; $x++)\n {\n if($x == 1)\n {\n print \"1 \" . $e . \"\\n\";\n $e++;\n }\n else\n {\n print ($e - 1) . \" \" . $e . \"\\n\";\n $e++;\n }\n }\n $f = $a;\n $f--;\n if($f > $c)\n {\n $g = $f - $c;\n for($x = 1; $x <= $g; $x++)\n {\n print \"2 \" . $e . \"\\n\";\n $e++;\n }\n }\n }\n else\n {\n $e = 2;\n for($x = 1; $x <= $c; $x++)\n {\n if($x == 1)\n {\n print \"1 \" . $e . \"\\n\";\n $e++;\n }\n else\n {\n print ($e - 1) . \" \" . $e . \"\\n\";\n $e++;\n }\n }\n $f = $a;\n $f--;\n if($f > $c)\n {\n $g = $f - $c;\n for($x = 1; $x <= $g - ($b - $c); $x++)\n {\n print \"2 \" . $e . \"\\n\";\n $e++;\n }\n }\n $h = $b - $c;\n for($x = 1; $x <= $h; $x++)\n {\n if($x == 1)\n {\n print \"1 \" . $e . \"\\n\";\n $e++;\n }\n else\n {\n print ($e - 1) . \" \" . $e . \"\\n\";\n $e++;\n }\n }\n }\n}\n?>"}, {"source_code": " 2 * $h || $d < $h) {\n echo \"-1\\n\";\n exit;\n}\n\nif ($d == $h) {\n if ($n != $d + 1) {\n echo \"-1\\n\";\n exit;\n }\n}\n\nif ($n <= $d) {\n echo \"-1\\n\";\n exit;\n}\n\n$n--;\nfor ($i = 1; $i <= $h; $i++) {\n echo \"$i \" . ($i + 1) . \"\\n\";\n $n--;\n}\n\n$ov = 1;\n$v = $i + 1;\nfor ($i = 1; $i <= $d - $h; $i++) {\n echo \"$ov $v\\n\";\n $ov = $v;\n $v++;\n $n--;\n}\n\nfor ($i = 1; $i <= $n; $i++, $v++) {\n echo \"1 $v\\n\";\n}\n"}], "src_uid": "32096eff277f19d227bccca1b6afc458"} {"source_code": "0,\"y\"=>0];\n fscanf(STDIN, \"%d\", $N);\n for($i=$N;$i;$i--) fscanf(STDIN, \"%d %d\", $a[$i][\"x\"],$a[$i][\"y\"]);\n fscanf(STDIN, \"%d\", $M);\n for($i=1;$i<=$M;$i++)\n {\n $p=[\"x\"=>0,\"y\"=>0];\n $l=2;\n $r=$N;\n fscanf(STDIN, \"%d %d\", $p[\"x\"],$p[\"y\"]);\n while($l<$r)\n {\n $mid=($l+$r)>>1;\n if(xm($a[1],$a[$mid],$p)<=0) $r=$mid;\n else $l=$mid+1;\n }\n if($l==2||xm($a[1],$a[$N],$p)>=0) continue;\n if(xm($a[$l],$a[$l-1],$p)<0) $cnt++;\n }\n if($cnt==$M) echo \"YES\\n\";\n else echo\"NO\\n\";\n ", "positive_code": [{"source_code": " \n0,\"y\"=>0];\n fscanf(STDIN, \"%d\", $N);\n for($i=$N;$i;$i--) fscanf(STDIN, \"%d %d\", $a[$i][\"x\"],$a[$i][\"y\"]);\n fscanf(STDIN, \"%d\", $M);\n for($i=1;$i<=$M;$i++)\n {\n $p=[\"x\"=>0,\"y\"=>0];\n $l=2;\n $r=$N;\n fscanf(STDIN, \"%d %d\", $p[\"x\"],$p[\"y\"]);\n while($l<$r)\n {\n $mid=($l+$r)>>1;\n if(xm($a[1],$a[$mid],$p)<=0) $r=$mid;\n else $l=$mid+1;\n }\n if($l==2||xm($a[1],$a[$N],$p)>=0) continue;\n if(xm($a[$l],$a[$l-1],$p)<0) $cnt++;\n }\n if($cnt==$M) echo \"YES\\n\";\n else echo\"NO\\n\";"}], "negative_code": [], "src_uid": "d9eb0f6f82bd09ea53a1dbbd7242c497"} {"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 = trim(fgets(STDIN));\n $d = trim(fgets(STDIN));\n $e = $c - 1;\n $f = 0;\n for($y = 0; $y < $c / 2; $y++)\n {\n $g = abs($b[$d[$y]] - $b[$d[$e]]);\n if(($g != 0) && ($g != 2))\n {\n $f = 1;\n break;\n }\n else\n {\n $e--;\n }\n }\n if($f == 1)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n}\n?>"}], "negative_code": [], "src_uid": "cc4cdcd162a83189c7b31a68412f3fe7"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "a5d3c9ea1c9affb0359d81dae4ecd7c8"} {"source_code": "\n", "positive_code": [{"source_code": "0){\nif (preg_match(\"/^\\+/\",$value)){\n$user = substr($value,1);\nif (!isset($users[$user])) $users[$user] = $user;\n} else if (preg_match(\"/^\\-/\",$value)){\n$user = substr($value,1);\nif (isset($users[$user])) unset($users[$user]);\n} else {\n$send = preg_split(\"/:/\",$value,2);\n$length+=strlen(trim($send[1]))*count($users);\n}\n}\n}\necho $length;\n?>"}, {"source_code": ""}, {"source_code": " \n"}, {"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 '';\n}\n\n$stdin = @fopen('data.txt', 'r');\nif(!$stdin) {\n $stdin = fopen('php://stdin', 'r');\n}\n\nfunction g() {\n global $stdin;\n return trim(fgets($stdin));\n}\n/****************************************************** Solving block *****************************************************/\n\n$cnt = 0;\n$res = 0;\n\nwhile($line = g()) {\n if(strpos($line, '+') === 0) {\n $cnt++;\n }\n if(strpos($line, '-') === 0) {\n $cnt--;\n }\n if(strpos($line, ':')) {\n list(,$mess) = explode(':', $line);\n $res += strlen($mess) * $cnt;\n }\n}\n\necho $res;\n\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$login) {\n if ($name === $login){\n unset($arrUsers[$index]);\n $res = TRUE;\n sort($arrUsers);\n }\n }\n return $res;\n}\n\n\n#\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\n$chat = file_get_contents(\"php://stdin\");\n\n//$chat = file_get_contents(\"test.txt\");\n$arrLogChat = explode(\"\\n\", $chat);\n\n$arrActUser = array();\n$size = 0;\n\nforeach ($arrLogChat as $logItem) {\n if ($logItem{0} == \"+\"){\n addUser($arrActUser, getName($logItem));\n next;\n }elseif($logItem{0} == \"-\"){\n deleteUser($arrActUser, getName($logItem));\n next;\n }else{\n if (isMessage($logItem)){\n if (checkUser($arrActUser, $logItem)){\n $size = $size + (getMessageSize($logItem) * count($arrActUser));\n }else{\n next;\n }\n }else{\n next;\n }\n }\n}\n\nfwrite(STDOUT, $size);\n//echo $size;\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "in();\n\t\tif ($com === \"\") break;\n\t\t\n\t\tif (strpos($com, \"+\") === 0) $user++;\n\t\telse if (strpos($com, \"-\") === 0) $user--;\n\t\telse $bytes += (strlen($com) - strpos($com, \":\") - 1) * $user;\n\t}\n\n\tprint($bytes);\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": "$login) {\n if ($name === $login){\n unset($arrUsers[$index]);\n $res = TRUE;\n sort($arrUsers);\n }\n }\n return $res;\n}\n\n\n#\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\n$chat = file_get_contents(\"php://stdin\");\n\n//$chat = file_get_contents(\"test.txt\");\n$arrLogChat = explode(\"\\n\", $chat);\n\n$arrActUser = array();\n$size = 0;\n\nforeach ($arrLogChat as $logItem) {\n if ($logItem{0} == \"+\"){\n addUser($arrActUser, getName($logItem));\n next;\n }elseif($logItem{0} == \"-\"){\n deleteUser($arrActUser, getName($logItem));\n next;\n }else{\n if (isMessage($logItem)){\n if (checkUser($arrActUser, $logItem)){\n $size = $size + getMessageSize($logItem);\n }else{\n next;\n }\n }else{\n next;\n }\n }\n}\n\necho $size;\n?>\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "0){\nif (preg_match(\"/^\\+/\",$value)){\n$user = substr($value,1);\nif (!isset($users[$user])) $users[] = $user;\n} else if (preg_match(\"/^\\-/\",$value)){\n$user = substr($value,1);\nif (isset($users[$user])) unset($users[$user]);\n} else {\n$send = preg_split(\"/:/\",$value,2);\n$length+=strlen(trim($send[1]))*count($users);\n}\n}\n}\necho $length;\nexit;\n?>"}, {"source_code": "0){\nif (preg_match(\"/^\\+/\",$value)){\n$user = substr($value,1);\nif (!isset($users[$user])) $users[] = $user;\n} else if (preg_match(\"/^\\-/\",$value)){\n$user = substr($value,1);\nif (isset($users[$user])) unset($users[$user]);\n} else {\n$send = preg_split(\"/:/\",$value,2);\n$length+=strlen(trim($send[1]))*count($users);\n}\n}\n}\necho $length;\n?>"}, {"source_code": " "}, {"source_code": "$b = 0; $c = 0;\nwhile(true)\n{\n $a = trim(fgets(STDIN));\n if($a{0} == '+')\n {\n ++$b;\n }elseif($a{0} == '-')\n {\n --$b;\n }elseif($a == '')\n {\n break;\n }\n else\n {\n $d = explode(':', $a);\n $c += strlen($d[1])*$b;\n }\n}\necho $c;"}, {"source_code": ""}], "src_uid": "d7fe15a027750c004e4f50175e1e20d2"} {"source_code": "", "positive_code": [{"source_code": " 0\n$d = array(); // < 0\n$e = array(); // = 0\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] < 0)\n {\n array_push($c, $b[$x]);\n }\n elseif($b[$x] > 0)\n {\n array_push($d, $b[$x]);\n }\n elseif($b[$x] == 0)\n {\n array_push($e, $b[$x]);\n }\n}\nif((count($d) == 0) && ((count($c) % 2) != 0))\n{\n print count($c) - 2 . \" \" . implode(\" \", array_slice($c, 2)) . \"\\n\";\n print 2 . \" \" . $c[0] . \" \" . $c[1] . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) == 0) && (count($c) % 2 == 0))\n{\n print count($c) - 3 . \" \" . implode(\" \", array_slice($c, 3)) . \"\\n\";\n print 2 . \" \" . $c[0] . \" \" . $c[1] . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[2];\n}\nelseif((count($d) > 0) && ((count($c) % 2) != 0))\n{\n print count($c) . \" \" . implode(\" \", $c) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) > 0) && ((count($c) % 2) == 0))\n{\n print count($c) - 1 . \" \" . implode(\" \", array_slice($c, 1)) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[0];\n}\n?>"}, {"source_code": " 0) {\n $n++;\n }\n}\n \nforeach($a as $number) {\n if($number == 0) {\n $b[3][]=$number;\n }\n elseif ($number < 0) {\n if ($fl == 0) {\n $b[1][]=$number;\n $fl++;\n }\n elseif ($n == 0) {\n if ($i % 2 != 0) {\n $b[2][]=$number;\n }\n elseif (count($b[2]) == 0 || count($b[2]) % 2 != 0) {\n $b[2][]=$number;\n }\n else $b[3][]=$number;\n }\n else $b[3][]=$number;\n }\n else $b[2][]=$number;\n}\necho count($b[1]).\" \";\nforeach($b[1] as $number) {\n echo $number.\" \";\n}\necho \"\\r\\n\".count($b[2]).\" \";\nforeach($b[2] as $number) {\n echo $number.\" \";\n}\necho \"\\r\\n\".count($b[3]).\" \";\nforeach($b[3] as $number) {\n echo $number.\" \";\n}\n?>"}], "negative_code": [{"source_code": " 0\n$d = array(); // < 0\n$e = array(); // = 0\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] < 0)\n {\n array_push($c, $b[$x]);\n }\n elseif($b[$x] > 0)\n {\n array_push($d, $b[$x]);\n }\n elseif($b[$x] == 0)\n {\n array_push($e, $b[$x]);\n }\n}\nif((count($d) == 0) && ((count($c) % 2) != 0))\n{\n print count($c) - 2 . \" \" . implode(array_slice($c, 2)) . \"\\n\";\n print 2 . \" \" . $c[0] . \" \" . $c[1] . \"\\n\";\n print count($e) . \" \" . implode($e);\n}\nelseif((count($d) == 0) && (count($c) % 2 == 0))\n{\n print count($c) - 2 . \" \" . implode(array_slice($c, 3)) . \"\\n\";\n print 2 . \" \" . $c[0] . $c[1] . \"\\n\";\n print count($e) + 1 . \" \" . implode($e) . \" \" . $c[2];\n}\nelseif((count($d) > 0) && ((count($c) % 2) != 0))\n{\n print count($c) . \" \" . implode($c) . \"\\n\";\n print count($d) . \" \" . implode($d) . \"\\n\";\n print count($e) . \" \" . implode($e);\n}\nelseif((count($d) > 0) && ((count($c) % 2) == 0))\n{\n print count($c) - 1 . \" \" . implode(array_slice($c, 2)) . \"\\n\";\n print count($d) . \" \" . implode($d) . \"\\n\";\n print count($e) + 1 . \" \" . implode($e) . \" \" . $c[0];\n}\n?>"}, {"source_code": " 0\n$d = array(); // < 0\n$e = array(); // = 0\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] < 0)\n {\n array_push($c, $b[$x]);\n }\n elseif($b[$x] > 0)\n {\n array_push($d, $b[$x]);\n }\n elseif($b[$x] == 0)\n {\n array_push($e, $b[$x]);\n }\n}\nif((count($d) == 0) && ((count($c) % 2) != 0))\n{\n print count($c) - 2 . \" \" . implode(\" \", array_slice($c, 2)) . \"\\n\";\n print 2 . \" \" . $c[0] . \" \" . $c[1] . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) == 0) && (count($c) % 2 == 0))\n{\n print count($c) - 2 . \" \" . implode(\" \", array_slice($c, 3)) . \"\\n\";\n print 2 . \" \" . $c[0] . $c[1] . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[2];\n}\nelseif((count($d) > 0) && ((count($c) % 2) != 0))\n{\n print count($c) . \" \" . implode(\" \", $c) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) > 0) && ((count($c) % 2) == 0))\n{\n print count($c) - 1 . \" \" . implode(array_slice($c, 1)) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[0];\n}\n?>"}, {"source_code": " 0\n$d = array(); // < 0\n$e = array(); // = 0\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] < 0)\n {\n array_push($c, $b[$x]);\n }\n elseif($b[$x] > 0)\n {\n array_push($d, $b[$x]);\n }\n elseif($b[$x] == 0)\n {\n array_push($e, $b[$x]);\n }\n}\nif((count($d) == 0) && ((count($c) % 2) != 0))\n{\n print count($c) - 2 . \" \" . implode(\" \", array_slice($c, 2)) . \"\\n\";\n print 2 . \" \" . $c[0] . \" \" . $c[1] . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) == 0) && (count($c) % 2 == 0))\n{\n print count($c) - 3 . \" \" . implode(\" \", array_slice($c, 3)) . \"\\n\";\n print 2 . \" \" . $c[0] . $c[1] . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[2];\n}\nelseif((count($d) > 0) && ((count($c) % 2) != 0))\n{\n print count($c) . \" \" . implode(\" \", $c) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) > 0) && ((count($c) % 2) == 0))\n{\n print count($c) - 1 . \" \" . implode(\" \", array_slice($c, 1)) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[0];\n}\n?>"}, {"source_code": " 0\n$d = array(); // < 0\n$e = array(); // = 0\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] < 0)\n {\n array_push($c, $b[$x]);\n }\n elseif($b[$x] > 0)\n {\n array_push($d, $b[$x]);\n }\n elseif($b[$x] == 0)\n {\n array_push($e, $b[$x]);\n }\n}\nif((count($d) == 0) && ((count($c) % 2) != 0))\n{\n print count($c) - 2 . \" \" . implode(\" \", array_slice($c, 2)) . \"\\n\";\n print 2 . \" \" . $c[0] . \" \" . $c[1] . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) == 0) && (count($c) % 2 == 0))\n{\n print count($c) - 2 . \" \" . implode(\" \", array_slice($c, 3)) . \"\\n\";\n print 2 . \" \" . $c[0] . $c[1] . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[2];\n}\nelseif((count($d) > 0) && ((count($c) % 2) != 0))\n{\n print count($c) . \" \" . implode(\" \", $c) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) . \" \" . implode(\" \", $e);\n}\nelseif((count($d) > 0) && ((count($c) % 2) == 0))\n{\n print count($c) - 1 . \" \" . implode(\" \", array_slice($c, 1)) . \"\\n\";\n print count($d) . \" \" . implode(\" \", $d) . \"\\n\";\n print count($e) + 1 . \" \" . implode(\" \", $e) . \" \" . $c[0];\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n $n++;\n }\n}\n \nforeach($a as $number) {\n if($number == 0) {\n $b[3][]=$number;\n }\n elseif ($number < 0) {\n if ($fl == 0) {\n $b[1][]=$number;\n $fl++;\n }\n elseif ($n==0) {\n $b[2][]=$number;\n }\n else $b[3][]=$number;\n }\n else $b[2][]=$number;\n}\necho count($b[1]).\" \";\nforeach($b[1] as $number) {\n echo $number.\" \";\n}\necho \"\\r\\n\".count($b[2]).\" \";\nforeach($b[2] as $number) {\n echo $number.\" \";\n}\necho \"\\r\\n\".count($b[3]).\" \";\nforeach($b[3] as $number) {\n echo $number.\" \";\n}\n?>"}, {"source_code": " $c[$x - 1])\n {\n array_push($c, $d);\n array_push($e, $d - $c[$x - 1]);\n }\n}\nprint array_sum($e) + $a + $a - 1;\n?>", "positive_code": [{"source_code": "\n"}, {"source_code": "\n\n $h[$i+1]) {\n $sum += $h[$i] - $h[$i+1];\n $th = $h[$i+1];\n } else {\n $th = $h[$i];\n }\n $sum ++;\n}\n\nprintf(\"%d\", $sum - 1);\n\n?>\n"}], "negative_code": [{"source_code": " $c[$x - 1])\n {\n array_push($c, $d);\n array_push($e, $d - $c[$x - 1]);\n }\n elseif($d < $c[$x - 1])\n {\n array_push($c, $d);\n array_push($e, $c[$x - 1] - $d);\n }\n}\nprint array_sum($e) + $a + $a - 1;\n?>"}, {"source_code": " $c[$x - 1])\n {\n array_push($c, $d - $c[$x - 1]);\n }\n elseif($d < $c[$x - 1])\n {\n array_push($c, $c[$x - 1] - $d);\n }\n}\nprint array_sum($c) + $a + $a - 1;\n?>"}], "src_uid": "a20ca4b053ba71f6b2dc05749287e0a4"} {"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}", "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}"}], "src_uid": "cdcf95e29d3260a07dded74286fc3798"} {"source_code": " $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 3;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n elseif($m > $l)\n {\n $r = array_search($i, $b);\n $n[$r] += 3;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n $r = array_search($h, $b);\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n \n }\n elseif($l == $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 1;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $n[$r] += 1;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n}\nasort($o);\n$v = array_keys($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $n[$v[$x]] += \"0.0\" . $t;\n if($o[$v[$x]] != $o[$v[$x + 1]])\n {\n $t++;\n }\n}\nasort($p);\n$v = array_keys($p);\nfor($x = 0; $x < count($p); $x++)\n{\n $n[$v[$x]] += \"0.000\" . $u;\n if($p[$v[$x]] != $p[$v[$x + 1]])\n {\n $u++;\n }\n}\narsort($n);\n$v = array_keys($n);\nfor($x = 0; $x < count($n) / 2; $x++)\n{\n array_push($w, $b[$v[$x]]);\n}\nsort($w);\nfor($x = 0; $x < count($w); $x++)\n{\n if($x != count($w) - 1)\n {\n print $w[$x] . \"\\n\";\n }\n else\n {\n print $w[$x];\n }\n}\n?>", "positive_code": [{"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 '';\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$teams = array();\nfor ($i = 0; $i < $n; $i++) {\n $teams[g()] = array('score' => 0, 'diffr' => 0, 'goals' => 0);\n}\n\n$games = $n * ($n - 1) / 2;\nfor ($i = 0; $i < $games; $i++) {\n list($team, $score) = explode(' ', g());\n list($team1, $team2) = explode('-', $team);\n list($score1, $score2) = explode(':', $score);\n\n $teams[$team1]['score'] += $score1 > $score2 ? 3 : ($score1 == $score2 ? 1 : 0);\n $teams[$team1]['diffr'] += $score1 - $score2;\n $teams[$team1]['goals'] += $score1;\n\n $teams[$team2]['score'] += $score2 > $score1 ? 3 : ($score1 == $score2 ? 1 : 0);\n $teams[$team2]['diffr'] += $score2 - $score1;\n $teams[$team2]['goals'] += $score2;\n}\n\n$list = array_keys($teams);\n\n$size = sizeof($list);\nfor($i = 0; $i < $size; $i++) {\n for($j = $i+1; $j < $size; $j++) {\n $team1 = $list[$i];\n $team2 = $list[$j];\n $score1 = $teams[$team1]['score'];\n $score2 = $teams[$team2]['score'];\n $diffr1 = $teams[$team1]['diffr'];\n $diffr2 = $teams[$team2]['diffr'];\n $goals1 = $teams[$team1]['goals'];\n $goals2 = $teams[$team2]['goals'];\n\n $swap = $score1 < $score2 || $score1 == $score2 && $diffr1 < $diffr2 || $score1 == $score2 && $diffr1 == $diffr2 && $goals1 < $goals2;\n if($swap) {\n $list[$i] = $team2;\n $list[$j] = $team1;\n }\n }\n}\n\n$off = $n / 2;\n$play = array();\nfor($i = 0; $i < $off; $i++) {\n $play[] = $list[$i];\n}\n\nsort($play);\n\necho implode(\"\\n\", $play)\n\n?>"}], "negative_code": [{"source_code": " $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 3;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n elseif($m > $l)\n {\n $r = array_search($i, $b);\n $n[$r] += 3;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n $r = array_search($h, $b);\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n \n }\n elseif($l == $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 1;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $n[$r] += 1;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n}\nasort($o);\n$v = array_keys($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $n[$v[$x]] += \"0.0\" . $t;\n if($o[$x] != $o[$x + 1])\n {\n $t++;\n }\n}\nasort($p);\n$v = array_keys($p);\nfor($x = 0; $x < count($p); $x++)\n{\n $n[$v[$x]] += \"0.000\" . $u;\n if($p[$x] != $p[$x + 1])\n {\n $u++;\n }\n}\narsort($n);\n$v = array_keys($n);\nfor($x = 0; $x < count($n) / 2; $x++)\n{\n array_push($w, $b[$v[$x]]);\n}\nsort($w);\nfor($x = 0; $x < count($w); $x++)\n{\n if($x != count($w) - 1)\n {\n print $w[$x] . \"\\n\";\n }\n else\n {\n print $w[$x];\n }\n}\n?>"}, {"source_code": " $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 3;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n elseif($m > $l)\n {\n $r = array_search($i, $b);\n $n[$r] += 3;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n $r = array_search($h, $b);\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n \n }\n elseif($l == $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 1;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $n[$r] += 1;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n}\nasort($o);\n$v = array_keys($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $n[$v[$x]] += \"0.0\" . $t;\n if($o[$x + 1] != $o[$x + 2])\n {\n $t++;\n }\n}\nasort($p);\n$v = array_keys($p);\nfor($x = 0; $x < count($p); $x++)\n{\n $n[$v[$x]] += \"0.000\" . $u;\n if($p[$x + 1] != $p[$x + 2])\n {\n $u++;\n }\n}\narsort($n);\n$v = array_keys($n);\nfor($x = 0; $x < count($n) / 2; $x++)\n{\n array_push($w, $b[$v[$x]]);\n}\nsort($w);\nif($w[0] == \"Iiazoylfrepo\")\n{\n print_r($w);\n}\nfor($x = 0; $x < count($w); $x++)\n{\n if($x != count($w) - 1)\n {\n print $w[$x] . \"\\n\";\n }\n else\n {\n print $w[$x];\n }\n}\n?>"}, {"source_code": " $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 3;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n elseif($m > $l)\n {\n $r = array_search($i, $b);\n $n[$r] += 3;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n $r = array_search($h, $b);\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n \n }\n elseif($l == $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 1;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $n[$r] += 1;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n}\nasort($o);\n$v = array_keys($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $n[$v[$x]] += \"0.0\" . $t;\n if($o[$x + 1] != $o[$x + 2])\n {\n $t++;\n }\n}\nasort($p);\n$v = array_keys($p);\nfor($x = 0; $x < count($p); $x++)\n{\n $n[$v[$x]] += \"0.000\" . $u;\n if($p[$x + 1] != $p[$x + 2])\n {\n $u++;\n }\n}\narsort($n);\n$v = array_keys($n);\nfor($x = 0; $x < count($n) / 2; $x++)\n{\n array_push($w, $b[$v[$x]]);\n}\nsort($w);\nif($w[0] == \"Iiazoylfrepo\")\n{\n print_r($n);\n}\nfor($x = 0; $x < count($w); $x++)\n{\n if($x != count($w) - 1)\n {\n print $w[$x] . \"\\n\";\n }\n else\n {\n print $w[$x];\n }\n}\n?>"}, {"source_code": " $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 3;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n elseif($m > $l)\n {\n $r = array_search($i, $b);\n $n[$r] += 3;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n $r = array_search($h, $b);\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n \n }\n elseif($l == $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 1;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $n[$r] += 1;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n}\nasort($o);\n$v = array_keys($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $n[$v[$x]] += \"0.0\" . $t;\n if($o[$x + 1] != $o[$x + 2])\n {\n $t++;\n }\n}\nasort($p);\n$v = array_keys($p);\nfor($x = 0; $x < count($p); $x++)\n{\n $n[$v[$x]] += \"0.000\" . $u;\n if($p[$x + 1] != $p[$x + 2])\n {\n $u++;\n }\n}\narsort($n);\n$v = array_keys($n);\nfor($x = 0; $x < count($n) / 2; $x++)\n{\n array_push($w, $b[$v[$x]]);\n}\nsort($w);\nfor($x = 0; $x < count($w); $x++)\n{\n if($x != count($w) - 1)\n {\n print $w[$x] . \"\\n\";\n }\n else\n {\n print $w[$x];\n }\n}\n?>"}, {"source_code": " $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 3;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n elseif($m > $l)\n {\n $r = array_search($i, $b);\n $n[$r] += 3;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n $r = array_search($h, $b);\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n \n }\n elseif($l == $m)\n {\n $r = array_search($h, $b);\n $n[$r] += 1;\n $s = $l - $m;\n $o[$r] += $s;\n $p[$r] += $l;\n $r = array_search($i, $b);\n $n[$r] += 1;\n $s = $m - $l;\n $o[$r] += $s;\n $p[$r] += $m;\n }\n}\nasort($o);\n$v = array_keys($o);\nfor($x = 0; $x < count($o); $x++)\n{\n $n[$v[$x]] += \"0.0\" . $t;\n if($o[$x + 1] != $o[$x + 2])\n {\n $t++;\n }\n}\nasort($p);\n$v = array_keys($p);\nfor($x = 0; $x < count($p); $x++)\n{\n $n[$v[$x]] += \"0.000\" . $u;\n if($p[$x + 1] != $p[$x + 2])\n {\n $u++;\n }\n}\narsort($n);\n$v = array_keys($n);\nfor($x = 0; $x < count($n) / 2; $x++)\n{\n array_push($w, $b[$v[$x]]);\n}\nsort($w);\nfor($x = 0; $x < count($w); $x++)\n{\n if($x != count($w) - 1)\n {\n print $w[$x] . \"\\n\";\n }\n else\n {\n print $w[$x];\n }\n}\n?>"}], "src_uid": "472c0cb256c062b9806bf93b13b453a2"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "\n\n"}], "negative_code": [], "src_uid": "cac8ca5565e06021a44bb4388b5913a5"} {"source_code": ""}], "negative_code": [], "src_uid": "891fabbb6ee8a4969b6f413120f672a8"} {"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", "positive_code": [{"source_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"}], "negative_code": [{"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "= $k) {\n $j = $i - 1;\n break;\n }\n }\n \n $k -= $j * ($j + 1) / 2;\n echo $a[$k - 1];\n}"}], "negative_code": [{"source_code": " $k) {\n $j = $i - 1;\n break;\n }\n }\n \n $k -= $j * ($j + 1) / 2;\n echo $a[$k - 1];\n}"}], "src_uid": "9ad07b42358e7f7cfa15ea382495a8a1"} {"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$not = [\n\t'R' => 'G',\n\t'G' => 'B',\n\t'B' => 'R',\n\t'R.R' => 'G',\n\t'G.G' => 'B',\n\t'B.B' => 'R',\n\t'R.G' => 'B',\n\t'G.R' => 'B',\n\t'G.B' => 'R',\n\t'B.G' => 'R',\n\t'R.B' => 'G',\n\t'B.R' => 'G',\n];\n\n\n$cnt = 0;\n$s = $s . $not[$s[$n-1]];\nfor ($i=1; $i<$n; $i++) {\n\tif ($s[$i]==$s[$i-1]) {\n\t\t$cnt++;\n\t\t$s[$i] = $not[$s[$i] .'.'. $s[$i+1]];\n\t}\n}\n\necho $cnt.\"\\n\";\necho substr($s, 0, $n);\n", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "ddaf86169a79942cefce8e5b5f3d6118"} {"source_code": "= $f)\n {\n break;\n }\n else\n {\n $a += $g;\n $h++;\n }\n}\nprint ($f + $h) . \"\\n\";\nfor($x = 0; $x < $h; $x++)\n{\n print \"HEAL\\n\";\n}\nfor($x = 0; $x < $f; $x++)\n{\n print \"STRIKE\\n\";\n}\n?>", "positive_code": [{"source_code": "0){\n $demnaUfliswuli++;\n \n if($h2-$a1<=0){\n $liparitBagvashi .= \"STRIKE\".\"\\n\";\n $h2-=$a1;\n }\n \n elseif($h1 - $a2 > 0){\n $liparitBagvashi .= \"STRIKE\".\"\\n\"; \n $h2-=$a1;\n }\n \n else{\n $liparitBagvashi .= \"HEAL\".\"\\n\";\n $h1+=$c1;\n }\n $h1-=$a2;\n}\n\necho $demnaUfliswuli.\"\\n\".$liparitBagvashi;\n\n?>"}, {"source_code": " 0)\n\t{\n\t\t$h1 += $c1;\n\t\t$action_list[] = 'HEAL';\n\t}\n\telse\n\t{\n\t\t$h2 -= $a1;\n\t\t$action_list[] = 'STRIKE';\n\t}\n\n\tif ($h2 <= 0)\n\t{\n\t\tbreak;\n\t}\n\t$h1 -= $a2;\n}\n\necho count($action_list).PHP_EOL;\nforeach ($action_list as $action)\n{\n\techo $action.PHP_EOL;\n}\n"}], "negative_code": [{"source_code": ""}, {"source_code": " 0)\n {\n $a -= $e;\n if($g <= 0)\n {\n $f[count($f)] = \"STRIKE\";\n break;\n }\n else\n {\n $d -= $b;\n $f[count($f)] = \"STRIKE\";\n }\n }\n}\nprint count($f) . \"\\n\";\nfor($x = 0; $x < count($f); $x++)\n{\n print $f[$x] . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $a -= $e;\n if($g <= 0)\n {\n $f[count($f)] = \"STRIKE\";\n break;\n }\n else\n {\n $d -= $b;\n $f[count($f)] = \"STRIKE\";\n }\n }\n}\nprint count($f) . \"\\n\";\nfor($x = 0; $x < count($f); $x++)\n{\n print $f[$x] . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $d -= $b;\n $f[count($f)] = \"STRIKE\";\n }\n if($h <= 0)\n {\n $a += $c;\n $f[count($f)] = \"HEAL\";\n }\n elseif($h > 0)\n {\n $a -= $e;\n }\n}\nprint count($f) . \"\\n\";\nfor($x = 0; $x < count($f); $x++)\n{\n print $f[$x] . \"\\n\";\n}\n?>"}, {"source_code": " https://youtu.be/ZenkI6QvosE\n//\u10e9\u10d0\u10db\u10dd\u10d7\u10dd\u10d5\u10d0 \u10d8\u10e1\u10d4\u10d5 \u10db\u10d0\u10db\u10e3\u10d9\u10d0 \u10e9\u10d0\u10e0\u10d9\u10d5\u10d8\u10d0\u10dc\u10d8\n\nlist($h1,$a1,$c1) = explode(\" \",trim(fgets(STDIN)));\nlist($h2,$a2) = explode(\" \",trim(fgets(STDIN)));\n\n$liparitBagvashi = \"\";\n$demnaUfliswuli = 0;\n\nwhile($h2>0){\n $demnaUfliswuli++;\n \n if($h2-$a1<0){\n $liparitBagvashi .= \"STRIKE\".\"\\n\";\n $h2-=$a1;\n }\n \n elseif($h1 - $a2 > 0){\n $liparitBagvashi .= \"STRIKE\".\"\\n\"; \n $h2-=$a1;\n }\n \n else{\n $liparitBagvashi .= \"HEAL\".\"\\n\";\n $h1+=$c1;\n }\n $h1-=$a2;\n}\n\necho $demnaUfliswuli.\"\\n\".$liparitBagvashi;\n\n?>"}], "src_uid": "d497431eb37fafdf211309da8740ece6"} {"source_code": " 0 ) {\n $ar[0] -=1;\n $n +=1;\n }\n if($ar[1]>0 ) {\n $ar[1] -=1; \n $n +=1;\n }\n if($ar[2]>0 ) {\n $ar[2] -=1; \n $n +=1;\n }\n \n rsort($ar);\n \n if($ar[0] > 0 && $ar[1]>0 ) {\n $ar[0] -=1; \n $ar[1] -=1;\n $n +=1;\n }\n if($ar[0] > 0 && $ar[2]>0 ) {\n $ar[0] -=1; \n $ar[2] -=1;\n $n +=1;\n }\n if($ar[1] > 0 && $ar[2]>0 ) {\n $ar[1] -=1; \n $ar[2] -=1;\n $n +=1;\n }\n \n if($ar[0] > 0 && $ar[1] > 0 && $ar[2]>0 ) {\n $ar[0] -=1;\n $ar[1] -=1; \n $ar[2] -=1;\n $n +=1;\n }\n \n \n \n \n \n echo trim($n) .\"\\n\";\n }\n ", "positive_code": [{"source_code": " 0)\n {\n $c++;\n $b[0]--;\n }\n if($b[1] > 0)\n {\n $c++;\n $b[1]--;\n }\n if($b[2] > 0)\n {\n $c++;\n $b[2]--;\n }\n rsort($b);\n if(($b[0] > 0) && ($b[1] > 0))\n {\n $c++;\n $b[0]--;\n $b[1]--;\n }\n if(($b[0] > 0) && ($b[2] > 0))\n {\n $c++;\n $b[0]--;\n $b[2]--;\n }\n if(($b[1] > 0) && ($b[2] > 0))\n {\n $c++;\n $b[1]--;\n $b[2]--;\n }\n rsort($b);\n if(($b[0] > 0) && ($b[1] > 0) && ($b[2] > 0))\n {\n $c++;\n }\n print $c . \"\\n\";\n}\n?>"}], "negative_code": [], "src_uid": "98a8fc06e8265bbf9c16ee3c7b9d0223"} {"source_code": "", "positive_code": [{"source_code": " $b) {\n\t\t\t$count2 = floor($a / $b);\n\t\t\t$a -= $b * $count2;\n\t\t\t$count += $count2;\n\t\t} else {\n\t\t\t$count2 = floor($b / $a);\n\t\t\t$b -= $a * $count2;\n\t\t\t$count += $count2;\n\t\t}\n\t};\n\tfwrite($f_out, $count . \"\\n\");\n}\nfclose($f_out);"}], "negative_code": [{"source_code": " $b) {\n\t\t\t$count2 = floor($a / $b);\n\t\t\t$a -= $b * $count2;\n\t\t\t$count += $count2;\n\t\t} else {\n\t\t\t$count2 = floor($b / $a);\n\t\t\t$b -= $a * $count2;\n\t\t\t$count += $count2;\n\t\t}\n\t};\n\tfwrite($f_out, $count . \"\\n\");\n}\nfclose($f_out);"}], "src_uid": "5c3eb78a7e15d9afe6d745e1a77d7451"} {"source_code": "= 0 ; $i--) { \n// if($i !=0){\n// $x=$array[$i];\n// $array[$i]=$array[$i-1];\n// $array[$i-1]=$x;\n// $s++;\n// }\n// }\n// echo $s;\n\n$n=fgets(STDIN);\n$one=0;\n$zero=0;\n$input=str_split(fgets(STDIN),1);\nforeach ($input as $key => $value) {\n if ($value == 1) {\n $one++;\n }else if($value == 0){\n $zero++;\n }\n}\n$zero-=2;\necho max($zero,$one)-min($zero,$one);\n# thanks danial !", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": " $value)\n{\n if ($value == 1)\n {\n $numOne++;\n }\n else\n {\n $numZero++;\n }\n}\n\necho abs($numZero - $numOne);\n\n\n"}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": "\n"}, {"source_code": "\n"}], "src_uid": "fa7a44fd24fa0a8910cb7cc0aa4f2155"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "d03ad531630cbecc43f8da53b02d842e"} {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = getPrimeNumbersViaErastofen(1000);\n\n$stdin = STDIN;\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n sort($delimiters);\n $minDelimiter = $delimiters[0];\n $maxDelimiter = $delimiters[$n - 1];\n\n $digit = (float)$minDelimiter * (float)$maxDelimiter;\n $halfOfDigit = $digit / 2;\n\n $baseDelimiters = [$minDelimiter => $minDelimiter];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $halfOfDigit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n if (count($baseDelimiters) > $n) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = $a * $b;\n $strResult = sprintf('%.0f', $result);\n if ($result < $digit && !isset ($baseDelimiters[$strResult]) && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n foreach ($baseDelimiters as $delimiter) {\n $result = sprintf('%.0f', $digit / $delimiter);\n if (!isset($baseDelimiters[$result]) && bcmod($digit, $delimiter) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters == $delimiters ? $digit : '-1') . PHP_EOL;\n}\n", "positive_code": [{"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = getPrimeNumbersViaErastofen(1000);\n\n$stdin = STDIN;\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n sort($delimiters);\n $minDelimiter = $delimiters[0];\n $maxDelimiter = $delimiters[$n - 1];\n\n $digit = (float)$minDelimiter * (float)$maxDelimiter;\n $halfOfDigit = $digit / 2;\n\n $baseDelimiters = [$minDelimiter => $minDelimiter];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $halfOfDigit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n if (count($baseDelimiters) > $n) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = $a * $b;\n if ($result < $digit && bcmod($digit, $result) === '0') {\n $result = sprintf('%.0f', $result);\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n foreach ($baseDelimiters as $delimiter) {\n if (bcmod($digit, $delimiter) === '0') {\n $result = sprintf('%.0f', $digit / $delimiter);\n $baseDelimiters[$result] = $result;\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters == $delimiters ? $digit : '-1') . PHP_EOL;\n}\n"}, {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = [];\n\n$stdin = STDIN;\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $maxDelimiter = $delimiters[$n - 1];\n\n $digit = bcmul($delimiters[0], $maxDelimiter);\n $halfOfDigit = bcdiv($digit, '2');\n\n if ($primes === []) {\n $primes = getPrimeNumbersViaErastofen(10000);\n }\n $baseDelimiters = [$delimiters[0] => $delimiters[0]];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $halfOfDigit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n if (count($baseDelimiters) > $n) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = bcmul($a, $b);\n if ($result < $digit && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n foreach ($baseDelimiters as $delimiter) {\n if (bcmod($digit, $delimiter) === '0') {\n $result = bcdiv($digit, $delimiter);\n $baseDelimiters[$result] = $result;\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters == $delimiters ? $digit : '-1') . PHP_EOL;\n}\n"}, {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = [];\n\n$stdin = STDIN;\n//$stdin = fopen('/home/vilnitskiy/.PhpStorm2019.1/config/scratches/data.txt', 'rb');\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $maxDelimiter = $delimiters[$n - 1];\n\n $digit = bcmul($delimiters[0], $maxDelimiter);\n\n if ($primes === []) {\n $primes = getPrimeNumbersViaErastofen(100000);\n }\n $baseDelimiters = [$delimiters[0] => $delimiters[0]];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $digit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n if (count($baseDelimiters) > $n) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n foreach ($baseDelimiters as $delimiter) {\n $i = 2;\n $result = $delimiter;\n $valid = true;\n $result = bcpow($delimiter, (string)$i);\n $valid = $result < $digit;\n while ($valid) {\n $result = bcpow($delimiter, (string)$i);\n $valid = $result < $digit;\n if ($valid && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n $i++;\n }\n }\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = bcmul($a, $b);\n if ($result < $digit && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n foreach ($baseDelimiters as $delimiter) {\n if (bcmod($digit, $delimiter) === '0') {\n $result = bcdiv($digit, $delimiter);\n $baseDelimiters[$result] = $result;\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters == $delimiters ? $digit : '-1') . PHP_EOL;\n}\n\n//echo microtime(true) - $start;\n"}], "negative_code": [{"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = [];\n\n$stdin = STDIN;\n//$stdin = fopen('/home/vilnitskiy/.PhpStorm2019.1/config/scratches/data.txt', 'rb');\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $maxDelimiter = $delimiters[$n - 1];\n\n if ($n <= 2) {\n echo bcmul($delimiters[0], $maxDelimiter) . PHP_EOL;\n continue;\n }\n\n for ($i = 0; $i < $n; $i++) {\n if (bcmod($maxDelimiter, $delimiters[$i]) !== '0') {\n $wrongDigit = false;\n break;\n }\n }\n if ($wrongDigit === true) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $digit = bcmul($delimiters[0], $maxDelimiter);\n\n if ($primes === []) {\n $primes = getPrimeNumbersViaErastofen(100000);\n }\n $baseDelimiters = [];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $digit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n foreach ($baseDelimiters as $prime) {\n $i = 2;\n $result = $prime;\n $valid = true;\n do {\n $result = bcpow($prime, (string)$i);\n $valid = $result <= $digit;\n if ($valid && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n $i++;\n } while ($valid);\n }\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = bcmul($a, $b);\n if ($result < $digit && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters === $delimiters ? $digit : '-1') . PHP_EOL;\n}\n\n//echo microtime(true) - $start;\n"}, {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$stdin = STDIN;\n[$t] = fscanf($stdin, '%u');\n\n$primes = getPrimeNumbersViaErastofen(1000000);\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $minDelimiter = $delimiters[0];\n $maxDelimiter = $delimiters[$n - 1];\n\n if ($n <= 2) {\n echo bcmul($delimiters[0], $maxDelimiter) . PHP_EOL;\n continue;\n }\n\n for ($i = 0; $i < $n; $i++) {\n if (bcmod($maxDelimiter, $delimiters[$i]) !== '0') {\n $wrongDigit = false;\n break;\n }\n }\n if ($wrongDigit === true) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $multiPlies = bcmul($minDelimiter, $maxDelimiter);\n\n $primeDelimiters = [];\n foreach ($primes as $prime) {\n if (bccomp($prime, $multiPlies) === 1) {\n break;\n }\n if (bcmod($multiPlies, $prime) === '0') {\n $primeDelimiters[] = $prime;\n }\n }\n $primeDelimitersCount = count($primeDelimiters);\n\n $powerMask = [];\n $maxPower = $primeDelimitersCount * $primeDelimitersCount;\n $baseMask = $arrayMask = array_fill(0, $primeDelimitersCount, 0);\n for ($j = 0; $j < $primeDelimitersCount; $j++) {\n $arrayMask = $baseMask;\n $arrayMask[$j] = 1;\n for($i = 0; $i <= $maxPower; $i++) {\n $powerMask[] = implode(' ', $arrayMask);\n $ind = $i % $primeDelimitersCount;\n $arrayMask[$ind]++;\n $tmp = $baseMask;\n $tmp[$ind] = $arrayMask[$ind];\n $powerMask[] = implode(' ', $tmp);\n }\n $powerMask[] = implode(' ', $arrayMask);\n }\n $powerMask = array_unique($powerMask);\n sort($powerMask);\n $baseDelimiters = [];\n\n foreach ($powerMask as $m) {\n $m = explode(' ', $m);\n $baseDelimiter = 1;\n foreach ($primeDelimiters as $i => $prime) {\n $baseDelimiter = bcmul($baseDelimiter, bcpow($prime, $m[$i]));\n }\n if (bcmod($multiPlies, $baseDelimiter) === '0') {\n $baseDelimiters[] = $baseDelimiter;\n }\n }\n unset($powerMask, $baseMask, $arrayMask, $tmp);\n sort($baseDelimiters);\n if ($delimiters === $baseDelimiters) {\n echo $multiPlies . PHP_EOL;\n } else {\n echo '-1' . PHP_EOL;\n }\n}\n"}, {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = [];\n\n$stdin = STDIN;\n//$stdin = fopen('/home/vilnitskiy/.PhpStorm2019.1/config/scratches/data.txt', 'rb');\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $maxDelimiter = $delimiters[$n - 1];\n\n if ($n <= 2) {\n echo bcmul($delimiters[0], $maxDelimiter) . PHP_EOL;\n continue;\n }\n\n for ($i = 0; $i < $n; $i++) {\n if (bcmod($maxDelimiter, $delimiters[$i]) !== '0') {\n $wrongDigit = false;\n break;\n }\n }\n if ($wrongDigit === true) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $digit = bcmul($delimiters[0], $maxDelimiter);\n\n if ($primes === []) {\n $primes = getPrimeNumbersViaErastofen(1000000);\n }\n $baseDelimiters = [];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $digit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n foreach ($baseDelimiters as $prime) {\n $i = 2;\n $result = $prime;\n $valid = true;\n do {\n $result = bcpow($prime, (string)$i);\n $valid = $result <= $digit;\n if ($valid && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n $i++;\n } while ($valid);\n }\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = bcmul($a, $b);\n if ($result < $digit && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters === $delimiters ? $digit : '-1') . PHP_EOL;\n}\n\necho microtime(true) - $start;\n"}, {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = [];\n\n$stdin = STDIN;\n//$stdin = fopen('/home/vilnitskiy/.PhpStorm2019.1/config/scratches/data.txt', 'rb');\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $maxDelimiter = $delimiters[$n - 1];\n\n if ($n <= 2) {\n echo bcmul($delimiters[0], $maxDelimiter) . PHP_EOL;\n continue;\n }\n\n for ($i = 0; $i < $n; $i++) {\n if (bcmod($maxDelimiter, $delimiters[$i]) !== '0') {\n $wrongDigit = false;\n break;\n }\n }\n if ($wrongDigit === true) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $digit = bcmul($delimiters[0], $maxDelimiter);\n\n if ($primes === []) {\n $primes = getPrimeNumbersViaErastofen(100000);\n }\n $baseDelimiters = [];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $digit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n foreach ($baseDelimiters as $delimiter) {\n $i = 2;\n $result = $delimiter;\n $valid = true;\n do {\n $result = bcpow($delimiter, (string)$i);\n $valid = $result <= $digit;\n if ($valid && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n $i++;\n } while ($valid);\n }\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = bcmul($a, $b);\n if ($result < $digit && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n foreach ($baseDelimiters as $delimiter) {\n if (bcmod($digit, $delimiter) === '0') {\n $result = bcdiv($digit, $delimiter);\n $baseDelimiters[$result] = $result;\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters == $delimiters ? $digit : '-1') . PHP_EOL;\n}\n\n//echo microtime(true) - $start;\n"}, {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = [];\n\n$stdin = STDIN;\n//$stdin = fopen('/home/vilnitskiy/.PhpStorm2019.1/config/scratches/data.txt', 'rb');\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $maxDelimiter = $delimiters[$n - 1];\n\n if ($n <= 2) {\n echo bcmul($delimiters[0], $maxDelimiter) . PHP_EOL;\n continue;\n }\n\n for ($i = 0; $i < $n; $i++) {\n if (bcmod($maxDelimiter, $delimiters[$i]) !== '0') {\n $wrongDigit = false;\n break;\n }\n }\n if ($wrongDigit === true) {\n echo '-1' . PHP_EOL;\n continue;\n }\n\n $digit = bcmul($delimiters[0], $maxDelimiter);\n\n if ($primes === []) {\n $primes = getPrimeNumbersViaErastofen(100000);\n }\n $baseDelimiters = [];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if (bccomp($prime, $digit) > -1) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n foreach ($baseDelimiters as $prime) {\n $i = 2;\n $result = $prime;\n $valid = true;\n do {\n $result = bcpow($prime, (string)$i);\n $valid = bccomp($result, $digit) < 1;\n if ($valid && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n $i++;\n } while ($valid);\n }\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = bcmul($a, $b);\n if (bccomp($result, $digit) < 0 && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters === $delimiters ? $digit : '-1') . PHP_EOL;\n}\n\n//echo microtime(true) - $start;\n"}, {"source_code": "= 10 && (($i % 5) === 0)) {\n continue;\n }\n $result[$i] = $i;\n }\n\n $i = reset($result);\n while ($i !== false) {\n if (isset($result[$i])) {\n /** @var int $j */\n $j = $i * 2;\n while ($j < $n) {\n unset($result[$j]);\n $j += $i;\n }\n }\n $i = next($result);\n }\n return $result;\n}\n\n$primes = [];\n\n$stdin = STDIN;\n[$t] = fscanf($stdin, '%u');\n\nfor ($tI = 0; $tI < $t; $tI++) {\n $wrongDigit = true;\n [$n] = fscanf($stdin, '%u');\n $delimiters = explode(' ', trim(fgets($stdin)));\n $delimitersMap = array_keys($delimiters);\n sort($delimiters);\n $maxDelimiter = $delimiters[$n - 1];\n\n $digit = bcmul($delimiters[0], $maxDelimiter);\n\n if ($primes === []) {\n $primes = getPrimeNumbersViaErastofen(100000);\n }\n $baseDelimiters = [];\n foreach ($primes as $prime) {\n $prime = (string)$prime;\n if ($prime >= $digit) {\n break;\n }\n if (bcmod($digit, $prime) === '0') {\n $baseDelimiters[$prime] = $prime;\n }\n }\n\n foreach ($baseDelimiters as $delimiter) {\n $i = 2;\n $result = $delimiter;\n $valid = true;\n $result = bcpow($delimiter, (string)$i);\n $valid = $result < $digit;\n while ($valid) {\n $result = bcpow($delimiter, (string)$i);\n $valid = $result < $digit;\n if ($valid && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n $i++;\n }\n }\n $tmp = [];\n while ($tmp !== $baseDelimiters) {\n $tmp = $baseDelimiters;\n foreach ($baseDelimiters as $a) {\n foreach ($baseDelimiters as $b) {\n $result = bcmul($a, $b);\n if ($result < $digit && bcmod($digit, $result) === '0') {\n $baseDelimiters[$result] = $result;\n }\n }\n }\n }\n foreach ($baseDelimiters as $delimiter) {\n if (bcmod($digit, $delimiter) === '0') {\n $result = bcdiv($digit, $delimiter);\n $baseDelimiters[$result] = $result;\n }\n }\n sort($baseDelimiters);\n\n echo ($baseDelimiters == $delimiters ? $digit : '-1') . PHP_EOL;\n}\n\n//echo microtime(true) - $start;\n"}], "src_uid": "fe9b1527571ea37f402512ac378dee13"} {"source_code": "=0; $i--) {\r\n if(isset($temp[$i+1])) {\r\n $temp[$i] =$temp[$i+1] + $a[$i]; \r\n } else {\r\n $temp[$i] = $a[$i];\r\n }\r\n \r\n }\r\n while($q--) {\r\n list($x, $y) = IO::getArray();\r\n $ans = $temp[$x-$y] -$temp[$x];\r\n \r\n IO::pr($ans);\r\n }\r\n \r\n \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 $j) return nsd($i - $j, $j); else return nsd($i, $j - $i);\n}\n\nlist($n, $m) = explode(' ',trim(fgets(STDIN)));\n\n$a = explode(' ',trim(fgets(STDIN)));\n$b = explode(' ',trim(fgets(STDIN)));\n\nif($n > $m) if($a[0] * $b[0] > 0) {print 'Infinity'; exit(0);}\n else {print '-Infinity'; exit(0);}\nelseif($n < $m){print '0/1'; exit(0);}\n\n$ns = nsd(abs($a[0]),abs($b[0]));\nprint (($a[0] * $b[0] < 0)?'-':'').abs($a[0] / $ns).'/'.abs($b[0] / $ns);\n?>", "positive_code": [{"source_code": " $m) {\n\tif ($dn * $dm > 0) {return \"Infinity\";} else {return \"-Infinity\";}\n} else if ($n < $m) {\n\treturn \"0/1\";\n} else {\n\t$tn = abs($dn);\n\t$tm = abs($dm);\n\twhile ($tn != $tm) {\n\t\tif ($tn > $tm) {$tn -= $tm;} else {$tm -= $tn;}\n\t}\n\treturn (($dn * $dm > 0) ? \"\" : \"-\") . (abs($dn) / $tn) . \"/\" . (abs($dm) / $tm);\n}\n}\n?>"}, {"source_code": " $m)\n printf(($a < 0 ? \"-\" : \"\") . \"Infinity\\n\");\nelse\n{\n $d = gcd(abs($a), $b);\n printf(\"%d/%d\\n\", $a / $d, $b / $d);\n}\n?>"}, {"source_code": " $m){\n\tif ($a * $b < 0){\n\t\techo '-';\n\t}\n\techo 'Infinity', PHP_EOL;\n}else if ($n < $m){\n\techo '0/1', PHP_EOL;\n}else{\n\t$c = abs(gcd($a, $b));\n\tif ($b < 0){\n\t\t$a = -$a;\n\t\t$b = -$b;\n\t}\n\n\techo $a/$c,'/',$b/$c, PHP_EOL;\n}\n\nfunction gcd($a, $b){\n\treturn ($b == 0) ? $a : gcd($b, $a%$b);\n}\n\n"}], "negative_code": [{"source_code": " $m)\n printf(($a < 0 ? \"-\" : \"\") . \"Infinity\\n\");\nelse\n{\n $d = gcd($a, $b);\n printf(\"%d/%d\\n\", $a / $d, $b / $d);\n}\n?>"}, {"source_code": " $m)\n printf(($a < 0 ? \"-\" : \"\") . \"Infinity\\n\");\nelse\n{\n $d = gcd($a, $b);\n printf(\"%d/%d\\n\", $a / $d, $b / $d);\n}\n?>"}, {"source_code": " m)\n printf(($a < 0 ? \"-\" : \"\") + \"-Infinity\\n\");\nelse\n{\n $d = gcd($a, $b);\n printf(\"%d/%d\\n\", $a / $d, $b / $d);\n}\n?>\n"}, {"source_code": " $m)\n printf(($a < 0 ? \"-\" : \"\") + \"Infinity\\n\");\nelse\n{\n $d = gcd($a, $b);\n printf(\"%d/%d\\n\", $a / $d, $b / $d);\n}\n?>"}, {"source_code": " $m) {\n\tif ($dn * $dm > 0) {return \"Infinity\";} else {return \"-Infinity\";}\n} else if ($m < $n) {\n\treturn \"0/1\";\n} else {\n\t$tn = $dn;\n\t$tm = $dm;\n\twhile ($tn != $tm) {\n\t\tif ($tn > $tm) {$tn -= $tm;} else {$tm -= $tn;}\n\t}\n\treturn ($dn / $tn) . \"/\" . ($dm / $tm);\n}\n}\n?>"}, {"source_code": " $n) {\n\tif ($dn * $dm > 0) {return \"Infinity\";} else {return \"-Infinity\";}\n} else if ($m < $n) {\n\treturn \"0/1\";\n} else {\n\t$tn = $dn;\n\t$tm = $dm;\n\twhile ($tn != $tm) {\n\t\tif ($tn > $tm) {$tn -= $tm;} else {$tm -= $tn;}\n\t}\n\treturn ($dn / $tn) . \"/\" . ($dm / $tm);\n}\n}\n?>"}, {"source_code": " $j) return nsd($i - $j, $j); else return nsd($i, $j - $i);\n}\n\nlist($n, $m) = explode(' ',trim(fgets(STDIN)));\n\n$a = explode(' ',trim(fgets(STDIN)));\n$b = explode(' ',trim(fgets(STDIN)));\n\nif($n > $m) if($a[0] > 0) {print 'Infinity'; exit(0);}\n else {print '-Infinity'; exit(0);}\nelseif($n < $m){print '0/1'; exit(0);}\n\n$ns = nsd(abs($a[0]),abs($b[0]));\nprint (($a[0] * $b[0] < 0)?'-':'').abs($a[0] / $ns).'/'.abs($b[0] / $ns);\n?>"}], "src_uid": "37cf6edce77238db53d9658bc92b2cab"} {"source_code": " $d)\n{\n print \"-1\";\n}\nelse\n{\n $e = 1;\n $f = 2;\n for($x = 1; $x < $b; $x++)\n {\n $g = array();\n $h = $f % 2;\n $f++;\n if($h == 0)\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($e > $a)\n {\n array_push($g, 0);\n }\n else\n {\n array_push($g, $e);\n $e++;\n }\n }\n print implode(\" \", $g) . \"\\n\";\n }\n else\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($e > $a)\n {\n array_unshift($g, 0);\n }\n else\n {\n array_unshift($g, $e);\n $e++;\n }\n }\n print implode(\" \", $g) . \"\\n\";\n }\n }\n $g = array();\n $h = $f % 2;\n $f++;\n if($h == 0)\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($e > $a)\n {\n array_push($g, 0);\n }\n else\n {\n array_push($g, $e);\n $e++;\n }\n }\n print implode(\" \", $g);\n }\n else\n {\n for($y = 1; $y <= $c; $y++)\n {\n if($e > $a)\n {\n array_unshift($g, 0);\n }\n else\n {\n array_unshift($g, $e);\n $e++;\n }\n }\n print implode(\" \", $g);\n }\n}\n?>", "positive_code": [{"source_code": " $n) {\n\t\t\tbreak 2;\n\t\t}\n\t\t$table[$i][$j] = $setNum;\n\t\t$setMax = $setNum;\n\t\t$setNum+=2;\n\t}\n}\n$setNum = 2;\nfor ($i = 0; $i < $a; $i++) {\n\tfor ($j = 0; $j < $b; $j++) {\n\t\tif ($setNum > $n) {\n\t\t\tbreak 2;\n\t\t}\n\t\tif (!empty($table[$i][$j])) {\n\t\t\tcontinue;\n\t\t}\n\t\t$table[$i][$j] = $setNum;\n\t\t$setMax = max($setMax, $setNum);\n\t\t$setNum+=2;\n\t}\n}\nif ($setMax == $n) {\n\tfor ($i = 0; $i < $a; $i++) {\n\t\tfor ($j = 0; $j < $b; $j++) {\n\t\t\techo $table[$i][$j] . \" \";\n\t\t}\n\t\techo \"\\n\";\n\t}\n} else {\n\techo '-1';\n}"}, {"source_code": " $a * $b) {\n\techo -1;\n} else {\n\t$odd = 1;\n\t$even = 2;\n\tfor ($r = 0; $r < $a; $r++) {\n\t\tfor ($c = 0; $c < $b; $c++) {\n\t\t\tif (($r + $c) % 2 == 1 && $even <= $n) {\n\t\t\t\techo $even . ' ';\n\t\t\t\t$even += 2;\n\t\t\t} elseif (($r + $c) % 2 == 0 && $odd <= $n) {\n\t\t\t\techo $odd . ' ';\n\t\t\t\t$odd += 2;\n\t\t\t} else {\n\t\t\t\techo \"0 \";\n\t\t\t}\n\t\t}\n\t\techo \"\\n\";\n\t}\n}\n"}, {"source_code": " $e) print $e.($d % $a['2'] == 0 && $d != $b ? \"\\n\":' ');"}, {"source_code": " $e) print $e.($d % $a['2'] == 0 && $d != $b ? \"\\n\":' ');\n"}], "negative_code": [{"source_code": " $d)\n{\n print \"-1\";\n}\nelse\n{\n $e = $c % 2;\n $f = array();\n $g = 1;\n if($e == 0)\n {\n for($x = 1; $x <= $b; $x++)\n {\n $h = 0;\n $i = array();\n for($y = 1; $y <= $c; $y++)\n {\n if($g > $a)\n {\n $i[$h] = 0;\n }\n else\n {\n $i[$h] = $g;\n }\n $g++;\n $h++;\n }\n array_push($f, $i);\n }\n $j = 2;\n for($x = 0; $x < $b - 1; $x++)\n {\n $k = $j % 2;\n $j++;\n if($k == 0)\n {\n $l = $f[$x];\n print implode(\" \", $l) . \"\\n\";\n }\n else\n {\n $l = $f[$x];\n $m = array_reverse($l);\n print implode(\" \", $m) . \"\\n\";\n }\n }\n $k = $j % 2;\n $j++;\n if($j == 0)\n {\n $l = $f[$x];\n print implode(\" \", $l);\n }\n else\n {\n $l = $f[$x];\n $m = array_reverse($l);\n print implode(\" \", $m);\n }\n }\n else\n {\n for($x = 1; $x <= $b; $x++)\n {\n $h = 0;\n $i = array();\n for($y = 1; $y <= $c; $y++)\n {\n if($g > $a)\n {\n $i[$h] = 0;\n }\n else\n {\n $i[$h] = $g;\n }\n $g++;\n $h++;\n }\n array_push($f, $i);\n }\n for($x = 0; $x < $b - 1; $x++)\n {\n $j = $f[$x];\n print implode(\" \", $j) . \"\\n\";\n }\n $j = $f[$x];\n print implode(\" \", $j);\n }\n}\n?>"}, {"source_code": " $e) print $e.($d % $a['2'] == 0 && $d != $b ? \"\\n\":' ');\n"}, {"source_code": "useStd = stristr($GLOBALS['argv'][0], '.PhpStorm2019.3\\config') === false;\n\t}\n\n\tpublic function calculateResult($input)\n\t{\n\t\t$numbers = array_map('intval', explode(' ', $input));\n\t\tsort($numbers);\n\t\t$c = count($numbers);\n\t\treturn abs($numbers[$c / 2] - $numbers[$c / 2 - 1]);\n\t}\n\n\tpublic function getInputLines()\n\t{\n\t\t$input = [];\n\t\tif ($this->useStd)\n\t\t{\n\t\t\twhile ($line = fgets(STDIN))\n\t\t\t{\n\t\t\t\t$input[] = $line;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tglobal $testInput;\n\t\t\t$input = explode(\"\\n\", trim($testInput));\n\t\t}\n\t\treturn $input;\n\t}\n\n\tpublic function printResult($result)\n\t{\n\t\tif ($this->useStd)\n\t\t{\n\t\t\tfwrite(STDOUT, $result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar_dump($result);\n\t\t}\n\t}\n\n}\n\n\n##################################################\n$testInput = '3\n1\n1 1\n3\n6 5 4 1 2 3\n5\n13 4 20 13 2 5 8 3 17 16\n';\n$helper = new ArgsHelper();\n$lines = $helper->getInputLines();\n\n$result = '';\n#\narray_shift($lines);\nforeach ($lines as $index => $line)\n{\n\tif ($index % 2 === 0)\n\t{\n\t\tcontinue;\n\t}\n\t$result .= $helper->calculateResult($line) . \"\\n\";\n}\n$result = trim($result);\n#\n\n\n$helper->printResult($result);\n\n\n", "positive_code": [{"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": "\n "}, {"source_code": "\n "}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "adb0f6082367dc432e2e096c64f13a56"} {"source_code": "= $stepT)\r\n {\r\n $results[] = 1;\r\n }\r\n\r\n else if ($diffInitMinT >= $stepT && $diffEndMinT >= $stepT)\r\n {\r\n $results[] = 2;\r\n }\r\n\r\n else if ($diffInitMaxT >= $stepT && $diffEndMaxT >= $stepT)\r\n {\r\n $results[] = 2;\r\n }\r\n\r\n else if ($diffInitMinT >= $stepT && $diffMinMaxT >= $stepT && $diffEndMaxT >= $stepT)\r\n {\r\n $results[] = 3;\r\n }\r\n\r\n else if ($diffInitMaxT >= $stepT && $diffMinMaxT >= $stepT && $diffEndMinT >= $stepT)\r\n {\r\n $results[] = 3;\r\n }\r\n \r\n else {\r\n $results[] = -1;\r\n }\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 getString()\r\n{\r\n return trim(fgets(STDIN));\r\n}\r\n\r\nfunction getWords()\r\n{\r\n return explode(' ', trim(fgets(STDIN)));\r\n}\r\n\r\n", "positive_code": [{"source_code": "= $x) {\r\n $ans[] = 1;\r\n continue;\r\n }\r\n if($a < $b){\r\n if($r >= $b + $x){\r\n $ans[] = 2;\r\n continue;\r\n }\r\n if($l <= $a - $x){\r\n $ans[] = 2;\r\n continue;\r\n }\r\n if($a + $x <= $r && (abs($r-$b) >= $x || abs($l-$b) >= $x)){\r\n $ans[] = 3;\r\n continue;\r\n } \r\n $ans[] = -1;\r\n continue;\r\n }else{\r\n if($l <= $b - $x){\r\n $ans[] = 2;\r\n continue;\r\n }\r\n if($r >= $a + $x){\r\n $ans[] = 2;\r\n continue;\r\n }\r\n if($a - $x >= $l && (abs($r-$b) >= $x || abs($l-$b) >= $x)){\r\n $ans[] = 3;\r\n continue;\r\n } \r\n $ans[] = -1;\r\n continue;\r\n }\r\n}\r\necho implode(PHP_EOL, $ans);"}], "negative_code": [], "src_uid": "e3a1f53f78fcb3a551c3ae1cbeedaf15"} {"source_code": "", "positive_code": [{"source_code": "= $a - 1)\n {\n break;\n }\n }\n $g = array(\"1\");\n for($x = 0; $x < count($f); $x++)\n {\n for($y = 0; $y < count($c); $y++)\n {\n if($f[$x] == $c[$y])\n {\n $g[count($g)] = $y + 2;\n $c[$y] = 1000;\n break;\n }\n }\n }\n $i = array();\n for($x = 0; $x < count($g); $x++)\n {\n $i[count($i)] = $b[$g[$x] - 1];\n }\n $j = range(1, $a);\n $k = array_diff($j, $g);\n sort($k);\n $l = array();\n $m = array();\n print ($a - 1) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $g[$x + 1] . \"\\n\";\n $i[$x]--;\n }\n $n = 0;\n for($x = 0; $x < count($g); $x++)\n {\n for($y = $n; $y < count($k); $y++)\n {\n if($i[$x] > 0)\n {\n print $g[$x] . \" \" . $k[$y] . \"\\n\";\n $n++;\n $i[$x]--;\n if($n == count($k))\n {\n break;\n }\n }\n }\n if($n == count($k))\n {\n break;\n }\n }\n}\n?>", "positive_code": [{"source_code": " 0)\n {\n $f[count($f)] = $x + 1;\n }\n else\n {\n $g[count($g)] = $x + 1;\n }\n $b[$x]--;\n }\n print ($d + $e) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \" \" . $f[$x + 1] . \"\\n\";\n }\n if(($d + $e) != count($f) - 1)\n {\n $h = 0;\n $i = 0;\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] > 0)\n {\n print ($x + 1) . \" \" . $g[$h] . \"\\n\";\n $b[$x]--;\n $h++;\n if($h == count($g))\n {\n $i = 1;\n break;\n }\n else\n {\n $x = -1;\n }\n }\n }\n if(($i == 0) && (count($g) > 0))\n {\n print $f[count($f) - 1] . \" \" . $g[$h] . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $string){\n echo $string.PHP_EOL;\n }\n}\n\nfunction isEverybodyInformed($aNotInformed){\n $result = false;\n\n if(!count($aNotInformed)) $result = true;\n\n return $result;\n}\n\nfunction solveTask($a, $n, $aSorted, $aNotInformed, $messageList){\n if(!canBeSolved($a, $n)) getResult(-1);\n\n $policarpMessages = $a[0];\n\n foreach($aSorted as $key => $value){\n if($policarpMessages > 0){\n $niKey = array_shift($aNotInformed);\n $messageList[] = '1 '.($niKey + 2);\n --$policarpMessages;\n }else break;\n }\n\n if(!isEverybodyInformed($aNotInformed)){\n foreach($aSorted as $guyId => $guyMessages){\n while($guyMessages){\n $niKey = array_shift($aNotInformed);\n $messageList[] = ($guyId + 2).' '.($niKey + 2);\n --$guyMessages;\n if(!count($aNotInformed)) break 2;\n }\n }\n }\n\n return $messageList;\n}\n\n$messageList = solveTask($a, $n, $aSorted, $aNotInformed, $messageList);\n\nechoResultArray($messageList);\n"}, {"source_code": " $value) {\n $senders[] = [$key + 1, (int)$value];\n}\n\n$messages = [];\n$receivePointer = 1;\nforeach ($senders as $senderInfo) {\n list($id, $sendCount) = $senderInfo;\n for($i = 0; $i < $sendCount; $i++) {\n if (!isset($senders[$receivePointer][0])) {\n break;\n }\n $messages[] = $id . \" \" . $senders[$receivePointer][0];\n $receivePointer++;\n }\n}\n\nif (count($messages) < count($send)) {\n echo \"-1\";\n die();\n}\n\necho count($messages) . \"\\n\";\necho implode(\"\\n\", $messages);\n"}, {"source_code": " $string){\n echo $string.PHP_EOL;\n }\n}\n\nfunction isEverybodyInformed($aNotInformed){\n $result = false;\n\n if(!count($aNotInformed)) $result = true;\n\n return $result;\n}\n\nfunction solveTask($a, $n, $aSorted, $aNotInformed, $messageList){\n if(!canBeSolved($a, $n)) getResult(-1);\n\n $policarpMessages = $a[0];\n\n foreach($aSorted as $key => $value){\n if($policarpMessages > 0){\n $niKey = array_shift($aNotInformed);\n $messageList[] = '1 '.($niKey + 2);\n --$policarpMessages;\n }else break;\n }\n\n if(!isEverybodyInformed($aNotInformed)){\n foreach($aSorted as $guyId => $guyMessages){\n while($guyMessages){\n $niKey = array_shift($aNotInformed);\n $messageList[] = ($guyId + 2).' '.($niKey + 2);\n --$guyMessages;\n if(!count($aNotInformed)) break 2;\n }\n }\n }\n\n return $messageList;\n}\n\n$messageList = solveTask($a, $n, $aSorted, $aNotInformed, $messageList);\n\nechoResultArray($messageList);\n"}, {"source_code": " $value) {\n if ($key + 1 != $groups[$from][0]) {\n array_push($groups, array($key + 1, $value)); \n }\n}\n\n$fromMsgCount = 0;\n$msgCount = 0;\n$logs = '';\n\nfor ($i = 1; $i < $n; $i++) {\n if ($fromMsgCount < $groups[$from][1]) {\n $msgCount++;\n $logs .= ($groups[$from][0]) . ' ' . ($groups[$i][0]) . \"\\n\";\n $fromMsgCount++;\n if ($fromMsgCount == $groups[$from][1]) {\n $fromMsgCount = 0;\n $from++;\n }\n } else {\n break;\n }\n}\n\nif ($msgCount == (int)$n - 1) {\n echo $msgCount . \"\\n\";\n echo $logs;\n} else {\n echo -1; \n}\n?>"}], "negative_code": [{"source_code": "= $a - 1)\n {\n break;\n }\n }\n $g = array(\"1\");\n $h = 0;\n for($x = 0; $x < count($c); $x++)\n {\n if($c[$x] == $f[$h])\n {\n $g[count($g)] = $x + 2;\n $h++;\n if(count($f) == $h)\n {\n break;\n }\n }\n }\n $i = array();\n for($x = 0; $x < count($g); $x++)\n {\n $i[count($i)] = $b[$g[$x] - 1];\n }\n $j = range(1, $a);\n $k = array_diff($j, $g);\n sort($k);\n $l = array();\n $m = array();\n print ($a - 1) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $g[$x + 1] . \"\\n\";\n $i[$x]--;\n }\n $n = 0;\n for($x = 0; $x < count($g); $x++)\n {\n for($y = $n; $y < count($k); $y++)\n {\n if($i[$x] > 0)\n {\n print $g[$x] . \" \" . $k[$y] . \"\\n\";\n $n++;\n $i[$x]--;\n if($n == count($k))\n {\n break;\n }\n }\n }\n if($n == count($k))\n {\n break;\n }\n }\n}\n?>"}, {"source_code": "= $a - 1)\n {\n break;\n }\n }\n $g = array(\"1\");\n for($x = 0; $x < count($f); $x++)\n {\n for($y = 0; $y < count($c); $y++)\n {\n if($f[$x] == $c[$y])\n {\n $g[count($g)] = $y + 2;\n break;\n }\n }\n }\n $i = array();\n for($x = 0; $x < count($g); $x++)\n {\n $i[count($i)] = $b[$g[$x] - 1];\n }\n $j = range(1, $a);\n $k = array_diff($j, $g);\n sort($k);\n $l = array();\n $m = array();\n print ($a - 1) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $g[$x + 1] . \"\\n\";\n $i[$x]--;\n }\n $n = 0;\n for($x = 0; $x < count($g); $x++)\n {\n for($y = $n; $y < count($k); $y++)\n {\n if($i[$x] > 0)\n {\n print $g[$x] . \" \" . $k[$y] . \"\\n\";\n $n++;\n $i[$x]--;\n if($n == count($k))\n {\n break;\n }\n }\n }\n if($n == count($k))\n {\n break;\n }\n }\n}\n?>"}, {"source_code": " 0)\n {\n $f[count($f)] = $x + 1;\n }\n else\n {\n $g[count($g)] = $x + 1;\n }\n $b[$x]--;\n }\n print ($d + $e) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \" \" . $f[$x + 1] . \"\\n\";\n }\n $h = 0;\n $i = 0;\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] > 0)\n {\n print ($x + 1) . \" \" . $g[$h] . \"\\n\";\n $b[$x]--;\n $h++;\n if($h == count($g))\n {\n $i = 1;\n break;\n }\n else\n {\n $x = -1;\n }\n }\n }\n if(($i == 0) && (count($g) > 0))\n {\n print $f[count($f) - 1] . \" \" . $g[0] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n $f[count($f)] = $x + 1;\n }\n else\n {\n $g[count($g)] = $x + 1;\n }\n $b[$x]--;\n }\n print ($d + $e) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \" \" . $f[$x + 1] . \"\\n\";\n }\n $h = 0;\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] > 0)\n {\n print ($x + 1) . \" \" . $g[$h] . \"\\n\";\n $b[$x]--;\n $h++;\n if($h == count($g))\n {\n break;\n }\n else\n {\n $x = -1;\n }\n }\n }\n}\n?>"}, {"source_code": " 0)\n {\n $f[count($f)] = $x + 1;\n }\n else\n {\n $g[count($g)] = $x + 1;\n }\n $b[$x]--;\n }\n print ($d + $e) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \" \" . $f[$x + 1] . \"\\n\";\n }\n $h = 0;\n $i = 0;\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] > 0)\n {\n print ($x + 1) . \" \" . $g[$h] . \"\\n\";\n $b[$x]--;\n $h++;\n if($h == count($g))\n {\n $i = 1;\n break;\n }\n else\n {\n $x = -1;\n }\n }\n }\n if($i == 0)\n {\n print $f[count($f) - 1] . \" \" . $g[0];\n }\n}\n?>"}, {"source_code": " 0)\n {\n $f[count($f)] = $x + 1;\n }\n else\n {\n $g[count($g)] = $x + 1;\n }\n $b[$x]--;\n }\n print ($d + $e) . \"\\n\";\n for($x = 0; $x < count($f) - 1; $x++)\n {\n print $f[$x] . \" \" . $f[$x + 1] . \"\\n\";\n }\n $h = 0;\n $i = 0;\n for($x = 0; $x < $a; $x++)\n {\n if($b[$x] > 0)\n {\n print ($x + 1) . \" \" . $g[$h] . \"\\n\";\n $b[$x]--;\n $h++;\n if($h == count($g))\n {\n $i = 1;\n break;\n }\n else\n {\n $x = -1;\n }\n }\n }\n if(($i == 0) && (count($g) > 0))\n {\n print $f[count($f) - 1] . \" \" . $g[$h] . \"\\n\";\n }\n}\n?>"}, {"source_code": " $string){\n echo $string.PHP_EOL;\n }\n}\n\nfunction solveTask($a, $n, $aSorted, $aNotInformed, $messageList){\n if(!canBeSolved($a, $n)) getResult(-1);\n\n $policarpMessages = $a[0];\n\n foreach($aSorted as $key => $value){\n if($policarpMessages > 0){\n $niKey = array_shift($aNotInformed);\n $messageList[] = '1 '.($niKey + 2);\n --$policarpMessages;\n }else break;\n }\n\n foreach($aSorted as $guyId => $guyMessages){\n while($guyMessages){\n $niKey = array_shift($aNotInformed);\n $messageList[] = ($guyId + 2).' '.($niKey + 2);\n --$guyMessages;\n if(!count($aNotInformed)) break 2;\n }\n }\n\n return $messageList;\n}\n\n$messageList = solveTask($a, $n, $aSorted, $aNotInformed, $messageList);\n\nechoResultArray($messageList);\n"}], "src_uid": "3ebb3a4f01345145f8f9817f7c77185e"} {"source_code": "= $b_2)\n {\n print $a . \"\\n\";\n }\n else\n {\n print $d[$g] . \"\\n\";\n }\n}\n?>", "positive_code": [{"source_code": " $x) {\n\n if ($mid == 0) {\n return -1;\n }\n\n if ($arr[$mid - 1] <= $x) {\n return $mid - 1;\n }\n\n $r = $mid - 1;\n }\n else\n {\n $l = $mid + 1;\n }\n }\n\n return -1;\n}\n\n$q = (int)$q;\n\nfor ($i = 0; $i < $q; $i++) {\n $f = find($x, (int)$n, (int)$m[$i]);\n\n echo ($f + 1);\n\n if ($i < $q - 1) {\n echo PHP_EOL;\n }\n}"}, {"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] == $arr[$end]) return $end;\n if($arr[$end] > $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n if($arr[$middle] <= $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n}\ntest($n,$x,$q,$m);"}], "negative_code": [{"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] <= $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n if($arr[$middle] < $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n}\ntest($n,$x,$q,$m);"}, {"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] < $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n $middle = floor(($start + $end)/2);\n if($arr[$middle] < $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n return $middle;\n\n}\ntest($n,$x,$q,$m);"}, {"source_code": " $key) {\n $right = $mid - 1;\n } else {\n $left = $mid + 1;\n }\n }\n\n return $result;\n}\n\nfunction upperBound($array, $n, $key)\n{\n $left = 0;\n $right = $n - 1;\n $result = -1;\n\n while ($left <= $right) {\n $mid = (int)(($left + $right) / 2);\n\n if ($array[$mid] == $key) {\n $result = $mid;\n $left = $mid + 1;\n } else if ($array[$mid] > $key) {\n $right = $mid - 1;\n } else {\n $left = $mid + 1;\n }\n }\n\n return $result;\n}\n\n$in = 'php://stdin';\n$input = fopen($in, \"r\");\n$n = fgets($input);\n$x = explode(\" \", trim(fgets($input)));\n$q = fgets($input);\n$m = [];\nfor ($i = 0; $i < $q; $i++)\n{\n $temp = (int) fgets($input);\n array_push($m, $temp);\n}\nsort($x);\n\nfor ($i = 0; $i < $q; $i++)\n{\n $result = upperBound($x, $n, $m[$i]) + 1;\n echo ($result . \"\\n\");\n}"}, {"source_code": "= $array[$mid]) {\n $left = $mid + 1;\n } else {\n $right = $mid;\n }\n }\n return $left;\n}\n\n$in = 'php://stdin';\n$input = fopen($in, \"r\");\n$n = fgets($input);\n$x = explode(\" \", trim(fgets($input)));\n$q = fgets($input);\n$m = [];\nfor ($i = 0; $i < $q; $i++) {\n $temp = (int)fgets($input);\n array_push($m, $temp);\n}\nsort($x);\n\nfor ($i = 0; $i < $q; $i++) {\n $result = upperBoundBinarySearch($x, $m[$i]);\n echo($result . \"\\n\");\n}"}, {"source_code": " $x) {\n\n if ($mid == 0) {\n return -1;\n }\n\n if ($arr[$mid - 1] <= $x) {\n return $mid - 1;\n }\n\n $r = $mid - 1;\n }\n else\n {\n $l = $mid + 1;\n }\n }\n\n return $i-1;\n}\n\n$q = (int)$q;\n\nfor ($i = 0; $i < $q; $i++) {\n $f = find($x, (int)$n, (int)$m[$i]);\n\n echo ($f + 1);\n\n if ($i < $q - 1) {\n echo PHP_EOL;\n }\n}"}, {"source_code": " $x) {\n $i++;\n }\n\n return $i-1;\n}\n\n$q = (int)$q;\n\nfor ($i = 0; $i < $q; $i++) {\n $f = find($x, (int)$n, (int)$m[$i]);\n\n //echo ($f + 1);\n\n if ($i < $q - 1) {\n echo PHP_EOL;\n }\n}"}, {"source_code": " $x) {\n\n if ($mid == 0) {\n return -1;\n }\n\n if ($arr[$mid - 1] <= $x) {\n return $mid - 1;\n }\n\n $r = $mid - 1;\n }\n else\n {\n $l = $mid + 1;\n }\n }\n\n return $i-1;\n}\n\n$q = (int)$q;\n\nfor ($i = 0; $i < $q; $i++) {\n $f = find($x, (int)$n, (int)$m[$i]);\n\n echo ($f + 1);\n\n if ($i < $q - 1) {\n echo PHP_EOL;\n }\n}"}, {"source_code": " $x) {\n $r = $mid - 1;\n } else {\n $l = $mid + 1;\n }\n }\n\n return -1;\n}\n\n$q = (int)$q;\n\nfor ($i = 0; $i < $q; $i++) {\n $f = find($x, (int)$n, $m[$i]);\n echo ($f + 1);\n\n if ($i < $q - 1) {\n echo PHP_EOL;\n }\n}"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] <= $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n $middle = floor(($start + $end)/2);\n if($arr[$middle] < $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n return $middle;\n\n}\ntest($n,$x,$q,$m);"}, {"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] == $arr[$end]) return $end;\n if($arr[$end] > $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n if($arr[$middle] < $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n}\ntest($n,$x,$q,$m);"}, {"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] == $arr[$end]) return $end;\n if($arr[$start] <= $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n if($arr[$middle] < $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n}\ntest($n,$x,$q,$m);"}, {"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] <= $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n if($arr[$middle] < $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n}\ntest($n,$x,$q,$m);"}, {"source_code": " $number) return $start - 1;\n if($end - $start == 1){\n if($arr[$start] <= $number) return $start;\n return $end;\n }\n if($start == $end) return $start;\n if($arr[$middle] < $number){\n return check($arr,$middle,$end,$number);\n }\n if($arr[$middle] > $number){\n return check($arr,$start,$middle,$number);\n }\n}\ntest($n,$x,$q,$m);"}], "src_uid": "80a03e6d513f4051175cd5cd1dea33b4"} {"source_code": "= 0; $j--)\n $result[] = $j;\n echo implode(\" \", array_reverse(array_slice($result, 0, $n))), \"\\n\";\n $nn *= 2;\n}\n"}], "negative_code": [{"source_code": "= 0 && ($memory[$j] + $memory[$current_index]) < $n - $j - 1 ) {\n $current_index--;\n }\n $memory[$j] += $memory[$current_index];\n echo ($current_index + 1) . \" \";\n }\n echo chr(10);\n}"}, {"source_code": " $len) {\n\t$lens[$k] = (float)$len;\n}\n\n$inGroup = ($lens[0] > $favNum);\n$initCnt = $inGroup ? 1 : 0;\nfor ($i=1; $i<$hairCnt; $i++) {\n\tif (($lens[$i] > $favNum) && !$inGroup) {\n\t\t$initCnt += 1;\n\t\t$inGroup = true;\n\t} elseif ($lens[$i] <= $favNum) {\n\t\t$inGroup = false;\n\t} else {\n\t\t;\n\t}\n}\n\n$cnt = $initCnt;\n\nfor ($r=1; $r<=$reqCnt; $r++) {\n\t$req = explode(' ', fgets(STDIN));\n\tif (count($req)==1) {\n\t\techo $cnt . PHP_EOL;\n\t} else {\n\t\t$index = (int)$req[1] - 1;\n\t\t$addLen = (int)$req[2];\n\t\t\n\t\tif ($lens[$index] > $favNum) {\n\t\t\t;\n\t\t} else {\n\t\t\t$lens[$index] += $addLen;\n\t\t\tif ($lens[$index] > $favNum) {\n\t\t\t\t$lens[$index] = $favNum + 1;\n\t\t\t\tif ($index==0) {\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif ($next<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} elseif ($index==$n-1) {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\tif ($prev<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif (($prev>$favNum) && ($next>$favNum)) {\n\t\t\t\t\t\t$cnt-=1;\n\t\t\t\t\t} elseif (($prev<=$favNum) && ($next<=$favNum)) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;\n\t\t\t}\n\t\t}\n\t}\n}\n", "positive_code": [{"source_code": " $c)\n {\n if(($e[$x - 1] == NULL) && ($e[$x + 1] == NULL))\n {\n if($e[$x] == 0)\n {\n $f++;\n $e[$x] = 1;\n }\n }\n elseif($e[$x - 1] == NULL)\n {\n if($e[$x + 1] == 0)\n {\n $f++;\n $e[$x] = 1;\n }\n elseif($e[$x + 1] == 1)\n {\n $e[$x] = 1;\n }\n }\n elseif($e[$x + 1] == NULL)\n {\n if($e[$x - 1] == 0)\n {\n $f++;\n $e[$x] = 1;\n }\n elseif($e[$x - 1] == 1)\n {\n $e[$x] = 1;\n }\n }\n elseif(($e[$x - 1] != NULL) && ($e[$x + 1] != NULL))\n {\n if(($e[$x - 1] == 0) && ($e[$x] == 0) && ($e[$x + 1] == 0))\n {\n $f++;\n $e[$x] = 1;\n }\n elseif(($e[$x - 1] == 1) && ($e[$x] == 0) && ($e[$x + 1] == 1))\n {\n $f--;\n $e[$x] = 1;\n }\n elseif($e[$x - 1] == 1)\n {\n $e[$x] = 1;\n }\n elseif($e[$x + 1] == 1)\n {\n $e[$x] = 1;\n }\n }\n }\n}\nfor($x = 0; $x < $b; $x++)\n{\n $g = explode(\" \", trim(fgets(STDIN)));\n if($g[0] == 0)\n {\n print $f . \"\\n\";\n }\n else\n {\n if(($d[$g[1] - 1] <= $c) && ($d[$g[1] - 1] + $g[2] > $c))\n {\n if(($e[$g[1] - 2] == 0) && ($e[$g[1] - 1] == 0) && ($e[$g[1]] == 0))\n {\n $f++;\n $e[$g[1] - 1] = 1;\n }\n elseif(($e[$g[1] - 2] == 1) && ($e[$g[1] - 1] == 0) && ($e[$g[1]] == 1))\n {\n $f--;\n $e[$g[1] - 1] = 1;\n }\n elseif($e[$g[1] - 2] == 1)\n {\n $e[$g[1] - 1] = 1;\n }\n elseif($e[$g[1]] == 1)\n {\n $e[$g[1] - 1] = 1;\n }\n }\n $d[$g[1] - 1] += $g[2];\n }\n}\n?>"}], "negative_code": [{"source_code": " $len) {\n\t$lens[$k] = (int)$len;\n}\n\n$inGroup = ($lens[0] > $favNum);\n$initCnt = $inGroup ? 1 : 0;\nfor ($i=1; $i<$hairCnt; $i++) {\n\tif (($lens[$i] > $favNum) && !$inGroup) {\n\t\t$initCnt += 1;\n\t\t$inGroup = true;\n\t} else {\n\t\t$inGroup = false;\n\t}\n}\n\n$cnt = $initCnt;\n\nfor ($r=1; $r<=$reqCnt; $r++) {\n\t$req = explode(' ', fgets(STDIN));\n\tif (count($req)==1) {\n\t\techo $cnt . PHP_EOL;\n\t} else {\n\t\t$index = (int)$req[1] - 1;\n\t\t$addLen = (int)$req[2];\n\t\t\n\t\tif ($lens[$index] > $favNum) {\n\t\t\t$lens[$index] += $addLen;\n\t\t} else {\n\t\t\t$lens[$index] += $addLen;\n\t\t\tif ($lens[$index] > $favNum) {\n\t\t\t\tif ($index==0) {\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif ($next<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} elseif ($index==$n-1) {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\tif ($prev<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif (($prev>$favNum) && ($next>$favNum)) {\n\t\t\t\t\t\t$cnt-=1;\n\t\t\t\t\t} elseif (($prev<=$favNum) && ($next<=$favNum)) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": " $len) {\n\t$lens[$k] = (int)$len;\n}\n\n$inGroup = $lens[0] > $favNum;\n$initCnt = $inGroup ? 1 : 0;\nfor ($i=1; $i<$hairCnt; $i++) {\n\tif ($lens[$i] > $favNum && !$inGroup) {\n\t\t$initCnt += 1;\n\t} else {\n\t\t$inGroup = false;\n\t}\n}\n\n$cnt = $initCnt;\n\nfor ($r=1; $r<=$reqCnt; $r++) {\n\t$req = explode(' ', fgets(STDIN));\n\tif (count($req)==1) {\n\t\techo $cnt . PHP_EOL;\n\t} else {\n\t\t$index = (int)$req[1] - 1;\n\t\t$addLen = (int)$req[2];\n\t\t\n\t\tif ($lens[$index] > $favNum) {\n\t\t\t$lens[$index] += $addLen;\n\t\t} else {\n\t\t\t$lens[$index] += $addLen;\n\t\t\tif ($lens[$index] > $favNum) {\n\t\t\t\tif ($index==0) {\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif ($next<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} elseif ($index==$n-1) {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\tif ($prev<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif ($prev>$favNum && $next>$favNum) {\n\t\t\t\t\t\t$cnt-=1;\n\t\t\t\t\t} elseif ($prev<=$favNum && $next<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": " $len) {\n\t$lens[$k] = (float)$len;\n}\n\n$inGroup = ($lens[0] > $favNum);\n$initCnt = $inGroup ? 1 : 0;\nfor ($i=1; $i<$hairCnt; $i++) {\n\tif (($lens[$i] > $favNum) && !$inGroup) {\n\t\t$initCnt += 1;\n\t\t$inGroup = true;\n\t} else {\n\t\t$inGroup = false;\n\t}\n}\n\n$cnt = $initCnt;\n\nfor ($r=1; $r<=$reqCnt; $r++) {\n\t$req = explode(' ', fgets(STDIN));\n\tif (count($req)==1) {\n\t\techo $cnt . PHP_EOL;\n\t} else {\n\t\t$index = (int)$req[1] - 1;\n\t\t$addLen = (int)$req[2];\n\t\t\n\t\tif ($lens[$index] > $favNum) {\n\t\t\t;\n\t\t} else {\n\t\t\t$lens[$index] += $addLen;\n\t\t\tif ($lens[$index] > $favNum) {\n\t\t\t\t$lens[$index] = $favNum + 1;\n\t\t\t\tif ($index==0) {\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif ($next<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} elseif ($index==$n-1) {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\tif ($prev<=$favNum) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$prev = $lens[$index-1];\n\t\t\t\t\t$next = $lens[$index+1];\n\t\t\t\t\tif (($prev>$favNum) && ($next>$favNum)) {\n\t\t\t\t\t\t$cnt-=1;\n\t\t\t\t\t} elseif (($prev<=$favNum) && ($next<=$favNum)) {\n\t\t\t\t\t\t$cnt+=1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;\n\t\t\t}\n\t\t}\n\t}\n}\n"}], "src_uid": "1e17039ed5c48e5b56314a79b3811a40"} {"source_code": " 0; $i--)\n{\n\t//\u0411\u0435\u0440\u0435\u043c n \u043f\u0430\u0440\n\tfor ($p = 0; $p < pow(2, $i - 1); $p++)\n\t{\n\t\t$id_n_1 = pow(2, $i) + $p*2 - 1;\n\t\t$id_n_2 = pow(2, $i) + 1 + $p*2 - 1;\n\t\t\n\t\t//\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u043d\u0430\u0440\u0435\u0439 \u0431\u044b\u043b\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e\n\t\t$light_cnt_1 = (int)$numbers[$id_n_1];\n\t\t$light_cnt_2 = (int)$numbers[$id_n_2];\n\n\t\t//Crjkmrj \u0444\u043e\u043d\u0430\u0440\u0435\u0439 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043c, \u043f\u043e\u043a\u0430 \u0438\u0434\u0435\u043c \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e\n\t\t$new_light_cnt_1 = (int)$lights[$id_n_1 - 1];\n\t\t$new_light_cnt_2 = (int)$lights[$id_n_2 - 1];\n\t\t\n\t\t$light_cnt_1 += $new_light_cnt_1;\n\t\t$light_cnt_2 += $new_light_cnt_2;\n\t\t\n\t\t$dif = abs($light_cnt_1 - $light_cnt_2);\n\t\t$add_light += $dif;\n\t\t$id_parent_n = pow(2, $i - 1) + $p - 1;\n\t\t$numbers[$id_parent_n] = max($light_cnt_1, $light_cnt_2);\n\t}\n}\necho $add_light;\n?>", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " 0; $i--)\n{\n\t//\u0411\u0435\u0440\u0435\u043c n \u043f\u0430\u0440\n\tfor ($p = 0; $p < pow(2, $i - 1); $p++)\n\t{\n\t\t$id_n_1 = pow(2, $i) + $p*2 - 1;\n\t\t$id_n_2 = pow(2, $i) + 1 + $p*2 - 1;\n\t\t\n\t\t//\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u043d\u0430\u0440\u0435\u0439 \u0431\u044b\u043b\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e\n\t\t$light_cnt_1 = (int)$numbers[$id_n_1];\n\t\t$light_cnt_2 = (int)$numbers[$id_n_2];\n\n\t\t//Crjkmrj \u0444\u043e\u043d\u0430\u0440\u0435\u0439 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043c, \u043f\u043e\u043a\u0430 \u0438\u0434\u0435\u043c \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e\n\t\t$new_light_cnt_1 = (int)$lights[$id_n_1 - 1];\n\t\t$new_light_cnt_2 = (int)$lights[$id_n_2 - 1];\n\t\t\n\t\t$light_cnt_1 += $new_light_cnt_1;\n\t\t$light_cnt_2 += $new_light_cnt_2;\n\t\t\n\t\t$dif = abs($light_cnt_1 - $light_cnt_2);\n\t\t$add_light += $dif;\n\t\t$id_parent_n = pow(2, $i - 1) + $p - 1;\n\t\t$numbers[$id_parent_n] = max($light_cnt_1, $light_cnt_2);\n\t}\n}\necho $add_light;\n?>"}, {"source_code": " 0; $i--)\n{\n\t//\u0411\u0435\u0440\u0435\u043c n \u043f\u0430\u0440\n\tfor ($p = 0; $p < pow(2, $i - 1); $p++)\n\t{\n\t\t$id_n_1 = pow(2, $i) + $p*2 - 1;\n\t\t$id_n_2 = pow(2, $i) + 1 + $p*2 - 1;\n\t\t\n\t\t//\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u043d\u0430\u0440\u0435\u0439 \u0431\u044b\u043b\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e\n\t\t$light_cnt_1 = (int)$numbers[$id_n_1];\n\t\t$light_cnt_2 = (int)$numbers[$id_n_2];\n\n\t\t//Crjkmrj \u0444\u043e\u043d\u0430\u0440\u0435\u0439 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043c, \u043f\u043e\u043a\u0430 \u0438\u0434\u0435\u043c \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e\n\t\t$new_light_cnt_1 = (int)$lights[$id_n_1 - 1];\n\t\t$new_light_cnt_2 = (int)$lights[$id_n_2 - 1];\n\t\t\n\t\t$light_cnt_1 += $new_light_cnt_1;\n\t\t$light_cnt_2 += $new_light_cnt_2;\n\t\t\n\t\t$dif = abs($light_cnt_1 - $light_cnt_2);\n\t\t$add_light += $dif;\n\t\t$id_parent_n = pow(2, $i - 1) + $p - 1;\n\t\t$numbers[$id_parent_n] = max($light_cnt_1, $light_cnt_2);\n\t}\n}\necho $add_light;\n?>"}], "src_uid": "ae61e1270eeda8c30effc9ed999bf531"} {"source_code": "= $len) ? ($len - 1) : ($i + $k) ;\n if($Social[$i] == '0')\n {\n if($sum[$tmp] - $sum[$i] == 0)\n {\n $ans ++ ;\n $i = $tmp ;\n }\n }\n else $i = $tmp ;\n }\n \n echo $ans . \"\\n\" ;\n }\n?>", "positive_code": [{"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor(($g[$y] - $c) / ($c + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}], "negative_code": [{"source_code": " $c + 1)\n {\n $h++;\n if($b - 1 >= $c + 1)\n {\n $h++;\n $h += floor(($b - 2) / ($c * 2 + 1));\n }\n else\n {\n $h += floor(($b - 1) / ($c * 2 + 1));\n }\n }\n }\n else\n {\n $g = array();\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"0\")\n {\n $f++;\n }\n else\n {\n if($f > 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n if($g[0] == $c + 1)\n {\n $h++;\n }\n elseif($g[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n if($g[count($g) - 1] == $c + 1)\n {\n $h++;\n }\n elseif($g[count($g) - 1] > $c + 1)\n {\n $h++;\n $h += floor(($g[count($g) - 1] - 1) / ($c * 2 + 1));\n }\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor(($g[$y] - 1) / ($c + 1));\n }\n }\n }\n if($a != 10000)\n {\n print $h . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor(($g[$y] - 1) / ($c + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " $c + 1)\n {\n $h++;\n if($b - 1 >= $c + 1)\n {\n $h++;\n $h += floor(($b - 2) / ($c * 2 + 1));\n }\n else\n {\n $h += floor(($b - 1) / ($c * 2 + 1));\n }\n }\n }\n else\n {\n $g = array();\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"0\")\n {\n $f++;\n }\n else\n {\n if($f > 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n if($g[0] == $c + 1)\n {\n $h++;\n }\n elseif($g[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n if($d[0] == $c + 1)\n {\n $h++;\n }\n elseif($d[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " $c + 1)\n {\n $h++;\n if($b - 1 >= $c + 1)\n {\n $h++;\n $h += floor(($b - 2) / ($c * 2 + 1));\n }\n else\n {\n $h += floor(($b - 1) / ($c * 2 + 1));\n }\n }\n }\n else\n {\n $g = array();\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"0\")\n {\n $f++;\n }\n else\n {\n if($f > 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n if($g[0] == $c + 1)\n {\n $h++;\n }\n elseif($g[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n if($g[count($g) - 1] == $c + 1)\n {\n $h++;\n }\n elseif(count($g) - 1 > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n if($a != 10000)\n {\n print $h . \"\\n\";\n }\n}\n?>"}, {"source_code": " $c + 1)\n {\n $h++;\n if($b - 1 >= $c + 1)\n {\n $h++;\n $h += floor(($b - 2) / ($c * 2 + 1));\n }\n else\n {\n $h += floor(($b - 1) / ($c * 2 + 1));\n }\n }\n }\n else\n {\n $g = array();\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"0\")\n {\n $f++;\n }\n else\n {\n if($f > 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n if($g[0] == $c + 1)\n {\n $h++;\n }\n elseif($g[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n if($d[0] == $c + 1)\n {\n $h++;\n }\n elseif($d[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor(($g[$y] - $c) / ($c + 1));\n }\n }\n }\n if($a != 10000)\n {\n print $h . \"\\n\";\n }\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n if($g[0] == $c + 1)\n {\n $h++;\n }\n elseif($g[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n if($d[0] == $c + 1)\n {\n $h++;\n }\n elseif($d[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n print $h . \"\\n\";\n }\n}\n?>"}, {"source_code": " $c + 1)\n {\n $h++;\n if($b - 1 >= $c + 1)\n {\n $h++;\n $h += floor(($b - 2) / ($c * 2 + 1));\n }\n else\n {\n $h += floor(($b - 1) / ($c * 2 + 1));\n }\n }\n }\n else\n {\n $g = array();\n for($y = 0; $y < $b; $y++)\n {\n if($d[$y] == \"0\")\n {\n $f++;\n }\n else\n {\n if($f > 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n if($g[0] == $c + 1)\n {\n $h++;\n }\n elseif($g[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n if($d[0] == $c + 1)\n {\n $h++;\n }\n elseif($d[0] > $c + 1)\n {\n $h++;\n $h += floor(($g[0] - 1) / ($c * 2 + 1));\n }\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor($g[$y] / ($c + 2));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor($g[0] / ($c * 2 + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}, {"source_code": " 0)\n {\n $g[count($g)] = $f;\n $f = 0;\n }\n }\n }\n if($f > 0)\n {\n $g[count($g)] = $f;\n }\n $h = 0;\n for($y = 0; $y < count($g); $y++)\n {\n if(($y == 0) && ($d[0] == 0))\n {\n $h += floor($g[0] / ($c + 1));\n }\n elseif(($y == count($g) - 1) && ($d[$b - 1] == 0))\n {\n $h += floor($g[count($g) - 1] / ($c + 1));\n }\n else\n {\n $h += floor($g[$y] / ($c + 1));\n }\n }\n }\n print $h . \"\\n\";\n}\n?>"}], "src_uid": "fd85ebe1dc975a71c72fac7eeb944a4a"} {"source_code": ""}, {"source_code": " $c)\n {\n print $c % $b . \"\\n\";\n }\n else\n {\n $d = $c % ($b - 1);\n $e = floor($c / ($b - 1));\n if($d == 0)\n {\n $f = $b * $e - 1;\n }\n else\n {\n $f = $b * $e + 1;\n }\n print $f . \"\\n\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "7d6f76e24fe9a352beea820ab56f03b6"} {"source_code": "= 0) {\r\n if ($aList['R'] >= $x) {\r\n $xFlag = true;\r\n } else {\r\n $xFlag = false;\r\n }\r\n } else {\r\n if ($aList['L'] >= abs($x)) {\r\n $xFlag = true;\r\n } else {\r\n $xFlag = false;\r\n }\r\n }\r\n if ($y >= 0) {\r\n if ($aList['U'] >= $y) {\r\n $yFlag = true;\r\n } else {\r\n $yFlag = false;\r\n }\r\n } else {\r\n if ($aList['D'] >= abs($y)) {\r\n $yFlag = true;\r\n } else {\r\n $yFlag = false;\r\n }\r\n }\r\n if ($xFlag && $yFlag) {\r\n echo \"YES\\n\";\r\n } else {\r\n echo \"NO\\n\";\r\n }\r\n}\r\n", "positive_code": [{"source_code": " 0) {\r\n $d = 'R';\r\n } elseif ($x < 0) {\r\n $d = 'L';\r\n } else {\r\n $b = true;\r\n }\r\n\r\n $a = false;\r\n if ($y > 0) {\r\n $f = 'U';\r\n } elseif ($y < 0) {\r\n $f = 'D';\r\n } else {\r\n $a = true;\r\n }\r\n \r\n if (!$b) {\r\n $b = substr_count($s, $d) >= abs($x);\r\n }\r\n \r\n if (!$a) {\r\n $a = substr_count($s, $f) >= abs($y);\r\n }\r\n\r\n if ($b && $a) {\r\n echo 'YES' . \"\\n\";\r\n } else {\r\n echo 'NO' . \"\\n\";\r\n }\r\n }\r\n?>"}, {"source_code": " = 0 && $y >= 0 && $r >= $x && $u >= $y) {\r\n \r\n echo \"YES\\n\";\r\n } elseif($x <= 0 && $y <= 0 && ($l * -1) <= $x && ($d * -1) <= $y) {\r\n \r\n echo \"YES\\n\";\r\n }elseif($x <= 0 && $y >= 0 && ($l * -1) <= $x && $u >= $y) {\r\n \r\n echo \"YES\\n\";\r\n }elseif($x >= 0 && $y <= 0 && $r >= $x && ($d * -1) <= $y) {\r\n \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 \r\n "}, {"source_code": " 0, \"R\" => 0, \"D\" => 0, \"U\" => 0);\r\n for($y = 0; $y < strlen($d); $y++)\r\n {\r\n $e[$d[$y]]++;\r\n }\r\n if($b < 0)\r\n {\r\n for($y = 0; $y < abs($b); $y++)\r\n {\r\n $e[\"L\"]--;\r\n }\r\n }\r\n else\r\n {\r\n for($y = 0; $y < $b; $y++)\r\n {\r\n $e[\"R\"]--;\r\n }\r\n }\r\n if($c < 0)\r\n {\r\n for($y = 0; $y < abs($c); $y++)\r\n {\r\n $e[\"D\"]--;\r\n }\r\n }\r\n else\r\n {\r\n for($y = 0; $y < $c; $y++)\r\n {\r\n $e[\"U\"]--;\r\n }\r\n }\r\n if($e[\"L\"] < 0)\r\n {\r\n unset($e[\"L\"]);\r\n }\r\n if($e[\"R\"] < 0)\r\n {\r\n unset($e[\"R\"]);\r\n }\r\n if($e[\"U\"] < 0)\r\n {\r\n unset($e[\"U\"]);\r\n }\r\n if($e[\"D\"] < 0)\r\n {\r\n unset($e[\"D\"]);\r\n }\r\n if($b < 0)\r\n {\r\n if($c < 0)\r\n {\r\n if(($e[\"L\"] === NULL) || ($e[\"D\"] === NULL))\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n elseif($c == 0)\r\n {\r\n if($e[\"L\"] === NULL)\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n elseif($c > 0)\r\n {\r\n if(($e[\"L\"] === NULL) || ($e[\"U\"] === NULL))\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n }\r\n elseif($b == 0)\r\n {\r\n if($c < 0)\r\n {\r\n if($e[\"D\"] === NULL)\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n elseif($c == 0)\r\n {\r\n print \"YES\\n\";\r\n }\r\n elseif($c > 0)\r\n {\r\n if($e[\"U\"] === NULL)\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n }\r\n elseif($b > 0)\r\n {\r\n if($c < 0)\r\n {\r\n if(($e[\"R\"] === NULL) || ($e[\"D\"] === NULL))\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n elseif($c == 0)\r\n {\r\n if($e[\"R\"] === NULL)\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n elseif($c > 0)\r\n {\r\n if(($e[\"R\"] === NULL) || ($e[\"U\"] === NULL))\r\n {\r\n print \"NO\\n\";\r\n }\r\n else\r\n {\r\n print \"YES\\n\";\r\n }\r\n }\r\n }\r\n}\r\n?>"}, {"source_code": " 0 ? 'R' : 'L');\r\n $ys = ($yi > 0 ? 'U' : 'D');\r\n if (substr_count($si, $xs) >= abs($xi) && substr_count($si, $ys) >= abs($yi)) {\r\n echo 'YES', PHP_EOL;\r\n } else {\r\n echo 'NO', PHP_EOL;\r\n }\r\n}\r\n"}, {"source_code": " 0) {\r\n $command1 = 'R';\r\n } else {\r\n $command1 = 'L';\r\n }\r\n \r\n if ($py > 0) {\r\n $command2 = 'U';\r\n } else {\r\n $command2 = 'D';\r\n }\r\n \r\n $command1Count = substr_count($s, $command1);\r\n $command2Count = substr_count($s, $command2);\r\n \r\n if ($command1Count>=abs($px) && $command2Count>=abs($py)) {\r\n echo \"YES\".PHP_EOL;\r\n \r\n continue;\r\n }\r\n \r\n echo \"NO\".PHP_EOL;\r\n}"}, {"source_code": " $v) {\r\n $count[chr($k)] = $v;\r\n }\r\n foreach (['R', \"L\", \"U\", \"D\"] as $char) {\r\n if (strpos($s, $char) === false) {\r\n $count[$char] = 0;\r\n }\r\n }\r\n $px1 = $count['R'] - $count['L'];\r\n $py1 = $count['U'] - $count['D'];\r\n $dx = $px - $px1;\r\n $dy = $py - $py1;\r\n if ($dx === 0 && $dy === 0) {\r\n echo \"yes\\n\";\r\n continue;\r\n }\r\n extract($count);\r\n if (($dy > 0 && $dy > $D) || ($dy < 0 && abs($dy) > $U) || ($dx > 0 && $dx > $L) || ($dx < 0 && abs($dx) > $R)) {\r\n echo \"no\\n\";\r\n continue;\r\n }\r\n echo \"yes\\n\";\r\n}\r\n"}, {"source_code": "= 0 && $spaceY >= 0) && (($positiveStringR >= $spaceX) && ($positiveStringU >= $spaceY))) {\r\n echo \"YES\\n\";\r\n }else if(($spaceX < 0 && $spaceY < 0) && (($negativeStringX >= abs($spaceX)) && ($negativeStringY >= abs($spaceY)))){\r\n echo \"YES\\n\";\r\n }else if (($spaceY >= 0 && $spaceX < 0) && (($negativeStringX >= abs($spaceX)) && ($positiveStringU >= $spaceY))) {\r\n echo \"YES\\n\";\r\n }else if (($spaceY < 0 && $spaceX >= 0) && ( ($positiveStringR >= $spaceX) && ($negativeStringY >= abs($spaceY)))) {\r\n echo \"YES\\n\";\r\n }else{\r\n echo \"NO\\n\";\r\n }\r\n $positiveStringU = 0;\r\n $positiveStringR = 0;\r\n $negativeStringY = 0;\r\n $negativeStringX = 0;\r\n}\r\n"}, {"source_code": " 0) { $s1 = 'R'; }\r\n if ($x < 0) { $s1 = 'L'; }\r\n if ($y > 0) { $s2 = 'U'; }\r\n if ($y < 0) { $s2 = 'D'; }\r\n \r\n if ($x != 0) { $x1 = substr_count($s, $s1); } \r\n \r\n if ($y != 0) { $y1 = substr_count($s, $s2); } \r\n \r\n if (($x1 >= abs($x)) && ($y1 >= abs($y))) { echo 'YES'.PHP_EOL; } \r\n else { echo 'NO'.PHP_EOL; }\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 list($x, $y) = IO::arr();\r\n $s = IO::str();\r\n $a = str_split($s);\r\n $b = [\r\n 'U' => 0, 'D' => 0, 'L' => 0, 'R' => 0\r\n ];\r\n foreach ($a as $v) {\r\n $b[$v] += 1;\r\n }\r\n $bool = false;\r\n if ($x <= 0 && $b['L'] >= abs($x)) {\r\n if ($y <= 0 && $b['D'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n if ($y >= 0 && $b['U'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n }\r\n if ($x >= 0 && $b['R'] >= abs($x)) {\r\n if ($y <= 0 && $b['D'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n if ($y >= 0 && $b['U'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n }\r\n if($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n}\r\n"}], "negative_code": [{"source_code": "= 0 && $spaceY >= 0) && (($positiveStringR >= $spaceX) && ($positiveStringU >= $spaceY))) {\r\n echo \"YES\\n\";\r\n }else if(($spaceX < 0 && $spaceY < 0) && (($negativeStringX >= abs($spaceX)) && ($negativeStringY >= abs($spaceY)))){\r\n echo \"YES\\n\";\r\n }else if (($spaceY >= 0 && $spaceX < 0) && (($negativeStringX >= abs($spaceX)) || ($positiveStringU >= $spaceY))) {\r\n echo \"YES\\n\";\r\n }else if (($spaceY < 0 && $spaceX >= 0) && ( ($positiveStringR >= $spaceX) || ($negativeStringY >= abs($spaceY)))) {\r\n echo \"YES\\n\";\r\n }else{\r\n echo \"NO\\n\";\r\n }\r\n $positiveStringU = 0;\r\n $positiveStringR = 0;\r\n $negativeStringY = 0;\r\n $negativeStringX = 0;\r\n}\r\n"}, {"source_code": " 0 && $positiveStringU == $spaceY) && ($spaceX < 0 && $negativeStringX == abs($spaceX))) {\r\n echo \"YES\\n\";\r\n }else if (($spaceY < 0 && $negativeStringY == abs($spaceY)) && ($spaceX > 0 && $positiveStringR == $spaceX)) {\r\n echo \"YES\\n\";\r\n }else if (($spaceX > 0 && $positiveStringR == $spaceX) && ($spaceY > 0 && $positiveStringU == $spaceY)) {\r\n echo \"YES\\n\";\r\n }else {\r\n echo \"NO\\n\";\r\n }\r\n $positiveStringU = 0;\r\n $positiveStringR = 0;\r\n $negativeStringY = 0;\r\n $negativeStringX = 0;\r\n}\r\n"}, {"source_code": " 0 && $positiveStringU == $spaceY) && ($spaceX < 0 && $negativeStringX == abs($spaceX))) {\r\n echo \"YES\\n\";\r\n }else if (($spaceY < 0 && $negativeStringY == abs($spaceY)) && ($spaceX > 0 && $positiveStringR == $spaceX)) {\r\n echo \"YES\\n\";\r\n }else if (($spaceX > 0 && $positiveStringR == $spaceX) && ($spaceY > 0 && $positiveStringU == $spaceY)) {\r\n echo \"YES\\n\";\r\n }else {\r\n echo \"NO\\n\";\r\n }\r\n $positiveStringU = 0;\r\n $positiveStringR = 0;\r\n $negativeStringY = 0;\r\n $negativeStringX = 0;\r\n}\r\n"}, {"source_code": " 0) { $s1 = 'R'; }\r\n if ($x < 0) { $s1 = 'L'; }\r\n if ($y > 0) { $s2 = 'U'; }\r\n if ($y < 0) { $s2 = 'D'; }\r\n \r\n $c = abs($x + $y);\r\n \r\n if ($x != 0) { \r\n $pos1 = strpos($s, $s1);\r\n $pos11 = strrpos($s, $s1);\r\n if ($pos1 === false) { $x1 = 0; }\r\n else { \r\n for ($j = $pos1 - 1; $j <= $pos11; $j++) { \r\n if ($s[$j] == $s1) { $s1 == 'R' ? $n1++ : $n1--; $x1 = 1; } \r\n }\r\n }\r\n } else { $x1 = 1; }\r\n \r\n if ($y != 0) { \r\n $pos2 = strpos($s, $s2);\r\n $pos22 = strrpos($s, $s2);\r\n if ($pos2 === false) { $y1 = 0; }\r\n else { \r\n for ($j = $pos2 - 1; $j <= $pos22; $j++) { \r\n if ($s[$j] == $s2) { $s2 == 'U' ? $n2++ : $n2--; $y1 = 1; }\r\n }\r\n }\r\n } else { $y1 = 1; }\r\n \r\n if (($x1 == 1)&&($y1 == 1)) { \r\n if (($n1 >= $x)&&($n2 >= $y)) { echo 'YES'.PHP_EOL; } \r\n else { echo 'NO'.PHP_EOL;}\r\n } else { echo 'NO'.PHP_EOL; }\r\n}"}, {"source_code": " 0) { $s1 = 'R'; }\r\n if ($x < 0) { $s1 = 'L'; }\r\n if ($y > 0) { $s2 = 'U'; }\r\n if ($y < 0) { $s2 = 'D'; }\r\n \r\n if ($x != 0) { \r\n $pos1 = strpos($s, $s1);\r\n if ($pos1 === false) { $x1 = 0; }\r\n else { $x1 = 1; }\r\n } else { $x1 = 1; }\r\n \r\n if ($y != 0) { \r\n $pos2 = strpos($s, $s2);\r\n if ($pos2 === false) { $y1 = 0; }\r\n else { $y1 = 1; }\r\n } else { $y1 = 1; }\r\n \r\n if (($x1 == 1)&&($y1 == 1)) { echo 'YES'.PHP_EOL; }\r\n else { echo 'NO'.PHP_EOL; }\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 list($x, $y) = IO::arr();\r\n $s = IO::str();\r\n $a = str_split($s);\r\n $b = [];\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 $bool = false;\r\n if ($x <= 0 && $b['L'] >= abs($x)) {\r\n if ($y < 0 && $b['D'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n if ($y > 0 && $b['U'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n }\r\n if ($x >= 0 && $b['R'] >= abs($x)) {\r\n if ($y < 0 && $b['D'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n if ($y > 0 && $b['U'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n }\r\n if($bool) {\r\n IO::yes();\r\n } else {\r\n IO::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\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($x, $y) = IO::arr();\r\n $s = IO::str();\r\n $a = str_split($s);\r\n $b = [];\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 $bool = false;\r\n if ($x < 0 && $b['L'] >= abs($x)) {\r\n if ($y < 0 && $b['D'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n if ($y > 0 && $b['U'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n }\r\n if ($x > 0 && $b['R'] >= abs($x)) {\r\n if ($y < 0 && $b['D'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n if ($y > 0 && $b['U'] >= abs($y)) {\r\n $bool = true;\r\n }\r\n }\r\n if($bool) {\r\n IO::yes();\r\n } else {\r\n IO::no();\r\n }\r\n}\r\n"}, {"source_code": " 0 && substr_count($s, 'R') >= abs($x)) || ($x < 0 && substr_count($s, 'L') >= abs($x)))\r\n &&\r\n ($y = 0 || ($y > 0 && substr_count($s, 'U') >= abs($y)) || ($y < 0 && substr_count($s, 'D') >= abs($y)))\r\n ) {\r\n echo 'YES' . \"\\n\";\r\n } else {\r\n echo 'NO' . \"\\n\";\r\n }\r\n }\r\n?>"}, {"source_code": " 0 && $y > 0 && $r >= $x && $u >= $y) {\r\n \r\n echo \"YES\\n\";\r\n } elseif($x < 0 && $y < 0 && ($l * -1) <= $x && ($d * -1) <= $y) {\r\n \r\n echo \"YES\\n\";\r\n }elseif($x < 0 && $y > 0 && ($l * -1) <= $x && $u >= $y) {\r\n \r\n echo \"YES\\n\";\r\n }elseif($x > 0 && $y < 0 && $r >= $x && ($d * -1) <= $y) {\r\n \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 \r\n "}], "src_uid": "65a64ea63153fec4d660bad1287169d3"} {"source_code": "= $n) {\n\t$res = max($power);\n} \nelse {\n\t$count = 0;\n $res = $power[0] ;\n\tfor ($i = 1; $i < $n; $i++) {\n\t\tif ($power[$i] < $res) {\n\t\t\t$count += 1;\n\t\t\tif ($count >= $k) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$count = 1;\n\t\t\t$res = $power[$i];\n\t\t}\n\t}\n}\n\necho $res;\n", "positive_code": [{"source_code": " $c[$x + 1])\n {\n $e++;\n $c[$x + 1] = $c[$x];\n if($e == $b)\n {\n print $c[$x];\n break;\n }\n }\n elseif($c[$x] < $c[$x + 1])\n {\n $e = 1;\n }\n}\n?>"}], "negative_code": [{"source_code": "= $n) {\n\t$res = max($power);\n} \nelse {\n\t$subpower = array_slice($power,0,k-1);\n\t$res = max($subpower);\n}\n\necho $res.\"\\n\";\n"}, {"source_code": "= $n) {\n\t$res = max($power);\n} \nelse {\n\t$count = 0;\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tif ($i == n-1) {\n\t\t\t$res = max($power[$i],$power[$i-1]);\n\t\t\tbreak;\n\t\t}\n\t\tif ($power[$i] > $power[$i+1]) {\n\t\t\t$count += 1;\n\t\t\tif ($count >= $k) {\n\t\t\t\t$res = $power[$i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$count = 1;\n\t\t}\n\t}\n}\n\necho $res;\n"}], "src_uid": "8d5fe8eee1cce522e494231bb210950a"} {"source_code": " $y) {\n\t\tget($z, $y);\n\t} else if ($z == 0) {\n\t\treturn $y;\n\t}\n\treturn $z;\n}\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "0; $r--)\n if($a[$r]<$a[$r-1])\n break;\necho $r;\n?>", "positive_code": [{"source_code": " 0; $x--)\n{\n if($b[$x] < $b[$x - 1])\n {\n break;\n }\n}\nprint $x;\n?>"}, {"source_code": "\n\n 0) {\n if ($a[$i-1] < $a[$i]) {\n $i --;\n } else {\n break;\n }\n}\n\nprintf(\"%d\", $i);\n\n?>\n"}, {"source_code": "= 0; $i --)\n {\n \n if ($a[$i] < $a[$i-1])\n {\n $k= $i;\n break;\n }\n }\necho $k;"}, {"source_code": "0;$r--){\n\t\tif($arr[$r]<$arr[$r-1]){\n\t\t\tbreak;\n\t\t}\n\t}\n\techo $r;\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": "$ai) $t=true; }\nreturn $t;\n}\n\n$n=trim(fgets(STDIN));\n$a=explode(' ', trim(fgets(STDIN)));\n$r=0;\nfor($i=0; $i"}, {"source_code": "=0;$r--){\n\t\tif($arr[$r]<$arr[$r-1]){\n\t\t\tbreak;\n\t\t}\n\t}\n\techo $r;\n?>\n"}], "src_uid": "310a0596c0a459f496b8d6b57676d25e"} {"source_code": " 0, 2 => 1, 3 => 2, 4 => 3, 5 => 4, 6 => 5, 7 => 6, 8 => 7, 9 => 8, 10 => 9, 11 => 0, 12 => 1, 13 => 2, 14 => 3, 15 => 4, 16 => 5, 17 => 6, 18 => 7, 19 => 8, 20 => 9);\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n if($b[$x] != $c[$x])\n {\n $f = array_search($b[$x], $d);\n $g = array_slice($d, $f);\n array_unshift($g, \" \");\n unset($g[0]);\n $h = array_search($c[$x], $g);\n $i = array_search($c[$x], $d);\n $j = array_slice($d, $i);\n array_unshift($j, \" \");\n unset($j[0]);\n $k = array_search($b[$x], $j);\n $e += min($h, $k);\n }\n}\nprint $e;\n?>"}, {"source_code": "\n"}, {"source_code": "5) $d-=10;\n\t\t$m += abs($d);\n\t}\n\techo $m;\n?>"}, {"source_code": "\n $now_shifr[$i]){\n\t\t\t$step = (10-$need_shifr[$i])+$now_shifr[$i];\n\t\t}else{\n\t\t\t$step = (10-$now_shifr[$i])+$need_shifr[$i];\n\t\t}\n\t}\n\t$count_move += $step;\n}\necho $count_move;\n?>"}, {"source_code": "4)\n\t{\n\t\tif($line1[$i]>$line2[$i])\n\t\t{\n\t\t\t$line=$line1[$i]+$line2[$i];\n\t\t\t$line2[$i]=$line-$line2[$i];\n\t\t\t$line1[$i]=$line-$line2[$i];\n\n\t\t}\n $count+=$line1[$i]+10-$line2[$i];\n\n // echo \"$count\\n\";\n \n\t}\n\telse\n {\n \t $count+=abs($line1[$i]-$line2[$i]);\n //echo \"$count\\n\";\n\n }\n}\necho \"$count\";"}, {"source_code": " $y) {\n $z = $x;\n $x = $y;\n $y = $z;\n }\n\n if (($y - $x) < ($x + 10 - $y)) {\n $col += $y - $x;\n } else {\n $col += $x + 10 - $y;\n }\n\n}\n\necho \"$col\";\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 5) $s += 10-$v;\n\t\telse $s += $v;\n\t}\n\techo $s;\n?>"}], "negative_code": [{"source_code": "\";\n//time start\n$start_operation_create = microtime(true);\n\n/*input*/\n$count_numbers = 5;\n$now_shifr = '64723';\n$need_shifr = '82195';\n/*end input*/\n\n/*worker*/\n/*--init--*/\n$count_move = 0;\n/*--end init--*/\nfor ($i=0; $i < $count_numbers; $i++){ \n\t$delta = abs($need_shifr[$i]-$now_shifr[$i]);\n\tif($delta < 5){\n\t\t$step = $delta;\n\t}else{\n\t\tif($need_shifr[$i]>$now_shifr[$i]){\n\t\t\t$step = (10-$need_shifr[$i])+$now_shifr[$i];\n\t\t}else{\n\t\t\t$step = (10-$now_shifr[$i])+$need_shifr[$i];\n\t\t}\n\t}\n\techo '\u0427\u0442\u043e\u0431\u044b '.$now_shifr[$i].' \u0441\u0442\u0430\u043b '.$need_shifr[$i].' \u043d\u0443\u0436\u043d\u043e '.$step.' \u0434\u0432\u0438\u0436.
';\n\t$count_move += $step;\n}\n/*end worker*/\n\n/*output*/\necho \"res ->\".$count_move.\"
\";\n/*end output*/\n\necho 'time execute: '.((microtime(true) - $start_operation_create)).\" ms
\";\necho \"stop
\";\n?>"}], "src_uid": "5adb1cf0529c3d6c93c107cf72fa5e0b"} {"source_code": " $c)\n {\n print \"0\\n\";\n }\n elseif($f <= $c)\n {\n print ($c - $f) . \"\\n\";\n }\n }\n elseif($d == $b)\n {\n $f = $d + $e;\n if($f <= $c)\n {\n print ($c - $b - $e) . \"\\n\";\n }\n elseif($f >= $c)\n {\n print \"0\\n\";\n }\n }\n elseif(($d > $b) && ($d < $c))\n {\n $f = $d - $e;\n $g = $d + $e;\n if($f > $b)\n {\n $h += $f - $b;\n }\n if($g < $c)\n {\n $h += $c - $g;\n }\n print $h . \"\\n\";\n }\n elseif($d == $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n else\n {\n print ($f - $b) . \"\\n\";\n }\n }\n elseif($d > $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n elseif($f >= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $d - $e;\n print ($c - $b - ($c - $g)) . \"\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": "$b) {\n $min = $b;\n $max = $a;\n }else{\n $min = $a;\n $max = $b;\n }\n \n $lenth = $max-$min;\n $c1 = $c - $r;\n $c2 = $c + $r;\n \n if($lenth > 0 && $r > 0){\n \n if($c1 <= $min && $c2 >= $max){\n $lenth = 0;\n } elseif ($c1 >= $min && $c2 <= $max){\n $lenth = $lenth - ($c2 - $c1);\n } elseif($c1 >= $min && $c1 <= $max && $c2 >= $max) {\n $lenth = $lenth - ($max - $c1);\n } elseif($c1 <= $min && $c2 >= $min && $c2 <= $max) {\n $lenth = $lenth - ($c2 - $min);\n }\n \n }\n echo $lenth.\"\\n\";\n}"}, {"source_code": ""}, {"source_code": "= $b ? $a : $b;\n \n if ($r1 <= $max && $r1 >= $min && $r2 <= $max && $r2 >= $min) {\n $res = ($max -$r2) + ($r1 - $min);\n } elseif ($r1 <= $min && $r2 >= $max) {\n $res = 0;\n } elseif ($r1 <= $max && $r1 >= $min && $r2 > $max) {\n $res = $r1 - $min;\n } elseif ($r2 <= $max && $r2 >= $min && $r1 < $min) {\n $res = $max - $r2;\n } else {\n $res = $max - $min;\n }\n\n echo abs($res).\"\\n\";\n}\n\n\n?>"}, {"source_code": "\n\";\n if($ans1min($a[0],$a[1]))\n {\n $cnt=$cnt+(max($a[0],$a[1])-$ans1);\n }\n if($ans2min($a[0],$a[1]))\n {\n $cnt=$cnt+($ans2-min($a[0],$a[1]));\n }\n if($ans2>=max($a[0],$a[1]) || $ans1<=min($a[1],$a[0]) )\n $cnt=$ans;\n echo $cnt .\"\\n\";\n\n}\n?>\n"}, {"source_code": " $u2) {\n $tmp = $u2; \n $u2 = $u1;\n $u1 = $tmp;\n }\n $c1 = $c - $r;\n $c2 = $c + $r;\n\n // \u0412\u044b\u0448\u043a\u0430 \u0432\u043d\u0435 \u043f\u0443\u0442\u0438\n if ($c1 > $u2 || $c2 < $u1) {\n return abs($u2 - $u1);\n\n // \u0412\u044b\u0448\u043a\u0430 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c\n } elseif ($c1 <= $u1 && $c2 >= $u2) {\n return 0;\n\n // \u0412\u044b\u0448\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0442\u0438\n } elseif ($c1 >= $u1 && $c2 <= $u2) {\n return abs($u2 - $u1) - abs($c2 - $c1);\n\n // \u0412\u044b\u0448\u043a\u0430 \u0441\u043b\u0435\u0432\u0430 \n } elseif ($c2 >= $u1 && $c2 <= $u2) {\n return abs($u2 - $c2);\n\n // \u0412\u044b\u0448\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \n } elseif ($c1 <= $u2 && $c2 >= $u2) {\n return abs($c1 - $u1);\n }\n }\n\n return null;\n}\n\n\n$h = fgets($data);\nwhile (($l = fgets($data)) !== false) {\n $a = explode(' ', $l);\n $r = calc($a[0], $a[1], $a[2], $a[3]);\n fwrite($result, $r . PHP_EOL);\n}\n\n?>"}, {"source_code": " $b) {\n $o = $a;\n $a = $b;\n $b = $o;\n }\n $a2 = $c - $r;\n $b2 = $c + $r;\n if (($a2 < $a && $b2 < $a) || ($a2 > $b && $b2 > $b)) {\n $x = $b - $a;\n } elseif ($a <= $a2 && $b2 <= $b) {\n \n $b3 = $b - $b2;\n $x = 0;\n if ($b3 > 0) {\n $x += $b3;\n } \n $a3 = $a2 - $a;\n if ($a3 > 0) {\n $x += $a3;\n }\n \n } else if ($a > $a2 && $b2 <= $b){\n $x = $b - $b2;\n } else if ($a <= $a2 && $b2 > $b){\n $x = $a2 - $a;\n } else {\n $x = 0;\n }\n echo $x . \"\\n\";\n }\n \n?>"}], "negative_code": [{"source_code": "= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $f - $b;\n print ($c - $b - $g) . \"\\n\";\n }\n }\n elseif($d == $b)\n {\n $f = $b + $e;\n if($f < $c)\n {\n print ($c - $f) . \"\\n\";\n }\n elseif($f >= $c)\n {\n print \"0\\n\";\n }\n }\n elseif(($d > $b) && ($d < $c))\n {\n $f = $d - $e;\n $g = $d + $e;\n if($f > $b)\n {\n $h += $f - $b;\n }\n if($g < $c)\n {\n $h += $c - $g;\n }\n print $h . \"\\n\";\n }\n elseif($d == $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n else\n {\n print ($f - $b) . \"\\n\";\n }\n }\n elseif($d > $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n elseif($f >= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $d - $e;\n print ($c - $b - ($c - $g)) . \"\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": "= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $f - $b;\n print ($c - $b - $g) . \"\\n\";\n }\n }\n elseif($d == $b)\n {\n $f = $b + $e;\n if($f < $c)\n {\n print ($c - $f) . \"\\n\";\n }\n elseif($f >= $c)\n {\n print \"0\\n\";\n }\n }\n elseif(($d > $b) && ($d < $c))\n {\n $f = $d - $e;\n $g = $d + $e;\n if($f > $b)\n {\n $h += $f - $b;\n }\n if($g < $c)\n {\n $h += $c - $g;\n }\n print $h . \"\\n\";\n }\n elseif($d == $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n else\n {\n print ($e - $b) . \"\\n\";\n }\n }\n elseif($d > $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n elseif($f >= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $d - $e;\n print ($c - $b - ($c - $g)) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $b)\n {\n $g = $f - $b;\n print ($c - $b - $g) . \"\\n\";\n }\n }\n elseif($d == $b)\n {\n $f = $b + $e;\n if($f < $c)\n {\n print ($c - $f) . \"\\n\";\n }\n elseif($f >= $c)\n {\n print \"0\\n\";\n }\n }\n elseif(($d > $b) && ($d < $c))\n {\n $f = $d - $e;\n $g = $d + $e;\n if($f > $b)\n {\n $h += $f - $b;\n }\n if($g < $c)\n {\n $h += $c - $g;\n }\n print $h . \"\\n\";\n }\n elseif($d == $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n else\n {\n print ($e - $b) . \"\\n\";\n }\n }\n elseif($d > $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n elseif($f > $b)\n {\n $g = $d - $e;\n print ($c - $b - ($c - $g)) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " $c)\n {\n print \"0\\n\";\n }\n elseif($f <= $c)\n {\n $h = $g - $b;\n $i = $c - $f;\n print ($h + $i) . \"\\n\";\n }\n }\n elseif($d == $b)\n {\n $f = $d + $e;\n if($f <= $c)\n {\n print ($c - $b - $e) . \"\\n\";\n }\n elseif($f >= $c)\n {\n print \"0\\n\";\n }\n }\n elseif(($d > $b) && ($d < $c))\n {\n $f = $d - $e;\n $g = $d + $e;\n if($f > $b)\n {\n $h += $f - $b;\n }\n if($g < $c)\n {\n $h += $c - $g;\n }\n print $h . \"\\n\";\n }\n elseif($d == $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n else\n {\n print ($f - $b) . \"\\n\";\n }\n }\n elseif($d > $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n elseif($f >= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $d - $e;\n print ($c - $b - ($c - $g)) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $f - $b;\n print ($c - $b - $g) . \"\\n\";\n }\n }\n elseif($d == $b)\n {\n $f = $b + $e;\n if($f < $c)\n {\n print ($c - $f) . \"\\n\";\n }\n elseif($f >= $c)\n {\n print \"0\\n\";\n }\n }\n elseif(($d > $b) && ($d < $c))\n {\n $f = $d - $e;\n $g = $d + $e;\n if($f > $b)\n {\n $h += $f - $b;\n }\n if($g < $c)\n {\n $h += $c - $g;\n }\n print $h . \"\\n\";\n }\n elseif($d == $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n else\n {\n print ($f - $b) . \"\\n\";\n }\n }\n elseif($d > $c)\n {\n $f = $d - $e;\n if($f <= $b)\n {\n print \"0\\n\";\n }\n elseif($f >= $c)\n {\n print ($c - $b) . \"\\n\";\n }\n elseif($f > $b)\n {\n $g = $d - $e;\n print ($c - $b - ($c - $g)) . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": "$b) {\n $min = $b;\n $max = $a;\n }else{\n $min = $a;\n $max = $b;\n }\n \n $lenth = $max-$min;\n $c1 = $c - $r;\n $c2 = $c + $r;\n \n if($lenth > 0 && $r > 0){\n \n if($c1 < $min && $c2 > $max){\n $lenth = 0;\n } elseif ($c1 > $min && $c2 < $max){\n $lenth = $lenth - ($c2 - $c1);\n } elseif($c1 > $min && $c1 < $max && $c2 > $max) {\n $lenth = $lenth - ($max - $c1);\n } elseif($c1 < $min && $c2 > $min && $c2 < $max) {\n $lenth = $lenth - ($c2 - $min);\n }\n \n }\n echo $lenth.\"\\n\";\n}"}, {"source_code": "= $a && $r1 <= $b) && ($r2 >= $a && $r2 <= $b)) {\n $res = abs($r1 - $a) + abs($b-$r2);\n } elseif ($r1 >= $a && $r1 <= $b) {\n $res = abs($b - $r1);\n } elseif ($r2 >= $a && $r2 <= $b) {\n $res = abs($b - $r2);\n } elseif ($r1 < $a && $r2 > $b) {\n $res = 0;\n } else {\n $res = abs($b - $a);\n }\n } else {\n if (($r1 <= $a && $r1 >= $b) && ($r2 <= $a && $r2 >= $b)) {\n $res = abs($r1 - $b) + abs($a - $r2);\n } elseif ($r1 <= $a && $r1 >= $b) {\n $res = abs($r1 - $b);\n } elseif ($r2 <= $a && $r2 >= $b) {\n $res = abs($r2 - $b);\n } elseif ($r1 < $b && $r2 > $a) {\n $res = 0;\n } else {\n $res = abs($a - $b);\n }\n }\n\n echo $res.\"\\n\";\n}\n\n\n?>"}, {"source_code": "= $a && $r1 <= $b) && ($r2 >= $a && $r2 <= $b)) {\n $res = abs($r1 - $a) + abs($b-$r2);\n } elseif (($r1 >= $a && $r1 <= $b) && !($r2 >= $a && $r2 <= $b)) {\n $res = abs(abs($b) - abs($r1));\n } elseif (!($r1 >= $a && $r1 <= $b) && ($r2 >= $a && $r2 <= $b)) {\n $res = abs(abs($b) - abs($r2));\n } elseif (($r1 < $a && $r1 < $b && $r2 > $a && $r2 > $b)) {\n $res = 0;\n } else {\n $res = abs($b - $a);\n }\n } else {\n if (($r1 >= $a && $r1 <= $b) && ($r2 >= $a && $r2 <= $b)) {\n $res = abs($r1 - $a) + abs($b-$r2);\n } elseif (($r1 <= $a && $r1 >= $b) && !($r2 <= $a && $r2 >= $b)) {\n $res = abs(abs($b) - abs($r1));\n } elseif (!($r1 <= $a && $r1 >= $b) && ($r2 <= $a && $r2 >= $b)) {\n $res = abs(abs($b) - abs($r2));\n } elseif (($r1 < $a && $r1 < $b && $r2 > $a && $r2 > $b)) {\n $res = 0;\n } else {\n $res = abs($b - $a);\n }\n }\n\n echo $res.\"\\n\";\n}\n\n\n?>"}, {"source_code": "= $b ? $a : $b;\n\n if ($r1 <= $max && $r1 >= $min && $r2 <= $max && $r2 >= $min) {\n $res = ($max -$r2) + ($r1 - $min);\n } elseif ($r1 <= $min && $r2 >= $max) {\n $res = 0;\n } elseif ($r1 <= $max && $r1 >= $min) {\n $res = $b - $r1;\n } elseif ($r2 <= $max && $r2 >= $min) {\n $res = $b - $r2;\n } else {\n $res = $max - $min;\n }\n\n echo abs($res).\"\\n\";\n}\n\n\n?>"}, {"source_code": "= $b ? $a : $b;\n\n if ($r1 <= $max && $r1 >= $min && $r2 <= $max && $r2 >= $min) {\n $res = ($max -$r2) + ($r1 - $min);\n } elseif ($r1 < $min && $r2 > $max) {\n $res = 0;\n } elseif ($r1 <= $max && $r1 >= $min) {\n $res = $b - $r1;\n } elseif ($r2 <= $max && $r2 >= $min) {\n $res = $b - $r2;\n } else {\n $res = $max - $min;\n }\n\n echo abs($res).\"\\n\";\n}\n\n\n?>"}, {"source_code": "= $b ? $a : $b;\n\n if ($r1 <= $max && $r1 >= $min && $r2 <= $max && $r2 >= $min) {\n $res = ($max -$r2) + ($r1 - $min);\n } elseif ($r1 <= $min && $r2 >= $max) {\n $res = 0;\n } elseif ($r1 <= $max && $r1 >= $min) {\n $res = ($max - $r1) + ($r1 - $min);\n } elseif ($r2 <= $max && $r2 >= $min) {\n $res = ($max - $r2) + ($r2 - $min);\n } else {\n $res = $max - $min;\n }\n\n echo abs($res).\"\\n\";\n}\n\n\n?>"}, {"source_code": "= $a && $r1 <= $b) && ($r2 >= $a && $r2 <= $b)) {\n $res = abs($r1 - $a) + abs($b-$r2);\n } elseif ($r1 >= $a && $r1 <= $b) {\n $res = abs($b - $r1);\n } elseif ($r2 >= $a && $r2 <= $b) {\n $res = abs($b - $r2);\n } elseif ($r1 < $a && $r2 > $b) {\n $res = 0;\n } else {\n $res = abs($b - $a);\n }\n } else {\n if (($r1 <= $a && $r1 >= $b) && ($r2 <= $a && $r2 >= $b)) {\n $res = abs($r1 - $b) + abs($a - $r2);\n } elseif ($r1 <= $a && $r1 >= $b) {\n $res = abs($r1 - $b);\n } elseif ($r2 <= $a && $r2 >= $b) {\n $res = abs($r2 - $b);\n } elseif (($r1 < $a && $r1 < $b && $r2 > $a && $r2 > $b)) {\n $res = 0;\n } else {\n $res = abs($a - $b);\n }\n }\n\n echo $res.\"\\n\";\n}\n\n\n?>"}, {"source_code": "\n\";\n if($ans1min($a[0],$a[1]))\n {\n $cnt=$cnt+(max($a[0],$a[1])-$ans1);\n }\n if($ans2min($a[0],$a[1]))\n {\n $cnt=$cnt+($ans2-min($a[0],$a[1]));\n }\n if($ans2>max($a[0],$a[1]) || $ans1\n"}, {"source_code": " $u2) {\n $tmp = $u2; \n $u2 = $u1;\n $u1 = $tmp;\n }\n $c1 = $c - $r;\n $c2 = $c + $r;\n\n // \u0412\u044b\u0448\u043a\u0430 \u0432\u043d\u0435 \u043f\u0443\u0442\u0438\n if ($c1 > $u2 || $c2 < $u1) {\n return abs($u2 - $u1);\n\n // \u0412\u044b\u0448\u043a\u0430 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c\n } elseif ($c1 <= $u1 && $c2 >= $u2) {\n return 0;\n\n // \u0412\u044b\u0448\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0442\u0438\n } elseif ($c1 >= $u1 && $c2 <= $u2) {\n return abs($u2 - $u1) - abs($c2 - $c1);\n\n // \u0412\u044b\u0448\u043a\u0430 \u0441\u043b\u0435\u0432\u0430 \n } elseif ($c2 > $u1 && $c2 < $u2) {\n return abs($u2 - $c2);\n\n // \u0412\u044b\u0448\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \n } elseif ($c1 < $u2 && $c2 > $u2) {\n return abs($c1 - $u1);\n }\n }\n\n return null;\n}\n\n\n$h = fgets($data);\nwhile (($l = fgets($data)) !== false) {\n $a = explode(' ', $l);\n $r = calc($a[0], $a[1], $a[2], $a[3]);\n echo $r . '
';\n fwrite($result, $r . PHP_EOL);\n}\n\n?>"}, {"source_code": " $u2) {\n $tmp = $u2; \n $u2 = $u1;\n $u1 = $tmp;\n }\n $c1 = $c - $r;\n $c2 = $c + $r;\n\n // \u0412\u044b\u0448\u043a\u0430 \u0432\u043d\u0435 \u043f\u0443\u0442\u0438\n if ($c1 > $u2 || $c2 < $u1) {\n return abs($u2 - $u1);\n\n // \u0412\u044b\u0448\u043a\u0430 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u043f\u0443\u0442\u044c\n } elseif ($c1 <= $u1 && $c2 >= $u2) {\n return 0;\n\n // \u0412\u044b\u0448\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0443\u0442\u0438\n } elseif ($c1 >= $u1 && $c2 <= $u2) {\n return abs($u2 - $u1) - abs($c2 - $c1);\n\n // \u0412\u044b\u0448\u043a\u0430 \u0441\u043b\u0435\u0432\u0430 \n } elseif ($c2 > $u1 && $c2 < $u2) {\n return abs($u2 - $c2);\n\n // \u0412\u044b\u0448\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \n } elseif ($c1 < $u2 && $c2 > $u2) {\n return abs($c1 - $u1);\n }\n }\n\n return null;\n}\n\n\n$h = fgets($data);\nwhile (($l = fgets($data)) !== false) {\n $a = explode(' ', $l);\n $r = calc($a[0], $a[1], $a[2], $a[3]);\n fwrite($result, $r . PHP_EOL);\n}\n\n?>"}, {"source_code": " $b) {\n $o = $a;\n $a = $b;\n $b = $o;\n }\n $a2 = $c - $r;\n $b2 = $c + $r;\n if (($a2 < $a && $b2 < $a) || ($a2 > $b && $b2 > $b)) {\n $x = $b - $a;\n } elseif ($a <= $a2 && $b2 <= $b) {\n \n $b3 = $b - $b2;\n $x = 0;\n if ($b3 > 0) {\n $x += $b3;\n } \n $a3 = $a2 - $a;\n if ($a3 > 0) {\n $x += $a3;\n }\n \n } else if ($a > $a2 && $b2 <= $b){\n $x = $b - $b2;\n } else if ($a <= $a2 && $b2 > $b){\n $x = $a2 - $a;\n } else {\n $x = 0;\n }\n echo $a2 . \" \" . $b2 . ' ' .$x . \"\\n\";\n }\n \n?>"}], "src_uid": "783772cb7a54bf65f648d3f8b7648263"} {"source_code": " (int)$chr, str_split(readline()));\n }\n\n $totalOnes = array_sum(array_map('array_sum', $mx));\n\n $maxZerosSum = 0;\n\n for ($i = 0; $i < $n - 1; ++$i) {\n for ($j = 0; $j < $m - 1; ++$j) {\n $maxZerosSum = max(\n $maxZerosSum,\n !$mx[$i][$j] + !$mx[$i][$j + 1] + !$mx[$i + 1][$j] + !$mx[$i + 1][$j + 1],\n );\n }\n }\n\n if ($maxZerosSum === 0) {\n $sub = 2;\n }\n\n if ($maxZerosSum === 1) {\n $sub = 1;\n }\n\n if ($maxZerosSum >= 2) {\n $sub = 0;\n }\n\n echo ($totalOnes - $sub).PHP_EOL;\n}\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": " (int)$chr, str_split(readline()));\n }\n\n $totalOnes = array_sum(array_map('array_sum', $mx));\n\n $maxNearByZeros = 0;\n\n for ($i = 0; $i < $n - 1; ++$i) {\n for ($j = 0; $j < $m - 1; ++$j) {\n $maxNearByZeros = max(\n $maxNearByZeros,\n !$mx[$i][$j] + !$mx[$i][$j + 1],\n !$mx[$i][$j] + !$mx[$i + 1][$j],\n !$mx[$i + 1][$j] + !$mx[$i + 1][$j + 1],\n !$mx[$i][$j + 1] + !$mx[$i + 1][$j + 1]\n );\n }\n }\n\n if ($maxNearByZeros === 0) {\n $sub = 2;\n }\n\n if ($maxNearByZeros === 1) {\n $sub = 1;\n }\n\n if ($maxNearByZeros === 2) {\n $sub = 0;\n }\n\n echo ($totalOnes - $sub).PHP_EOL;\n}\n"}], "src_uid": "3bf5d493813c5582200eca9248b357d3"} {"source_code": "_fh = $fileHandler;\n\t}\n\t\n\tpublic function readInt() \n\t{\n\t\t$d = trim(fgets($this->_fh));\n\t\t\n\t\treturn (int)$d;\n\t}\n\t\n\tpublic function readString() \n\t{\n\t\t$s = trim(fgets($this->_fh));\n\t\t\n\t\treturn $s;\n\t}\n\t\n\tpublic function readArrayOfInt($size, $indexFrom = 0) \n\t{\n\t\t$a = [];\n\t\t$ind = $indexFrom;\n\t\tforeach (explode(' ', fgets($this->_fh)) as $item) {\n\t\t\t$a[$ind++] = (int)$item;\n\t\t}\n\t\t\n\t\treturn $a;\n\t}\n\t\n\tpublic function readArrayOfString($size, $indexFrom = 0) \n\t{\n\t\t$a = [];\n\t\t$ind = $indexFrom;\n\t\tforeach (explode(' ', fgets($this->_fh)) as $item) {\n\t\t\t$a[$ind++] = $item;\n\t\t}\n\t\t\n\t\treturn $a;\n\t}\n}\n\nfunction ntimes($n, $func, $returnResults = false) {\n\t$a = [];\n\tfor ($i=1; $i<=$n; $i++) {\n\t\t$result = $func();\n\t\t\n\t\tif ($returnResults) {\n\t\t\t$a[$i] = $result;\n\t\t}\n\t}\n\t\n\treturn $a;\n}\n\n$ir = new InputReader();\n$n = $ir->readInt();\n$s = $ir->readString();\n\n$prev = 'a';\n$ind = -1;\nfor ($i=0; $i<$n; $i++) {\n\tif ($s[$i] < $prev) {\n\t\t$ind = $i-1;\n\t\tbreak;\n\t}\n\t$prev = $s[$i];\n}\n\nif ($ind>-1) {\n\techo substr($s, 0, $ind) . substr($s, $ind+1);\n} else {\n\techo substr($s, 0, $n-1);\n}\n", "positive_code": [{"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);\n $g = 0;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($c[$b[$x + 1]] < $c[$b[$x]])\n {\n $d = substr($b, 0, $x);\n $e = substr($b, $x + 1);\n $f = $d . $e;\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print substr($b, 0, -1);\n }\n else\n {\n print $f;\n }\n}\n?>"}], "negative_code": [{"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, 0 => 15, p => 16, q => 17, r => 18, s => 19, t => 20, u => 21, v => 22, w => 23, x => 24, y => 25, z => 26);\n $g = 0;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($c[$b[$x + 1]] < $c[$b[$x]])\n {\n $d = substr($b, 0, $x);\n $e = substr($b, $x + 1);\n $f = $d . $e;\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print substr($b, 1);\n }\n else\n {\n print $f;\n }\n}\n?>"}, {"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, 0 => 15, p => 16, q => 17, r => 18, s => 19, t => 20, u => 21, v => 22, w => 23, x => 24, y => 25, z => 26);\n $g = 0;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($c[$b[$x + 1]] < $c[$b[$x]])\n {\n $d = substr($b, 0, $x);\n $e = substr($b, $x + 1);\n $f = $d . $e;\n $g = 1;\n break;\n }\n }\n if($g == 0)\n {\n print substr($b, 0, -1);\n }\n else\n {\n print $f;\n }\n}\n?>"}], "src_uid": "c01fc2cb6efc7eef290be12015f8d920"} {"source_code": "", "positive_code": [{"source_code": "0)\n {\n if ($x % 2 == 0)\n $x/=2;\n else {\n $x--;\n $x/=2;\n $retInt++;\n } \n }\n \n return $retInt;\n }\n \n $count=0;\n \n $zarr=array();\n for ($i=0; $i<$k; $i++)\n {\n $c = GetC($arr[$i]);\n if (!isset($zarr[$c]))\n $zarr[$c] = 1;\n else\n $zarr[$c]++;\n }\n foreach ($zarr as $k1)\n {\n if ($k1 > 1)\n $add = ($k1 * ($k1 - 1) / 2);\n else\n $add = 0;\n $count += $add;\n }\n \n echo $count;\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c547e32f114546638973e0f0dd16d1a4"} {"source_code": "1)\n printf(\" \");\n if ($who==0)\n $who=$n;\n printf(\"%d\",$who);\n go(($who+$num+1)%(int)$n,$num+1, $n);\n}\n$file=STDIN;//fopen(\"input.txt\",\"r\");\n$n=fgets($file);\ngo(2,1,$n);\nprintf(\"\\n\");\n?>", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "1)\n printf(\" \");\n printf(\"%d\",$who);\n go(($who+$num+1)%(int)$n,$num+1, $n);\n}\n$file=STDIN;//fopen(\"input.txt\",\"r\");\n$n=fgets($file);\ngo(2,1,$n);\nprintf(\"\\n\");\n?>"}, {"source_code": ""}], "src_uid": "7170c40405cf7a5e0f2bd15e4c7d189d"} {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$n = readNum($f);\n\t$q = array();\n\t$allList = array();\n\t$afterList = array();\n\tfor ($i = 0; $i < $n; $i++) {\n\t\tlist($before, $after) = readStringExplodeNum($f, ' ', true);\n\t\t$q[$before] = $after;\n\t\t$allList[$before] = true;\n\t\t$allList[$after] = true;\n\t\t$afterList[$after] = true;\n\t}\n\n\t$currItem = false;\n\tforeach ($allList as $k => $v) {\n\t\tif (!isset($afterList[$k])) {\n\t\t\t$currItem = $k;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$list = array();\n\t$nextItem = false;\n\twhile (!empty($q)) {\n\t\t$nextItem = $q[0];\n\t\t$list[] = $currItem;\n\t\tunset($afterList[$q[0]]);\n\t\tif (isset($q[$currItem])) {\n\t\t\t$q[0] = $q[$currItem];\n\t\t} else {\n\t\t\tunset($q[0]);\n\t\t}\n\t\tunset($q[$currItem]);\n\t\tunset($allList[$currItem]);\n\t\t$currItem = $nextItem;\n\t}\n\n\techo implode(' ', $list);\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": " $value){\n if (!$left[$key] && $key != $b){\n $a = $key;\n break;\n }\n}\n\nwhile ($a) {\n printf(\"%d \", $a);\n if ($b) {\n printf(\"%d \", $b);\n }\n $a = $right[$a];\n $b = $right[$b];\n}\n?>"}, {"source_code": " 3)\n{\n $g = \"\";\n $g .= $f . \" \";\n $g .= $c[0] . \" \";\n $g .= $c[$f] . \" \";\n $h = $c[0];\n $i = $c[$f];\n $j = 0;\n while(TRUE)\n {\n $k = $j % 2;\n $j++;\n if($k == 0)\n {\n $g .= $c[$h] . \" \";\n $h = $c[$h];\n if($c[$h] == NULL)\n {\n break;\n }\n }\n else\n {\n $g .= $c[$i] . \" \";\n $i = $c[$i];\n if($c[$i] == NULL)\n {\n break;\n }\n }\n }\n print $g;\n}\n?>"}, {"source_code": " $value){\n\tif (!$le[$key] && $key != $B){\n\t$A = $key;\n\tbreak;\n\t}\n}\n\nwhile ($A){\n\tprintf(\"%d \", $A);\n\tif ($B)\n\t\tprintf(\"%d \", $B);\n\t$A = $ri[$A];\n\t$B = $ri[$B];\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "prev=$a1;\n\t\t$this->next=$a2;\n\t} \n}\n\nclass Calculator{\n\tpublic function getnext($pairs, $current){\n\t\t$i=0;\n\t\twhile (($i prev!=$current)) \n\t\t\t$i++; \n\t\treturn $pairs[$i]->next;\n\t}\n\tpublic function getprev($pairs, $current){\n\t\t$i=0;\n\t\twhile (($i next!=$current))\n\t\t\t$i++; \n\t\treturn $pairs[$i]->prev;\n\t}\n}\n\n$number_of_students = trim(fgets(STDIN));\nfor ($i=0;$i<$number_of_students;$i++){\n\t$input = explode(' ',trim(fgets(STDIN)));\n\t$pairs[]= new Pair($input[0],$input[1]);\n}\n\n$odd=array();\n$calculator = new Calculator;\n\n\n$num = ($number_of_students%2==0)?array_fill(0,2,$number_of_students/2):array(($number_of_students+1)/2,$number_of_students-($number_of_students+1)/2);\nfor ($i=0;$i<$num[0];$i++)\n\t$odd[$i] = ($i==0) ? $calculator->getnext($pairs,0) : $calculator->getnext($pairs,$odd[$i-1]);\n$results = $odd;\n//monkey_code_startpoint\nfor ($i=0;$i<$number_of_students;$i++)\n\tif (in_array($pairs[$i]->prev,$results) || in_array($pairs[$i]->next,$results))\n\t\t$pairs[$i]=null;\nrsort($pairs);\n$i = $number_of_students-1;\nwhile ($i>0){\n\tif($pairs[$i]==null)\n\t\t$t = array_pop($pairs);\n\t$i--;\n}\n$even = array();\nfor ($i=0;$i<$num[1];$i++){\n\t$key1 = array_search($pairs[$i]->prev,$even);\n\t$key2 = array_search($pairs[$i]->next,$even);\n\tif ($key1==0&&$key2==0)\n\t\tarray_push($even,$pairs[$i]->prev,$pairs[$i]->next);\n\telse{\n\t\tif($key1)\n\t\t\tarray_push($even,$pairs[$i]->next);\n\t\tif($key2)\n\t\t\tarray_unshift($even,$pairs[$i]->prev);\n\t}\n}\nfor ($i=0;$i<$num[0];$i++)\n\t$results[$i*2+1] = $odd[$i];\nfor ($i=0;$i<$num[0];$i++)\n\t$results[$i*2] = $even[$i];\n//monkey_code_endpoint\nfor ($i=0;$i<$number_of_students;$i++)\n\tprintf(\"%d \",$results[$i]); \n?>"}, {"source_code": ""}, {"source_code": "prev=$a1;\n\t\t$this->next=$a2;\n\t} \n}\n\nclass Calculator{\n\tpublic function getnext($pairs, $current){\n\t\t$i=0;\n\t\twhile (($i prev!=$current)) \n\t\t\t$i++; \n\t\treturn $pairs[$i]->next;\n\t}\n\tpublic function getprev($pairs, $current){\n\t\t$i=0;\n\t\twhile (($i next!=$current))\n\t\t\t$i++; \n\t\treturn $pairs[$i]->prev;\n\t}\n}\n\n$number_of_students = trim(fgets(STDIN));\nfor ($i=0;$i<$number_of_students;$i++){\n\t$input = explode(' ',trim(fgets(STDIN)));\n\t$pairs[]= new Pair($input[0],$input[1]);\n}\n\n$odd=array();\n$even = array();\n$calculator = new Calculator;\n\n$num = ($number_of_students%2==0)?array_fill(0,2,$number_of_students/2):array(($number_of_students+1)/2,$number_of_students-($number_of_students+1)/2);\nfor ($i=0;$i<$num[0];$i++)\n\t$odd[$i] = ($i==0) ? $calculator->getnext($pairs,0) : $calculator->getnext($pairs,$odd[$i-1]);\n$results = $odd;\nif ($number_of_students%2==0){\n\tfor ($i=0;$i<$num[0];$i++)\n\t\t$even[$i] = ($i==0) ? $calculator->getprev($pairs,0) : $calculator->getprev($pairs,$even[$i-1]);\n\t$even = array_reverse($even);\n}else{\n\t//monkey_code_startpoint\n\tfor ($i=0;$i<$number_of_students;$i++)\n\t\tif (in_array($pairs[$i]->prev,$results) || in_array($pairs[$i]->next,$results))\n\t\t\t$pairs[$i]=null;\n\trsort($pairs);\n\t$i = $number_of_students-1;\n\twhile ($i>0){\n\t\tif($pairs[$i]==null)\n\t\t\t$t = array_pop($pairs);\n\t\t$i--;\n\t}\n\tfor ($i=0;$i<$num[1];$i++){\n\t\t$key1 = array_search($pairs[$i]->prev,$even);\n\t\t$key2 = array_search($pairs[$i]->next,$even);\n\t\tif ($key1==0&&$key2==0)\n\t\t\tarray_push($even,$pairs[$i]->prev,$pairs[$i]->next);\n\t\telse{\n\t\t\tif($key1)\n\t\t\t\tarray_push($even,$pairs[$i]->next);\n\t\t\tif($key2)\n\t\t\t\tarray_unshift($even,$pairs[$i]->prev);\n\t\t}\n\t}\n}\nfor ($i=0;$i<$num[0];$i++)\n\t$results[$i*2+1] = $odd[$i];\nfor ($i=0;$i<$num[0];$i++)\n\t$results[$i*2] = $even[$i];\n//monkey_code_endpoint\nfor ($i=0;$i<$number_of_students;$i++)\n\tprintf(\"%d \",$results[$i]); \n?>"}, {"source_code": "1){\n\tprintf(\"%d %d \",$result2[$i],$result1[$i]);\n\t$n -=2;\n\t$i++;\n}\nif ($n > 0)\n\tprintf(\"%d \",$result2[$i]);\n?>"}], "src_uid": "1aaced1322c47f1908f2bc667bca1dbe"} {"source_code": "$time) {\n if ($time <= $min) {\n $min = $time;\n $n = $number + 1;\n }\n}\nforeach ($timetable as $number=>$time) {\n if ($min == $time) {\n $m++;\n }\n}\nif ($m > 1) {\n echo 'Still Rozdil';\n} else {\n echo $n;\n}\n?>", "positive_code": [{"source_code": "= 2) print \"Still Rozdil\"; else print key($a) + 1;\n?>"}, {"source_code": " intval($a[$i])){\n\t\t\t$res = $i + 1;\n\t\t\t$minval = intval($a[$i]);\n\t\t}\n\t}\n\t$cnt = 0;\n\tfor($i = 0;$i<$n;$i++){\n\t\tif (intval($a[$i]) == intval($minval)){\n\t\t\t$cnt++;\n\t\t}\n\t}\n\tif (intval($cnt) >= intval(2)) print \"Still Rozdil\"; else print $res;\n?>"}, {"source_code": " $i + 1);}\n}\n\nif(count($t) > 1) print 'Still Rozdil'; else print $t[0];\n?>"}, {"source_code": " $number) {\n\t$number = intval($number);\n\tif (!isset($all[$number])) {\n\t\t$all[$number] = [];\n\t}\n\t$all[$number][] = $k + 1;\n\t$result = min($result, $number);\n}\nif (count($all[$result]) == 1) {\n\techo $all[$result][0];\n} else {\n\techo \"Still Rozdil\";\n}"}, {"source_code": "$value)\n { \n if ($min>$value)\n { $min=$value; $w=$key+1;};\n }; \n foreach ($tm as $value)\n { if ($value==$min) {$q++;};\n };\nif ($q==1) {print ($w);} else {print (\"Still Rozdil\");}; \n?>"}, {"source_code": "\n"}, {"source_code": ""}], "negative_code": [{"source_code": " $number) {\n\tif (!isset($all[$number])) {\n\t\t$all[$number] = [];\n\t}\n\t$all[$number][] = $k + 1;\n\t$result = min($result, $number);\n}\nif (count($all[$result]) == 1) {\n\techo $all[$result][0];\n} else {\n\techo 'Still Rozdil';\n}"}, {"source_code": "= 2) print \"Still Rozdil\"; else print key($a) + 1;\n?>"}, {"source_code": "= 2) print \"Still Rozdil\"; else print key($a) + 1;\n?>"}, {"source_code": "= intval(2)) print \"Still Rozdil\"; else print intval(key($a)) + 1;\n?>"}, {"source_code": "= intval(2)) print \"Still Rozdil\"; else print intval(key($a)) + 1;\n?>"}, {"source_code": " $a[$i]){\n\t\t\t$res = $i + 1;\n\t\t\t$minval = $a[$i];\n\t\t}\n\t}\n\t$cnt = 0;\n\tfor($i = 0;$i<$n;$i++){\n\t\tif (intval($a[$i]) == intval($minval)){\n\t\t\t$cnt++;\n\t\t}\n\t}\n\tif (intval($cnt) >= intval(2)) print \"Still Rozdil\"; else print $res;\n?>"}], "src_uid": "ce68f1171d9972a1b40b0450a05aa9cd"} {"source_code": " \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\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 $c = 0;\r\n foreach ($a as $v) {\r\n if ($v != 2) {\r\n $c++;\r\n }\r\n }\r\n\r\n IO::line($c);\r\n\r\n}\r\n\r\n?>"}, {"source_code": ""}], "negative_code": [{"source_code": " $l) { $d++; } \r\n else { $l++; }\r\n }\r\n \r\n if ($r[$j] == 1) { $l++; }\r\n if ($r[$j] == 2) { $d++; }\r\n }\r\n echo $l.PHP_EOL;\r\n}\r\n\r\n\r\n?>"}], "src_uid": "a063705bd0ce1e17ccaafbbfc2663d93"} {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n break;\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n break;\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>", "positive_code": [{"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n if(($a = 200000) && ($d == 100048))\n {\n print $b[0] . \" \" . $b[3] . \"\\n\";\n print $c[0] . \" \" . $c[3] . \"\\n\";\n }\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if($e[$b[$x]] == $j[0])\n {\n if(($a == 1000) && ($x + 1 == 1))\n {\n print_r($j);\n }\n print $x + 1 . \" \";\n $k++;\n }\n elseif($f[$c[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]) && ($k == 0))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]) && ($k == 1))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]) && ($k == 0))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]) && ($k == 1))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if($e[$b[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($f[$c[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if($e[$b[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n elseif($f[$c[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] == $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]) && ($l == 0))\n {\n print $x + 1 . \" \";\n $k++;\n $l++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]) && ($l == 0))\n {\n print $x + 1 . \" \";\n $k++;\n $l++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]) && ($l == 0))\n {\n print $x + 1 . \" \";\n $k++;\n $l++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]) && ($l == 0))\n {\n print $x + 1 . \" \";\n $k++;\n $l++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if($e[$b[$x]] == $j[0])\n {\n if(($a == 1000) && ($x + 1 == 1))\n {\n print implode(\" \", array_unique(str_split($b))) . \"\\n\";\n print implode(\" \", array_unique(str_split($c))) . \"\\n\";\n }\n print $x + 1 . \" \";\n $k++;\n }\n elseif($f[$c[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n if(($a = 200000) && ($d == 100048))\n {\n print $b[0] . \" \" . $b[3] . \"\\n\";\n print $c[0] . \" \" . $c[3] . \"\\n\";\n }\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[1][0]) && ($f[$c[$x]] == $i[1][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if($e[$b[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($f[$c[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n if(($a = 200000) && ($d == 100048))\n {\n print $b[199997] . \" \" . $b[199999] . \"\\n\";\n print $c[199997] . \" \" . $c[199999] . \"\\n\";\n }\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n if(($a = 200000) && ($d == 100048))\n {\n print_r($i);\n }\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n }\n }\n for($x = 0; $x < $a; $x++)\n {\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]))\n {\n print $x + 1 . \" \";\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $j[0]) && ($f[$c[$x]] != $j[0]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n $l++;\n }\n if(($f[$c[$x]] == $j[0]) && ($e[$b[$x]] != $j[0]) && ($k == $l))\n {\n print $x + 1 . \" \";\n $k++;\n $l++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": " 0)\n{\n $d -= 2;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if(($e[$b[$x]] == $i[0][0]) && ($f[$c[$x]] == $i[0][1]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if(($e[$b[$x]] == $i[0][1]) && ($f[$c[$x]] == $i[0][0]))\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelseif(count($j) > 0)\n{\n $d--;\n print $d . \"\\n\";\n for($x = 0; $x < $a; $x++)\n {\n if($e[$b[$x]] == $j[0])\n {\n if(($a == 1000) && ($x + 1 == 1))\n {\n print array_unique(str_split($b)) . \"\\n\";\n print array_unique(str_split($c)) . \"\\n\";\n }\n print $x + 1 . \" \";\n $k++;\n }\n elseif($f[$c[$x]] == $j[0])\n {\n print $x + 1 . \" \";\n $k++;\n }\n if($k == 2)\n {\n break;\n }\n }\n}\nelse\n{\n print $d . \"\\n\";\n print \"-1 -1\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "2fa543c8b8f9dc500c36cf719800a6b0"} {"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 === false) {\n\t\t$f = STDIN;\n\t}\n\t/* begin body */\n\t$n = readNum($f);\n\t$str = readString($f);\n\t$chars = str_split($str);\n\t$charsCount = array();\n\t$maxCount = 26;\n\t$changes = 0;\n\tforeach ($chars as $s) {\n\t\tif (!empty($charsCount[$s])) {\n\t\t\t$changes++;\n\t\t} else {\n\t\t\t$charsCount[$s] = true;\n\t\t}\n\t}\n\tif (count($charsCount) + $changes > $maxCount) {\n\t\techo -1;\n\t} else {\n\t\techo $changes;\n\t}\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();", "positive_code": [{"source_code": "26) {echo -1;}\nelse {\n\t$b=array(); $ans=$n;\n\tfor ($i=0;$i<$n;$i+=1) if ($b[$s[$i]]==0){\n\t\t$ans-=1; $b[$s[$i]]=1;\n\t}\n\techo $ans;\n}\n?>"}, {"source_code": " 26)\n{\n print \"-1\";\n}\nelse\n{\n $c = 0;\n for($x = 0; $x < $a - 1; $x++)\n {\n if($b[$x] == $b[$x + 1])\n {\n $c++;\n }\n }\n print $c;\n}\n?>"}], "negative_code": [{"source_code": "26) {echo -1;}\nelse {\n\t$b=array(); $ans=0;\n\tfor ($i=0;$i<$n;$i+=1) if ($b[$s[$i]]==0){\n\t\t$ans+=1; $b[$s[$i]]=1;\n\t}\n\techo $ans;\n}\n?>"}], "src_uid": "d9e9c53b391eb44f469cc92fdcf3ea0a"} {"source_code": " $c[$y])\n {\n array_push($d, $x);\n break;\n }\n }\n}\nprint count($d) . \"\\n\";\nprint implode(\" \", $d);\n?>", "positive_code": [{"source_code": " 0) echo $am[count($am)-1].PHP_EOL;\n\n?>"}, {"source_code": "$q[$j]){\n $t++;\n $s[] = $i;\n break;\n }\n }\n}\n$l = count($s);\nif($l==0){\n echo \"0\\n\";\n}else{\n echo \"$l\\n\";\n for($x=0;$x<$l;$x++){\n echo $s[$x].\" \";\n }\n}"}, {"source_code": " 0) {\n echo $c . PHP_EOL;\n echo implode(' ', $goodSeller);\n} else {\n echo 0;\n}\necho PHP_EOL;\n\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n echo $c . PHP_EOL;\n echo implode(' ', $goodSeller);\n} else {\n echo 0;\n}\necho PHP_EOL;\n\n?>"}, {"source_code": ""}], "src_uid": "7804152ee14264afef019c5ad33094f9"} {"source_code": "", "positive_code": [{"source_code": " \"I hate\");\n$c = 2;\nfor($x = 2; $x <= 100; $x++)\n{\n $d = $c % 2;\n $c++;\n if($d == 0)\n {\n $e = $b[$x - 1] . \" that I love\";\n }\n else\n {\n $e = $b[$x - 1] . \" that I hate\";\n }\n $b[$x] = $e;\n}\nprint trim($b[$a] . \" it\");\n?>"}, {"source_code": " 1) {\n for ($i = 2; $i <= $count; $i++) {\n $string .= ($i%2 == 0) ? ' that I love' : ' that I hate';\n }\n}\n$string .= ' it';\necho $string;"}, {"source_code": " 0];\n }\n\n fwrite(STDOUT, implode(' that ', $f) .' it');\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\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;$t=0;\n $t = trim(fgets($handle));\n\n for ($i=1;$i<$t;$i++)\n {\n if($i%2!=0)printf(\"%s\",\"I hate \");\n else printf(\"%s\",\"I love \");\n printf(\"%s\",\"that \");\n }\n if($t%2!=0)printf(\"%s\",\"I hate it\");\n else printf(\"%s\",\"I love it\");\n}\n\nsolve();\n?>"}, {"source_code": " $line) {\n $input[$index] = explode(\" \", trim($line));\n}\n\n// Solve past this line\n$layers = $input[0][0];\n$hateLove = '';\n$output = '';\n\nfor ($i = 0; $i < (int)$layers; $i++) {\n $hateLove = $hateLove == 'hate' ? 'love': 'hate';\n $output .= empty($output) ? \"I $hateLove\": \" that I $hateLove\";\n}\n\necho $output . ' it';\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"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$hateLast = \"I hate it\";\n$loveLast = \"I love it\";\n$hate = \"I hate that\";\n$love = \"I love that\";\n\n$str_arr = [];\nfor ($i = 0; $i<$n; $i++){\n\n if($i%2==0){\n array_push($str_arr,$hate);\n }else{\n array_push($str_arr,$love);\n }\n}\n\nif($n%2!=0){\n $str_arr[$i-1]=$hateLast;\n}else{\n $str_arr[$i-1]=$loveLast;\n}\necho implode(\" \",$str_arr);"}, {"source_code": " 0) {\n for($i = 1; $i <= $num; $i++){\n if($i%2 == 0) {\n $array[] = 'I love';\n } else {\n $array[] = 'I hate';\n }\n \n }\n $result = implode(' that ', $array) . ' it';\n}\n\necho $result;"}], "negative_code": [{"source_code": " 1) {\n for ($i = 2; $i <= $count; $i++) {\n $string .= ($i%2 == 0) ? ' than I love' : ' than I hate';\n }\n}\n$string .= ' it';\necho $string;"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": "\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;$t=0;\n $t = trim(fgets($handle));\n\n for ($i=0;$i<$t-1;$i++)\n {\n if($i%2==0)printf(\"%s\",\"I hate \");\n else printf(\"%s\",\"I love \");\n printf(\"%s\",\"that \");\n }\n if($t%2==0)printf(\"%s\",\"I hate it\");\n else printf(\"%s\",\"I love it\");\n}\n\nsolve();\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n for($i = 1; $i <= $num; $i++){\n if($i%2 == 0) {\n $array[] = 'I love';\n } else {\n $array[] = 'I hate';\n }\n \n }\n $result = implode(' that ') . ' it';\n}\n\necho $result;"}], "src_uid": "7f2441cfb32d105607e63020bed0e145"} {"source_code": "0)\n {\n $cnt--;\n fprintf(STDOUT,\"%s\",$lastv);\n }\n }\n$cnt=1;\n }\n else\n {\n $cnt++;\n }\n $lastv=$nowchar;\n}\n\nif($lastv=='a' || $lastv=='e' || $lastv=='i' || $lastv=='o' || $lastv=='u' || $lastv=='y')\n {\n if(($lastv=='e' || $lastv=='o') && $cnt==2)\n {\n fprintf(STDOUT,\"%s\",$lastv);\n fprintf(STDOUT,\"%s\",$lastv);\n }\n else fprintf(STDOUT,\"%s\",$lastv);\n $cnt=1;\n }\n else\n {\n while($cnt>0)\n {\n $cnt--;\n fprintf(STDOUT,\"%s\",$lastv);\n }\n }\n}\n", "positive_code": [{"source_code": " \"a\",\n\t\t1 => \"e\",\n\t\t2 => \"i\",\n\t\t3 => \"o\",\n\t\t4 => \"u\",\n\t\t5 => \"y\"];\n$ans = \"\";\n//print ans\n$n = $number;\nfor ($i=0; $i < $n; $i++)\n{\n\t$ans .= $line[$i];\n\t//randomise\n\t$j = 1;\n\tif ($line[$i] == $cyl[1]){\n\t\tif ($line[$i+1] == $cyl[1])\n\t\t{\n\t\t\tif ($line[$i+2] == $cyl[1])\n\t\t\t{\n\t\t\t\t\n\t\t\t\tfor (; $j+$i < $n && $line[$i+$j] == $cyl[1]; $j++)\n\t\t\t\t{\n \n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t}\n //cyl = [0 => \"a\",\n\t//\t1 => \"e\",\n\t\t//2 => \"i\",\n\t\t//3 => \"o\",\n\t\t//4 => \"u\",\n\t//\t5 => \"y\"];\n//$ans = \"\";\n \n\tif ($line[$i] == $cyl[3]){\n\t\tif ($line[$i+1] == $cyl[3]){\n\t\t\tif ($line[$i+2] == $cyl[3]){\n\t\t\t\n\t\t\t\tfor (; $j+$i < $n && $line[$i+$j] == $cyl[3]; $j++)\n\t\t\t\t{\n \n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n //cyl = [0 => \"a\",\n\t//\t1 => \"e\",\n\t\t//2 => \"i\",\n\t\t//3 => \"o\",\n\t\t//4 => \"u\",\n\t//\t5 => \"y\"];\n//$ans = \"\";\n \n\tif ($line[$i] == $cyl[0] || $line[$i] == $cyl[2] ||$line[$i] == $cyl[4] ||$line[$i] == $cyl[5])\n\t{\n\t\tif ($line[$i+1] == $line[$i])\n\t\t{\n\t\t\tfor (; $j+$i < $n && $line[$i+$j] == $line[$i]; $j++)\n{\n \n\t\t\t}\n\t\t}\n\t}\n \n\t$i += $j-1;\n}\nprint($ans);\n//cyl = [0 => \"a\",\n\t//\t1 => \"e\",\n\t\t//2 => \"i\",\n\t\t//3 => \"o\",\n\t\t//4 => \"u\",\n\t//\t5 => \"y\"];\n//$ans = \"\";\n \n?>\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n\t\t\t$b .= $prv;\n\t\t}\n\t\t$prv = $a[$i];\n\t\t$cnt = 1;\n\t}\n\t\n\t\t\n}\nif ($prv=='a'||$prv=='e'||$prv=='i'||$prv=='o'||$prv=='u'||$prv=='y')\nif ($prv != 'e' && $prv != 'o' || $cnt != 2)\n\t\t\t$cnt = 1;\nif ($prv!='=')\nwhile ($cnt-- > 0) {\n\t\t\t$b .= $prv;\n\t\t}\n \nprintf(\"%s\\n\",$b);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n\t\t\techo $serija;\n\t\t}\n\t\tbreak;\n\t}\n\n\tif (!is_numeric($novo) && $activated == 0) {\n\t\t$activated = 1;\n\t\tcontinue;\n\t}\n\n\tif ($activated == 1) {\n\t\tif ($novo == $serija) {\n\t\t\t$duzina++;\n\t\t} else {\n\t\t\tif ((($serija == 'e' || $serija == 'o') && $duzina == 2) || kons($serija)) {\n\t\t\t\tfor ($j = 0; $j < $duzina; $j++) {\n\t\t\t\t\techo $serija;\n\t\t\t\t}\n\t\t\t} else if ($duzina > 0) {\n\t\t\t\techo $serija;\n\t\t\t}\n\t\t\t$serija = $novo;\n\t\t\t$duzina = 1;\n\t\t}\n\t}\t\n\n}"}, {"source_code": ""}, {"source_code": " 1 && $a[$i-2] === $a[$i])))continue;\n else array_push($d,$i);\n}\n\nfor($x = 0; $x < sizeof($d); $x++)print $a[$d[$x]];\n?>"}, {"source_code": " 0 ? 1 : 0);\n }\n else\n {\n $res .= str_repeat($pr, $count);\n }\n $count = 1;\n }\n}\n\nfputs($stdout, $res . \"\\n\");\n?>\n"}, {"source_code": " \"a\",\n\t\t1 => \"e\",\n\t\t2 => \"i\",\n\t\t3 => \"o\",\n\t\t4 => \"u\",\n\t\t5 => \"y\"];\n$ans = \"\";\n$n = $number;\nfor ($i=0; $i < $n; $i++){\n\t$ans .= $line[$i];\n\t$j = 1;\n\tif ($line[$i] == $cyl[1]){\n\t\tif ($line[$i+1] == $cyl[1]){\n\t\t\tif ($line[$i+2] == $cyl[1]){\n\t\t\t\t//$j = 0;\n\t\t\t\tfor (; $j+$i < $n && $line[$i+$j] == $cyl[1]; $j++){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t//\t$i += $j;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif ($line[$i] == $cyl[3]){\n\t\tif ($line[$i+1] == $cyl[3]){\n\t\t\tif ($line[$i+2] == $cyl[3]){\n\t\t\t//\t$j = 0;\n\t\t\t\tfor (; $j+$i < $n && $line[$i+$j] == $cyl[3]; $j++){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//$i += $j;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif ($line[$i] == $cyl[0] || $line[$i] == $cyl[2] ||$line[$i] == $cyl[4] ||$line[$i] == $cyl[5]){\n\t\tif ($line[$i+1] == $line[$i]){\n\t\t\t//$j = 0;\n\t\t\tfor (; $j+$i < $n && $line[$i+$j] == $line[$i]; $j++){\n\t\t\t\t\n\t\t\t}\n\t\t\t//$i += $j;\n\t\t}\n\t}\n\t\n\t$i += $j-1;\n}\nprint($ans);\n?>\n"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": " 1 && $a[$i] == $a[$i-2] && ($a[$i] === \"o\" || $a[$i] === \"e\"))continue;\n else array_push($d,$i);\n}\n\nfor($x = 0; $x < sizeof($d); $x++)print $a[$d[$x]];\n?>"}, {"source_code": " 1 && $a[$i] == $a[$i-2] && $b[$a[$i]-'a'] == 2)continue;\n else array_push($d,$i);\n}\n\nfor($x = 0; $x < sizeof($d); $x++)print $a[$d[$x]];\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n\t\t\t$b .= $prv;\n\t\t}\n\t\t$prv = $a[$i];\n\t\t$cnt = 1;\n\t}\n\t\n\t\t\n}\n\nif ($prv != 'e' || $prv != 'o' && $cnt != 2)\n\t\t\t$cnt = 1;\nif ($prv!='=')\nwhile ($cnt-- > 0) {\n\t\t\t$b .= $prv;\n\t\t}\n \nprintf(\"%s\\n\",$b);\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "8ff1b4cf9875f1301e603b47626d06b4"} {"source_code": " 0)\n {\n $e += $g - $f;\n $f++;\n }\n else\n {\n $g--;\n }\n }\n elseif($d[$g] >= 0)\n {\n if($d[$f] >= $d[$g])\n {\n $e += $g - $f;\n $f++;\n }\n else\n {\n $g--;\n }\n }\n }\n}\nprint $e;\n?>", "positive_code": [{"source_code": " 0 ? $l : -1;\n }\n if ($l + 1 === $r) {\n if ($n + $a[$r] > 0) {\n return $r;\n } else if($n + $a[$l] > 0) {\n return $l;\n } else {\n return -1;\n }\n }\n $m = intval(($l + $r + 1) / 2);\n if ($n + $a[$m] > 0) {\n return bs($n, $a, $m, $r);\n } else {\n return bs($n, $a, $l, $m);\n }\n}\n$c = array();\nfor ($i = 0; $i < count($a); $i++) {\n $c[$i] = $a[$i] - $b[$i];\n}\nrsort($c);\n$x = 0;\nfor ($i = 0; $i < count($c) - 1; $i++) {\n $n = $c[$i];\n if (($target = bs($n, $c, $i + 1, count($c) - 1)) !== -1) {\n $x += ($target - $i);\n }\n}\necho $x;\n \n \n"}, {"source_code": " 0 ? $l : -1;\n }\n if ($l + 1 === $r) {\n if ($n + $a[$r] > 0) {\n return $r;\n } else if($n + $a[$l] > 0) {\n return $l;\n } else {\n return -1;\n }\n }\n $m = intval(($l + $r + 1) / 2);\n if ($n + $a[$m] > 0) {\n return bs2($n, $a, $m, $r);\n } else {\n return bs2($n, $a, $l, $m);\n }\n }\n $c = array();\n for ($i = 0; $i < count($a); $i++) {\n $c[$i] = $a[$i] - $b[$i];\n }\n rsort($c);\n $x = 0;\n for ($i = 0; $i < count($c) - 1; $i++) {\n $n = $c[$i];\n if (($target = bs2($n, $c, $i + 1, count($c) - 1)) !== -1) {\n $x += ($target - $i);\n }\n }\n echo $x;\n?>"}], "negative_code": [{"source_code": " 0)\n {\n $e += $g - $f;\n $f++;\n }\n else\n {\n $g--;\n }\n }\n elseif($d[$g] >= 0)\n {\n if($d[$f] > $d[$g])\n {\n $e += $g - $f;\n $f++;\n }\n else\n {\n $g--;\n }\n }\n }\n}\nprint $e;\n?>"}, {"source_code": " $d[$x + 1]) && ($d[$x] > 0))\n {\n $e += ($a - ($x + 1));\n }\n}\nprint $e;\n?>"}, {"source_code": " $v){\n $c += ($a[$k] - $b[$k]);\n }\n $d = ($c * ($c + 1)) / 2;\n $d -= 1;\n echo $d/2;\n \n \n"}, {"source_code": " 0 ? $l : -1;\n }\n if ($l + 1 === $r) {\n if ($n + $a[$r] > 0) {\n return $r;\n } else if($n + $a[$l] > 0) {\n return $l;\n } else {\n return -1;\n }\n }\n $m = intval(($l + $r + 1) / 2);\n if ($n + $a[$m] > 0) {\n return bs($n, $a, $m, $r);\n } else {\n return bs($n, $a, $l, $m);\n }\n}\n$c = array();\nfor ($i = 0; $i < count($a); $i++) {\n $c[$i] = $a[$i] - $b[$i];\n}\nrsort($c);\n$x = 0;\nfor ($i = 0; $i < count($c) - 1; $i++) {\n $n = $c[$i];\n if (($target = bs($n, $c, $i + 1, count($c) - 1)) !== -1) {\n echo $target . \"\\n\";\n $x += ($target - $i);\n }\n}\necho $x;\n \n \n"}, {"source_code": " $v){\n $c += ($a[$k] - $b[$k]);\n }\n $d = ($c * ($c + 1)) / 2;\n \n if($d > 1){\n $d -= 1;\n echo $d/2;\n } else {\n echo $d;\n }\n \n \n \n"}], "src_uid": "e25b247975660c5005bd4da7afd38a56"} {"source_code": " $capacity) return 0;\n return $capacity - ($max - $min) + 1;\n}\n\n\nfunction main()\n{\n list($n, $w) = explode(\" \", stream_get_line(STDIN, 4096, \"\\n\"));\n $arr = array();\n\n for($i=0; $i $max)\n\t{\n\t\t$max = $b;\n\t}\n\telseif($b < $min)\n\t{\n\t\t$min = $b;\n\t}\n}\n\n\nif($max > $w || abs($min) > $w - $max)\n{\n\techo 0;\n}\nelse\n{\t\n\techo ($w - $max) - (-min($min, 0)) + 1;\n}"}], "negative_code": [{"source_code": " $max)\n\t{\n\t\t$max = $b;\n\t}\n\telseif($b < $min)\n\t{\n\t\t$min = $b;\n\t}\n}\n\n\nif($max > $w)\n{\n\techo 0;\n}\nelse\n{\t\n\techo ($w - $max) - (-min($min, 0)) + 1;\n}"}], "src_uid": "8cf5d08a319672d9b767d3523eca4df6"} {"source_code": " 1){\n for ($i = 0; $i < $n; $i++){\n if ($arr[$i] % 2 != 0){\n $v = $i;\n }\n }\n }\n else {\n for ($i = 0; $i < $n; $i++){\n if ($arr[$i] % 2 == 0){\n $v = $i;\n }\n \n }\n }\n echo ($v + 1);", "positive_code": [{"source_code": "=3 && $t<=100)\n {\nfor ($i=1; $i<=$t-1; $i++)\n{\n $r=stripos($s,' ');\n $posl[$i]=substr($s, 0, $r);\n if (($posl[$i]<1 && $posl[$i]>100))\n {$f=false;}\n $s=substr($s, $r+1, $len-$r-1);\n }\n $posl[$t]=$s;\n if (($posl[$t]<1 && $posl[$t]>100))\n {$f=false;}\n//fputs(STDOUT, \"Vihodnie dannie: \");\n for ($i=1; $i<=$t; $i++)\n {\n $r=$posl[$i]%2;\n if($r==0){\n $chet[$i]=0;\n }\n else {$chet[$i]=1;}\n }\n $countc=0; $countnc=0;\n for ($i=1; $i<=$t; $i++)\n {\n if ($chet[$i]==0){$countc++; $k1=$i;}\n if ($chet[$i]==1){$countnc++; $k2=$i;}\n }\n if ($countc==1){fputs(STDOUT, \"$k1\");}\n elseif ($countnc==1){fputs(STDOUT, \"$k2\");}\n }\n /*else\n {fputs(STDOUT, \"\u0427\u0438\u0441\u043b\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u0437 \u0434\u0438\u0430\u043f\u043e\u0437\u043e\u043d\u0430 3<=n<=100\");\n }*/\n?>"}, {"source_code": "$v)\n if($v==$count0[0]) $res=$k+1;\n}\nelseif(sizeof($count1)==1) {\n foreach($arr as $k=>$v)\n if($v==$count1[0]) $res=$k+1;\n}\necho $res;\n?>"}, {"source_code": " $odds) {\n\tforeach ($line as $key => $value) {\n\t\tif(($value % 2) != 0){\n\t\t\t$result = $key + 1;\n\t\t}\n\t}\n} else {\n\tforeach ($line as $key => $value) {\n\t\tif(($value % 2) == 0){\n\t\t\t$result = $key + 1;\n\t\t}\n\t}\n}\n\nprint_r($result);\n"}, {"source_code": "$v)\n{\n if($v%2==0){$_e[$i]=$k;$i++;}\n else {$_o[$a]=$k;$a++;}\n}\nif(count($_e)<2)echo $_e[0]+1;\nelse echo $_o[0]+1;\n?>"}, {"source_code": ""}, {"source_code": "$num)\n{\n if ($num%2==0)\n $chet[]=$key+1;\n else\n $nechet[]=$key+1;\n}\n\necho (count($chet)==1)?$chet[0]:$nechet[0];\n\n?>"}, {"source_code": "$q[1] ? $k=0 : $k=1;\nfor($i=0;$i<$n;++$i) \n if ($a[$i] % 2 != $k) {echo $i+1; break;}\n?>"}, {"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 '';\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$numbers = explode(' ', g());\n\n$n0cnt = $n1cnt = $n0 = $n1 = 0;\n\nforeach($numbers as $key => $number) {\n if($number % 2 == 0) {\n $n0 = $key + 1;\n $n0cnt++;\n } else {\n $n1 = $key + 1;\n $n1cnt++;\n }\n}\n\necho $n0cnt > $n1cnt ? $n1 : $n0;\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $number) {\n if($number & 1){\n $nechet++;\n $nechetKey = $key;\n }else{\n $chet++;\n $chetKey = $key;\n }\n\n if($nechet > 1 && $chet == 1){\n echo $chetKey+1;\n break;\n }elseif($chet > 1 && $nechet == 1){\n echo $nechetKey+1;\n break;\n }\n}"}, {"source_code": ""}, {"source_code": "$odd)echo $oddPlace+1;\nelse echo $evenPlace+1;"}, {"source_code": "\n"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": " $value) {\n if ($value % 2 == 0) {\n $even = $even + 1;\n $evenKeys[] = $key;\n }\n else {\n $odd = $odd + 1;\n $oddKeys[] = $key;\n }\n}\n\nif ($odd > $even) echo ($evenKeys[0] + 1);\nelse echo ($oddKeys[0] + 1);\n\n\n\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": " 1)\n {\n echo $i;\n exit();\n }\n }\n else\n {\n $ganjil++;\n $angkaGanjil = $number[$i];\n if($genap > 1)\n {\n echo $i;\n exit();\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n echo ($i+1);\n exit();\n }\n }\n else\n {\n $ganjil++;\n $angkaGanjil = $number[$i];\n if($genap > 1)\n {\n echo ($i+1);\n exit();\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n echo $angkaGanjil;\n exit();\n }\n }\n else\n {\n $ganjil++;\n $angkaGanjil = $number[$i];\n if($genap > 1)\n {\n echo $angkaGanjil;\n exit();\n }\n }\n}\n?>"}, {"source_code": " 1)\n {\n echo ($i+1);\n break;\n }\n }\n else\n {\n $ganjil++;\n $angkaGanjil = $number[$i];\n if($genap > 1)\n {\n echo ($i+1);\n break;\n }\n }\n}\n?>"}, {"source_code": "=3 & $k<=100)\n\t{\nfor($i=1; $i<=$t; $i++)\n{\n\t$posl[$i] = trim(fgets($h));\n\t}\nfputs(STDOUT, \"Vihodnie dannie: \");\n\tfor ($i=1; $i<=$t; $i++)\n\t{\n\t\t$r=$posl[$i]%2;\n\t\tif($r==0){\n\t\t$chet[$i]=0;\n\t\t}\n\t\telse {$chet[$i]=1;}\n\t\t}\n\t\t$countc=0; $countnc=0;\n\t\tfor ($i=1; $i<=$t; $i++)\n\t\t{\n\t\t\tif ($chet[$i]==0){$countc++; $k1=$i;}\n\t\t\tif ($chet[$i]==1){$countnc++; $k2=$i;}\n\t\t\t}\n\t\tif ($countc==1){fputs(STDOUT, \"$k1\");}\n\t\telseif ($countnc==1){fputs(STDOUT, \"$k2\");}\n\t}\n\telse\n\t{fputs(STDOUT, \"\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd 3<=n<=100\");\n\t\t}\n?>"}, {"source_code": " $value) {\n\t\tif(($value % 2) != 0){\n\t\t\t$result = $key + 1;\n\t\t}\n\t}\n} else {\n\tforeach ($line as $key => $value) {\n\t\tif(($value % 2) == 0){\n\t\t\t$result = $key + 1;\n\t\t}\n\t}\n}\n\nprint_r($result);"}, {"source_code": "$v)\n{\n if($v%2==0){$_e[$i]=$k;$i++;}\n else {$_o[$a]=$k;$a++;}\n}\nif(count($_e)==1)echo $e[0]+1;\nelse echo $_o[0]+1;\n?>"}, {"source_code": "$v)\n{\n if($v%2==0){$_e[$i]=$k;$i++;}\n else {$_o[$a]=$k;$a++;}\n}\nif(count($_e)==1)echo $e[0];\nelse echo $_o[0];\n?>"}, {"source_code": "$v)\n{\n if($v%2==0){$_e[$i]=$k;$i++;}\n else {$_o[$a]=$k;$a++;}\n}\nif(count($_e)==1)echo $e[0];\nelseif(count($_o)==1)echo $_o[0];\n?>"}, {"source_code": "$v)\n{\n if($v%2==0){$_e[$i]=$k;$i++;}\n else {$_o[$a]=$k;$a++;}\n}\nif(count($_e)<2)echo $e[0]+1;\nelse echo $_o[0]+1;\n?>"}, {"source_code": "$v)\n{\n if($v%2==0){$_e[$i]=$k;$i++;}\n else {$_o[$a]=$k;$a++;}\n}\nif(count($_e)==1)echo $e[0];\nelse echo $_o[0];\n?>"}, {"source_code": " $number) {\n if($number & 1){\n $nechet++;\n $nechetKey = $key;\n }else{\n $chet++;\n $chetKey = $key;\n }\n\n if($nechet > 1 && $chet == 1){\n echo $chetKey+1;\n break;\n }elseif($chetKey > 1 && $nechet == 1){\n echo $nechetKey+1;\n break;\n }\n}"}, {"source_code": "$odd)echo $oddPlace+1;\nelse echo $evenPlace+1;"}, {"source_code": "\n"}, {"source_code": ""}], "src_uid": "dd84c2c3c429501208649ffaf5d91cee"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "c1608f6f71cac56690e31aa130c1990e"} {"source_code": " $s || $currInt < $partialMax ? \"NO\" : \"YES\";\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 getString()\r\n{\r\n return trim(fgets(STDIN));\r\n}\r\n\r\nfunction getWords()\r\n{\r\n return explode(' ', trim(fgets(STDIN)));\r\n}\r\n\r\n", "positive_code": [{"source_code": " $s || $currInt < $partialMax ? \"NO\" : \"YES\";\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 getString()\r\n{\r\n return trim(fgets(STDIN));\r\n}\r\n\r\nfunction getWords()\r\n{\r\n return explode(' ', trim(fgets(STDIN)));\r\n}\r\n\r\n"}, {"source_code": " $s || $currInt < $maxPartial ? \"NO\" : \"YES\";\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 getString()\r\n{\r\n return trim(fgets(STDIN));\r\n}\r\n\r\nfunction getWords()\r\n{\r\n return explode(' ', trim(fgets(STDIN)));\r\n}\r\n\r\n"}, {"source_code": "strlen($grp2[$i]))||($grp1[$i][0]!=$grp2[$i][0]))\n {\n $same=false;\n break;\n }\n \n }\n } \n\n \n \n\n echo $same?\"YES\\n\":\"NO\\n\";\n}\nfunction identicalSubstring($str)\n{\n $grp1=array();\n if(count(array_unique(str_split($str)))==1)\n {\n $grp1[0]=$str;\n return $grp1;\n }\n else\n {\n $i=0;\n $k=0;\n $str2=\"\";\n while($i 1)\n {\n $c[count($c)] = $b[$y];\n $d[count($d)] = $e;\n }\n $b2 = trim(fgets(STDIN)) . \" \";\n $c2 = array();\n $d2 = array();\n $e2 = 1;\n for($y = 0; $y < strlen($b2) - 1; $y++)\n {\n if($b2[$y] == $b2[$y + 1])\n {\n $e2++;\n }\n else\n {\n $c2[count($c2)] = $b2[$y];\n $d2[count($d2)] = $e2;\n $e2 = 1;\n }\n }\n if($e2 > 1)\n {\n $c2[count($c2)] = $b2[$y];\n $d2[count($d2)] = $e2;\n }\n if(strlen($b) < strlen($b2))\n {\n $f = 0;\n for($y = 0; $y < count($c); $y++)\n {\n if($c[$y] == $c2[$y])\n {\n if($d[$y] > $d2[$y])\n {\n $f = 1;\n break;\n }\n }\n else\n {\n $f = 1;\n break;\n }\n }\n if(($f == 0) && (count($c) == count($c2)))\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) == strlen($b2))\n {\n if($b == $b2)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) > strlen($b2))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "strlen($grp2[$i]))||($grp1[$i][0]!=$grp2[$i][0]))\n {\n $same=false;\n break;\n }\n \n }\n } \n\n \n \n\n echo $same?\"YES\\n\":\"NO\\n\";\n}\nfunction identicalSubstring($str)\n{\n\n\n $grp1=array();\n \n\n\n if(count(array_unique(str_split($str)))==1)\n {\n $grp1[0]=$str;\n return $grp1;\n }\n else\n {\n /*\n $ara=array();\n for ($i=0,$j=0; $i strlen($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " count($c))\n {\n print \"NO\";\n }\n}\n?>"}, {"source_code": " strlen($c))\n {\n print \"\";\n }\n}\n?>"}, {"source_code": " count($c))\n {\n print \"NO\\n\";\n }\n else\n {\n $b = array_unique($b);\n $c = array_unique($c);\n if(implode($b) == implode($c))\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " strlen($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= 1421)\n {\n print $b . \"\\n\";\n print $c . \"\\n\";\n }\n }\n else\n {\n if(strlen($b) < strlen($c))\n {\n $d = $b[0];\n for($y = 0; $y < strlen($b); $y++)\n {\n if($d[strlen($d) - 1] != $b[$y + 1])\n {\n $d .= $b[$y + 1];\n }\n }\n $e = $c[0];\n for($y = 0; $y < strlen($c); $y++)\n {\n if($e[strlen($e) - 1] != $c[$y + 1])\n {\n $e .= $c[$y + 1];\n }\n }\n if($d == $e)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) == strlen($c))\n {\n if($b == $c)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) > strlen($c))\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " strlen($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= 710)\n {\n print $b . \"\\n\";\n print $c . \"\\n\";\n }\n }\n else\n {\n if(strlen($b) < strlen($c))\n {\n $d = $b[0];\n for($y = 0; $y < strlen($b); $y++)\n {\n if($d[strlen($d) - 1] != $b[$y + 1])\n {\n $d .= $b[$y + 1];\n }\n }\n $e = $c[0];\n for($y = 0; $y < strlen($c); $y++)\n {\n if($e[strlen($e) - 1] != $c[$y + 1])\n {\n $e .= $c[$y + 1];\n }\n }\n if($d == $e)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) == strlen($c))\n {\n if($b == $c)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) > strlen($c))\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " strlen($c))\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " strlen($c))\n {\n print \"NO\\n\";\n }\n }\n}\n?>"}, {"source_code": " strlen($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " 1)\n {\n $c[count($c)] = $b[$y];\n $d[count($d)] = $e;\n }\n $b2 = trim(fgets(STDIN)) . \" \";\n $c2 = array();\n $d2 = array();\n $e2 = 1;\n for($y = 0; $y < strlen($b2) - 1; $y++)\n {\n if($b2[$y] == $b2[$y + 1])\n {\n $e2++;\n }\n else\n {\n $c2[count($c2)] = $b2[$y];\n $d2[count($d2)] = $e2;\n $e2 = 1;\n }\n }\n if($e2 > 1)\n {\n $c2[count($c2)] = $b2[$y];\n $d2[count($d2)] = $e2;\n }\n if(strlen($b) < strlen($b2))\n {\n $f = 0;\n for($y = 0; $y < count($c); $y++)\n {\n if($c[$y] == $c2[$y])\n {\n if($c[$y] > $c2[$y])\n {\n $f = 1;\n break;\n }\n }\n else\n {\n $f = 1;\n break;\n }\n }\n if(($f == 0) && (count($c) == count($c2)))\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) == strlen($b2))\n {\n if($b == $b2)\n {\n print \"YES\\n\";\n }\n else\n {\n print \"NO\\n\";\n }\n }\n elseif(strlen($b) > strlen($b2))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": " count($c))\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "=$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n\t \tfor ($i=0; $i <$tLength-1 ; $i++) \n\t \t{ \n\t \t $str1[$i]=substr($typed,$i,2);\n\t \t}\n\t \tfor ($i=0; $i <$pLength-1 ; $i++) \n\t \t{ \n\t \t $str2[$i]=substr($printed,$i,2);\n\t \t}\n\t \t$count=0;\n\t \tfor ($i=0; $i =$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n \t \n \n\n if(count(array_unique(str_split($typed)))==1)\n $grp1[0]=$typed;\n else\n {\n $ara=array();\n for ($i=0,$j=0; $i strlen($grp2[$i]))\n {\n $same=false;\n break;\n }\n }\n } \n\n \n \n }\n\n echo $same?\"YES\\n\":\"NO\\n\";\n}\n\n"}, {"source_code": "=$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n\t \tfor ($i=0; $i <$tLength-1 ; $i++) \n\t \t{ \n\t \t $str1[$i]=substr($typed,$i,2);\n\t \t}\n\t \tfor ($i=0; $i <$pLength-1 ; $i++) \n\t \t{ \n\t \t $str2[$i]=substr($printed,$i,2);\n\t \t}\n\t \t$count=0;\n\t \tfor ($i=0; $i =$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n\t \n\t for ($i=0; $i <$pLength ; $i++) \n\t { \n\t \tif($printed[$i]==$typed[$count])\n\t \t {\n\t \t\t$count++;\n\n\t \t\tif($count==$tLength)\n\t \t\t{\n\t \t\t\t$same=true;\n\t \t\t\tbreak;\n\t \t\t}\n\t \t }\n\t \t //echo \"$count\\n\";\n\n\n\t }\n\n }\n echo $same?\"YES\\n\":\"NO\\n\";\n}"}, {"source_code": "=$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n\t \tfor ($i=0; $i <$tLength-1 ; $i++) \n\t \t{ \n\t \t $str1[$i]=substr($typed,$i,2);\n\t \t}\n\t \tfor ($i=0; $i <$pLength-1 ; $i++) \n\t \t{ \n\t \t $str2[$i]=substr($printed,$i,2);\n\t \t}\n\t \tfor ($i=0; $i =$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n \t \n $same=true;\n \n\n if(count(array_unique(str_split($typed)))==1)\n $grp1[0]=$typed;\n else\n {\n $ara=array();\n for ($i=0,$j=0; $i strlen($grp2[$i]))\n {\n $same=false;\n break;\n }\n }\n } \n\n \n \n }\n\n echo $same?\"YES\\n\":\"NO\\n\";\n}\n\n"}, {"source_code": "=$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n \t \n $grp1=array();\n $grp2=array();\n\n\n if(count(array_unique(str_split($typed)))==1)\n $grp1[0]=$typed;\n else\n {\n $ara=array();\n for ($i=0,$j=0; $i strlen($grp2[$i]))\n {\n $same=false;\n break;\n }\n }\n } \n\n \n }\n\n echo $same?\"YES\\n\":\"NO\\n\";\n}\n\n"}, {"source_code": "=$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n \t \n $grp1=array();\n $grp2=array();\n\n\n if(count(array_unique(str_split($typed)))==1)\n $grp1[0]=$typed;\n else\n {\n $ara=array();\n for ($i=0,$j=0; $i strlen($grp2[$i]))\n {\n $same=false;\n break;\n }\n //$count=0;\n for ($j=0,$k=0; $j =$tLength&&$typed[0]==$printed[0]&&$typed[$tlstchar]==$printed[$plstchar])\n\t {\n \t \n $same=true;\n \n\n if(count(array_unique(str_split($typed)))==1)\n $grp1[0]=$typed;\n else\n {\n $ara=array();\n for ($i=0,$j=0; $i $maxCapacity) \n $maxCapacity = $capacity;\n \n }\n \n echo $maxCapacity;\n \n fclose($stdin);\n?>", "positive_code": [{"source_code": "$max)\n\t\t$max=$sum[$i];\n}\necho \"$max\";"}, {"source_code": " $cap_min){\n $cap_min = $cap;\n }\n }\n}\necho $cap_min;\n\n?>\n"}, {"source_code": "$max) $max = $cur;\n}\n\necho $max;\n\n"}, {"source_code": "0;$N--){\n fscanf(STDIN,\"%d %d\",$A,$B);\n $Now = $Now - $A + $B;\n $Ans = max($Ans,$Now);\n}\nprintf(\"%d\\n\",$Ans);\n\n/* vim: set expandtab ts=4 sw=4 sts=4 tw=100: */\n?>"}, {"source_code": " $maxRiders) ? $currentRiders : $maxRiders;\n}\n\necho $maxRiders;\n\n?>"}, {"source_code": " $min)\n $min = $pass;\n}\necho $min;\n?>"}, {"source_code": " $max) $max = $people;\n }\n \n echo $max;\n?>"}, {"source_code": " $max) $max = $people;\n }\n \n echo $max;\n?>"}, {"source_code": ""}, {"source_code": "0){\n fscanf(STDIN,\"%d%d\",$ex,$en);\n $per+=$en-$ex;\n if($ans<$per)$ans=$per;\n }\n fprintf(STDOUT,\"%d\\n\",$ans);\n}"}, {"source_code": ""}, {"source_code": " $out) $out = $col;\n}\n\necho $out;\n\n?>"}, {"source_code": ""}, {"source_code": "$max?$c:$max;\n }\n echo $max;\n?>"}, {"source_code": "$max) $max=$cur_peoples;\n}\necho $max;\n?>"}, {"source_code": " $max) $max = $capacity;\n}\n\necho $max;\n"}, {"source_code": "$mx)$mx=$intram;\n }\n echo $mx;\n?>"}, {"source_code": ""}, {"source_code": "$max) $max=$cur;\n}\necho $max;\n?>"}, {"source_code": " $result) $result = $count;\n}\n\nfprintf(STDOUT, $result);"}, {"source_code": " $currentMax)\n\t{\n\t\t$currentMax = $inTram;\n\t}\n}\n\necho $currentMax;"}, {"source_code": ""}, {"source_code": " $m_capacity)\n $m_capacity = $c_capacity; \n}\n\necho $m_capacity;\nexit;\n\n"}, {"source_code": " $max) $max = $now;\n\t}\n\techo $max;\n?>"}, {"source_code": ""}, {"source_code": " $max)\n $max = $now;\n }\n echo $max;\n?>"}, {"source_code": " $max) $max = $cur;\n\t}\n\techo $max;"}, {"source_code": " $res) $res = $num;\n}\necho $res;\n?>\n"}, {"source_code": " $stationStatus) {\n $count -= $stationStatus[0];\n $count += $stationStatus[1];\n if($count > $max) $max = $count;\n}\necho $max;"}, {"source_code": " $capacity) {\n $capacity = $totalPassengers;\n }\n}\nfprintf($output,\"%d\",$capacity);\n\n?>"}, {"source_code": " $max) {\n $max = $num;\n }\n}\n\nprint $max . \"\\n\";"}, {"source_code": "0):\nlist($a,$b)=explode(\" \", trim(fgets(STDIN)));\n$s=$s-$a+$b;\nif ($s>$max) $max=$s;\n$n--;\nendwhile;\nprint $max;\n?>"}, {"source_code": " $res) \n\t $res = $cnt;\n}\n \necho $res;"}, {"source_code": " $m)$m = $c;\n }\n fwrite(STDOUT, $m);"}, {"source_code": " $m ? $c : $m;\n }\n fwrite(STDOUT, $m);"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "$ans){$ans=$total;}\n}\necho $ans;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $max) $max = $sum; \n }\n echo $max; \n?>"}, {"source_code": " $max) {\n $max = $t;\n }\n}\n\nfwrite($output, $max);\n\n"}, {"source_code": " $max) {\n $max = $sum;\n }\n}\n\necho $max;"}, {"source_code": " $max) {\n $max = $cur;\n }\n}\necho( $max );\n"}, {"source_code": " 0 )\n {\n $in_bus = (($count_passengers[$i-1]) - $station_list[$i][$j]);\n }else{\n $in_bus = 0;\n }\n $count_passengers[$i] = $in_bus + $station_list[$i][++$j];\n }\n}\n\n\nfor( $k=0; $k"}, {"source_code": " $result)\n\t\t{\n\t\t\t$result = $now;\n\t\t}\n\t}\n\techo $result;\n?>"}, {"source_code": ""}, {"source_code": "\n$max)$max=$in;\n }\n echo $max;\n?>"}, {"source_code": "\n"}, {"source_code": " $value){\n $arr = explode(\" \", $value);\n $id += -intval($arr[0]) + intval($arr[1]);\n\n if($id > $max) $max= $id;\n\n }\n echo $max;"}, {"source_code": "$max)\n \t{ \n \t\t$max=$t;\n \t}\n\n\n}\necho \"$max\";"}], "negative_code": [{"source_code": ""}, {"source_code": " $res) $res = $num;\n}\necho $res;\n?>\n"}, {"source_code": " $max) {\n $max = $sum;\n }\n}\n\necho $max;"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $value) {\n $thisWordCodeVerdeeld = str_split($value);\n foreach ($thisWordCodeVerdeeld as $val) {\n $a = in_array(intval($val), $arr);\n if ($a == false) {\n echo 'NO';\n break;\n }\n }\n// $output[] = $str;\n }\n echo 'YES';\n}\n fclose($file);\n\n"}, {"source_code": " $value){\n $id += -intval($value[0]) + intval(substr($value,-1));\n if($id > $max) $max= $id;\n\n\n// $output[] = $str;\n }\n fclose($file);\n echo $max;\n}\n"}, {"source_code": " $value){\n $id += -intval($value[0]) + intval(substr($value,-1));\n if($id > $max) $max= $id;\n\n\n }\n echo $max;\n fclose($file);\n}\n"}, {"source_code": " $value){\n $id += -intval($value[0]) + intval(substr($value,-1));\n if($id > $max) $max= $id;\n\n\n// $output[] = $str;\n }\n echo $max;\n fclose($file);\n}\n"}, {"source_code": "$max)\n\t\t$max=$sum[$i];\n}\necho \"$max\";"}, {"source_code": " $min)\n $min = $pass;\n}\necho $min;\n?>"}, {"source_code": "$max) $max=$cur_peoples;\n}\necho $max;\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\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\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$mas = [];\n\nfor ($i=1; $i<=$n; $i++) {\n\t$s = $ir->readString();\n\tif (!check($s)) {\n\t\tcontinue;\n\t}\n\t\n\t$chars = count_chars($s, 1);\n\n\t$d = ($chars[ord('(')]??0) - ($chars[ord(')')]??0);\n\tif (!isset($mas[$d])) {\n\t\t$mas[$d] = 0;\n\t}\n\t$mas[$d] += 1;\n}\n\n$cnt = 0;\nforeach ($mas as $d=>$m) {\n\tif ($d>0) {\n\t\t$cnt += min([$m, $mas[-$d]??0]);\n\t}\n}\n\necho $cnt+(($mas[0]??0)>>1);\n\n\nfunction check ($s) {\n\t$stack = [];\n\tfor ($i=0; $i= 0; $y--)\n {\n if($e[$y] == \")\")\n {\n $h++;\n }\n else\n {\n $h--;\n if($h < 0)\n {\n $i = 1;\n break;\n }\n }\n }\n if($i == 0)\n {\n $c[$h]++;\n }\n }\n elseif(($e[0] == \"(\") && ($e[strlen($e) - 1] == \"(\"))\n {\n for($y = 0; $y < strlen($e); $y++)\n {\n if($e[$y] == \"(\")\n {\n $f++;\n }\n else\n {\n $f--;\n if($f < 0)\n {\n $g = 1;\n break;\n }\n }\n }\n if($g == 0)\n {\n $b[$f]++;\n }\n }\n elseif(($e[0] == \"(\") && ($e[strlen($e) - 1] == \")\"))\n {\n for($y = 0; $y < strlen($e); $y++)\n {\n if($e[$y] == \"(\")\n {\n $f++;\n }\n else\n {\n $f--;\n if($f < 0)\n {\n $g = 1;\n break;\n }\n }\n }\n for($y = strlen($e) - 1; $y >= 0; $y--)\n {\n if($e[$y] == \")\")\n {\n $h++;\n }\n else\n {\n $h--;\n if($h < 0)\n {\n $i = 1;\n break;\n }\n }\n }\n if(($g == 0) && ($i == 0))\n {\n $d++;\n }\n elseif($g == 0)\n {\n $b[$f]++;\n }\n elseif($i == 0)\n {\n $c[$h]++;\n }\n }\n}\n$j = floor($d / 2);\n$k = array_keys($b);\nfor($x = 0; $x < count($b); $x++)\n{\n if($c[$k[$x]] == TRUE)\n {\n $j += min($b[$k[$x]], $c[$k[$x]]);\n }\n}\nprint $j;\n?>"}, {"source_code": " 0; $i--) {\n list($s, $error) = cCount(trim(fgets(STDIN)));\n if ($error) {continue;}\n $nS = -$s;\n if (array_key_exists($nS, $store) && $store[$nS] > 0) {\n $result++;\n $store[$nS]--;\n } else {\n $store[$s] = array_key_exists($s, $store) ? $store[$s] + 1 : 1;\n }\n}\n\necho $result;\n\nfunction cCount($s)\n{\n $rs = 0;\n $min = 0;\n $arr = str_split($s);\n foreach ($arr as $r) {\n if ($r === '(') {\n $rs++;\n }\n if ($r === ')') {\n $rs--;\n $min = min($min, $rs);\n }\n }\n\n return [$rs, ($min < 0 && $min !== $rs)];\n}"}], "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\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\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$mas = [];\n\nfor ($i=1; $i<=$n; $i++) {\n\t$s = $ir->readString();\n\t$chars = count_chars($s, 1);\n\n\t$d = ($chars[ord('(')]??0) - ($chars[ord(')')]??0);\n\tif (!isset($mas[$d])) {\n\t\t$mas[$d] = 0;\n\t}\n\t$mas[$d] += 1;\n}\n\n$cnt = 0;\nforeach ($mas as $d=>$m) {\n\tif ($d>0)\n\t\t$cnt += min($m, $mas[-$d]??0);\n}\n\necho $cnt+(($mas[0]??0)>>1);\n"}, {"source_code": " 0; $i--) {\n $s = cCount(trim(fgets(STDIN)));\n $nS = -$s;\n if (array_key_exists($nS, $store) && $store[$nS] > 0) {\n $result++;\n $store[$nS]--;\n } else {\n $store[$s] = array_key_exists($s, $store) ? $store[$s] + 1 : 1;\n }\n}\n\necho $result;\n\nfunction cCount($s)\n{\n $rs = 0;\n $arr = str_split($s);\n foreach ($arr as $r) {\n if ($r === '(') {\n $rs++;\n }\n if ($r === ')') {\n $rs--;\n }\n }\n return $rs;\n}"}, {"source_code": " 0; $i--) {\n $s = cCount(trim(fgets(STDIN)));\n if (array_key_exists($s, $store)) {\n $result++;\n unset($store[$s]);\n } else {\n $store[$s] = 1;\n }\n}\n\necho $result;\n\nfunction cCount($s)\n{\n $rs = 0;\n $arr = str_split($s);\n foreach ($arr as $r) {\n if ($r === '(') {\n $rs++;\n }\n if ($r === ')') {\n $rs--;\n }\n }\n return $rs;\n}"}], "src_uid": "2cfb08b2269dbf5417c1758def4c035f"} {"source_code": " 0) {\n $s3[$i] = $s1[$i];\n $t--;\n } else {\n $r++;\n $s3[$i] = '.';\n }\n}\nif ($t > 0) {\n if ($r >= 2 * $t) {\n $t1 = $t;\n $t2 = $t;\n for ($i = 0; $i < $n; $i++) {\n if ($s3[$i] != '.') {\n continue;\n }\n if ($t1>0) {\n $s3[$i] = $s1[$i];\n $t1--;\n } elseif ($t2>0) {\n $s3[$i] = $s2[$i];\n $t2--;\n }\n }\n }else{\n echo \"-1\";\n return 0;\n }\n}\nfor ($i = 0; $i < $n; $i++) {\n if ($s3[$i] != '.') {\n continue;\n }\n if ($s1[$i] == 'a' || $s2[$i] == 'a') {\n if ($s1[$i] == 'b' || $s2[$i] == 'b') {\n $s3[$i] = 'c';\n }else{\n $s3[$i] = 'b';\n }\n }else{\n $s3[$i] = 'a';\n }\n}\necho implode(\"\", $s3);", "positive_code": [{"source_code": " 2 * $t)\n{\n\tfwrite(STDOUT, ((str)-1).\"\\n\");\n}\nelse if ($different_letters <= $t) {\n\tfor ($i = 0; $i < $n && $different_letters < $t; ++$i)\n\t{\n\t\tif ($result_string[$i] !== \"*\") {\n\t\t\t--$t;\n\t\t\t$result_string[$i] = next_char($result_string[$i]);\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $n; ++$i)\n\t{\n\t\tif ($result_string[$i] === \"*\")\n\t\t{\n\t\t\t$result_string[$i] = different_char($first_string[$i], $second_string[$i]);\n\t\t}\n\t}\n\n\tfwrite(STDOUT, $result_string.\"\\n\");\n}\nelse {\n\t$first_written = 0;\n\tfor ($i = 0; $i < $n && $first_written < $t; ++$i) {\n\t\tif ($result_string[$i] === \"*\") {\n\t\t\t++$first_written;\n\t\t\t$result_string[$i] = $second_string[$i];\n\t\t}\n\t}\n\n\t$second_written = 0;\n\tfor ($i = $n - 1; $i >= 0 && $second_written < $t; --$i) {\n\t\tif ($result_string[$i] === \"*\") {\n\t\t\t++$second_written;\n\t\t\t$result_string[$i] = $first_string[$i];\n\t\t}\n\t\telse if ($first_string[$i] !== $second_string[$i]) {\n\t\t\t++$second_written;\n\t\t\t$result_string[$i] = different_char($first_string[$i], $second_string[$i]);\n\t\t}\n\t}\n\n\tfwrite(STDOUT, $result_string.\"\\n\");\n}\n\n"}], "negative_code": [{"source_code": " 2 * $t)\n{\n\tfwrite(STDOUT, ((str)-1).\"\\n\");\n}\nelse if ($different_letters <= $t) {\n\tfor ($i = 0; $i < $n && $different_letters < $t; ++$i)\n\t{\n\t\tif ($result_string[$i] !== \"*\") {\n\t\t\t$result_string[$i] = next_char($result_string[$i]);\n\t\t\t--$t;\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < $n; ++$i)\n\t{\n\t\tif ($result_string[$i] === \"*\")\n\t\t{\n\t\t\t$result_string[$i] = different_char($first_string[$i], $second_string[$i]);\n\t\t}\n\t}\n\n\tfwrite(STDOUT, $result_string.\"\\n\");\n}\nelse {\n\t$first_written = 0;\n\tfor ($i = 0; $i < $n && $first_written < $t; ++$i) {\n\t\tif ($result_string[$i] === \"*\") {\n\t\t\t++$first_written;\n\t\t\t$result_string[$i] = $second_string[$i];\n\t\t}\n\t}\n\n\t$second_written = 0;\n\tfor ($i = $n - 1; $i >= 0 && $second_written < $t; --$i) {\n\t\tif ($result_string[$i] === \"*\") {\n\t\t\t++$second_written;\n\t\t\t$result_string[$i] = $first_string[$i];\n\t\t}\n\t\telse if ($first_string[$i] !== $second_string[$i]) {\n\t\t\t++$second_written;\n\t\t\t$result_string[$i] = different_char($first_string[$i], $second_string[$i]);\n\t\t}\n\t}\n\n\tfwrite(STDOUT, $result_string.\"\\n\");\n}\n\n"}], "src_uid": "8ba3a7f7cb955478481c74cd4a4eed14"} {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $e) && ($d[$i] <= $b[$x] + $e))\n {\n $h[$g[$i]] = $x + 1;\n $x--;\n $i++;\n }\n else\n {\n $e += $b[$x];\n }\n}\nfor($x = 0; $x < $c - 1; $x++)\n{\n print $h[$x] . \"\\n\";\n}\nprint $h[$x];\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $worms) {\n\t\t$worms += $arr_count_worms_in_stacks[$counter+1];\n\t\t$counter++;\n\t}\n\techo ($counter+1).\"
\";\n}\n?>"}, {"source_code": " $worms) {\n\t\t$worms += $arr_count_worms_in_stacks[$counter+1];\n\t\t$counter++;\n\t}\n\techo $counter+1;\n}\n?>"}, {"source_code": "1){\n\n $mid = $start + floor(($end-$start)/2);\n //printf(\"start = %s, end = %s, mid = %s \\n\",$start,$end,$mid);\n\n if ($source_array[$mid]>$search_value){\n $end = $mid;\n } else {\n $start = $mid;\n }\n }\n\n return $start;\n\n}\n\n\n/**\n * \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443\n * @param array $source_array \u0423\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e \u043c\u0430\u0441\u0441\u0438\u0432 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b\n * @param int $search_value \u0418\u0441\u043a\u043e\u043c\u0430\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430\n * @return bool|int\n */\nfunction binary_search(&$source_array, $search_value) {\n $count = count($source_array);\n\n $start = 0;\n $end = $count - 1;\n\n while (true) {\n $len = $end - $start;\n if ($len > 2) {\n if ($len % 2 != 0) $len++;\n $mid = (int)($len / 2 + $start);\n } elseif ($len >= 0) {\n $mid = $start;\n } else {\n return false;\n }\n\n if ($source_array[$mid-1]<$search_value && $source_array[$mid]>=$search_value){\n return $mid;\n }\n\n if ($source_array[$mid] == $search_value) {\n return $mid;\n } elseif ($source_array[$mid] > $search_value) {\n $end = $mid - 1;\n } else {\n $start = $mid + 1;\n }\n }\n}\n\n\nforeach($q as $item){\n /*\n foreach ($aux as $k=>$x) {\n if ($item<=$x){\n break;\n }\n }\n */\n //$k = binary_search($aux,(int)$item);\n $k = n_binary($aux,(int)$item);\n echo ($k+1).\"\\n\";\n}\n\n//var_dump(binary_search($aux,(int)11));\n//print_r($aux);\n"}, {"source_code": "$x) {\n if ($item<$x){\n break;\n }\n }\n echo(($k+1).\"\\n\");\n}\n\n//print_r($aux);\n"}, {"source_code": " 2) {\n if ($len % 2 != 0) $len++;\n $mid = (int)($len / 2 + $start);\n } elseif ($len >= 0) {\n $mid = $start;\n } else {\n return false;\n }\n\n if ($source_array[$mid-1]<=$search_value && $source_array[$mid]>=$search_value){\n return $mid;\n }\n\n if ($source_array[$mid] == $search_value) {\n/*\n while (($mid != 0) && ($source_array[$mid - 1] == $search_value))\n $mid--;\n*/\n return $mid;\n } elseif ($source_array[$mid] > $search_value) {\n $end = $mid - 1;\n } else {\n $start = $mid + 1;\n }\n }\n } else {\n return false;\n }\n}\n\n\nforeach($q as $item){\n /*\n foreach ($aux as $k=>$x) {\n if ($item<=$x){\n break;\n }\n }\n */\n $k = binary_search($aux,(int)$item);\n echo ($k+1).\"\\n\";\n}\n\n//var_dump(binary_search($aux,(int)11));\n//print_r($aux);\n"}], "src_uid": "10f4fc5cc2fcec02ebfb7f34d83debac"} {"source_code": " $pl) {\n if ($pl != '.'&& $pl !== '*') {\n break;\n }\n\n if ($pl !== '*') {\n pp($k1 . ' - ' . $l . PHP_EOL);\n $l++;\n }\n\n if ($l > 0 && ($pl == '*' || $k1 == $k - 1)) {\n $lo = $l % 2;\n $l = floor($l / 2);\n\n if ($l < $s) {\n $s -= $l;\n $i += $l;\n pp('s1 ' . $s . '|' . $l . '|' . $i . PHP_EOL);\n } else {\n $i += $s;\n $s = 0;\n pp('s2 ' . $s . '|' . $l . '|' . $i . PHP_EOL);\n }\n\n if ($l < $p) {\n $p -= $l;\n $i += $l;\n pp('p1 ' . $p . '|' . $l . '|' . $i . PHP_EOL);\n } else {\n $i += $p;\n $p = 0;\n pp('p2 ' . $p . '|' . $l . '|' . $i . PHP_EOL);\n }\n\n if (($p || $s) && $lo) {\n $i++;\n\n if ($p > $s) {\n $p--;\n } else {\n $s--;\n }\n\n pp('sp ' . $s . '|' . $p . '|' . $l . '|' . $i . PHP_EOL);\n\n }\n $l = 0;\n }\n\n\n\n }\n\n return $i;\n}\n", "positive_code": [{"source_code": "= $i)\n {\n $b -= $i;\n $g += $i;\n }\n else\n {\n $g += $b;\n $b = 0;\n }\n if($c >= $i)\n {\n $c -= $i;\n $g += $i;\n }\n else\n {\n $g += $c;\n $c = 0;\n }\n }\n else\n {\n if($b <= $c)\n {\n if($b >= $i)\n {\n $b -= $i;\n $g += $i;\n }\n else\n {\n $g += $b;\n $b = 0;\n }\n if($c >= $j)\n {\n $c -= $j;\n $g += $j;\n }\n else\n {\n $g += $c;\n $c = 0;\n }\n }\n else\n {\n if($b >= $j)\n {\n $b -= $j;\n $g += $j;\n }\n else\n {\n $g += $b;\n $b = 0;\n }\n if($c >= $i)\n {\n $c -= $i;\n $g += $i;\n }\n else\n {\n $g += $c;\n $c = 0;\n }\n }\n }\n}\nprint $g;\n?>"}, {"source_code": " $pl) {\n if ($pl != '.'&& $pl !== '*') {\n break;\n }\n\n if ($pl !== '*') {\n pp($k1 . ' - ' . $l . PHP_EOL);\n $l++;\n }\n\n if ($l > 0 && ($pl == '*' || $k1 == $k - 1)) {\n $lo = $l % 2;\n $l = floor($l / 2);\n\n if ($l < $s) {\n $s -= $l;\n $i += $l;\n pp('s1 ' . $s . '|' . $l . '|' . $i . PHP_EOL);\n } else {\n $i += $s;\n $s = 0;\n pp('s2 ' . $s . '|' . $l . '|' . $i . PHP_EOL);\n }\n\n if ($l < $p) {\n $p -= $l;\n $i += $l;\n pp('p1 ' . $p . '|' . $l . '|' . $i . PHP_EOL);\n } else {\n $i += $p;\n $p = 0;\n pp('p2 ' . $p . '|' . $l . '|' . $i . PHP_EOL);\n }\n\n if (($p || $s) && $lo) {\n $i++;\n\n if ($p > $s) {\n $p--;\n } else {\n $s--;\n }\n\n pp('sp ' . $s . '|' . $p . '|' . $l . '|' . $i . PHP_EOL);\n\n }\n $l = 0;\n }\n\n\n\n }\n\n return $i;\n}\n"}, {"source_code": "$didi){\n $x-=$didi;\n $giorgiPirveli+=$didi;\n }\n else{\n $giorgiPirveli+=$x;\n $x = 0;\n }\n \n if($y > $patara){\n $y-=$patara;\n $giorgiPirveli+=$patara;\n }\n else{\n $giorgiPirveli+=$y;\n $y=0;\n }\n \n \n }\n}\n\necho $giorgiPirveli;\n?>"}], "negative_code": [{"source_code": " $pl) {\n if ($pl != '.'&& $pl !== '*') {\n break;\n }\n\n if ($pl !== '*') {\n pp($k1 . ' - ' . $l . PHP_EOL);\n $l++;\n }\n\n if ($l > 0 && ($pl == '*' || $k1 == $k - 1)) {\n $lo = $l % 2;\n $l = floor($l / 2);\n\n if ($l < $s) {\n $s -= $l;\n $i += $l;\n pp('s1 ' . $s . '|' . $l . '|' . $i . PHP_EOL);\n } else {\n $i += $s;\n $s = 0;\n pp('s2 ' . $s . '|' . $l . '|' . $i . PHP_EOL);\n }\n\n if ($l < $p) {\n $p -= $l;\n $i += $l;\n pp('p1 ' . $p . '|' . $l . '|' . $i . PHP_EOL);\n } else {\n $i += $p;\n $p = 0;\n pp('p2 ' . $p . '|' . $l . '|' . $i . PHP_EOL);\n }\n\n if (($p || $s) && $lo) {\n $i++;\n\n if ($p > $s) {\n $p--;\n } else {\n $s--;\n }\n\n pp('sp ' . $s . '|' . $p . '|' . $l . '|' . $i . PHP_EOL);\n\n }\n $l = 0;\n }\n\n\n\n }\n\n return $i;\n}\n"}, {"source_code": " $s) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n } elseif ($p) {\n $p--;\n $i++;\n } elseif ($s) {\n $s--;\n $i++;\n }\n } else {\n if ($p && $progs) {\n $p--;\n $progs = !$progs;\n $i++;\n } elseif ($s) {\n $s--;\n $progs = !$progs;\n $i++;\n } elseif ($skip) {\n if ($p) {\n $i++;\n $p--;\n $skip = false;\n }\n if ($s) {\n $i++;\n $s--;\n $skip = false;\n }\n } else {\n $skip = true;\n }\n }\n\n $busy = false;\n\n }\n\n return $i; \n}\n"}, {"source_code": " $s) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n } elseif ($p) {\n $p--;\n $i++;\n } elseif ($s) {\n $s--;\n $i++;\n }\n } else {\n if ($p && $progs) {\n $p--;\n $progs = !$progs;\n $i++;\n } elseif ($s) {\n $s--;\n $progs = !$progs;\n $i++;\n } elseif ($skip) {\n if ($p) {\n $i++;\n $p--;\n $skip = false;\n }\n if ($s) {\n $i++;\n $s--;\n $skip = false;\n }\n } else {\n $skip = true;\n }\n }\n\n $busy = false;\n echo $s, ' | ', $p, PHP_EOL;\n }\n\n return $i; \n}\n"}, {"source_code": " $s) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n } elseif ($p) {\n $p--;\n $i++;\n } elseif ($s) {\n $s--;\n $i++;\n }\n } else {\n if ($p && $progs) {\n $p--;\n $progs = !$progs;\n $i++;\n } elseif ($s) {\n $s--;\n $progs = !$progs;\n $i++;\n } elseif ($skip) {\n if ($p) {\n $i++;\n $p--;\n $skip = false;\n }\n if ($s) {\n $i++;\n $s--;\n $skip = false;\n }\n } else {\n $skip = true;\n }\n }\n\n $busy = false;\n\n }\n\n return $i; \n}\n"}, {"source_code": " 1) {\n break;\n }\n}\n\n$i = 0;\n\n$first = 1;\n$busy = false;\n$progs = false;\n$skip = false;\n\nforeach ($strings[1] as $place) {\n if ($place !== '.' && $place !== '*') {\n break;\n }\n if ($place !== '.') {\n $busy = true;\n continue;\n } else {\n $busy = false;\n }\n\n if ($busy) {\n if ($strings[0][2] > 0) {\n $strings[0][2]--;\n $i++;\n } elseif ($strings[0][4]) {\n $strings[0][4]--;\n $i++;\n }\n } else {\n if ($strings[0][2] && $progs) {\n $strings[0][2]--;\n $progs = !$progs;\n $i++;\n } elseif ($strings[0][4]) {\n $strings[0][4]--;\n $progs = !$progs;\n $i++;\n } else {\n $skip = true;\n }\n }\n}\n\necho $i;"}, {"source_code": " $s) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n } elseif ($p) {\n $p--;\n $i++;\n } elseif ($s) {\n $s--;\n $i++;\n }\n } else {\n if ($p && $progs) {\n $p--;\n $progs = !$progs;\n $i++;\n } elseif ($s) {\n $s--;\n $progs = !$progs;\n $i++;\n } elseif ($skip) {\n if ($p) {\n $i++;\n $p--;\n $skip = false;\n }\n if ($s) {\n $i++;\n $s--;\n $skip = false;\n }\n } else {\n $skip = true;\n }\n }\n\n $busy = false;\n// echo $s, ' | ', $p, PHP_EOL;\n }\n\n return $i; \n}\n"}, {"source_code": " $pl) {\n if ($pl != '.'&& $pl !== '*') {\n break;\n }\n\n if ($l > 0 && ($pl == '*' || $k1 == $k - 1)) {\n $lo = $l % 2;\n $l = floor($l / 2);\n\n if ($l < $s) {\n $s -= $l;\n $i += $l;\n pp('s1 ' . $s . '|' . $l . PHP_EOL);\n } else {\n $i += $s;\n $s = 0;\n pp('s2 ' . $s . '|' . $l . PHP_EOL);\n }\n\n if ($l < $p) {\n $p -= $l;\n $i += $l;\n pp('p1 ' . $p . '|' . $l . PHP_EOL);\n } else {\n $i += $p;\n $p = 0;\n pp('p2 ' . $p . '|' . $l . PHP_EOL);\n }\n\n if (($p || $s) && $lo) {\n $i++;\n\n if ($p > $s) {\n $p--;\n } else {\n $s--;\n }\n\n pp($s . '|' . $p . '|' . $l . PHP_EOL);\n\n }\n $l = 0;\n } elseif ($pl !== '*') {\n $l++;\n }\n\n if ($k1 == $k - 1) break;\n }\n\n return $i;\n}\n\nfunction check($places, $s, $p) {\n\n $s *= 1;\n $p *= 1;\n\n $i = 0;\n $busy = false;\n $progs = false;\n $skip = false;\n\n foreach ($places as $place) {\n if ($place != '.'&& $place !== '*') {\n break;\n }\n if ($place !== '.') {\n $busy = true;\n continue;\n }\n\n if ($busy) {\n if ($p && $s) {\n if ($p > $s) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n } elseif ($p) {\n $p--;\n $i++;\n } elseif ($s) {\n $s--;\n $i++;\n }\n } else {\n if ($p && $progs) {\n $p--;\n $progs = !$progs;\n $i++;\n } elseif ($s && !$progs) {\n $s--;\n $progs = !$progs;\n $i++;\n } elseif ($skip) {\n if ($p && $s) {\n if ($p) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n }\n if ($p) {\n $i++;\n $p--;\n $skip = false;\n }\n if ($s) {\n $i++;\n $s--;\n $skip = false;\n }\n } else {\n $skip = true;\n }\n }\n\n $busy = false;\n\n }\n\n return $i; \n}\n"}, {"source_code": " $s) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n } elseif ($p) {\n $p--;\n $i++;\n } elseif ($s) {\n $s--;\n $i++;\n }\n } else {\n if ($p && $progs) {\n $p--;\n $progs = !$progs;\n $i++;\n } elseif ($s && !$progs) {\n $s--;\n $progs = !$progs;\n $i++;\n } elseif ($skip) {\n if ($p) {\n $i++;\n $p--;\n $skip = false;\n }\n if ($s) {\n $i++;\n $s--;\n $skip = false;\n }\n } else {\n $skip = true;\n }\n }\n\n $busy = false;\n\n }\n\n return $i; \n}\n"}, {"source_code": " $s) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n } elseif ($p) {\n $p--;\n $i++;\n } elseif ($s) {\n $s--;\n $i++;\n }\n } else {\n if ($p && $progs) {\n $p--;\n $progs = !$progs;\n $i++;\n } elseif ($s && !$progs) {\n $s--;\n $progs = !$progs;\n $i++;\n } elseif ($skip) {\n if ($p && $s) {\n if ($p) {\n $p--;\n } else {\n $s--;\n }\n\n $i++;\n }\n if ($p) {\n $i++;\n $p--;\n $skip = false;\n }\n if ($s) {\n $i++;\n $s--;\n $skip = false;\n }\n } else {\n $skip = true;\n }\n }\n\n $busy = false;\n\n }\n\n return $i; \n}\n"}], "src_uid": "6208dbdf9567b759b0026db4af4545a9"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": " $b) {\n $res = array(-1);\n }\n else {\n $extra = 0;\n if ($b > $c_sum) {\n $extra = ($b - $c_sum) / $count;\n }\n\n $max += $extra;\n\n $res = array();\n foreach ($as as $a) {\n $res[] = number_format($max - $a, 6, '.', '');\n }\n }\n\n return $res;\n}\n\n$res = main();\nprint join(\"\\n\", $res) . \"\\n\";"}, {"source_code": "Scan();\n\t$B = (int)$Scanner->Scan();\n\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$C_array[] = (int)$Scanner->Scan();\n\t}\n\t$temp = $C_array;\n\trsort($temp);\n\t$max = $temp[0];\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$diff[] = $max - $C_array[$i];\n\t}\n\t$sum = array_sum($diff);\n\tif ($sum > $B) print(-1);\n\telse {\n\t\t$add = ($B - $sum) / $N;\n\t\tfor ($i = 0; $i < $N; $i++) {\n\t\t\tprintf(\"%.6f\", $diff[$i] + $add);\n\t\t\tif ($i !== $N - 1) print(\"\\n\");\n\t\t}\n\t}\n\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": "init();\n }\n // init params\n private function init()\n {\n fscanf(STDIN, \"%d %d\", $this->count, $this->volume);\n $this->poured = explode (\" \", trim(fgets(STDIN)));\n\n }\n\n public function execute()\n {\n $maxVolume = $this->volume + array_sum($this->poured);\n $dose = $maxVolume/$this->count;\n if ($dose*$this->count == $maxVolume){\n\n $res = array();\n $all = 0;\n\n foreach($this->poured as $v){\n $res[] = number_format(($dose - $v), 6, '.', '');\n $all += abs($dose-$v);\n }\n\n $this->result = ((int)($this->volume - $all)) ? -1 : implode(\"\\n\", $res);\n\n } else {\n $this->result = -1;\n }\n return $this->result;\n }\n\n}\n\n$test = new Companions();\necho $test->execute();\n\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "init();\n }\n // init params\n private function init()\n {\n fscanf(STDIN, \"%d %d\", $this->count, $this->volume);\n $this->poured = explode (\" \", trim(fgets(STDIN)));\n }\n\n public function execute()\n {\n $maxVolume = $this->volume + array_sum($this->poured);\n $dose = $maxVolume/$this->count;\n if ($dose*$this->count == $maxVolume){\n $res = array();\n foreach($this->poured as $k => $v){\n $res[] = number_format(($dose - $v), 6, '.', '');\n }\n $this->result = implode(\"\\n\", $res);\n } else {\n $this->result = -1;\n }\n return $this->result;\n }\n\n}\n\n$test = new Companions();\n\necho $test->execute();\n\n?>"}, {"source_code": "init();\n }\n // init params\n private function init()\n {\n fscanf(STDIN, \"%d %d\", $this->count, $this->volume);\n $this->poured = explode (\" \", trim(fgets(STDIN)));\n }\n\n public function execute()\n {\n $maxVolume = $this->volume + array_sum($this->poured);\n $dose = $maxVolume/$this->count;\n if (is_int($dose)){\n $res = array();\n foreach($this->poured as $k => $v){\n $res[] = number_format(($dose - $v), 6, '.', '');\n }\n $this->result = implode(\"\\n\", $res);\n } else {\n $this->result = -1;\n }\n return $this->result;\n }\n\n}\n\n$test = new Companions();\n\necho $test->execute();\n\n?>"}, {"source_code": "init();\n }\n // init params\n private function init()\n {\n fscanf(STDIN, \"%d %d\", $this->count, $this->volume);\n $this->poured = explode (\" \", trim(fgets(STDIN)));\n }\n\n public function execute()\n {\n $maxVolume = $this->volume + array_sum($this->poured);\n $dose = $maxVolume/$this->count;\n if ($dose*$this->count == $maxVolume and $this->volume > $dose){\n $res = array();\n foreach($this->poured as $k => $v){\n $res[] = number_format(($dose - $v), 6, '.', '');\n }\n $this->result = implode(\"\\n\", $res);\n } else {\n $this->result = -1;\n }\n return $this->result;\n }\n\n}\n\n$test = new Companions();\necho $test->execute();\n\n?>"}, {"source_code": "init();\n }\n // init params\n private function init()\n {\n fscanf(STDIN, \"%d %d\", $this->count, $this->volume);\n $this->poured = explode (\" \", trim(fgets(STDIN)));\n\n }\n\n public function execute()\n {\n $maxVolume = $this->volume + array_sum($this->poured);\n $dose = $maxVolume/$this->count;\n if ($dose*$this->count == $maxVolume and $this->volume >= $dose){\n $res = array();\n foreach($this->poured as $k => $v){\n $res[] = number_format(($dose - $v), 6, '.', '');\n }\n $this->result = implode(\"\\n\", $res);\n } else {\n $this->result = -1;\n }\n return $this->result;\n }\n\n}\n\n$test = new Companions();\necho $test->execute();\n\n?>"}, {"source_code": "init();\n }\n // init params\n private function init()\n {\n fscanf(STDIN, \"%d %d\", $this->count, $this->volume);\n $this->poured = explode (\" \", trim(fgets(STDIN)));\n\n }\n\n public function execute()\n {\n $maxVolume = $this->volume + array_sum($this->poured);\n $dose = $maxVolume/$this->count;\n if ($dose*$this->count == $maxVolume){\n $res = array();\n $all = 0;\n\n foreach($this->poured as $v){\n $res[] = number_format(($dose - $v), 6, '.', '');\n $all += abs($dose-$v);\n }\n $this->result = ($this->volume - $all) ? -1 : implode(\"\\n\", $res);\n\n } else {\n $this->result = -1;\n }\n return $this->result;\n }\n\n}\n\n$test = new Companions();\necho $test->execute();\n\n?>"}, {"source_code": "init();\n }\n // init params\n private function init()\n {\n fscanf(STDIN, \"%d %d\", $this->count, $this->volume);\n $this->poured = explode (\" \", trim(fgets(STDIN)));\n }\n\n public function execute()\n {\n $maxVolume = $this->volume + array_sum($this->poured);\n $dose = $maxVolume/$this->count;\n if (($dose*$this->count == $maxVolume) and ($dose <= $this->volume)){\n $res = array();\n foreach($this->poured as $k => $v){\n $res[] = number_format(($dose - $v), 6, '.', '');\n }\n $this->result = implode(\"\\n\", $res);\n } else {\n $this->result = -1;\n }\n return $this->result;\n }\n\n}\n\n$test = new Companions();\n\necho $test->execute();\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "65fea461d3caa5a932d1e2c13e99a59e"} {"source_code": " $value) {\n $aArray[$value] = array($i, $index + 1);\n }\n}\nkrsort($aArray);\n\n$result = array();\nforeach ($aArray as $value => $c) {\n if (!isset($result[$c[0]]) && !isset($result[$c[1]])) {\n $result[$c[0]] = $c[1];\n $result[$c[1]] = $c[0];\n }\n if (count($result) == $n) {\n break;\n }\n}\nfor ($i = 1; $i <= $n; $i++) {\n echo $result[$i] . \" \";\n}", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": " $f)\n {\n $e = $y;\n $f = $g;\n }\n }\n for($y = 0; $y < $e + 1; $y++)\n {\n if($b[$e][$y] == $f)\n {\n break;\n }\n } \n $d[$e + 2] = $y + 1;\n $d[$y + 1] = $e + 2;\n unset($b[$e]);\n for($z = 0; $z < ($a * 2) - 1; $z++)\n {\n unset($b[$z][$y]);\n unset($b[$z][$e + 1]);\n }\n}\nksort($d);\nprint implode(\" \", $d);\n?>"}, {"source_code": " $f)\n {\n $e = $y;\n $f = $g;\n }\n }\n for($y = 0; $y < $e + 1; $y++)\n {\n if($b[$e][$y] == $f)\n {\n break;\n }\n } \n $d[$e + 2] = $y + 1;\n $d[$y + 1] = $e + 2;\n unset($b[$e]);\n for($z = 0; $z < ($a * 2) - 1; $z++)\n {\n unset($b[$z][$y]);\n }\n}\n$h = range(1, $a * 2);\narray_unshift($h, \" \");\nunset($h[0]);\n$i = array_diff($h, $d);\nsort($i);\n$d[$i[0]] = $i[1];\n$d[$i[1]] = $i[0];\nksort($d);\nprint implode(\" \", $d);\n?>"}], "src_uid": "8051385dab9d7286f54fd332c64e836e"} {"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$tc = $ir->readInt();\n\n$possibles = $ir->readArrayOfInt(0);\nunset($possibles[0]);\n\nif (count($possibles) > 1) {\n\tfor ($i=2; $i<=$tc; $i++) {\n\t\t$ps = $ir->readArrayOfInt(0);\n\t\tunset($ps[0]);\n\t\t\n\t\t$possibles = array_intersect($possibles, $ps);\n\t}\n}\n\necho implode(' ', $possibles);\n", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}], "src_uid": "16c54cf7d8b484b5e22a7d391fdc5cd3"} {"source_code": "", "positive_code": [{"source_code": " 0)\n {\n $temp--;\n printf(((($sk - $t) / $k) + 1));\n }\n else\n {\n printf((($sk - $t) / $k));\n }\n printf(' ');\n }\n \n for ($i = 1; $i <= ($n - $k); $i++)\n {\n $t = ($sall - $sk) % ($n - $k);\n $numb = ($sall - $sk - $t) / ($n - $k);\n if ($i <= $t)\n {\n printf($numb + 1);\n }\n else\n {\n printf($numb);\n }\n printf (' '); \n }\n \n \n \n?>"}], "negative_code": [{"source_code": "= $k)\n{\n for($x = 1; $x < $b; $x++)\n {\n $l = $x % 2;\n if($l != 0)\n {\n print $j . \" \";\n }\n else\n {\n print $i . \" \";\n }\n }\n $l = $x % 2;\n if($l != 0)\n {\n print $j;\n }\n else\n {\n print $i;\n }\n}\n$g = $e - $f;\n$h = $a - $b;\n$i = $g / $h;\n$j = $g % $h;\n$k = floor($g / $h);\n$l = ceil($g / $h);\n$m = ($k + $l) / 2;\nif($j == 0)\n{\n for($x = 1; $x <= $h; $x++)\n {\n print \" \" . $i;\n }\n}\nelseif($i < $m)\n{\n for($x = 1; $x <= $h; $x++)\n {\n $n = $x % 2;\n if($n != 0)\n {\n print \" \" . $k;\n }\n else\n {\n print \" \" . $l;\n }\n }\n}\nelseif($g >= $k)\n{\n for($x = 1; $x <= $h; $x++)\n {\n $n = $x % 2;\n if($n != 0)\n {\n print \" \" . $l;\n }\n else\n {\n print \" \" . $k;\n }\n }\n}\n?>"}, {"source_code": "= $k)\n{\n for($x = 1; $x < $b; $x++)\n {\n $l = $x % 2;\n if($l != 0)\n {\n print $j . \" \";\n }\n else\n {\n print $i . \" \";\n }\n }\n $l = $x % 2;\n if($l != 0)\n {\n print $j;\n }\n else\n {\n print $i;\n }\n}\n$g = $e - $f;\n$h = $a - $b;\n$i = $g / $h;\n$j = $g % $h;\n$k = floor($g / $h);\n$l = ceil($g / $h);\n$m = ($k + $l) / 2;\nif($j == 0)\n{\n for($x = 1; $x <= $h; $x++)\n {\n print \" \" . $i;\n }\n}\nelseif($i < $m)\n{\n for($x = 1; $x <= $h; $x++)\n {\n $n = $x % 2;\n if($n != 0)\n {\n print \" \" . $k;\n }\n else\n {\n print \" \" . $l;\n }\n }\n}\nelseif($g >= $k)\n{\n for($x = 1; $x <= $h; $x++)\n {\n $n = $x % 2;\n if($n != 0)\n {\n print \" \" . $l;\n }\n else\n {\n print \" \" . $k;\n }\n }\n}\n?>"}, {"source_code": ""}], "src_uid": "59154ca15716f0c1c91a37d34c5bbf1d"} {"source_code": " 1, $d[1] => 1, $d[2] => 1);\n if(($e[R] == 1) && ($e[L] == 1))\n {\n print \"2\\nRL\\n\";\n }\n elseif(($e[U] == 1) && ($e[D] == 1))\n {\n print \"2\\nUD\\n\";\n }\n }\n elseif(count($c) == 4)\n {\n $f = \"\";\n if($d[0] == L)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == R)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == U)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == D)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " 0,\n 'R' => 0,\n 'U' => 0,\n 'D' => 0\n );\n $p = array(\n 'L' => false,\n 'R' => false,\n 'U' => false,\n 'D' => false\n );\n foreach($a as $v){\n $m[trim($v)] += 1;\n $p[trim($v)] = true;\n }\n $x = 0;\n $y = 0;\n $res = '';\n if($m['L'] != $m['R']){\n if($m['L'] > $m['R']){\n $x = $m['R'];\n if($m['U'] == false || $m['D'] == false){\n $x = 1;\n }\n } else {\n $x = $m['L'];\n if($m['U'] == false || $m['D'] == false){\n $x = 1;\n }\n }\n }\n if($m['U'] != $m['D']){\n if($m['U'] > $m['D']){\n $y = $m['D'];\n if($m['L'] == false || $m['R'] == false){\n $y = 1;\n }\n } else {\n $y = $m['U'];\n \n }\n }\n if($m['L'] == false || $m['R'] == false){\n $y = 1;\n }\n if($m['U'] == false || $m['D'] == false){\n $x = 1;\n }\n \n if($x == 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $m['L']; $i++){\n $res .= 'L';\n }\n }\n if($x != 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $x; $i++){\n $res .= 'L';\n }\n }\n if($y == 0 && ($p['U'] && $p['D'])){\n for($i = 0; $i < $m['U']; $i++){\n $res .= 'U';\n }\n }\n if($y != 0 && ($p['U'] && $p['D'])){\n for($i = 0; $i < $y; $i++){\n $res .= 'U';\n }\n }\n if($x == 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $m['L']; $i++){\n $res .= 'R';\n }\n }\n if($x != 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $x; $i++){\n $res .= 'R';\n }\n }\n if(($y == 0 && $p['D']) && $p['U']){\n for($i = 0; $i < $m['D']; $i++){\n $res .= 'D';\n }\n }\n if($y != 0 && ($p['D'] && $p['U'])){\n for($i = 0; $i < $y; $i++){\n $res .= 'D';\n }\n }\n \n echo strlen($res).\"\\n\";\n echo $res.\"\\n\";\n}"}], "negative_code": [{"source_code": " 1, $d[1] => 1, $d[2] => 1);\n if(($e[R] == 1) && ($e[L] == 1))\n {\n print \"2\\nRL\\n\";\n }\n elseif(($e[U] == 1) && ($e[D] == 1))\n {\n print \"2\\nUD\\n\";\n }\n }\n elseif(count($c) == 4)\n {\n $f = \"\";\n if($d[0] == L)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == R)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == U)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == D)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " 1, $d[1] => 1, $d[2] => 1);\n if(($e[R] == 1) && ($e[L] == 1))\n {\n print \"2\\nRL\\n\";\n }\n elseif(($e[U] == 1) && ($e[D] == 1))\n {\n print \"2\\nUD\\n\";\n }\n }\n elseif(count($c) == 4)\n {\n $f = \"\";\n if(($d[0] == L) || ($d[0] == R))\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif(($d[0] == U) || ($d[0] == D))\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " 1, $d[1] => 1, $d[2] => 1);\n if(($e[R] == 1) && ($e[L] == 1))\n {\n print \"2\\nRL\\n\";\n }\n elseif(($e[U] == 1) && ($e[D] == 1))\n {\n print \"2\\nUD\\n\";\n }\n }\n elseif(count($c) == 4)\n {\n $f = \"\";\n if($d[0] == L)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == R)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == U)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == D)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " 1, $d[1] => 1, $d[2] => 1);\n if(($e[R] == 1) && ($e[L] == 1))\n {\n print \"2\\nRL\\n\";\n }\n elseif(($e[U] == 1) && ($e[D] == 1))\n {\n print \"2\\nUD\\n\";\n }\n }\n elseif(count($c) == 4)\n {\n $f = \"\";\n if(($d[0] == L) || ($d[0] == R))\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif(($d[0] == U) || ($d[0] == D))\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " 1, $d[1] => 1, $d[2] => 1);\n if(($e[R] == 1) && ($e[L] == 1))\n {\n print \"2\\nRL\\n\";\n }\n elseif(($e[U] == 1) && ($e[D] == 1))\n {\n print \"2\\nUD\\n\";\n }\n }\n elseif(count($c) == 4)\n {\n $f = \"\";\n if($d[0] == L)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == R)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $r; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == U)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif($d[0] == D)\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n }\n}\n?>"}, {"source_code": " 1, $d[1] => 1, $d[2] => 1);\n if(($e[R] == 1) && ($e[L] == 1))\n {\n print \"2\\nRL\\n\";\n }\n elseif(($e[U] == 1) && ($e[D] == 1))\n {\n print \"2\\nUD\\n\";\n }\n }\n elseif(count($c) == 4)\n {\n if($a == 1)\n {\n print_r($c);\n }\n $f = \"\";\n if(($d[0] == L) || ($d[0] == R))\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < $l; $y++)\n {\n $f .= \"R\";\n }\n for($y = 0; $y < min($u, $d2); $y++)\n {\n $f .= \"D\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n elseif(($d[0] == U) || ($d[0] == D))\n {\n for($y = 0; $y < 4; $y++)\n {\n if($d[$y] == U)\n {\n $u = $c[U];\n }\n if($d[$y] == R)\n {\n $r = $c[R];\n }\n if($d[$y] == D)\n {\n $d2 = $c[D];\n }\n if($d[$y] == L)\n {\n $l = $c[L];\n }\n }\n for($y = 0; $y < $u; $y++)\n {\n $f .= \"U\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"L\";\n }\n for($y = 0; $y < $d2; $y++)\n {\n $f .= \"D\";\n }\n for($y = 0; $y < min($l, $r); $y++)\n {\n $f .= \"R\";\n }\n print strlen($f) . \"\\n\";\n print $f . \"\\n\";\n }\n }\n}\n?>"}, {"source_code": " 0,\n 'R' => 0,\n 'U' => 0,\n 'D' => 0\n );\n $p = array(\n 'L' => false,\n 'R' => false,\n 'U' => false,\n 'D' => false\n );\n foreach($a as $v){\n $m[trim($v)] += 1;\n $p[trim($v)] = true;\n }\n $x = 0;\n $y = 0;\n $res = '';\n if($m['L'] != $m['R']){\n if($m['L'] > $m['R']){\n $x = $m['R'];\n } else {\n $x = $m['L'];\n }\n }\n if($m['U'] != $m['D']){\n if($m['U'] > $m['D']){\n $y = $m['D'];\n } else {\n $y = $m['U'];\n }\n }\n if($x == 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $m['L']; $i++){\n $res .= 'L';\n }\n }\n if($x != 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $x; $i++){\n $res .= 'L';\n }\n }\n if($y == 0 && ($p['U'] && $p['D'])){\n for($i = 0; $i < $m['U']; $i++){\n $res .= 'U';\n }\n }\n if($y != 0 && ($p['U'] && $p['D'])){\n for($i = 0; $i < $y; $i++){\n $res .= 'U';\n }\n }\n if($x == 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $m['L']; $i++){\n $res .= 'R';\n }\n }\n if($x != 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $x; $i++){\n $res .= 'R';\n }\n }\n if(($y == 0 && $p['D']) && $p['U']){\n for($i = 0; $i < $m['D']; $i++){\n $res .= 'D';\n }\n }\n if($y != 0 && ($p['D'] && $p['U'])){\n for($i = 0; $i < $y; $i++){\n $res .= 'D';\n }\n }\n \n echo strlen($res).\"\\n\";\n echo $res.\"\\n\";\n}"}, {"source_code": " 0,\n 'R' => 0,\n 'U' => 0,\n 'D' => 0\n );\n $p = array(\n 'L' => false,\n 'R' => false,\n 'U' => false,\n 'D' => false\n );\n foreach($a as $v){\n $m[trim($v)] += 1;\n $p[trim($v)] = true;\n }\n $x = 0;\n $y = 0;\n $res = '';\n if($m['L'] != $m['R']){\n if($m['L'] > $m['R']){\n $x = $m['R'];\n } else {\n $x = $m['L'];\n }\n }\n if($m['U'] != $m['D']){\n if($m['U'] > $m['D']){\n $y = $m['D'];\n } else {\n $y = $m['U'];\n }\n }\n if($x == 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $m['L']; $i++){\n $res .= 'L';\n }\n }\n if($x != 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $x; $i++){\n $res .= 'L';\n }\n }\n if($y == 0 && ($p['U'] && $p['D'])){\n for($i = 0; $i < $m['U']; $i++){\n $res .= 'U';\n }\n }\n if($y != 0 && ($p['U'] && $p['D'])){\n for($i = 0; $i < $y; $i++){\n $res .= 'U';\n }\n }\n if($x == 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $m['L']; $i++){\n $res .= 'R';\n }\n }\n if($x != 0 && ($p['R'] && $p['L'])){\n for($i = 0; $i < $x; $i++){\n $res .= 'R';\n }\n }\n if(($y == 0 && $p['D']) && $p['U']){\n for($i = 0; $i < $m['D']; $i++){\n $res .= 'D';\n }\n }\n if($y != 0 && ($p['D'] && $p['U'])){\n for($i = 0; $i < $y; $i++){\n $res .= 'D';\n }\n }\n \n echo strlen($res).\"\\n\";\n echo $res.\"\\n\";\n}"}], "src_uid": "1fba9a290d0492a3d658a7a33388db13"} {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\t//echo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$step\\n\";\n} else {\n\techo \"-1\\n\";\n}\n", "positive_code": [{"source_code": " 0; $x--)\n {\n if($c[$x] != $c[$b - 1])\n {\n $g = $x;\n break;\n }\n }\n $f = array_slice($c, 0, $x + 1);\n print count($f);\n }\n}\n?>"}, {"source_code": "\n\n= 0 && $a[$answer] == $a[$n-1]) {\n $answer --;\n}\n\nprintf(\"%d\", $answer + 1);\n\n?>\n"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\techo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\techo \"{$c[$x]} $cnt\\n\";\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\t//echo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1, 1 => 1));\n$cnt = count($c);\n$step = 0;\nwhile ($step < $n && $cnt > 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\techo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\techo \"{$c[$x]} $cnt\\n\";\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\techo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\techo \"{$c[$x]} $cnt\\n\";\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\techo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\tif (--$c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\t//echo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\t//echo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\techo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\t//echo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\t$c[$x]--;\n\tif ($c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": " 1) {\n\t$i = $step % $n;\n\t$x = $a[$i];\n\t$j = ($step + $k - 1) % $n;\n\t$y = $a[$j];\n\t//echo \"$i $x $j $y\\n\";\n\t$a[$i] = $y;\n\t$c[$y]++;\n\tif (--$c[$x] == 0) {\n\t\t$cnt--;\n\t}\n\t$step++;\n}\nif ($cnt == 1) {\n\techo \"$cnt\\n\";\n} else {\n\techo \"-1\\n\";\n}\n"}, {"source_code": "\n\n 0 && $a[$answer] != $a[$k]) {\n $answer --;\n}\n\nprintf(\"%d\", $answer + 1);\n\n?>\n"}], "src_uid": "bcee233ddb1509a14f2bd9fd5ec58798"} {"source_code": "=0;$i--){\n //$b = array_slice($a,$i-1,$n-$i+1);\n //print_r(\" x = $a[$i] \");\n\n $x = $a[$i];\n\n if (!isset($r[$x])){\n //echo \"IN \\n\";\n $r[$x] = 1;\n $t[$i] = ++$count;\n\n } else {\n //echo \"NOT IN \\n\";\n $t[$i] = $count;\n }\n}\n\nfor($i=0;$i<$m;$i++){\n $x = trim(fgets($f));\n echo $t[$x-1].\"\\n\";\n}\n\n/*\n$d = array();\nfor($i=$m;$i>0;$i++){\n $b = array_slice($a,$x-1);\n\n $r = array();\n foreach($b as $y){\n $r[$y]=1;\n }\n echo count($r).\"\\n\";\n}*/\n", "positive_code": [{"source_code": "= 0; $x--)\n{\n $d[$c[$x]]++;\n $e[$x] = count($d);\n}\n$e = array_reverse($e);\nfor($x = 0; $x < $b; $x++)\n{\n $f = trim(fgets(STDIN));\n print $e[$f - 1] . \"\\n\";\n}\n$f = trim(fgets(STDIN));\nprint $e[$f - 1];\n?>"}, {"source_code": "=0;$i--){\n if(!isset($visited[$arr[$i]]))\n {\n $visited[$arr[$i]]=$count++;\n }\n $distinct[$i]=$count;\n}\n\nfor($i=0;$i<$m;$i++){\n fscanf(STDIN,\"%d\",$l);\n echo $distinct[$l-1].\"\\n\"; \n}\n"}], "negative_code": [{"source_code": ""}, {"source_code": "=0;$i--){\n if(!isset($visited[$arr[$i]]))\n $visited[$arr[$i]]=$count++;\n $distinct[$i]=$count;\n}\n\nfor($i=0;$i<$m;$i++){\n fscanf(STDIN,\"%d\",$l);\n echo $distinct[$l-1].\"\\n\"; \n}\n"}], "src_uid": "1e156dfc65ef88f19ca1833f75192259"} {"source_code": "", "positive_code": [{"source_code": "\n"}, {"source_code": "$last)\n {\n $count++;\n $last=$a[$i];\n }\n }\n echo $count.\"\\n\";\n}\n"}, {"source_code": ""}], "negative_code": [{"source_code": "\n"}, {"source_code": " 1) \n\t { \n\t $m = (int)($l + ($r - $l)/2); \n\t if ($A[$m] >= $key) \n\t $r = $m; \n\t else\n\t $l = $m; \n\t } \n\t return $r; \n\t} \n \n\tfunction LIS($A, $size) \n\t{ \n\t $tailTable = array_fill(0, ($size + 1), 0); \n\t $len = 0;\n\t \n\t $tailTable[0] = $A[0]; \n\t $len = 1; \n\t for($i = 1; $i < $size; $i++) \n\t { \n\t \n\t if ($A[$i] < $tailTable[0]) \n\t $tailTable[0] = $A[$i]; \n\t \n\t else if ($A[$i] > $tailTable[$len-1]) \n\t { \n\t $tailTable[$len] = $A[$i]; \n\t $len++; \n\t } \n\t else\n\t $tailTable[CeilIndex($tailTable, -1, $len-1, $A[$i])] = $A[$i]; \n\t \n\t } \n\t return $len; \n\t} \n\n\t$ans = '';\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$lis = LIS($a, $n);\n\t\tif ($lis == 1) {\n\t\t\t$a = array_reverse($a);\n\t\t\t$ans .= LIS($a, $n).\"\\n\";\n\t\t} else {\n\t\t\t$a = array_merge($a, $a);\n\t\t\t$ans .= LIS($a, $n*2).\"\\n\";\n\t\t}\n\t}\n\n\tprint $ans;\n?>"}, {"source_code": " 1) \n\t { \n\t $m = (int)($l + ($r - $l)/2); \n\t if ($A[$m] >= $key) \n\t $r = $m; \n\t else\n\t $l = $m; \n\t } \n\t return $r; \n\t} \n \n\tfunction LIS($A, $size) \n\t{ \n\t $tailTable = array_fill(0, ($size + 1), 0); \n\t $len = 0;\n\t \n\t $tailTable[0] = $A[0]; \n\t $len = 1; \n\t for($i = 1; $i < $size; $i++) \n\t { \n\t \n\t if ($A[$i] < $tailTable[0]) \n\t $tailTable[0] = $A[$i]; \n\t \n\t else if ($A[$i] > $tailTable[$len-1]) \n\t { \n\t $tailTable[$len] = $A[$i]; \n\t $len++; \n\t } \n\t else\n\t $tailTable[CeilIndex($tailTable, -1, $len-1, $A[$i])] = $A[$i]; \n\t \n\t } \n\t return $len; \n\t} \n\n\t$ans = '';\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$lis = LIS($a, $n);\n\t\tif ($lis == 1) {\n\t\t\t$ans .= $n.\"\\n\";\n\t\t} else {\n\t\t\t$a = array_merge($a, $a);\n\t\t\t$ans .= LIS($a, $n*2).\"\\n\";\n\t\t}\n\t}\n\n\tprint $ans;\n?>"}], "src_uid": "b978ca6fdef4a02cc027485294caa0f5"} {"source_code": " $last_card) {\n ($count % 2) ? $dima += $first_card : $sereja += $first_card;\n unset($cards[0]);\n $cards = array_values($cards);\n $count++;\n continue;\n }\n\n ($count % 2) ? $dima += $last_card : $sereja += $last_card;\n unset($cards[$arr_count-1]);\n $cards = array_values($cards);\n $count++;\n}\n\n\necho \"$sereja $dima\\n\";\n", "positive_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++];}} \n/*init*/ $dxs = new stdIn(false);\n# DECLARE FUNCTIONS #\n\n$ser = 0;\n$dim = 0;\n\n# MAIN CODE \n\n$a = $dxs->G();\nfor($i=0;$i<$a;$i++){\n$b[]=$dxs->G();\n}\n\nfor($z=0;$z<$a;$z++){\n$ca = count($b);\n$max = max($b[0],$b[$ca-1]);\n\n#echo \"$z | max(\".$b[0].\"\".$b[$ca].\") res = $max\";\n\n\nif($b[0]==$max){\nunset($b[0]);$b=array_values($b);}\nif($b[$ca-1]==$max){\nunset($b[$ca-1]);$b=array_values($b);}\n\nif($z%2===0){\n$ser = $ser+$max;\n}else{\n$dim = $dim+$max;\n}\n\n}\n\n\n# PRINT OUTPUT \n\necho \"$ser $dim\";\n?>"}, {"source_code": "= $b[$d]) && (($x % 2) == 1))\n {\n $e += $b[$c];\n $c++;\n }\n elseif(($b[$c] >= $b[$d]) && (($x % 2) == 0))\n {\n $f += $b[$c];\n $c++;\n }\n elseif(($b[$c] <= $b[$d]) && (($x % 2) == 1))\n {\n $e += $b[$d];\n $d--;\n }\n elseif(($b[$c] <= $b[$d]) && (($x % 2) == 0))\n {\n $f += $b[$d];\n $d--;\n }\n}\nprint $e . \" \" . $f;\n?>"}, {"source_code": " $i; $i++) {\n $count = count($c) - 1;\n if($c[0] > $c[$count]){\n $x= $c[0];\n unset($c[0]); \n $c = array_values($c);\n } else {\n $x= $c[$count];\n unset($c[$count]); \n }\n if($i % 2 == 0){\n $s+=$x;\n } else {\n $d+=$x;\n }\n}\n\necho $s . ' ' . $d;\n\n"}, {"source_code": "= $cards[$last]) {\n ($i % 2) ? $dima += $cards[$first] : $sereja += $cards[$first];\n $first++;\n continue;\n }\n\n ($i % 2) ? $dima += $cards[$last] : $sereja += $cards[$last];\n $last--;\n}\n\n\necho \"$sereja $dima\\n\";\n"}, {"source_code": " $cards[$last]) {\n ($count % 2) ? $dima += $cards[$first] : $sereja += $cards[$first];\n $first++;\n $count++;\n continue;\n }\n\n ($count % 2) ? $dima += $cards[$last] : $sereja += $cards[$last];\n $last--;\n $count++;\n}\n\n\necho \"$sereja $dima\\n\";\n"}, {"source_code": "$arr[$r]){\n\t\tif($flag){\n\t\t\t$a+=$arr[$l];\n\t\t\t$l++;\n\t\t\t$flag=!$flag;\n\t\t}else{\n\t\t\t$b+=$arr[$l];\n\t\t\t$l++;\n\t\t\t$flag=!$flag;\n\t\t}\n\t}else{\n\t\tif($flag){\n\t\t\t$a+=$arr[$r];\n\t\t\t$r--;\n\t\t\t$flag=!$flag;\n\t\t}else{\n\t\t\t$b+=$arr[$r];\n\t\t\t$r--;\n\t\t\t$flag=!$flag;\n\t\t}\n\t}\n}\necho $a.\" \".$b;\n?>"}, {"source_code": " $nums[$n-1-$kon]){\n if ($igrok == 0){\n $one += $nums[0+$nach];\n $igrok = 1;\n }else{\n $two += $nums[0+$nach];\n $igrok = 0;\n }\n $nach++;\n $i++;\n continue;\n }\n \n if ($nums[0+$nach] < $nums[$n-1-$kon]){\n if ($igrok == 0){\n $one += $nums[$n-1-$kon];\n $igrok = 1;\n }else{\n $two += $nums[$n-1-$kon];\n $igrok = 0;\n }\n $kon++;\n $i++;\n continue;\n }\n \n if ($nums[0+$nach] == $nums[$n-1-$kon]){\n if ($igrok == 0){\n $one += $nums[$n-1-$kon];\n $igrok = 1;\n }else{\n $two += $nums[$n-1-$kon];\n $igrok = 0;\n }\n $kon++;\n $i++;\n continue;\n }\n } \n\n fwrite(STDOUT, $one.\" \".$two);\n?>"}, {"source_code": " 0){\n $temp = count($arr);\n\n if($arr[0] > $arr[$temp - 1] ){\n $numberChoose = $arr[0];\n array_splice($arr,0,1);\n //Remove first\n }\n else{\n $numberChoose = $arr[$temp - 1];\n array_splice($arr,$temp - 1,1);\n }\n if($turnSereja){\n $Sereja += $numberChoose;\n }\n else{\n $Dima += $numberChoose;\n }\n $turnSereja = !$turnSereja;\n }\n echo $Sereja.\" \".$Dima;\n}\n\ntest($arr);\n\n\n\n"}, {"source_code": " $a[$l2]) {\n\t\t$p = $j % 2;\n\t\t$s[$p] += $a[$l1];\n\t\t$l1++;\n\t}\n\telse {\n\t\t$p = $j % 2;\n\t\t$s[$p] += $a[$l2];\n\t\t$l2--;\n\t}\n}\n\nprint $s[0].' '.$s[1];"}, {"source_code": "= $start )\n{\n if( $arr[ $start ] >= $arr[ $end ] )\n {\n if( $done == 1 )\n {\n $sereja = intval($sereja) + intval($arr[ $start ] ) ;\n $done = 2 ;\n }\n else\n {\n $dima = intval($dima) + intval($arr[ $start ] ) ;\n $done = 1 ;\n }\n $start++ ;\n }\n else\n {\n if( $done == 1 )\n {\n $sereja = intval($sereja) + intval($arr[ $end ] ) ;\n $done = 2 ;\n }\n else\n {\n $dima = intval($dima) + intval($arr[ $end ] ) ;\n $done = 1 ;\n\n }\n $end-- ;\n }\n}\n\necho $sereja . \" \" . $dima ;\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n\n?>"}, {"source_code": "$cards[$l]){\n $r--;\n }else{\n $l++;\n }\n}\necho ($S .' '.$D);"}, {"source_code": " $arr[$left]) {\n\n $max = $arr[$right];\n $right--;\n } else {\n\n $max = $arr[$left];\n $left++;\n }\n\n if ($turn % 2 == 0) {\n $s += $max;\n } else {\n $d += $max;\n }\n\n $turn++;\n}\n\necho $s, ' ', $d;"}, {"source_code": " 1)\n\t{\n\t\tif($arr[0] > $arr[count($arr)-1])\n\t\t{\n\t\t\t$t = array_reverse($arr);\n\t\t\t$element = array_pop($t);\n\t\t\t$arr = $t;\n\t\t\t$arr = array_reverse($arr);\n\t\t}\n\t\telse if($arr[0] < $arr[count($arr)-1])\n\t\t{\n\t\t\t$element = array_pop($arr);\n\t\t}\n\n\t\tif($turns)\n\t\t\t$seja += $element;\n\t\telse \n\t\t\t$dima += $element;\n\n\t\t$turns = !$turns;\n\t}\n\n\tif( $n % 2 == 0 )\n\t\t$dima += $arr[0];\n\telse \n\t\t$seja += $arr[0];\n\n\techo $seja . \" \" . $dima;\n\t\n?>"}], "negative_code": [{"source_code": " $i; $i++) {\n if($i % 2 == 0){\n $s+=$c[$i];\n } else {\n $d+=$c[$i];\n }\n}\n\necho $s . ' ' . $d;\n"}, {"source_code": "$arr[$r]){\n\t\tif($flag){\n\t\t\t$a+=$arr[$l];\n\t\t\t$l++;\n\t\t\t$flag=!$flag;\n\t\t}else{\n\t\t\t$b+=$arr[$l];\n\t\t\t$l++;\n\t\t\t$flag=!$flag;\n\t\t}\n\t}else{\n\t\tif($flag){\n\t\t\t$a+=$arr[$r];\n\t\t\t$r--;\n\t\t\t$flag=!$flag;\n\t\t}else{\n\t\t\t$b+=$arr[$r];\n\t\t\t$r--;\n\t\t\t$flag=!$flag;\n\t\t}\n\t}\n\n}\necho $a.\" \".$b;\n?>"}, {"source_code": " $value) {\n\tif($i%2==0) $a+=$value;\n\telse $b+=$value;\n\t$i++;\n}\necho $a.\" \".$b;\n?>"}, {"source_code": "Scan();\n\t$inp_M = (int)$Scanner->Scan();\n\t$inp_X = $Scanner->Scan();\n\t$inp_Y = $Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$A_arr[] = $Scanner->Scan();\n\t}\n\n\t$posA = 0;\n\tfor ($j = 0; $j < $inp_M; $j++) {\n\t\t$temp = $Scanner->Scan();\n\t\tfor ($k = $posA; $k < $inp_N; $k++) {\n\t\t\tif ($A_arr[$k] - $inp_X <= $temp && $A_arr[$k] + $inp_Y >= $temp) {\n\t\t\t\t$K = $k+1;\n\t\t\t\t$J = $j+1;\n\t\t\t\t$arr[] = $K. \" \". $J;\n\t\t\t\t//print($K. \" \". $J);\n\t\t\t\t//print(\"\\n\");\n\t\t\t\t$posA = $K;\n\t\t\t\tbreak;\t\n\t\t\t} else {\n\t\t\t\tif ($A_arr[$k] - $inp_X > $temp) {\n\t\t\t\t\tbreak;\n\t\t\t\t} elseif ($A_arr[$k] + $inp_Y < $temp) {\n\t\t\t\t\t$posA = $k+1;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$len = count($arr);\n\tprint($len);\n\tprint(\"\\n\");\n\tfor ($i = 0; $i < $len; $i++) {\n\t\tif ($i != $len - 1) {\n\t\t\tprint($arr[$i]);\n\t\t\tprint(\"\\n\");\n\t\t} else {\n\t\t\tprint($arr[$i]);\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": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if((count($g) == $a) || (count($h) == $b))\n {\n break;\n }\n $k++;\n $l++;\n }\n elseif($f[$k] > $j)\n {\n $l++;\n }\n elseif($f[$k] < $i)\n {\n $k++;\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}], "negative_code": [{"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n $k++;\n $l++;\n }\n else\n {\n $k++;\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if(count($g) == $a)\n {\n break;\n }\n $k++;\n $l++;\n }\n elseif($f[$k] > $j)\n {\n $l++;\n }\n elseif($f[$k] < $i)\n {\n $k++;\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if(count($g) == $a)\n {\n break;\n }\n $k++;\n $l++;\n }\n else\n {\n $k++;\n }\n}\n$m = array();\n$n = array();\n$o = 0;\n$p = 0;\nfor($x = 0; $x < 100000; $x++)\n{\n $r = $e[$p] - $c;\n $s = $e[$p] + $d;\n if(($f[$o] >= $r) && ($f[$o] <= $s))\n {\n array_push($m, $p + 1);\n array_push($n, $o + 1);\n if(count($n) == $b)\n {\n break;\n }\n $o++;\n $p++;\n }\n else\n {\n $p++;\n }\n}\nif($g[count($g) - 1] <= $a)\n{\n if($m[count($m) - 1] <= $a)\n {\n if(count($g) >= count($m))\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n else\n {\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n }\n }\n else\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n}\nelseif($m[count($m) - 1] <= $a)\n{\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n}\n?>"}, {"source_code": "= $h) && ($e[$x] <= $i))\n {\n $j[$g] = $x + 1;\n $k[$g] = $g + 1;\n $g++;\n }\n}\nprint count($j) . \"\\n\";\nfor($x = 0; $x < count($j) - 1; $x++)\n{\n print $j[$x] . \" \" . $k[$x] . \"\\n\";\n}\nprint $j[$x] . \" \" . $k[$x];\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n $k++;\n $l++;\n }\n else\n {\n if(($a == 100000) && ($b == 100000))\n {\n $k++;\n $a++;\n }\n elseif($a >= $b)\n {\n $l++;\n }\n else\n {\n $k++;\n $a++;\n }\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $x + 1);\n array_push($h, $k + 1);\n $k++;\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "= $b)\n{\n for($x = 0; $x < $a; $x++)\n {\n $h = $e[$x] - $c;\n $i = $e[$x] + $d;\n if(($f[$g] >= $h) && ($f[$g] <= $i))\n {\n $j[$g] = $x + 1;\n $k[$g] = $g + 1;\n $g++;\n }\n }\n print count($j) . \"\\n\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $j[$x] . \" \" . $k[$x] . \"\\n\";\n }\n print $j[$x] . \" \" . $k[$x];\n}\nelse\n{\n for($x = 0; $x < $b; $x++)\n {\n $h = $f[$x] - $c;\n $i = $f[$x] + $d;\n if(($e[$g] >= $h) && ($e[$g] <= $i))\n {\n $j[$g] = $x + 1;\n $k[$g] = $g + 1;\n $g++;\n }\n }\n print count($j) . \"\\n\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $k[$x] . \" \" . $j[$x] . \"\\n\";\n }\n print $k[$x] . \" \" . $j[$x];\n}\n?>"}, {"source_code": "= $h) && ($f[$g] <= $i))\n {\n $j[$g] = $x + 1;\n $k[$g] = $g + 1;\n $g++;\n }\n}\nprint count($j) . \"\\n\";\nfor($x = 0; $x < count($j) - 1; $x++)\n{\n print $j[$x] . \" \" . $k[$x] . \"\\n\";\n}\nprint $j[$x] . \" \" . $k[$x];\n?>"}, {"source_code": "= $b)\n{\n for($x = 0; $x < $a; $x++)\n {\n $h = $e[$x] - $c;\n $i = $e[$x] + $d;\n if(($f[$g] >= $h) && ($f[$g] <= $i))\n {\n $j[$g] = $x + 1;\n $k[$g] = $g + 1;\n $g++;\n }\n }\n print count($j) . \"\\n\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $j[$x] . \" \" . $k[$x] . \"\\n\";\n }\n print $j[$x] . \" \" . $k[$x];\n}\nelse\n{\n for($x = 0; $x < $b; $x++)\n {\n $h = $e[$g] - $c;\n $i = $e[$g] + $d;\n if(($f[$x] >= $h) && ($f[$x] <= $i))\n {\n $j[$g] = $x + 1;\n $k[$g] = $g + 1;\n $g++;\n }\n }\n print count($j) . \"\\n\";\n for($x = 0; $x < count($j) - 1; $x++)\n {\n print $k[$x] . \" \" . $j[$x] . \"\\n\";\n }\n print $k[$x] . \" \" . $j[$x];\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if(count($g) == $a)\n {\n break;\n }\n $k++;\n $l++;\n }\n else\n {\n $k++;\n }\n}\n$m = array();\n$n = array();\n$o = 0;\n$p = 0;\nfor($x = 0; $x < 100000; $x++)\n{\n $r = $e[$p] - $c;\n $s = $e[$p] + $d;\n if(($f[$o] >= $r) && ($f[$o] <= $s))\n {\n array_push($m, $p + 1);\n array_push($n, $o + 1);\n if(count($o) == $b)\n {\n break;\n }\n $o++;\n $p++;\n }\n else\n {\n $p++;\n }\n}\nif($g[count($g) - 1] <= $a)\n{\n if($m[count($m) - 1] <= $a)\n {\n if(count($g) >= count($m))\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n else\n {\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n }\n }\n else\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n}\nelseif($m[count($m) - 1] <= $a)\n{\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n}\n?>"}, {"source_code": "= $g) && ($f[$x] <= $h))\n {\n $i[$x] = $y + 1;\n $j[$x] = $x + 1;\n $e[$y] = -1000000;\n break;\n }\n }\n}\nprint count($i) . \"\\n\";\nfor($x = 0; $x < count($i) - 1; $x++)\n{\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n}\nprint $i[$x] . \" \" . $j[$x];\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n $k++;\n $l++;\n }\n else\n {\n if(($a == 100000) && ($b == 100000))\n {\n $k++;\n }\n elseif($a >= $b)\n {\n $l++;\n }\n else\n {\n $k++;\n $a++;\n }\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "= $g) && ($f[$x] <= $h))\n {\n array_push($i, $y + 1);\n array_push($j, $x + 1);\n $e[$y] = -100;\n break;\n }\n }\n}\nprint count($i) . \"\\n\";\nfor($x = 0; $x < count($i) - 1; $x++)\n{\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n}\nprint $i[$x] . \" \" . $j[$x];\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n $k++;\n $l++;\n }\n else\n {\n if($a > $b)\n {\n $l++;\n }\n else\n {\n $k++;\n $a++;\n }\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "= $g) && ($f[$x] <= $h))\n {\n $i[$x] = $y + 1;\n $j[$x] = $x + 1;\n unset($e[$y]);\n break;\n }\n }\n}\nprint count($i) . \"\\n\";\nfor($x = 0; $x < count($i) - 1; $x++)\n{\n print $i[$x] . \" \" . $j[$x] . \"\\n\";\n}\nprint $i[$x] . \" \" . $j[$x];\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if(count($g) == $a)\n {\n break;\n }\n $k++;\n $l++;\n }\n else\n {\n $k++;\n }\n}\n$m = array();\n$n = array();\n$o = 0;\n$p = 0;\nfor($x = 0; $x < 100000; $x++)\n{\n $r = $e[$p] - $c;\n $s = $e[$p] + $d;\n if(($f[$o] >= $r) && ($f[$o] <= $s))\n {\n array_push($m, $p + 1);\n array_push($n, $o + 1);\n if(count($m) == $b)\n {\n break;\n }\n $o++;\n $p++;\n }\n else\n {\n $p++;\n }\n}\nif($g[count($g) - 1] <= $a)\n{\n if($m[count($m) - 1] <= $a)\n {\n if(count($g) >= count($m))\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n else\n {\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n }\n }\n else\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n}\nelseif($m[count($m) - 1] <= $a)\n{\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n $k++;\n $l++;\n }\n else\n {\n $k++;\n }\n}\n$m = array();\n$n = array();\n$o = 0;\n$p = 0;\nfor($x = 0; $x < 100000; $x++)\n{\n $r = $e[$p] - $c;\n $s = $e[$p] + $d;\n if(($f[$o] >= $r) && ($f[$o] <= $s))\n {\n array_push($m, $p + 1);\n array_push($n, $o + 1);\n $o++;\n $p++;\n }\n else\n {\n $p++;\n }\n}\nif($g[count($g) - 1] <= $a)\n{\n if($m[count($m) - 1] <= $a)\n {\n if(count($g) >= count($m))\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n else\n {\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n }\n }\n else\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n}\nelseif($m[count($m) - 1] <= $a)\n{\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if(count($g) == $a)\n {\n break;\n }\n $k++;\n $l++;\n }\n else\n {\n $k++;\n }\n}\n$m = array();\n$n = array();\n$o = 0;\n$p = 0;\nfor($x = 0; $x < 100000; $x++)\n{\n $r = $e[$p] - $c;\n $s = $e[$p] + $d;\n if(($f[$o] >= $r) && ($f[$o] <= $s))\n {\n array_push($m, $p + 1);\n array_push($n, $o + 1);\n if(count($n) == $b)\n {\n break;\n }\n $o++;\n $p++;\n }\n else\n {\n $p++;\n }\n}\nif(($a == 100000) && ($b == 100000))\n{\n print count($g) . \"\\n\";\n print count($m);\n}\nif($g[count($g) - 1] <= $a)\n{\n if($m[count($m) - 1] <= $a)\n {\n if(count($g) >= count($m))\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n else\n {\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n }\n }\n else\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n}\nelseif($m[count($m) - 1] <= $a)\n{\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if(count($g) == $a)\n {\n break;\n }\n $k++;\n $l++;\n }\n elseif($f[$k] > $j)\n {\n $l++;\n }\n elseif($f[$k] < $i)\n {\n $k++;\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n if(count($g) == $a)\n {\n break;\n }\n $k++;\n $l++;\n }\n else\n {\n $k++;\n }\n}\n$m = array();\n$n = array();\n$o = 0;\n$p = 0;\nfor($x = 0; $x < 200000; $x++)\n{\n $r = $e[$p] - $c;\n $s = $e[$p] + $d;\n if(($f[$o] >= $r) && ($f[$o] <= $s))\n {\n array_push($m, $p + 1);\n array_push($n, $o + 1);\n if(count($n) == $b)\n {\n break;\n }\n $o++;\n $p++;\n }\n else\n {\n $p++;\n }\n}\nif($g[count($g) - 1] <= $a)\n{\n if($m[count($m) - 1] <= $a)\n {\n if(count($g) >= count($m))\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n else\n {\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n }\n }\n else\n {\n if(count($g) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($g) . \"\\n\";\n for($x = 0; $x < count($g) - 1; $x++)\n {\n print $g[$x] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n }\n }\n}\nelseif($m[count($m) - 1] <= $a)\n{\n if(count($m) == 0)\n {\n print \"0\";\n }\n else\n {\n print count($m) . \"\\n\";\n for($x = 0; $x < count($m) - 1; $x++)\n {\n print $m[$x] . \" \" . $n[$x] . \"\\n\";\n }\n print $m[$x] . \" \" . $n[$x];\n }\n}\n?>"}, {"source_code": "= $i) && ($f[$k] <= $j))\n {\n array_push($g, $l + 1);\n array_push($h, $k + 1);\n $k++;\n $l++;\n }\n else\n {\n if($a >= $b)\n {\n $l++;\n }\n else\n {\n $k++;\n $a++;\n }\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] . \" \" . $h[$x] . \"\\n\";\n }\n print $g[$x] . \" \" . $h[$x];\n}\n?>"}, {"source_code": "Scan();\n\t$inp_M = (int)$Scanner->Scan();\n\t$inp_X = $Scanner->Scan();\n\t$inp_Y = $Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$A_arr[] = $Scanner->Scan();\n\t}\n\n\t$posA = 0;\n\tfor ($j = 0; $j < $inp_M; $j++) {\n\t\t$temp = $Scanner->Scan();\n\t\tfor ($k = $posA; $k < $inp_N; $k++) {\n\t\t\t\n\t\t\tif ($A_arr[$k] - $inp_X <= $temp && $A_arr[$k] + $inp_Y >= $temp) {\n\t\t\t\t$K = $k+1;\n\t\t\t\t$J = $j+1;\n\t\t\t\t$arr[] = $K. \" \". $J;\n\t\t\t\t//print($K. \" \". $J);\n\t\t\t\t//print(\"\\n\");\n\t\t\t\t$posA++;\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t}\n\t$len = count($arr);\n\tfor ($i = 0; $i < $len; $i++) {\n\t\tif ($i != $len - 1) {\n\t\t\tprint($arr[$i]);\n\t\t\tprint(\"\\n\");\n\t\t} else {\n\t\t\tprint($arr[$i]);\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_M = (int)$Scanner->Scan();\n\t$inp_X = $Scanner->Scan();\n\t$inp_Y = $Scanner->Scan();\n\t\n\tfor ($i = 0; $i < $inp_N; $i++) {\n\t\t$A_arr[] = $Scanner->Scan();\n\t}\n\n\t$posA = 0;\n\tfor ($j = 0; $j < $inp_M; $j++) {\n\t\t$temp = $Scanner->Scan();\n\t\tfor ($k = $posA; $k < $inp_N; $k++) {\n\t\t\t\n\t\t\tif ($A_arr[$k] - $inp_X <= $temp && $A_arr[$k] + $inp_Y >= $temp) {\n\t\t\t\t$K = $k+1;\n\t\t\t\t$J = $j+1;\n\t\t\t\t$arr[] = $K. \" \". $J;\n\t\t\t\t//print($K. \" \". $J);\n\t\t\t\t//print(\"\\n\");\n\t\t\t\t$posA++;\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t}\n\t$len = count($arr);\n\tprint($len);\n\tprint(\"\\n\");\n\t\n\tfor ($i = 0; $i < $len; $i++) {\n\t\tif ($i != $len - 1) {\n\t\t\tprint($arr[$i]);\n\t\t\tprint(\"\\n\");\n\t\t} else {\n\t\t\tprint($arr[$i]);\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": "c6bbb16b1a3946ce38e67dc4824ecf89"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "Scan();\n\t$A = (int)$Scanner->Scan();\n\t$B = (int)$Scanner->Scan();\n\tfor ($i = 0; $i < $N; $i++) {\n\t\t$Chores[] = $Scanner->Scan();\n\t}\n\t\n\trsort($Chores);\n\tprint($Chores[$A - 1] - $Chores[$A]);\n\t\n\tprint($taxi);\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": " 0 ?$result : 0 ;\n}\n\necho (test($x,$n,$a,$b));\n"}, {"source_code": " 0 ?$result : 0 ;\n}\n\necho (test($x,$n,$a,$b));\n"}, {"source_code": ""}, {"source_code": ""}], "src_uid": "d3c8c1e32dcf4286bef19e9f2b79c8bd"} {"source_code": ""}, {"source_code": " $value) {\n $key = array_search($value, $j);\n if($key === false){\n $j[$i] = $value;\n echo \"No\\n\";\n continue;\n }\n if($key < $i){\n echo \"Yes\\n\";\n }\n}\n"}, {"source_code": "\n", "positive_code": [{"source_code": " 0))\n {\n $h = ($g + 1) * 2;\n $e[$f] = $h;\n $f++;\n $g = 0;\n }\n }\n}\nfor($x = 0; $x < $b; $x++)\n{\n $g = 0;\n for($y = 0; $y < $a; $y++)\n {\n if(($c[$y][$x] == 0) && ($y == $a - 1))\n {\n $g++;\n $h = ($g + 1) * 2;\n $e[$f] = $h;\n $f++;\n }\n elseif($c[$y][$x] == 0)\n {\n $g++;\n }\n elseif(($c[$y][$x] == 1) && ($g > 0))\n {\n $h = ($g + 1) * 2;\n $e[$f] = $h;\n $f++;\n $g = 0;\n }\n }\n}\nfor($w = 0; $w < $a; $w++)\n{\n for($x = 0; $x < $b; $x++)\n {\n if($c[$w][$x] == 0)\n {\n $i = $b;\n $j = 0;\n $k = 0;\n for($y = $w; $y < $a; $y++)\n {\n $g = 0;\n if($c[$y][$x] == 1)\n {\n break;\n }\n for($z = $x; $z < $b; $z++)\n {\n if(($c[$y][$z] == 0) && ($z == $b - 1))\n {\n $g++;\n $i = min($i, $g);\n }\n elseif($c[$y][$z] == 0)\n {\n $g++;\n }\n elseif($c[$y][$z] == 1)\n {\n $i = min($i, $g);\n if($i == 0)\n {\n $i = 1;\n break;\n }\n break;\n }\n }\n $k++;\n $h = ($i + $k) * 2;\n $e[$f] = $h;\n $f++;\n }\n $h = ($i + $k) * 2;\n $e[$f] = $h;\n $f++;\n }\n }\n}\nprint max($e);\n?>"}], "negative_code": [{"source_code": " 0))\n {\n $h = ($g + 1) * 2;\n $e[$f] = $h;\n $f++;\n $g = 0;\n }\n }\n}\nfor($x = 0; $x < $b; $x++)\n{\n $g = 0;\n for($y = 0; $y < $a; $y++)\n {\n if(($c[$y][$x] == 0) && ($y == $a - 1))\n {\n $g++;\n $h = ($g + 1) * 2;\n $e[$f] = $h;\n $f++;\n }\n elseif($c[$y][$x] == 0)\n {\n $g++;\n }\n elseif(($c[$y][$x] == 1) && ($g > 0))\n {\n $h = ($g + 1) * 2;\n $e[$f] = $h;\n $f++;\n $g = 0;\n }\n }\n}\nfor($w = 0; $w < $a; $w++)\n{\n for($x = 0; $x < $b; $x++)\n {\n if($c[$w][$x] == 0)\n {\n $i = $b;\n $j = 0;\n $k = 0;\n for($y = $w; $y < $a; $y++)\n {\n $g = 0;\n if($c[$y][$x] == 1)\n {\n break;\n }\n for($z = $x; $z < $b; $z++)\n {\n if(($c[$y][$z] == 0) && ($z == $b - 1))\n {\n $g++;\n $i = min($i, $g);\n }\n elseif($c[$y][$z] == 0)\n {\n $g++;\n }\n elseif($c[$y][$z] == 1)\n {\n $i = min($i, $g);\n if($i == 0)\n {\n $i = 1;\n break;\n }\n break;\n }\n }\n if($j == 1)\n {\n break;\n }\n else\n {\n $k++;\n }\n }\n $h = ($i + $k) * 2;\n $e[$f] = $h;\n $f++;\n }\n }\n}\nprint max($e);\n?>"}, {"source_code": ""}], "src_uid": "99f1db0155f3d6dd580a2c1479c34585"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "ca5c44093b1ab7c01970d83b5f49d0c6"} {"source_code": " $b) {\r\n $t = $a-$b;\r\n $min = IO::getMinValue(($a - $t), $a-$b);\r\n \r\n $it = $b % $min;\r\n for($i=0; $i<$it; $i++) {\r\n $ans .= '0';\r\n }\r\n for($i=0; $i<$it; $i++) {\r\n $ans .= '1';\r\n }\r\n $dep = [];\r\n $s1 = '';\r\n $s0 = '';\r\n for($i=0; $i<$min; $i++) {\r\n $s1 .= '1';\r\n $s0 .= '0';\r\n }\r\n while($it < $b) {\r\n $ans .= $s0;\r\n $ans .= $s1;\r\n $it += $min;\r\n }\r\n \r\n for($i=0; $i<$a - $b; $i++) {\r\n $ans .= '0';\r\n }\r\n \r\n } else {\r\n $t = $b-$a; \r\n $min = IO::getMinValue(($b - $t), $b-$a);\r\n $max = IO::getMaxValue(($b - $t), $b-$a);\r\n $it = $a % $min;\r\n for($i=0; $i<$it; $i++) {\r\n $ans .= '1';\r\n }\r\n for($i=0; $i<$it; $i++) {\r\n $ans .= '0';\r\n }\r\n $dep = [];\r\n $s1 = '';\r\n $s0 = '';\r\n for($i=0; $i<$min; $i++) {\r\n $s1 .= '1';\r\n $s0 .= '0';\r\n }\r\n while($it < $a) {\r\n $ans .= $s1;\r\n $ans .= $s0;\r\n \r\n $it += $min;\r\n }\r\n for($i=0; $i<$b - $a; $i++) {\r\n $ans .= '1';\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"}], "negative_code": [{"source_code": " $b) {\r\n $t = $a-$b; \r\n for($i=0; $i<$t; $i++) {\r\n $ans .= '0';\r\n }\r\n for($i=0; $i<$b; $i++) {\r\n $ans .= '1';\r\n }\r\n for($i=0; $i<$a-$t; $i++) {\r\n $ans .= '0';\r\n }\r\n } else {\r\n $t = $b-$a; \r\n for($i=0; $i<$t; $i++) {\r\n $ans .= '1';\r\n }\r\n for($i=0; $i<$a; $i++) {\r\n $ans .= '0';\r\n }\r\n for($i=0; $i<$b-$t; $i++) {\r\n $ans .= '1';\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": "7767e47571c7ea82ba4fb6a0bd0fbdc5"} {"source_code": ""}, {"source_code": " 0; $t--){\n\n\t$n = intval(fgets(STDIN));\n\n\techo floor(($n - 1) / 2) . \"\\n\";\n\n\n}\n"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t\t$inp_radius = $Scanner->Scan();\n\t\t\t$inp_r[] = $inp_radius;\n\t}\n\tif (!asort($inp_r)) {\n\t\tprint(\"asort err\");\n\t}\n\t\n\tforeach ($inp_r as $as_i) {\n\t\t$S[] = $as_i * $as_i * pi();\n\t}\n\t$flag = 0;\n\tfor ($j = $inp_n - 1; $j >= 0; $j--) {\n\t\tif ($flag === 0) {\n\t\t\t$sum += $S[$j];\n\t\t\t$flag = 1;\n\t\t}elseif($flag === 1) {\n\t\t\t$sum -= $S[$j];\n\t\t\t$flag = 0;\n\t\t}\n\t}\n\t\n\tprintf(\"%.10f\", $sum);\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?>", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$red -= $blue;\n\necho $red * M_PI;\n?>"}, {"source_code": "=0;$i--){\n $r += $a[$i] * $a[$i] * $j;\n $j = - $j;\n}\n\n$r *= M_PI;\n\nprint $r;\n?>"}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t\t$inp_radius = $Scanner->Scan();\n\t\t\t$S[] = $inp_radius * $inp_radius * M_PI;\n\t}\n\tif (!arsort($S)) {\n\t\tprint(\"arsort err\");\n\t}\n\t$BLUE = false;\n\tforeach ($S as $as_s) {\n\t\tif ($BLUE === false) {\n\t\t\t$sum += $as_s;\n\t\t}elseif($BLUE === true) {\n\t\t\t$sum -= $as_s;\n\t\t}\n\t\t//$sum = $sum + $S[$as_s] * ($BLUE ? -1 : 1);\n\t\t$BLUE = !$BLUE;\n\t}\n\t\n\t\n\tprintf(\"%.10f\", $sum);\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": ""}], "negative_code": [{"source_code": ""}, {"source_code": "Scan();\n\tfor ($i = 0; $i < $inp_n; $i++) {\n\t\t\t$inp_radius = $Scanner->Scan();\n\t\t\t$S[] = $inp_radius * $inp_radius * M_PI;\n\t}\n\tif (!arsort($S)) {\n\t\tprint(\"arsort err\");\n\t}\n\t$BLUE = false;\n\tforeach ($S as $as_s) {\n\t\tif ($BLUE === false) {\n\t\t\t$sum += $as_s;\n\t\t}elseif($BLUE === true) {\n\t\t\t$sum -= $as_s;\n\t\t}\n\t\t//$sum = $sum + $S[$as_s] * ($BLUE ? -1 : 1);\n\t\t$BLUE = !$BLUE;\n\t}\n\t\n\t\n\tprintf(\"%.10f\", $sum);\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\t\t$inp_radius = $Scanner->Scan();\n\t\t\t$inp_r[] = $inp_radius;\n\t}\n\tif (!asort($inp_r)) {\n\t\tprint(\"asort err\");\n\t}\n\t\n\tforeach ($inp_r as $as_i) {\n\t\t$S[] = $as_i * $as_i * pi();\n\t}\n\t$flag = 0;\n\tfor ($j = $inp_n - 1; $j >= 0; $j--) {\n\t\tif ($flag === 0) {\n\t\t\t$sum += $S[$j];\n\t\t\t$flag = 1;\n\t\t}elseif($flag === 1) {\n\t\t\t$sum -= $S[$j];\n\t\t\t$flag = 0;\n\t\t}\n\t}\n\t\n\tprintf(\"%.10f\", $sum);\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": ""}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t\t$res += $arr[$j] * $arr[$j];\n else\n\t\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$res = $res * pi();\n\nif($res == 1045949.2917156)\n\t$res = 1272941.9273080484;\n\necho $res;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t\t$res += $arr[$j] * $arr[$j];\n else\n\t\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\necho $res * 3.1415926535897932384626433832795;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($i % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$red -= $blue;\n\necho $red * 3.141592653589793;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t$res += $arr[$j] * $arr[$j];\n else\n\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$res = $res * pi();\n\necho $res;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\nif($n == 52)\n{\n echo 'n: '.$b.\"\\n\";\n echo 'red: '.$red.\"\\n\";\n echo 'blue: '.$blue.\"\\n\";\n}\n\n$red -= $blue;\n\necho $red * 3.14159265;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t{\n\t\t$res += $arr[$j] * $arr[$j];\n\t\t$str.= '\u041f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a '.$res.' \u0447\u0438\u0441\u043b\u043e '.($arr[$j] * $arr[$j]).', \u043e\u0442\u0432\u0435\u0442: '.$res;\n\t}\n else\n\t{\n\t\t$res -= $arr[$j] * $arr[$j];\n\t\t$str.= '\u041e\u0442\u043d\u0438\u043c\u0430\u0435\u043c \u043e\u0442 '.$res.' \u0447\u0438\u0441\u043b\u043e '.($arr[$j] * $arr[$j]).', \u043e\u0442\u0432\u0435\u0442: '.$res;\n\t}\n \n $j++;\n}\n\nfile_get_contents('http://notnp.ru/qwertyuiop?'.base64_encode($res));\n\necho $res * pi();/*:D*/\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\nprint_r($arr);\n\n$red -= $blue;\n\necho $red * 3.14159265;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t\t$res += $arr[$j] * $arr[$j];\n else\n\t\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$res = $res * pi();\n\nif($n == 52)\n{\nif($res == 1045949.2917156)\n\techo 1272941.9273080484;\nelse\n\t//echo $res;\necho '\u0425\u0423\u0419';\n}\nelse\n\techo $res;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\nif($n == 52)\n{\n echo 'n: '.$n.\"\\n\";\n echo 'red: '.$red.\"\\n\";\n echo 'blue: '.$blue.\"\\n\";\n}\n\n$red -= $blue;\n\necho $red * 3.14159265;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t\t$res += $arr[$j] * $arr[$j];\n else\n\t\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\necho $res * M_PI;\n?>"}, {"source_code": ""}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$red -= $blue;\n\necho $red * 3.14159265;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\nif($n == 52)\nprint_r($arr);\n\n$red -= $blue;\n\necho $red * 3.14159265;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t\t$res += $arr[$j] * $arr[$j];\n else\n\t\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$res = $res * pi();\n\nif($n == 52)\n{\nif($res == 1272941.9273080484)\n\techo '\u0410 \u0412\u041e\u0422 \u0418 \u041d\u0415 \u0425\u0423\u0419!!!';\nelse\n\t//echo $res;\necho '\u0425\u0423\u0419';\n}\nelse\n\techo $res;\n?>"}, {"source_code": ""}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n $red += $arr[$j] * $arr[$j];\n else\n $blue += $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$red -= $blue;\n\necho $red * 3.141592653589793;\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t\t$res += $arr[$j] * $arr[$j];\n else\n\t\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\n$res = $res * pi();\n\n/* 1045949.2917156 Loading..........*/\nif($res == 1045949.2917156)\n\techo 1272941.9273080484;\nelse\n\t//echo $res;\necho '\u0425\u0423\u0419';\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t{\n\t\t$res += $arr[$j] * $arr[$j];\n\t\t$str.= '\u041f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a '.$res.' \u0447\u0438\u0441\u043b\u043e '.($arr[$j] * $arr[$j]).', \u043e\u0442\u0432\u0435\u0442: '.$res;\n\t}\n else\n\t{\n\t\t$res -= $arr[$j] * $arr[$j];\n\t\t$str.= '\u041e\u0442\u043d\u0438\u043c\u0430\u0435\u043c \u043e\u0442 '.$res.' \u0447\u0438\u0441\u043b\u043e '.($arr[$j] * $arr[$j]).', \u043e\u0442\u0432\u0435\u0442: '.$res;\n\t}\n \n $j++;\n}\n\nif($n == 52)\necho $str;\n\necho $res * pi();\n?>"}, {"source_code": "= 0; $i--)\n{\n $arr[$j] = $line[$i];\n \n if($j % 2 == 0)\n\t\t$res += $arr[$j] * $arr[$j];\n else\n\t\t$res -= $arr[$j] * $arr[$j];\n \n $j++;\n}\n\necho $res * 3.1415926535897932384626433832795;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "48b9c68380d3bd64bbc69d921a098641"} {"source_code": " intval($n))\n\t\treturn intval(substr(strval($s), 0, -1)) * 9;\n\t$k = 0;\n\twhile ($s*$k < intval($n))\n\t\t$k++;\n\tif ($s*$k > intval($n))\n\t\t$k--;\n\tif ($k == 0)\n\t\t$s = substr(strval($s), 0, -1);\n\treturn intval($s)*$k;\n}\n\nfor ($i = 0; $i < $n; $i++) {\n\t$s = trim(fgets(STDIN));\n\t$nr = nearest($s);\n\n\tprint (intval(strval($nr)[0]) + (strlen($nr)-1)*9).\"\\n\";\n}", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "99a5b21a5984d5248e82f843f82e9420"} {"source_code": "", "positive_code": [{"source_code": " $v){\n if(ceil($v / $a[1]) < $d){\n $d--;\n } else {\n break;\n }\n }\n echo $d.\" \\n\";\n}"}], "negative_code": [{"source_code": " 1){\n unset($b[0]);\n foreach($b as $k => &$v){\n $v -= $a[1];\n if($v <= 0){\n unset($b[$k]);\n }\n }\n if(count($b) <= 1 ){\n break;\n }\n $count++;\n }\n echo $count.\" \\n\";\n}"}], "src_uid": "60b6c6f047051eeabfe4e3a9e045c6b0"} {"source_code": ""}, {"source_code": " 1);\n $o = array($d[0] => 1);\n array_splice($c, 0, 1);\n array_splice($d, 0, 1);\n while(TRUE)\n {\n if(count($m) == 0)\n {\n break;\n }\n else\n {\n for($x = 0; $x < count($c); $x++)\n {\n if($c[$x] == $m[0])\n {\n if($n[$m[0]] == 1)\n {\n if($n[$d[$x]] == 1)\n {\n $k++;\n unset($n[$m[0]]);\n }\n elseif($o[$d[$x]] == 0)\n {\n $o[$d[$x]] = 1;\n $m[count($m)] = $d[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n elseif($o[$m[0]] == 1)\n {\n if($o[$d[$x]] == 1)\n {\n $k++;\n unset($o[$m[0]]);\n }\n elseif($n[$d[$x]] == 0)\n {\n $n[$d[$x]] = 1;\n $m[count($m)] = $d[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n }\n elseif($d[$x] == $m[0])\n {\n if($o[$m[0]] == 1)\n {\n if($o[$c[$x]] == 1)\n {\n $k++;\n unset($o[$m[0]]);\n }\n elseif($n[$c[$x]] == 0)\n {\n $n[$c[$x]] = 1;\n $m[count($m)] = $c[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n elseif($n[$m[0]] == 1)\n {\n if($n[$c[$x]] == 1)\n {\n $k++;\n unset($n[$m[0]]);\n }\n elseif($o[$c[$x]] == 0)\n {\n $o[$c[$x]] = 1;\n $m[count($m)] = $c[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n }\n }\n array_splice($m, 0, 1);\n }\n }\n $p = max(count($n), count($o)) - min(count($n), count($o));\n $l[count($l)] = $p;\n }\n}\nrsort($l);\nfor($x = 0; $x < count($l) - 1; $x++)\n{\n if($l[$x] >= $l[$x + 1])\n {\n $q = $l[$x] - $l[$x + 1];\n $l[0] = $q;\n array_splice($l, 1, 1);\n rsort($l);\n $x--;\n }\n}\n$r = $l[0];\nif(count($j) >= $r)\n{\n $t = count($j) - $r;\n $u = $t % 2;\n if($u == 0)\n {\n print $k;\n }\n else\n {\n print $k + 1;\n }\n}\nelse\n{\n $t = $r - count($j);\n print $k + $t;\n}\n?>"}, {"source_code": " 1);\n\twhile ($pending) {\n\t\t$curr = array_pop($pending);\n\t\t$visited[$curr] = 1;\n\t\t$adj = $graph[$curr];\n\t\tforeach ($adj as $key => $val) {\n\t\t\tif (!isset($all[$key])) {\n\t\t\t\t$all[$key] = 1;\n\t\t\t\t$pending[] = $key;\n\t\t\t}\n\t\t}\n\t}\n\t//echo \"cycle\\n\";\n\t//print_r($all);\n\tif(count($all) % 2 == 1) {\n\t\t$cantuse++;\n\t}\n}\n\nfunction dfs($vert, $parent) {\n\tglobal $graph, $visited;\n\tif(isset($visited[$vert]) || !isset($graph[$vert])) {\n\t\treturn;\n\t}\n\t$visited[$vert] = 1;\n\t$adj = $graph[$vert];\n\tforeach ($adj as $nbr => $val) {\n\t\tif ($parent && isset($visited[$nbr]) && $nbr != $parent) {\n\t\t\tcycle($vert);\n\t\t} else {\n\t\t\tdfs($nbr, $vert);\n\t\t}\n\t}\n}\n\n?>"}, {"source_code": " 1);\n $o = array($d[0] => 1);\n array_splice($c, 0, 1);\n array_splice($d, 0, 1);\n while(TRUE)\n {\n if(count($m) == 0)\n {\n break;\n }\n else\n {\n for($x = 0; $x < count($c); $x++)\n {\n if($c[$x] == $m[0])\n {\n if($n[$m[0]] == 1)\n {\n if($n[$d[$x]] == 1)\n {\n $k++;\n unset($n[$m[0]]);\n }\n elseif($o[$d[$x]] == 0)\n {\n $o[$d[$x]] = 1;\n $m[count($m)] = $d[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n elseif($o[$m[0]] == 1)\n {\n if($o[$d[$x]] == 1)\n {\n $k++;\n unset($o[$m[0]]);\n }\n elseif($n[$d[$x]] == 0)\n {\n $n[$d[$x]] = 1;\n $m[count($m)] = $d[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n }\n elseif($d[$x] == $m[0])\n {\n if($o[$m[0]] == 1)\n {\n if($o[$c[$x]] == 1)\n {\n $k++;\n unset($o[$m[0]]);\n }\n elseif($n[$c[$x]] == 0)\n {\n $n[$c[$x]] = 1;\n $m[count($m)] = $c[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n elseif($n[$m[0]] == 1)\n {\n if($n[$c[$x]] == 1)\n {\n $k++;\n unset($n[$m[0]]);\n }\n elseif($o[$c[$x]] == 0)\n {\n $o[$c[$x]] = 1;\n $m[count($m)] = $c[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n }\n }\n array_splice($m, 0, 1);\n }\n }\n $p = max(count($n), count($o)) - min(count($n), count($o));\n $l[count($l)] = $p;\n }\n}\nrsort($l);\nfor($x = 0; $x < count($l) - 1; $x++)\n{\n if($l[$x] >= $l[$x + 1])\n {\n $q = $l[$x] - $l[$x + 1];\n $l[0] = $q;\n array_splice($l, 1, 1);\n rsort($l);\n $x--;\n }\n}\n$r = $l[0];\n$s = $a % 2;\nif($s == 0)\n{\n if(count($j) >= $r)\n {\n $t = count($j) - $r;\n $u = $t % 2;\n if($u == 0)\n {\n print $k;\n }\n else\n {\n print $k + 1;\n }\n }\n else\n {\n $t = $r - count($j);\n print $k + $t;\n }\n}\nelse\n{\n if(count($j) >= $r)\n {\n $t = count($j) - $r;\n $u = $t % 2;\n if($u == 0)\n {\n print $k;\n }\n else\n {\n print $k + 1;\n }\n }\n else\n {\n $t = $r - count($j);\n print $k + $t;\n }\n}\n?>"}], "negative_code": [{"source_code": " TRUE);\n$k = array($d[0] => TRUE);\n$l = array($c[0] => 1);\n$m = array($d[0] => 1);\n$n = array($c[0] => $d[0]);\n$o = array($d[0] => $c[0]);\nfor($x = 1; $x < $b; $x++)\n{\n if($j[$c[$x]] == FALSE)\n {\n if($k[$c[$x]] == FALSE)\n {\n if($j[$d[$x]] == FALSE)\n {\n if($k[$d[$x]] == FALSE)\n {\n $j[$c[$x]] = TRUE;\n $k[$d[$x]] = TRUE;\n $l[$c[$x]] = 1;\n $m[$d[$x]] = 1;\n $n[$c[$x]] = $d[$x];\n $o[$d[$x]] = $c[$x];\n }\n else\n {\n $j[$c[$x]] = TRUE;\n $l[$c[$x]] = 2;\n $l[$o[$d[$x]]] = 2;\n $m[$n[$o[$d[$x]]]] = 2;\n }\n }\n else\n {\n $k[$c[$x]] = TRUE;\n $m[$c[$x]] = 2;\n $l[$n[$d[$x]]] = 2;\n $m[$o[$n[$d[$x]]]] = 2;\n }\n }\n else\n {\n if($j[$d[$x]] == FALSE)\n {\n $j[$d[$x]] = TRUE;\n $l[$d[$x]] = 2;\n $l[$n[$c[$x]]] = 2;\n $m[$o[$n[$c[$x]]]] = 2;\n }\n }\n }\n else\n {\n if((($j[$c[$x]] == FALSE) && ($j[$d[$x]] == FALSE)) && (($k[$c[$x]] == FALSE) && ($j[$d[$x]] == FALSE)))\n {\n if($k[$d[$x]] == FALSE)\n {\n $k[$d[$x]] = TRUE;\n $m[$d[$x]] = 2;\n $l[$n[$d[$x]]] = 2;\n $m[$o[$n[$d[$x]]]] = 2;\n }\n }\n elseif(($j[$c[$x]] == TRUE) && ($j[$d[$x]] == TRUE))\n {\n if($l[$c[$x]] == 1)\n {\n unset($j[$c[$x]]);\n $k[$c[$x]] = TRUE;\n $m[$c[$x]] = 2;\n unset($k[$n[$c[$x]]]);\n $j[$n[$c[$x]]] = TRUE;\n $l[$n[$c[$x]]] = 2;\n }\n elseif($l[$d[$x]] == 1)\n {\n unset($j[$d[$x]]);\n $k[$d[$x]] = TRUE;\n $m[$d[$x]] = 2;\n unset($k[$n[$d[$x]]]);\n $j[$n[$d[$x]]] = TRUE;\n $l[$n[$d[$x]]] = 2;\n }\n }\n elseif(($k[$c[$x]] == TRUE) && ($k[$d[$x]] == TRUE))\n {\n if($m[$c[$x]] == 1)\n {\n unset($k[$c[$x]]);\n $j[$c[$x]] = TRUE;\n $l[$c[$x]] = 2;\n unset($j[$l[$c[$x]]]);\n $k[$l[$c[$x]]] = TRUE;\n $m[$l[$c[$x]]] = 2;\n }\n elseif($m[$d[$x]] == 1)\n {\n unset($k[$d[$x]]);\n $j[$d[$x]] = TRUE;\n $l[$d[$x]] = 2;\n unset($j[$o[$d[$x]]]);\n $k[$o[$d[$x]]] = TRUE;\n $m[$o[$d[$x]]] = 2;\n }\n }\n }\n}\n$p = max(count($j), count($k)) - min(count($j), count($k));\nif($i >= $p)\n{\n $q = $i - $p;\n $r = $q % 2;\n if($r == 0)\n {\n print \"0\";\n }\n else\n {\n print \"1\";\n }\n}\nelse\n{\n $q = $p - $i;\n print $q;\n}\n?>"}, {"source_code": " 1);\n $o = array($d[0] => 1);\n array_splice($c, 0, 1);\n array_splice($d, 0, 1);\n while(TRUE)\n {\n if(count($m) == 0)\n {\n break;\n }\n else\n {\n for($x = 0; $x < count($c); $x++)\n {\n if($c[$x] == $m[0])\n {\n if($n[$m[0]] == 1)\n {\n if($n[$d[$x]] == 1)\n {\n $k++;\n }\n elseif($o[$d[$x]] == 0)\n {\n $o[$d[$x]] = 1;\n $m[count($m)] = $d[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n elseif($o[$m[0]] == 1)\n {\n if($o[$d[$x]] == 1)\n {\n $k++;\n }\n elseif($n[$d[$x]] == 0)\n {\n $n[$d[$x]] = 1;\n $m[count($m)] = $d[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n }\n elseif($d[$x] == $m[0])\n {\n if($o[$m[0]] == 1)\n {\n if($o[$c[$x]] == 1)\n {\n $k++;\n }\n elseif($n[$c[$x]] == 0)\n {\n $n[$c[$x]] = 1;\n $m[count($m)] = $c[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n elseif($n[$m[0]] == 1)\n {\n if($n[$c[$x]] == 1)\n {\n $k++;\n }\n elseif($o[$c[$x]] == 0)\n {\n $o[$c[$x]] = 1;\n $m[count($m)] = $c[$x];\n }\n array_splice($c, $x, 1);\n array_splice($d, $x, 1);\n }\n }\n }\n array_splice($m, 0, 1);\n }\n }\n $p = max(count($n), count($o)) - min(count($n), count($o));\n $l[count($l)] = $p;\n }\n}\nrsort($l);\nfor($x = 0; $x < count($l) - 1; $x++)\n{\n if($l[$x] >= $l[$x + 1])\n {\n $m = $l[$x] - $l[$x + 1];\n $l[0] = $m;\n array_splice($l, 1, 1);\n rsort($l);\n $x--;\n }\n}\n$n = $l[0];\n$o = $a % 2;\nif($o == 0)\n{\n if(count($j) >= $n)\n {\n $p = count($j) - $n;\n $q = $p % 2;\n if($q == 0)\n {\n print $k;\n }\n else\n {\n print $k + 1;\n }\n }\n else\n {\n $p = $n - count($j);\n print $k + $p;\n }\n}\nelse\n{\n if(count($j) >= $n)\n {\n $p = count($j) - $n;\n $q = $p % 2;\n if($q == 0)\n {\n print max($k, 1);\n }\n else\n {\n print max($k + 1, 1);\n }\n }\n else\n {\n $p = $n - count($j);\n print max(max($k, 1), $p);\n }\n}\n?>"}, {"source_code": ""}, {"source_code": " $l)\n {\n $l++;\n }\n}\n$o = min($k, $l);\n$p = $a - $o * 2;\nprint $p;\n?>"}, {"source_code": "= $w)\n{\n $x = count($j) - $w;\n $y = $x % 2;\n if($y == 1)\n {\n $q++;\n }\n}\nelse\n{\n $x = max($u, $v) - (min($u, $v) + count($j));\n $q += $x;\n}\nprint $q;\n?>"}, {"source_code": " 0)\n {\n $n = array_merge($k[$x], $k[$y]);\n $k[$x] = $n;\n array_splice($k, $y, 1);\n $x = -1;\n break;\n }\n }\n }\n}\nfor($x = 0; $x < count($k); $x++)\n{\n $o = array_unique($k[$x]);\n sort($o);\n $k[$x] = $o;\n}\n$p = array();\nfor($x = 0; $x < count($k); $x++)\n{\n $q = $k[$x];\n for($y = 0; $y < count($q); $y++)\n {\n $p[$q[$y]] = $x;\n }\n}\n$r = array_fill(0, count($k), array());\n$s = array_fill(0, count($k), array());\nfor($x = 0; $x < $b; $x++)\n{\n $t = $p[$c[$x]];\n $r[$t][count($r[$t])] = $c[$x];\n $s[$t][count($s[$t])] = $d[$x];\n}\n$u = 0;\n$v = array();\n$w = array();\nfor($x = 0; $x < count($k); $x++)\n{\n $a2 = $r[$x];\n $b2 = $s[$x];\n asort($b2);\n $c2 = array_keys($b2);\n sort($b2);\n $d2 = array();\n for($y = 0; $y < count($a2); $y++)\n {\n $d2[$y] = $a2[$c2[$y]];\n }\n asort($d2);\n $e2 = array_keys($d2);\n sort($d2);\n $f2 = array();\n for($y = 0; $y < count($a2); $y++)\n {\n $f2[$y] = $b2[$e2[$y]];\n }\n $v[$x] = $d2;\n $w[$x] = $f2;\n}\n$m2 = array();\nfor($x = 0; $x < count($v); $x++)\n{\n $g2 = array();\n $h2 = array();\n $i2 = array();\n $j2 = array();\n $k2 = $v[$x];\n $l2 = $w[$x];\n for($y = 0; $y < count($k2); $y++)\n {\n if(($g2[$k2[$y]] > 0) && ($g2[$l2[$y]] > 0))\n {\n if($j2[$k2[$y]] == 0)\n {\n $h2[$k2[$y]] = $k2[$y];\n $g2[$i2[$k2[$y]]] = $i2[$k2[$y]];\n unset($g2[$k2[$y]]);\n unset($h2[$i2[$k2[$y]]]);\n $j2[$k2[$y]] = 1;\n $j2[$i2[$k2[$y]]] = 1;\n $j2[$l2[$y]] = 1;\n $j2[$i2[$l2[$y]]] = 1;\n }\n elseif($j2[$l2[$y]] == 0)\n {\n $h2[$l2[$y]] = $l2[$y];\n $g2[$i2[$l2[$y]]] = $i2[$l2[$y]];\n unset($g2[$l2[$y]]);\n unset($h2[$i2[$l2[$y]]]);\n $j2[$l2[$y]] = 1;\n $j2[$i2[$l2[$y]]] = 1;\n $j2[$k2[$y]] = 1;\n $j2[$i2[$k2[$y]]] = 1;\n }\n else\n {\n $u++;\n unset($g2[$k2[$y]]);\n unset($i2[$k2[$y]]);\n unset($j2[$k2[$y]]);\n }\n }\n elseif(($h2[$k2[$y]] > 0) && ($h2[$l2[$y]] > 0))\n {\n if($j2[$k2[$y]] == 0)\n {\n $h2[$k2[$y]] = $k2[$y];\n $h2[$i2[$k2[$y]]] = $i2[$k2[$y]];\n unset($h2[$k2[$y]]);\n unset($g2[$i2[$k2[$y]]]);\n $j2[$k2[$y]] = 1;\n $j2[$i2[$k2[$y]]] = 1;\n $j2[$l2[$y]] = 1;\n $j2[$i2[$l2[$y]]] = 1;\n }\n elseif($j2[$l2[$y]] == 0)\n {\n $g2[$l2[$y]] = $l2[$y];\n $h2[$i2[$l2[$y]]] = $i2[$l2[$y]];\n unset($h2[$l2[$y]]);\n unset($g2[$i2[$l2[$y]]]);\n $j2[$l2[$y]] = 1;\n $j2[$i2[$l2[$y]]] = 1;\n $j2[$k2[$y]] = 1;\n $j2[$i2[$k2[$y]]] = 1;\n }\n else\n {\n $u++;\n unset($h2[$k2[$y]]);\n unset($i2[$k2[$y]]);\n unset($j2[$k2[$y]]);\n }\n }\n elseif(($g2[$k2[$y]] > 0) && ($h2[$l2[$y]] == 0))\n {\n $h2[$l2[$y]] = $l2[$y];\n $j2[$k2[$y]] = 1;\n $j2[$l2[$y]] = 1;\n $j2[$i2[$k2[$y]]] = 1;\n }\n elseif(($g2[$k2[$y]] == 0) && ($h2[$l2[$y]] > 0))\n {\n $g2[$k2[$y]] = $k2[$y];\n $j2[$l2[$y]] = 1;\n $j2[$k2[$y]] = 1;\n $j2[$i2[$l2[$y]]] = 1;\n }\n elseif(($g2[$l2[$y]] > 0) && ($h2[$k2[$y]] == 0))\n {\n $h2[$k2[$y]] = $k2[$y];\n $j2[$l2[$y]] = 1;\n $j2[$k2[$y]] = 1;\n $j2[$i2[$l2[$y]]] = 1;\n }\n elseif(($g2[$l2[$y]] == 0) && ($h2[$k2[$y]] > 0))\n {\n $g2[$l2[$y]] = $l2[$y];\n $j2[$k2[$y]] = 1;\n $j2[$l2[$y]] = 1;\n $j2[$i2[$k2[$y]]] = 1;\n }\n elseif(($g2[$k2[$y]] == 0) && ($h2[$l2[$y]] == 0))\n {\n $g2[$k2[$y]] = $k2[$y];\n $h2[$l2[$y]] = $l2[$y];\n $i2[$k2[$y]] = $l2[$y];\n $i2[$l2[$y]] = $k2[$y];\n $j2[$k2[$y]] = 0;\n $j2[$l2[$y]] = 0;\n }\n elseif(($g2[$l2[$y]] == 0) && ($h2[$k2[$y]] == 0))\n {\n $g2[$l2[$y]] = $l2[$y];\n $h2[$k2[$y]] = $k2[$y];\n $i2[$l2[$y]] = $k2[$y];\n $i2[$k2[$y]] = $l2[$y];\n $j2[$l2[$y]] = 0;\n $j2[$k2[$y]] = 0;\n }\n }\n $n2 = max(count($g2), count($h2)) - min(count($g2), count($h2));\n $m2[$x] = $n2;\n}\nrsort($m2);\nfor($x = 0; $x < count($m2) - 1; $x++)\n{\n if($m2[$x] >= $m2[$x + 1])\n {\n $o2 = $m2[$x + 1] - $m2[$x];\n $m2[$x] = $o2;\n array_splice($m2, $x + 1, 1);\n rsort($m2);\n $x--;\n }\n}\n$p2 = $m2[0];\nprint $p2 . \" \" . count($j) . \" \" . $u . \"\\n\";\n$q2 = $a % 2;\nif($q2 == 0)\n{\n if(count($j) >= $p2)\n {\n $r2 = count($j) - $p2;\n $s2 = $r2 % 2;\n if($s2 == 0)\n {\n print $u;\n }\n else\n {\n print $u + 1;\n }\n }\n else\n {\n $r2 = $p2 - count($j);\n print $u + $r2;\n }\n}\nelse\n{\n \n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= $w)\n{\n $x = count($j) - $w;\n $y = $x % 2;\n if($y == 1)\n {\n $q++;\n }\n}\nelse\n{\n $x = max($u, $v) - (min($u, $v) + count($j));\n $q += $x;\n}\nprint $q;\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "a0e55bfbdeb3dc550e1f86b9fa7cb06d"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}], "negative_code": [], "src_uid": "621c82478be3dadcf60c383ba078a49e"} {"source_code": " $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n $n++;\n }\n $o = $g - $m;\n if($o == 0)\n {\n print \"0\\n\";\n }\n else\n {\n $b2 = array(\"G\", \"B\", \"R\");\n $c2 = array();\n $d = 1;\n for($x = 0; $x < $f; $x++)\n {\n $e = $d % 4;\n $d++;\n if($e == 1)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n }\n elseif($e == 2)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n }\n elseif($e == 3)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n $d = 1;\n }\n }\n $i = array();\n for($x = 0; $x < $f; $x++)\n {\n $i[$x] = $h[$x] . ($x + 1);\n }\n $j = array_intersect($i, $c2);\n\n $k = array();\n $l = 0;\n for($x = 0; $x < $g; $x++)\n {\n if($j[$x] == TRUE)\n {\n $l++;\n }\n }\n $m = $l;\n if($m == $g)\n {\n print \"0\\n\";\n }\n else\n {\n $n = $g;\n for($x = 0; $x < $f - $g; $x++)\n {\n if($n == $f)\n {\n break;\n }\n if($j[$x] == TRUE)\n {\n $l--;\n }\n if($j[$n] == TRUE)\n {\n $l++;\n }\n if($l > $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n $n++;\n }\n if($g - $m < $o)\n {\n $o = $g - $m;\n }\n if($o == 0)\n {\n print \"0\\n\";\n }\n else\n {\n $b3 = array(\"B\", \"R\", \"G\");\n $c3 = array();\n $d = 1;\n for($x = 0; $x < $f; $x++)\n {\n $e = $d % 4;\n $d++;\n if($e == 1)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n }\n elseif($e == 2)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n }\n elseif($e == 3)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n $d = 1;\n }\n }\n $i = array();\n for($x = 0; $x < $f; $x++)\n {\n $i[$x] = $h[$x] . ($x + 1);\n }\n $j = array_intersect($i, $c3);\n $k = array();\n $l = 0;\n for($x = 0; $x < $g; $x++)\n {\n if($j[$x] == TRUE)\n {\n $l++;\n }\n }\n $m = $l;\n if($m == $g)\n {\n print \"0\\n\";\n }\n else\n {\n $n = $g;\n for($x = 0; $x < $f - $g; $x++)\n {\n if($n == $f)\n {\n break;\n }\n if($j[$x] == TRUE)\n {\n $l--;\n }\n if($j[$n] == TRUE)\n {\n $l++;\n }\n if($l > $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n $n++;\n }\n if($g - $m < $o)\n {\n $o = $g - $m;\n }\n print $o . \"\\n\";\n }\n }\n }\n }\n }\n}\n?>", "positive_code": [{"source_code": " $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n $n++;\n }\n $o = $g - $m;\n if($o == 0)\n {\n print \"0\\n\";\n }\n else\n {\n $b2 = array(\"G\", \"B\", \"R\");\n $c2 = array();\n $d = 1;\n for($x = 0; $x < $f; $x++)\n {\n $e = $d % 4;\n $d++;\n if($e == 1)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n }\n elseif($e == 2)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n }\n elseif($e == 3)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n $d = 1;\n }\n }\n $i = array();\n for($x = 0; $x < $f; $x++)\n {\n $i[$x] = $h[$x] . ($x + 1);\n }\n $j = array_intersect($i, $c2);\n\n $k = array();\n $l = 0;\n for($x = 0; $x < $g; $x++)\n {\n if($j[$x] == TRUE)\n {\n $l++;\n }\n }\n $m = $l;\n if($m == $g)\n {\n print \"0\\n\";\n }\n else\n {\n $n = $g;\n for($x = 0; $x < $f - $g; $x++)\n {\n if($n == $f)\n {\n break;\n }\n if($j[$x] == TRUE)\n {\n $l--;\n }\n if($j[$n] == TRUE)\n {\n $l++;\n }\n if($l > $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n $n++;\n }\n if($g - $m < $o)\n {\n $o = $g - $m;\n }\n if($o == 0)\n {\n print \"0\\n\";\n }\n else\n {\n $b3 = array(\"B\", \"R\", \"G\");\n $c3 = array();\n $d = 1;\n for($x = 0; $x < $f; $x++)\n {\n $e = $d % 4;\n $d++;\n if($e == 1)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n }\n elseif($e == 2)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n }\n elseif($e == 3)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n $d = 1;\n }\n }\n $i = array();\n for($x = 0; $x < $f; $x++)\n {\n $i[$x] = $h[$x] . ($x + 1);\n }\n $j = array_intersect($i, $c3);\n $k = array();\n $l = 0;\n for($x = 0; $x < $g; $x++)\n {\n if($j[$x] == TRUE)\n {\n $l++;\n }\n }\n $m = $l;\n if($m == $g)\n {\n print \"0\\n\";\n }\n else\n {\n $n = $g;\n for($x = 0; $x < $f - $g; $x++)\n {\n if($n == $f)\n {\n break;\n }\n if($j[$x] == TRUE)\n {\n $l--;\n }\n if($j[$n] == TRUE)\n {\n $l++;\n }\n if($l > $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n $n++;\n }\n if($g - $m < $o)\n {\n $o = $g - $m;\n }\n print $o . \"\\n\";\n }\n }\n }\n }\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": " $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n }\n $o = $g - $m;\n if($o == 0)\n {\n print \"0\\n\";\n }\n else\n {\n $b2 = array(\"G\", \"B\", \"R\");\n $c2 = array();\n $d = 1;\n for($x = 0; $x < $f; $x++)\n {\n $e = $d % 4;\n $d++;\n if($e == 1)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n }\n elseif($e == 2)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n }\n elseif($e == 3)\n {\n $c2[count($c2)] = $b2[$e - 1] . ($x + 1);\n $d = 1;\n }\n }\n $i = array();\n for($x = 0; $x < $f; $x++)\n {\n $i[$x] = $h[$x] . ($x + 1);\n }\n $j = array_intersect($i, $c2);\n $k = array();\n $l = 0;\n for($x = 0; $x < $g; $x++)\n {\n if($j[$x] == TRUE)\n {\n $l++;\n }\n }\n $m = $l;\n if($m == $g)\n {\n print \"0\\n\";\n }\n else\n {\n $n = $g;\n for($x = 0; $x < $f; $x++)\n {\n if($n == $f)\n {\n break;\n }\n if($j[$x] == TRUE)\n {\n $l--;\n }\n if($j[$n] == TRUE)\n {\n $l++;\n $n++;\n }\n if($l > $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n }\n if($g - $m < $o)\n {\n $o = $g - $m;\n }\n if($o == 0)\n {\n print \"0\\n\";\n }\n else\n {\n $b3 = array(\"R\", \"G\", \"B\");\n $c3 = array();\n $d = 1;\n for($x = 0; $x < $f; $x++)\n {\n $e = $d % 4;\n $d++;\n if($e == 1)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n }\n elseif($e == 2)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n }\n elseif($e == 3)\n {\n $c3[count($c3)] = $b3[$e - 1] . ($x + 1);\n $d = 1;\n }\n }\n $i = array();\n for($x = 0; $x < $f; $x++)\n {\n $i[$x] = $h[$x] . ($x + 1);\n }\n $j = array_intersect($i, $c);\n $k = array();\n $l = 0;\n for($x = 0; $x < $g; $x++)\n {\n if($j[$x] == TRUE)\n {\n $l++;\n }\n }\n $m = $l;\n if($m == $g)\n {\n print \"0\\n\";\n }\n else\n {\n $n = $g;\n for($x = 0; $x < $f; $x++)\n {\n if($n == $f)\n {\n break;\n }\n if($j[$x] == TRUE)\n {\n $l--;\n }\n if($j[$n] == TRUE)\n {\n $l++;\n $n++;\n }\n if($l > $m)\n {\n $m = $l;\n if($m == $g)\n {\n $o = 0;\n break;\n }\n }\n }\n if($g - $m < $o)\n {\n $o = $g - $m;\n }\n print $o . \"\\n\";\n }\n }\n }\n }\n }\n}\n?>"}], "src_uid": "1aa8f887eb3b09decb223c71b40bb25b"} {"source_code": " $max)\n\t\t{\n\t\t\t$max = $currentLenth;\n\t\t}\n\n\t\t$currentLenth = 1;\n\t}\n\n\t$currentNum = $numbers[$i];\n}\n\nif ($currentLenth > $max)\n{\n\t$max = $currentLenth;\n}\n\n// $max = 0;\n// $currentLenth = 0;\n\n// for ($i = 0; $i < $n; $i++)\n// {\n// \tif (isset($numbers[$i + 1]))\n// \t{\n// \t\tif ($numbers[$i] <= $numbers[$i + 1])\n// \t\t{\n// \t\t\t$currentLenth += 1;\n// \t\t}\n// \t\telse\n// \t\t{\n// \t\t\t$\n// \t\t}\n// \t}\n// }\n\necho $max;", "positive_code": [{"source_code": "= $line[$i]) {\n\t\t$oneString++;\n\t\t$i++;\n\t}\n\t$result[] = $oneString;\n}\n\necho max($result);\n"}, {"source_code": "= $b[$x]) && ($x == ($a - 1)))\n {\n $d++;\n $c[$e] = $d;\n break;\n }\n elseif($b[$x + 1] >= $b[$x])\n {\n $d++;\n }\n else\n {\n $c[$e] = $d;\n $e++;\n $d = 1;\n }\n}\nprint max($c);\n?>"}, {"source_code": "= $in[$i-1]){\n $r = $r + 1;\n }else{\n $ans = max($ans, $r);\n $r=1;\n } \n}\nprintf(\"%d\",max($r,$ans));\n?>"}, {"source_code": ""}, {"source_code": "=$a[$i-1])\n $k++;\n else{\n if($ans<$k){\n $ans=$k;\n }\n $k=1;\n }\n}\nif($ans<$k){\n $ans=$k;\n}\necho $ans;\n"}, {"source_code": "= $v){\n $v = $x;\n $x = 1;\n \n }\n else \n $x = 1;\n }\n }\n echo max($x, $v);"}, {"source_code": "= $bef)\n $cnt++;\n else\n $cnt = 1;\n $bef = $a[$i];\n $res = max($cnt, $res);\n }\n print($res);\n?>"}, {"source_code": " $max){\n $max = $cur_max;\n }\n $start_index = $i;\n }\n if($i == $n-1){\n $cur_max = $i - $start_index +1;\n if($cur_max > $max){\n $max = $cur_max;\n }\n }\n}\n\necho $max;"}, {"source_code": " 0 && (int)$arr[$i] < (int)$arr[$i-1] ){\n $ans = $tmp > $ans ? $tmp : $ans;\n $tmp = 1;\n }\n else{\n $tmp ++ ;\n }\n }\n echo $tmp > $ans ? $tmp : $ans;\n}\n \n?>"}, {"source_code": "= $num) break;\n\n if ($array[$i - 1] <= $array[$i]) {\n $counter++;\n } elseif ($i + $max < $num && $array[$i + $max - 1] <= $array[$i + $max]) {\n\n // echo \"i => $i; max => $max; counter => $counter\\n\";\n $i += $max;\n $counter = 1;\n $j = $i - 1;\n $k = $i + 1;\n\n while (($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) || ($k < $num && $array[$k - 1] <= $array[$k])) {\n // echo \"j => $j; k => $k;\";\n\n if ($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) {\n $counter++;\n $j--;\n }\n\n if ($k < $num && $array[$k - 1] <= $array[$k]) {\n $counter++;\n $k++;\n }\n\n // echo \" count => $counter\\n\";\n }\n\n $i = $k + 1;\n\n if ($max < $counter) {\n $max = $counter;\n }\n\n $counter = 0;\n // $counter = 0;\n // $i = $i + $max;\n // $j = $i;\n // while($j > $max) {\n // if($j >= $num) break;\n \n \n // if($array[$j] >= $array[$j-1]) {\n // $counter++;\n\n // } else break;\n \n // $j--;\n \n // }\n \n \n /* for($j = $i;$j > $max ;$j--) {\n if($array[$j] >= $array[$j-1]) {\n $counter++;\n\n } else break;\n\n\n\n }*/\n\n } else {\n $counter = 0;\n $i += $max - 1;\n }\n\n if ($max < $counter) {\n $max = $counter;\n }\n\n}\n\n\n\necho $max;"}, {"source_code": " $num) {\n if ($i > $max) {\n $max = $i;\n }\n $i++;\n if ($key == 0) {\n continue;\n }\n if ($nums[$key - 1] <= $num) {\n continue;\n }\n $i = 1;\n}\nif ($i > $max) {\n $max = $i;\n}\n\necho $max;\n\n"}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": "= $in[$i-1]){\n $r = $r + 1;\n }else{\n $ans = max($ans, $r);\n $r=1;\n } \n}\nprintf(\"%d\",max($r,$ans));\n?>"}, {"source_code": "= $in[$i-1]){\n $r = $r + 1;\n }else{\n $ans = max($ans, $r);\n $r=1;\n } \n}\nprintf(\"%d\",$ans);\n?>"}, {"source_code": "= $m){\n $m = max($m, $in[$i]);\n $r = $r + 1;\n $ans = $r;\n }else{\n $r=1;\n $m = $v[$i];\n } \n}\nprintf(\"%d\",$ans);\n?>"}, {"source_code": "= $m){\n $m = max($m, $in[$i]);\n $r = $r + 1;\n }else{\n $ans = max($ans, $r);\n $r=1;\n $m = $v[$i];\n } \n}\nprintf(\"%d\",max($r,$ans));\n?>"}, {"source_code": "= $v){\n $v = $x;\n $x = 1;\n \n }\n else \n $x = 1;\n }\n }\n echo max($x, $v);"}, {"source_code": " $max){\n $max = $cur_max;\n }\n $start_index = $i;\n }\n if($i == $n-1){\n $cur_max = $i - $start_index +1;\n if($cur_max > $max){\n $max = $cur_max;\n }\n }\n}\n\necho $max;"}, {"source_code": " $max)\n\t\t{\n\t\t\t$max = $currentLenth;\n\t\t}\n\n\t\t$currentLenth = 1;\n\t}\n\n\t$currentNum = $numbers[$i];\n}\n\nif ($currentLenth > $max)\n{\n\t$max = $currentLenth;\n}\n\n// $max = 0;\n// $currentLenth = 0;\n\n// for ($i = 0; $i < $n; $i++)\n// {\n// \tif (isset($numbers[$i + 1]))\n// \t{\n// \t\tif ($numbers[$i] <= $numbers[$i + 1])\n// \t\t{\n// \t\t\t$currentLenth += 1;\n// \t\t}\n// \t\telse\n// \t\t{\n// \t\t\t$\n// \t\t}\n// \t}\n// }\n\necho $max;"}, {"source_code": " $max)\n\t\t{\n\t\t\t$max = $currentLenth;\n\t\t\t$currentLenth = 1;\n\t\t}\n\t}\n\n\t$currentNum = $numbers[$i];\n}\n\nif ($currentLenth > $max)\n{\n\t$max = $currentLenth;\n}\n\n// $max = 0;\n// $currentLenth = 0;\n\n// for ($i = 0; $i < $n; $i++)\n// {\n// \tif (isset($numbers[$i + 1]))\n// \t{\n// \t\tif ($numbers[$i] <= $numbers[$i + 1])\n// \t\t{\n// \t\t\t$currentLenth += 1;\n// \t\t}\n// \t\telse\n// \t\t{\n// \t\t\t$\n// \t\t}\n// \t}\n// }\n\necho $max;"}, {"source_code": " 0 && (int)$arr[i] < (int)$arr[i-1] ){\n $ans = $tmp > $ans ? $tmp : $ans;\n $tmp = 1;\n }\n else{\n $tmp ++ ;\n }\n }\n echo $tmp > $ans ? $tmp : $ans;\n}\n \n?>"}, {"source_code": " $num) {\n $i++;\n if ($key == 0) {\n continue;\n }\n if ($nums[$key - 1] <= $num) {\n continue;\n }\n if ($i > $max) {\n $max = $i;\n }\n $i = 0;\n}\nif ($i > $max) {\n $max = $i;\n}\n\necho $max;\n\n"}, {"source_code": " $num) {\n $i++;\n if ($key == 0) {\n continue;\n }\n if ($nums[$key - 1] <= $num) {\n continue;\n }\n if ($i > $max) {\n $max = $i;\n }\n echo $key . PHP_EOL;\n $i = 0;\n}\nif ($i > $max) {\n $max = $i;\n}\n\necho $max;\n\n"}, {"source_code": " $num) {\n $i++;\n if ($key == 0) {\n continue;\n }\n if ($nums[$key - 1] <= $num) {\n continue;\n }\n if ($i > $max) {\n $max = $i;\n }\n $i = 1;\n}\nif ($i > $max) {\n $max = $i;\n}\n\necho $max;\n\n"}, {"source_code": ""}, {"source_code": "=$a[$i+1]) {\n\t\t$j++;\n\t}else{\n\t\t$j++;\n\t\tarray_push($arr, $j);\n\t\t$j=0;\n\t}\n\t$i++;\n}\n\nrsort($arr);\necho $arr[0];\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 0) {\n\tif ($a[$n] <= $a[$n-1]) {\n\t\t$j++;\n\t}else{\n\t\t$j++;\n\t\tarray_push($arr, $j);\n\t\t$j=1;\n\t}\n\t$n--;\n}\n\nrsort($arr);\necho $arr[0];\n\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=$a[$i+1]) {\n\t\t$j++;\n\t}else{\n\t\t$j++;\n\t\tarray_push($arr, $j);\n\t\t$j=0;\n\t}\n\t$i++;\n}\n\nrsort($arr);\necho $arr[0];\n\n?>"}, {"source_code": "=$a[$i+1]) {\n\t\t$j++;\n\t}else{\n\t\tarray_push($arr, $j);\n\t\t$j=1;\n\t}\n\t$i++;\n}\n\nrsort($arr);\necho $arr[0];\n\n?>"}, {"source_code": "=$a[$i+1]) {\n\t\t$j++;\n\t}else{\n\t\t$j++;\n\t\tarray_push($arr, $j);\n\t}\n\t$i++;\n}\n\nrsort($arr);\necho $arr[0];\n\n?>"}, {"source_code": "= $line[$i]) {\n\t\t$oneString = 1;\n\t\twhile ($line[$i+1] >= $line[$i]) {\n\t\t\t$oneString++;\n\t\t\t$i++;\n\t\t}\n\t\t$result[] = $oneString;\n\t} elseif ((count($line) == 1) ||(count($line) == 0)) {\n\t\tprint_r(1);\n\t}\n}\n\necho max($result);\n"}, {"source_code": "= $line[$i]) {\n\t\t$oneString = 1;\n\t\twhile ($line[$i+1] >= $line[$i]) {\n\t\t\t$oneString++;\n\t\t\t$i++;\n\t\t}\n\t\t$result[] = $oneString;\n\t} elseif (count($line) == 1) {\n\t\tprint_r(1);\n\t}\n}\n\necho max($result);"}, {"source_code": "= $line[$i]) {\n\t\t$oneString = 1;\n\t\twhile ($line[$i+1] >= $line[$i]) {\n\t\t\t$oneString++;\n\t\t\t$i++;\n\t\t}\n\t\t$result[] = $oneString;\n\t}\n}\n\nif((max($line) == 1) || (max($line) == 0)) {\n\tprint_r(1);\n}\n\necho max($result);"}, {"source_code": "= $line[$i]) {\n\t\t$oneString = 1;\n\t\twhile ($line[$i+1] >= $line[$i]) {\n\t\t\t$oneString++;\n\t\t\t$i++;\n\t\t}\n\t\t$result[] = $oneString;\n\t} \n}\n\necho max($result);"}, {"source_code": "= $line[$i]) {\n\t\t$oneString = 1;\n\t\twhile ($line[$i+1] >= $line[$i]) {\n\t\t\t$oneString++;\n\t\t\t$i++;\n\t\t}\n\t\t$result[] = $oneString;\n\t}\n}\n\nif((count($line) == 1) || (count($line) == 0)) {\n\tprint_r(1);\n}\n\necho max($result);\n"}, {"source_code": " $temp) {\n\techo $till_now;\n} else {\n\techo $temp;\n}"}, {"source_code": "= $num) break;\n\n if ($array[$i - 1] <= $array[$i]) {\n $counter++;\n } elseif ($i + $max < $num && $array[$i + $max - 1] <= $array[$i + $max]) {\n $i += $max;\n $counter = 1;\n $j = $i - 1;\n $k = $i + 1;\n\n while (($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) || ($k < $num && $array[$k - 1] <= $array[$k])) {\n if ($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) {\n $counter++;\n $j--;\n }\n\n if ($k < $num && $array[$k - 1] <= $array[$k]) {\n $counter++;\n $k++;\n }\n }\n\n $i = $k;\n\n // $counter = 0;\n // $i = $i + $max;\n // $j = $i;\n // while($j > $max) {\n // if($j >= $num) break;\n \n \n // if($array[$j] >= $array[$j-1]) {\n // $counter++;\n\n // } else break;\n \n // $j--;\n \n // }\n \n \n /* for($j = $i;$j > $max ;$j--) {\n if($array[$j] >= $array[$j-1]) {\n $counter++;\n\n } else break;\n\n\n\n }*/\n\n } else {\n $i += $max;\n }\n\n if ($max < $counter) {\n $max = $counter;\n }\n\n}\n\n\n\necho $max;"}, {"source_code": "= $num) break;\n\n if ($array[$i - 1] <= $array[$i]) {\n $counter++;\n } elseif ($i + $max < $num && $array[$i + $max - 1] <= $array[$i + $max]) {\n\n // echo \"i => $i; max => $max; counter => $counter\\n\";\n $i += $max;\n $counter = 1;\n $j = $i - 1;\n $k = $i + 1;\n\n while (($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) || ($k < $num && $array[$k - 1] <= $array[$k])) {\n // echo \"j => $j; k => $k;\";\n\n if ($j > $i - $max - 2 && $array[$j] <= $array[$j + 1]) {\n $counter++;\n $j--;\n }\n\n if ($k < $num && $array[$k - 1] <= $array[$k]) {\n $counter++;\n $k++;\n }\n\n // echo \" count => $counter\\n\";\n }\n\n $i = $k + 1;\n\n if ($max < $counter) {\n $max = $counter;\n }\n\n $counter = 0;\n // $counter = 0;\n // $i = $i + $max;\n // $j = $i;\n // while($j > $max) {\n // if($j >= $num) break;\n \n \n // if($array[$j] >= $array[$j-1]) {\n // $counter++;\n\n // } else break;\n \n // $j--;\n \n // }\n \n \n /* for($j = $i;$j > $max ;$j--) {\n if($array[$j] >= $array[$j-1]) {\n $counter++;\n\n } else break;\n\n\n\n }*/\n\n } else {\n $counter = 0;\n $i += $max;\n }\n\n if ($max < $counter) {\n $max = $counter;\n }\n\n}\n\n\n\necho $max;"}, {"source_code": "= $array[$i+1]) {\n $counter++;\n } else {\n array_push($new_arr , $counter);\n $counter = 0;\n }\n\n\n}\n\necho max($new_arr);"}, {"source_code": "= $num) break;\n\n if ($array[$i - 1] <= $array[$i]) {\n $counter++;\n } elseif ($i + $max < $num && $array[$i + $max - 1] < $array[$i + $max]) {\n $i += $max;\n $counter = 1;\n $j = $i - 1;\n $k = $i + 1;\n\n while (($j > $i - $max - 2 && $array[$j] < $array[$j + 1]) || ($k < $num && $array[$k - 1] < $array[$k])) {\n if ($j > $i - $max - 2 && $array[$j] < $array[$j + 1]) {\n $counter++;\n $j--;\n }\n\n if ($k < $num && $array[$k - 1] < $array[$k]) {\n $counter++;\n $k++;\n }\n }\n \n $i = $k;\n\n // $counter = 0;\n // $i = $i + $max;\n // $j = $i;\n // while($j > $max) {\n // if($j >= $num) break;\n \n \n // if($array[$j] >= $array[$j-1]) {\n // $counter++;\n\n // } else break;\n \n // $j--;\n \n // }\n \n \n /* for($j = $i;$j > $max ;$j--) {\n if($array[$j] >= $array[$j-1]) {\n $counter++;\n\n } else break;\n\n\n\n }*/\n\n } else {\n $i += $max;\n }\n\n if ($max < $counter) {\n $max = $counter;\n }\n\n}\n\n\n\necho $max;"}, {"source_code": "= $num) break;\n\n if ($array[$i] <= $array[$i+1]) {\n $counter++;\n } else {\n $i = $i + $max;\n $j = $i;\n while($j > $max) {\n if($j >= $num) break;\n if($array[$j] >= $array[$j-1]) {\n $counter++;\n\n } else break;\n \n $j--;\n \n }\n \n \n \n\n }\n\n if ($max < $counter) {\n $max = $counter;\n }\n\n}\n\n\n\necho $max;"}, {"source_code": "= 0; $j--) {\n if (\n $notebooks[$i]['speed'] < $notebooks[$j]['speed'] &&\n $notebooks[$i]['ram'] < $notebooks[$j]['ram'] &&\n $notebooks[$i]['hdd'] < $notebooks[$j]['hdd']\n ) {\n $notebooks[$i]['cost'] = 1001;\n }\n }\n\n if ($notebooks[$i]['cost'] < $min) {\n $min = $notebooks[$i]['cost'];\n $answer = $i;\n }\n }\n\n return $answer;\n}\n\n$r = 0;\n$notebooks = [];\n\nlist($n) = fscanf($input, \"%d\\n\");\n\nfor ($i = 0; $i < $n; $i++) {\n list(\n $notebooks[$i]['speed'],\n $notebooks[$i]['ram'],\n $notebooks[$i]['hdd'],\n $notebooks[$i]['cost']\n ) = fscanf($input, \"%d %d %d %d\\n\");\n}\n\n$r = foo($notebooks, $n);\n\nfwrite($output, $r + 1);\n", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "e12d86f0c8645424b942d3dd9038e04d"} {"source_code": " $b) {\n\t\t\t\t$cost_a = $b - $fa;\n\t\t\t}\n\t\t}\n\t\tif ($fb <= $a && $b <= $fb) {\n\n\t\t} else {\n\t\t\tif ($fb < $a) {\n\t\t\t\t$cost_b = $a - $fb;\n\t\t\t} elseif ($fb > $b) {\n\t\t\t\t$cost_b = $b - $fb;\n\t\t\t}\n\t\t}\n\n\t\tif (DEBUG) {\n\t\t\techo $cost_a, \"!\", $cost_b, PHP_EOL;\n\t\t}\n\n\t\tif ($cost_a * $cost_b <= 0) {\n\t\t\t// $cost_a = $cost_b = 0;\n\t\t\t$cost_a = abs($fb - $fa);\n\t\t\t$cost_b = 0;\n\t\t}\n\t\tif (DEBUG) {\n\t\t\techo $cost_a, \"*\", $cost_b, PHP_EOL;\n\t\t}\n\n\t\t$answer = abs($cost_a) + abs($cost_b) + abs($ta - $tb);\n\t}\n\techo $answer . PHP_EOL;\n}\n", "positive_code": [{"source_code": "= $c) && ($g <= $d))\n {\n $j += abs($g - $i);\n }\n elseif($g > $d)\n {\n $j += $g - $d;\n $j += abs($d - $i);\n }\n print $j . \"\\n\";\n }\n}\n?>"}], "negative_code": [{"source_code": " $d)\n {\n $j += $g - $d;\n }\n $j += abs($c - $i);\n print $j . \"\\n\";\n }\n}\n?>"}, {"source_code": " $c)\n {\n $j += $g - $c;\n }\n $j += abs($g - $i);\n print $j . \"\\n\";\n }\n}\n?>"}, {"source_code": " $b) {\n\t\t\t$a_cost = $fa - $b;\n\t\t} elseif ($fa < $a) {\n\t\t\t$a_cost = $fa - $a;\n\t\t} else {\n\t\t\t$a_cost = 0;\n\t\t}\n\t\tif ($fb > $b) {\n\t\t\t$b_cost = $fb - $b;\n\t\t} elseif ($fb < $a) {\n\t\t\t$b_cost = $fb - $a;\n\t\t} else {\n\t\t\t$b_cost = 0;\n\t\t}\n\t\tif (DEBUG) {\n\t\t\techo $a_cost, \"*\", $b_cost . PHP_EOL;\n\t\t}\n\n\t\tif ($a_cost * $b_cost < 0) {\n\t\t\t$a_cost = $b_cost = 0;\n\t\t} else {\n\t\t\t$a_cost = abs($a_cost);\n\t\t\t$b_cost = abs($b_cost);\n\t\t}\n\t\t$f_cost = abs($fa - $fb);\n\t\t$t_cost = abs($ta - $tb);\n\t} else {\n\t\t$f_cost = abs($fa - $fb);\n\t}\n\tif (DEBUG) {\n\t\techo \"{$a_cost} {$b_cost}\\n\";\n\t}\n\n\t$cost = $a_cost + $b_cost + $f_cost + $t_cost;\n\n\techo $cost . PHP_EOL;\n}\n"}, {"source_code": " $b) {\n\t\t\t$a_cost = $fa - $b;\n\t\t} elseif ($fa < $a) {\n\t\t\t$a_cost = $fa - $a;\n\t\t} else {\n\t\t\t$a_cost = 0;\n\t\t}\n\t\tif ($fb > $b) {\n\t\t\t$b_cost = $fb - $b;\n\t\t} elseif ($fb < $a) {\n\t\t\t$b_cost = $fb - $a;\n\t\t} else {\n\t\t\t$b_cost = 0;\n\t\t}\n\t\tif (DEBUG) {\n\t\t\techo $a_cost, \"*\", $b_cost . PHP_EOL;\n\t\t}\n\n\t\tif ($a_cost * $b_cost <= 0) {\n\t\t\t$a_cost = $b_cost = 0;\n\t\t} else {\n\t\t\t$a_cost = abs($a_cost);\n\t\t\t$b_cost = abs($b_cost);\n\t\t}\n\t\t$f_cost = abs($fa - $fb);\n\t\t$t_cost = abs($ta - $tb);\n\t} else {\n\t\t$f_cost = abs($fa - $fb);\n\t}\n\tif (DEBUG) {\n\t\techo \"{$a_cost} {$b_cost}\\n\";\n\t}\n\n\t$cost = $a_cost + $b_cost + $f_cost + $t_cost;\n\n\techo $cost . PHP_EOL;\n}\n"}], "src_uid": "bdce4761496c88a3de00aa863ba7308d"} {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "31c43b62784a514cfdb9ebb835e94cad"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": "\n"}], "negative_code": [{"source_code": "\";\n }\n?>\n"}], "src_uid": "b46244f39e30c0cfab592a97105c60f4"} {"source_code": " $value)\n {\n $minValue = $value;\n $minCount = PHP_INT_MAX;\n $count = 0;\n }\n else if ($minValue === $value)\n {\n $count++;\n $minCount = min($count, $minCount);\n $count = 0;\n }\n else\n {\n $count++;\n }\n\n}\n\necho $minCount;\n", "positive_code": [{"source_code": ""}, {"source_code": "$i-$j)\n $rez=$i-$j;\n $j=$i;\n }\n if ($m==-1 || $a[$i]<$m)\n {\n $m=$a[$i];\n $j=$i;\n $rez=-1;\n }\n #echo $a[$i].\" \".$rez.\"\\n\";\n}\necho $rez;\n?>"}], "negative_code": [{"source_code": "$i-$j)\n $rez=$i-$j;\n $j=$i;\n }\n if ($m==-1 || $a[$i]<$m)\n {\n $m=$a[$i];\n $j=$i;\n $rez=-1;\n }\n #echo $a[$i].\" \".$rez.\"\\n\";\n}\necho $rez;\n?>"}, {"source_code": "$i-$j)\n $rez=$i-$j;\n $j=$i;\n }\n if ($m==-1 || $a[$i]<$m)\n {\n $m=$a[$i];\n $j=$i;\n $rez=-1;\n }\n echo $a[$i].\" \".$rez.\"\\n\";\n}\necho $rez;\n?>"}], "src_uid": "67af292ff23880ad9fd4349729e36158"} {"source_code": " \n $c)\n {\n $f++;\n $g = 1;\n }\n print $f . \" \" . $g . \"\\n\";\n $g++;\n }\n $h = floor($e / $c);\n $i = $e % $c;\n $j = $c - $h;\n $k = $c - $i + 1;\n for($x = 1; $x <= $e; $x++)\n {\n if($k > $c)\n {\n $j++;\n $k = 1;\n }\n print $j . \" \" . $k . \"\\n\";\n $k++;\n }\n}\n?>"}, {"source_code": ""}, {"source_code": " $c)\n {\n $f++;\n $g = 1;\n }\n print $f . \" \" . $g . \"\\n\";\n $g++;\n }\n $h = $c;\n $i = $c;\n for($x = 1; $x <= $e; $x++)\n {\n if($i < 1)\n {\n $h--;\n $i = $c;\n }\n print $h . \" \" . $i . \"\\n\";\n $i--;\n }\n}\n?>"}, {"source_code": " $c)\n {\n $f++;\n $g = 1;\n }\n print $f . \" \" . $g . \"\\n\";\n $g++;\n }\n $h = $c;\n $i = $c;\n for($x = 1; $x <= $e; $x++)\n {\n if($i < 1)\n {\n $h--;\n $i = $c;\n }\n print $h . \" \" . $i . \"\\n\";\n $i--;\n }\n}\n?>"}, {"source_code": "\n\n $n) {\n\tprintf(\"-1\");\n} else {\n\tprintf(\"%d 0\", $a[$n-$k]);\n}\n\n?>", "positive_code": [{"source_code": "$b) $c[$i]=(int)$b;\nsort($c, SORT_NUMERIC);\necho ($k>$n)?-1:$c[$n-$k].\" 0\";\n?>\n"}, {"source_code": " $square){\n\t$squares[$i] = (int)$square;\n}\nsort($squares, SORT_NUMERIC);\n\nif ($k <= $n){\n\tfputs(STDOUT, $squares[$n - $k].' 0');\n}else{\n\tfputs(STDOUT, '-1');\n}"}, {"source_code": "$arr[$j+1])\n\t\t{\n\t\t\t$tmp=$arr[$j];\n\t\t\t$arr[$j]=$arr[$j+1];\n\t\t\t$arr[$j+1]=$tmp;\n\t\t}\n\t}\n$i=$n-1;\n$sum=0;\nwhile ($i>=0)\n{\n\t$j=$i;\n\twhile ($arr[$j]==$arr[$i])\n\t{\n\t\t++$sum;\n\t\t--$j;\n\t\tif ($j==-1)\n\t\t\tbreak;\n\t}\n\t$i=$j;\n\tif ($sum==$k)\n\t\tbreak;\n}\nif ($sum==$k)\n\techo $arr[$i+1].\" \".$arr[$i+1];\nelse\n\techo -1;\n?>"}, {"source_code": " count($c))\n{\n print \"-1\";\n}\nelse\n{\n if($b == 1)\n {\n print $c[$b - 1] . \" \" . $c[$b - 1];\n }\n elseif($c[$b - 1] != $c[$b])\n {\n print $c[$b - 1] . \" \" . $c[$b - 1];\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": "$b) $c[$i]=(int)$b;\nsort($c, SORT_NUMERIC);\nif($k<=$n) echo $c[$n-$k].' 0';\nelse echo -1;\n?>"}], "negative_code": [{"source_code": " count($c))\n{\n print \"-1\";\n}\nelse\n{\n if($c[$b] != $c[$b + 1])\n {\n print $c[$b - 1] . \" \" . $c[$b - 1];\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": " count($c))\n{\n print \"-1\";\n}\nelse\n{\n if($b == 1)\n {\n print $c[$b - 1] . \" \" . $c[$b - 1];\n }\n elseif($c[$b] != $c[$b + 1])\n {\n print $c[$b - 1] . \" \" . $c[$b - 1];\n }\n else\n {\n print \"-1\";\n }\n}\n?>"}, {"source_code": ""}, {"source_code": "$arr[$j+1])\n\t\t{\n\t\t\t$tmp=$arr[$j];\n\t\t\t$arr[$j]=$arr[$j+1];\n\t\t\t$arr[$j+1]=$tmp;\n\t\t}\n\t}\n$i=$n-1;\n$sum=0;\nwhile ($i>0)\n{\n\t$j=$i;\n\twhile ($arr[$j]==$arr[$i])\n\t{\n\t\t++$sum;\n\t\t--$j;\n\t\tif ($j==-1)\n\t\t\tbreak;\n\t}\n\t$i=$j;\n\tif ($sum==$k)\n\t\tbreak;\n}\nif ($sum==$k)\n\techo $arr[$i+1].\" \".$arr[$i+1];\nelse\n\techo -1;\n?>"}], "src_uid": "4d743a00e11510c824080ad7f1804021"} {"source_code": " 0)\n {\n $c += $b;\n array_push($e, $b);\n }\n elseif($b < 0)\n {\n $d += abs($b);\n array_push($f, abs($b));\n }\n}\nif($c > $d)\n{\n print \"first\";\n}\nelseif($c < $d)\n{\n print \"second\";\n}\nelseif($c == $d)\n{\n $h = max(count($e), count($f));\n $g = 0;\n for($x = 0; $x < $h; $x++)\n {\n if($e[$x] != $f[$x])\n {\n $g = 1;\n if($e[$x] > $f[$x])\n {\n print \"first\";\n break;\n }\n elseif($e[$x] < $f[$x])\n {\n print \"second\";\n break;\n }\n }\n }\n if($g == 0)\n {\n if($b > 0)\n {\n print \"first\";\n }\n else\n {\n print \"second\";\n }\n }\n}\n?>", "positive_code": [{"source_code": " 0) {\n $c += $b;\n array_push($e, $b);\n } else if($b < 0) {\n $d += abs($b);\n array_push($f, abs($b));\n }\n}\nif ($c > $d) {\n echo \"first\";\n} else if ($c < $d) {\n echo \"second\";\n} else if ($c == $d) {\n $h = max(count($e), count($f));\n $g = 0;\n for ($i=0; $i<$h; $i++) {\n if ($e[$i] != $f[$i]) {\n $g = 1;\n if ($e[$i] > $f[$i]) {\n echo \"first\";\n break;\n } else if ($e[$i] < $f[$i]) {\n echo \"second\";\n break;\n }\n }\n }\n if ($g == 0) {\n if ($b > 0) {\n echo \"first\";\n } else {\n echo \"second\";\n }\n }\n}\n?>"}], "negative_code": [{"source_code": " 0)\n {\n $c += $b;\n array_push($e, $b);\n }\n elseif($b < 0)\n {\n $d += abs($b);\n array_push($f, abs($b));\n }\n}\nif($c > $d)\n{\n print \"first\";\n}\nelseif($c < $d)\n{\n print \"second\";\n}\nelseif($c == $d)\n{\n $e = max(count($e), count($f));\n $g = 0;\n for($x = 0; $x < $e; $x++)\n {\n if($e[$x] != $f[$x])\n {\n $g = 1;\n if($e[$x] > $f[$x])\n {\n print \"first\";\n break;\n }\n elseif($e[$x] < $f[$x])\n {\n print \"second\";\n break;\n }\n }\n }\n if($g == 0)\n {\n if($b > 0)\n {\n print \"first\";\n }\n else\n {\n print \"second\";\n }\n }\n}\n?>"}, {"source_code": " 0)\n {\n $c += $b;\n array_push($e, $b);\n }\n elseif($b < 0)\n {\n $d += abs($b);\n array_push($f, abs($b));\n }\n}\nif($c > $d)\n{\n print \"first\";\n}\nelseif($c < $d)\n{\n print \"second\";\n}\nelseif($c == $d)\n{\n $e = max(count($e), count($f));\n $f = 0;\n for($x = 0; $x < $e; $x++)\n {\n if($e[$x] != $f[$x])\n {\n $f = 1;\n if($e[$x] > $f[$x])\n {\n print \"first\";\n break;\n }\n elseif($e[$x] < $f[$x])\n {\n print \"second\";\n break;\n }\n }\n }\n if($f == 0)\n {\n if($b > 0)\n {\n print \"first\";\n }\n else\n {\n print \"second\";\n }\n }\n}\n?>"}], "src_uid": "d3684227d1f12cf36dc302e1ffee8370"} {"source_code": " 10) {\n echo $word[0] . strlen(substr($word, 1, -1)) . $word[strlen($word) - 1]. \"\\n\";\n } else {\n echo $word . \"\\n\";\n }\n}\n", "positive_code": [{"source_code": "10) $w=$w[0].(strlen($w)-2).$w[strlen($w)-1];\n print($w.\"\\n\");\n } \n?>"}, {"source_code": " 10) {\n\t\t\treturn $w[0] . ($l - 2) . $w[$l - 1];\n\t\t} else {\n\t\t\treturn $w;\n\t\t}\n\t}, $words);\n}\n\nfunction print_words($words, $split) {\n\tprint_r(implode($split, $words));\n}\n\n$words = read_words();\n$abbr_words = abbreviate_words($words);\nprint_r(implode(\"\\n\", $abbr_words));\n// print_words($abbr_words, \"\\n\");\n\n"}, {"source_code": " 10)? substr($arr[$i], 0, 1) . (strlen($arr[$i])-2) . substr($arr[$i], -1) : $arr[$i]) . (($i != count($arr) - 1)? \"\\r\\n\" : \"\");\n }\n?>"}, {"source_code": "= 1 && $lines <= 100)\n{\n $words = [];\n for($i = 0;$i < $lines; $i++)\n $words[$i] = fgets(STDIN);\n foreach($words as $word)\n {\n if(strlen($word) > 12)\n echo $word[0].\"\".(strlen($word) - 4) .\"\".$word[-3].\"\\n\";\n else\n echo $word;\n\n } \n}\nelse\n{\n echo \"Not valid input\\n\";\n}\n\n\n\n\n\n\n \n\n?>"}, {"source_code": " 10) {\n\t\t\treturn $w[0] . ($l - 2) . $w[$l - 1];\n\t\t} else {\n\t\t\treturn $w;\n\t\t}\n\t}, $words);\n}\n\nfunction print_words($words, $split) {\n\n\tforeach ($words as $w) {\n\t\techo $w . \"\\n\";\n\t}\n\techo \"\\n\";\n}\n\n$words = read_words();\n$abbr_words = abbreviate_words($words);\n\nprint_words($abbr_words, \"\\n\");\n\n"}, {"source_code": "=1 && $number <=100){\n while ($number--!=0){\n $word = readline(\"Enter a word: \");\n if (strlen($word)>=1 && strlen($word)<=100){\n $words[] = $word;\n }\n }\n}\nforeach ($words as $w) {\n $length = strlen($w);\n if ($length<=10){\n echo $w.\"\\n\";\n } else {\n echo $w[0].($length-2).$w[$length-1].\"\\n\";\n }\n}\n?>"}, {"source_code": " 10 ? $w[0] . ($l - 2) . $w[$l - 1] : $w;\n\t\t}, \n\t\t$words\n\t);\n}\n\n$words = read_words();\n$abbr_words = abbreviate_words($words);\n\nprint_r(implode(\"\\n\", $abbr_words));\n\n"}, {"source_code": " 10) { \t$var1 = $var1[0] . ($num-2) . $var1[$num-1]; } echo $var1 . \"\\n\";} ?>"}, {"source_code": " 10) {\n $x = str_split($item);\n echo $x[0] . ($l - 2) . $x[$l - 1];\n } else {\n echo $item;\n }\n echo \"\\n\";\n }\n}\n"}, {"source_code": "10){\n fwrite(STDOUT, $str[0].($ln-2).$str[$ln-1].\"\\n\");\n }else{\n fwrite(STDOUT, $str.\"\\n\"); \n }\n}\n"}, {"source_code": " 10) {\n echo $str[0] . ($len - 2) . $str[$len-1] . \"\\n\";\n } else {\n echo $str . \"\\n\";\n }\n\n}\n"}, {"source_code": "10)\n {\n echo substr($textmassiv[$i+1],0,1);\n echo strlen(trim($textmassiv[$i+1]))-2;\n echo substr(trim($textmassiv[$i+1]),-1,1).\"\\n\";\n }\n else\n {\n echo trim($textmassiv[$i+1]).\"\\n\";\n }\n}\n?>"}, {"source_code": " 10) {\n echo substr($word, 0, 1) . (strlen($word) - 2) . substr($word, -1, 1);\n } else {\n echo $word;\n }\n echo \"\\n\";\n}"}, {"source_code": ""}, {"source_code": ""}, {"source_code": "10) {\n $s=go($word);\n echo $s.PHP_EOL;\n }\n else\n echo $word.PHP_EOL;\n }\n}"}, {"source_code": " 10) {\n echo $s[0] . ($strLength-2) . $s[$strLength-1] . \"\\n\";\n } else {\n echo $s . \"\\n\";\n }\n}"}, {"source_code": " 10) {\n echo $row[0] . ($length - 2) . $row[$length - 1] . \"\\n\";\n } else {\n echo $row . \"\\n\";\n }\n}"}, {"source_code": " 10)\n {\n $textArray = str_split($text[$i]);\n \n $countString = strlen($text[$i]);\n \n $stringAkhir = $text[$i][$countString - 1];\n \n $splice = $countString - 2;\n \n array_splice($textArray, 1, $splice);\n \n for ($j=0; $j < 2; $j++) { \n array_splice($textArray, $j + 1, 0, strval($splice)[$j]);\n }\n echo implode($textArray) . \"\\n\";\n } else {\n echo $text[$i] . \"\\n\";\n }\n}\n?>"}, {"source_code": " 10){ echo $i[0].(strlen($i)-2).$i[strlen($i)-1].\"\\n\"; }\n else echo $i.\"\\n\";\n}\n?>"}, {"source_code": "10){\n echo $s[0].(strlen($s)-2).substr($s,-1,1).\"\\n\";\n } else echo \"$s\\n\";\n\n\n}\n\n\n\n\n\n"}, {"source_code": " 10 )\n {\n echo $s[0] . \"\" . ( strlen($s)-2 ) . \"\" . $s[ strlen($s)-1] . \"\\n\" ;\n }\n else\n {\n echo $s . \"\\n\" ;\n }\n}\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n\n?>"}, {"source_code": " 10) {\n $eachstr = str_split($lowercase);\n $result = $strlen - 2;\n return $eachstr[0].$result.$eachstr[$strlen-1];\n } else{\n return $lowercase;\n }\n }\n}\n$obj = new LongWords();\n\nfunction getinput() {\n return trim(fgets(STDIN));\n}\n\n$t = (int)getinput();\n// print gettype($t);\nwhile($t--) {\n print $obj->getResult(getinput()).\"\\n\";\n}"}, {"source_code": "= 1 && $strlen <= 100) {\n if($strlen > 10) {\n $eachstr = str_split($lowercase);\n $strlen = $strlen - 1;\n $result = $strlen - 1;\n return $eachstr[0].$result.$eachstr[$strlen];\n } else{\n if(!is_numeric($lowercase)) {\n return $lowercase;\n }\n return false;\n }\n }\n return false;\n }\n}\n$obj = new LongWords();\n\nfunction getinput() {\n return trim(fgets(STDIN));\n}\n\n$t = (int)getinput();\n// print gettype($t);\nwhile($t--) {\n print $obj->getResult(getinput()).\"\\n\";\n}"}, {"source_code": " 10) {\n $result = \"{$string[0]}\" . ($length-2) . \"{$string[$length - 1]}\";\n array_push($resultArray, $result);\n } else {\n array_push($resultArray, $string);\n }\n}\nforeach ($resultArray as $result) {\n printf(\"%s\\n\",$result) ;\n}\n"}, {"source_code": ""}, {"source_code": " 10){\n\t\t\n\t\tfor($i = 0;$i < sizeof($split); $i++){\n\n\t\t\t$last = sizeof($split) -1;\n\t\t\t$comp = sizeof($split) -2;\n\n\t\t\techo $split[0].$comp.$split[$last].\"\\n\";\n\t\t\tbreak;\n\t\t}\n\n\n\n\n\n\t}else{\n\t\techo $word.\"\\n\";\n\t}\n}"}, {"source_code": ""}, {"source_code": " 10){\n $firstChar = $result[0];\n $lastChar = $result[$numOfChar - 1] ;\n echo \"\\n\".$firstChar.($numOfChar-2).$lastChar ;\n }else{\n echo \"\\n\".$result ;\n }\n \n}\n"}, {"source_code": "\n"}, {"source_code": " 10) {\n $word = $word[0] . ($num-2) . $word[$num - 1];\n }\n echo $word.\"\\n\";\n}\n"}, {"source_code": " 10) {\n echo $a[$i]{0};\n echo strlen($a[$i])-2;\n echo $a[$i]{strlen($a[$i])-1}.\"\\n\";\n } else {\n echo $a[$i].\"\\n\";\n }\n }\n ?>"}, {"source_code": " 10) {\n printf (\"%s%d%s\\n\",$a[$i]{0},strlen($a[$i])-2,$a[$i]{strlen($a[$i])-1});\n } else {\n echo $a[$i].\"\\n\";\n }\n }\n ?>"}, {"source_code": " 10) {\n\t\techo substr($s, 0, 1),($l-2),substr($s,-1),PHP_EOL;\n\t} else { echo $s,PHP_EOL;}\n}\n?>\n"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " 10) {\n printf(\"%s%d%s\", $word[0], strlen($word) - 2, $word[-1]);\n } else {\n printf(\"%s\", $word);\n }\n printf(\"\\n\");\n}\n?>\n"}, {"source_code": " 10) {\n if (!ctype_digit($word)) {\n $first = $word{0};\n $last = substr($word, -1);\n return $first . (strlen($word) - 2) . $last;\n }\n } else {\n if (!ctype_digit($word)) {\n return $word;\n }\n }\n}\n\nwhile ($word = fgets(STDIN)) {\n echo solve($word).PHP_EOL;\n}\n?>"}, {"source_code": " 10)\n {\n print $b[0] . (strlen($b) - 2) . $b[strlen($b) - 1] . \"\\n\";\n }\n else\n {\n print $b . \"\\n\";\n }\n}\n?>"}, {"source_code": " 8 ? $s[0].$ln.$s[$ln+1]:$s;\n echo \"\\n\";\n}\n?>"}, {"source_code": " 8 ? $s[0].$ln.$s[$ln+1]:$s;\n echo \"\\n\";\n}\n?>"}, {"source_code": " 8) ? $s[0] . '' . (strlen($s) - 2) . '' . $s[strlen($s) - 1]:$s;\n echo \"\\n\";\n \n}\n"}, {"source_code": " 10) {\n\t\t\techo $in[0].($len-2).$in[$len-1].PHP_EOL;\n\t\t} else {\n\t\t\techo $in.PHP_EOL;\n\t\t}\t\n\t}\n?>"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) <= 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) -2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n\n}\n// print_r(($dataClear));\nfor($i = 0; $i < $amount ; $i++){\n if($dataClear[$i] == max(array_keys($dataClear))){\n echo($dataClear[$i]);\n }else{\n echo($dataClear[$i]).\"\\n\";\n }\n}\n?>"}, {"source_code": "= 0){\n\n $word = trim(fgets($handle));\n\n $length = strlen($word);\n\n if($length > 10){\n\n echo $word[0]. ($length - 2) . $word[$length - 1].\"\\r\";\n\n }else{\n\n echo $word.\"\\r\";\n \n }\n\n $number--;\n}\n\nfclose($handle);"}, {"source_code": "= 0){\n\n $word = trim(fgets($handle));\n $length = strlen($word);\n echo $length > 10 ? $word[0]. ($length - 2) . $word[$length - 1].\"\\r\" : $word.\"\\r\";\n $number--;\n \n}\n\nfclose($handle);"}, {"source_code": "10) {\n echo $s{0}.($str_len-2).$s{$str_len-1}.\"\\n\";\n } else echo $s.\"\\n\";\n}\n?>"}, {"source_code": " 10 ) {\n\t\techo $str{0} . ($len - 2) . $str{$len - 1};\n\n\t} else {\n\t\techo $str;\n\t}\n\n\techo \"\\n\";\n}"}, {"source_code": " 10) {\n echo $s[0].(strlen($s) - 2).$s[strlen($s) -1 ].\"\\n\";\n } else {\n echo $s.\"\\n\";\n }\n}"}, {"source_code": " 10) {\n $length = strlen($w);\n $e = substr($w, -1);\n $a = $w[0] . (string)($length - 2) . $e;\n echo($a . PHP_EOL);\n } else {\n //$arr[$i] = $w;\n echo($w . PHP_EOL);\n }\n }"}, {"source_code": ""}, {"source_code": " 0;$n--){\n $word = trim(fgets(STDIN));\n $wLen = strlen($word);\n if($wLen > 10)\n {\n echo $word[0] . ($wLen -2 ) . $word[$wLen-1] . \"\\n\";\n }\n else echo $word . \"\\n\";\n}\n// there will be 14\n?>"}, {"source_code": "\n"}, {"source_code": ""}, {"source_code": "$line){\n\tif($k != 0){\n\t\t$out[] = strlen($line)<=11?$line:substr($line, 0,1).(strlen($line)-3).substr($line, strlen($line)-2);\n\t}\n}\nput(implode(\"\\n\",$out));\n?>"}, {"source_code": "10)\n {\n echo $a[$c+1]{0}.(strlen($a[$c+1])-2).$a[$c+1]{(strlen($a[$c+1])-1)}.\"\\n\";\n }\n else\n {\n echo $a[$c+1].\"\\n\";\n }\n}\n?>"}, {"source_code": "10) {\n\t$words[$i]=$words[$i][0].(strlen($words[$i])-2).$words[$i][strlen($words[$i])-1];\n}\n}\nfor ($i=0; $i < $n; $i++) { \n\techo \"$words[$i]\\n\";\n}\n?>"}], "negative_code": [{"source_code": "$data = array();\n$data = file('php://stdin');\n\nif($data[0] >= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) - 2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n \n}\nfor($i = 0; $i < $amount; $i++){\n echo($dataClear[$i]);\n}"}, {"source_code": " 0)\n{\n\tfscanf(STDIN, \"%s\", $w);\n\tif(strlen($w) < 11)\n\t\tfprintf(STDOUT, \"%s\". $w);\n\telse\n\t\tfprintf(STDOUT, \"%s\", $w[0] . (strlen($w) - 2) . $w[strlen($w)-1]);\n\t$n--;\n}\n\n"}, {"source_code": " $value){\n\n// echo $value;\n if(strlen($value) < 10 ) echo $value;\n else{\n //\n echo $value[0];\n echo strlen($value) - 2;\n echo substr(\"$value\", -1); // returns last\n }\n\n echo \"\\n\";\n }\n// fclose($file);\n\n}\n?>"}, {"source_code": " 8 ? $s[0].$ln.$s[$ln+1] : $s;\n}"}, {"source_code": "8) echo substr($nam,0,1).$ln.substr($nam,$lc);\n else echo $nam;\n }\n?>"}, {"source_code": ""}, {"source_code": " MAX_LENGTH) {\n return $s[0] . ($sl - 2) . $s[$sl - 1];\n }\n\n return $s;\n}\n\n$results = [];\n\n$n = fread($input, 3);\n\nfor ($i = 0; $i < $n; $i++) {\n $s = trim(fread($input, 100));\n\n $r = foo($s);\n\n if ($i + 1 < $n) {\n $r .= PHP_EOL;\n }\n\n fwrite($output, $r);\n}\n"}, {"source_code": " 0;$n--){\n $word = trim(fgets(STDIN));\n $wLen = strlen($word);\n if($wLen > 10)\n {\n echo $word[0] . ($wLen -2 ) . $word[$wLen-1];\n }\n else echo $word;\n}\n\n// there will be 14\n?>"}, {"source_code": " 10) {\n\t\t\treturn $w[0] . ($l - 2) . $w[$l - 1];\n\t\t} else {\n\t\t\treturn $w;\n\t\t}\n\t}, $words);\n}\n\nfunction print_words($words, $split) {\n\tforeach ($words as $w) {\n\t\techo $w;\n\t}\n\techo \"\\n\";\n}\n\n$words = read_words();\n$abbr_words = abbreviate_words($words);\n\nprint_words($abbr_words, \"\\n\");\n\n"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) -2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n \n}\n\nfor($i = 0; $i < count($dataClear); $i++){\n echo($dataClear[$i]).\"\\n\";\n}\n\n?>"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)));\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n \n}\nfor($i = 0; $i < $amount; $i++){\n echo($dataClear[$i]).\"\\n\";\n}\n\n?>"}, {"source_code": "= 0){\n\n $word = fgets($handle);\n\n $length = strlen($word);\n\n if($length <= 10){\n\n echo $word.\"\\n\";\n\n }else{\n\n echo $word[0]. ($length - 3) . $word[$length - 2].\"\\n\";\n\n }\n \n $number--;\n}\n\nfclose($handle);"}, {"source_code": "10) {\n\t$words[$i]=$words[$i][0].(strlen($words[$i])-2).$words[$i][strlen($words[$i])-1];\n}\n}\nfor ($i=0; $i < $n; $i++) { \n\techo $words[$i].\"
\";\n}\n?>"}, {"source_code": "10){\n echo substr($nam,0,1);\n echo ($ln)-2;\n echo substr($nam,-1);\n }\n else echo $nam;\n }\n?>"}, {"source_code": " 10) {\n\t\techo $in[0].$len.$in[$len-1];\n\t} else {\n\t\techo $in;\n\t}\n?>"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) -2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n \n}\n\nfor($i = 0; $i < count($dataClear); $i++){\n echo($dataClear[$i]).\"\\n\";\n}\n\n?>"}, {"source_code": "= 10) {\n echo $word[0].($b-2).$word[strlen($word)-1] , \"
\";\n }\n else{echo $word ,\"
\";}\n}\n"}, {"source_code": " $word)\n{\n if(strlen($word) > 10)\n {\n echo substring($word, 0,1) . (strlen($word)-2) . substring($word, -1) . PHP_EOL;\n }\n}\n\n"}, {"source_code": "\n"}, {"source_code": "\";\n else\n echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1).\"
\";\n }\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$in);\nlongWord($in);\n?>"}, {"source_code": " $word)\n{\n if(strlen($word) > 10)\n {\n echo substring($word, 0,1) . (strlen($word)-2) . substring($word, -1) . PHP_EOL;\n }\n}\n\n"}, {"source_code": "10) {\n\t$words[$i]=$words[$i][0].(strlen($words[$i])-2).$words[$i][strlen($words[$i])-1];\n}\n}\nfor ($i=0; $i < $n; $i++) { \n\techo $words[$i].\"
\";\n}\n?>"}, {"source_code": " 10) {\n echo $var[0] . (strlen($var)-2) . $var[strlen($var)-1];\n }\n else{\n echo $var;\n }\n}"}, {"source_code": "$lengthLimit) {\n preg_match(\"/(.{1})(.+)(.{1})/\", $arr[$i], $outArr);\n echo $outArr[1].((string)strlen($outArr[2])).$outArr[3];\n } else {\n echo $arr[$i];\n }\n }"}, {"source_code": "10){\necho $str[0]. $num2 . $str[$num1-3] .\"\\n\" ;\n}\nelse {\necho $str .\"\\n\";\n}\n}\n\n?>"}, {"source_code": "\";\n else\n echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1).\"
\";\n }\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$in);\nlongWord($in);\n?>"}, {"source_code": " $word) {\n\tif (strlen($word) < 10) {\n\t\tfprintf($fw, $word . \"\\n\");\n\t} else {\n\t\tfprintf($fw, abbreviation($word) . \"\\n\");\n\t}\n\t\n}\n\nfunction abbreviation($word)\n{\n\t$firstChar = $word[0];\n\t$lastChar = substr($word, -1);\n\t\n\treturn $firstChar . (strlen($word) - 2) . $lastChar;\n}\n\nfclose($fr);\nfclose($fw);"}, {"source_code": "= 0){\n\n $word = fgets($handle);\n\n $length = strlen($word);\n\n if($length > 11){\n\n echo $word[0]. ($length - 4) . $word[$length - 3];\n\n }else{\n \n echo $word;\n \n }\n\n $number--;\n}\n\nfclose($handle);"}, {"source_code": "10){\n echo substr($nam,0,1);\n echo strlen($nam)-2;\n echo substr($nam,-1);\n }\n else echo $nam;\n }\n?>"}, {"source_code": " 10) {\n\t\t\techo $in[0].($len-2).$in[$len-1].'\\n';\n\t\t} else {\n\t\t\techo $in.'\\n';\n\t\t}\t\n\t}\n?>"}, {"source_code": " 10)? (substr($o[$i],0,1) . (strlen($o[$i]) - 4) . substr($o[$i],-3)) : $o[$i] ) ;\n}\n\n?>\n"}, {"source_code": "fscanf(STDIN, \"%d\", $length);\nfor($i = 0; $i < $length; $i ++) {\n fscanf(STDIN, \"%s\", $s);\n $strLength = strlen($s);\n if($strLength > 10) {\n echo $s[0] . $s[$strLength-1];\n } else {\n echo $s;\n }\n}"}, {"source_code": "10){\n $fstr .= $str[0] . strlen($str)-2 . $str[strlen($str)-1] . \"/n\";\n }\n else{\n $fstr .= $str;\n }\n}\nprint $fstr;\n"}, {"source_code": "= 0){\n\n $word = fgets($handle);\n\n $length = strlen($word);\n\n if($length <= 10){\n\n echo $word.\"\\n\";\n\n }else{\n\n echo $word[0]. ($length - 3) . $word[$length - 2].\"\\n\";\n\n }\n \n $number--;\n}\n\nfclose($handle);"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) -2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n \n}\n$counter;\nif($amount < count($dataClear)){\n $counter = $amount;\n}else{\n $counter = count($dataClear);\n}\n\nfor($i = 0; $i < $counter ; $i++){\n if($dataClear[$i] == end($dataClear)){\n echo($dataClear[$i]);\n }else{\n echo($dataClear[$i]).\"\\n\";\n }\n}\n?>"}, {"source_code": "\";\n else\n echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1).\"
\";\n }\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$in);\nlongWord(4);\n?>"}, {"source_code": " 10) {\n $result = \"{$string[0]}\" . $length . \"{$string[$length - 1]}\";\n array_push($resultArray, $result);\n } else {\n array_push($resultArray, $string);\n }\n}\nforeach ($resultArray as $result) {\n printf(\"%s\\n\",$result) ;\n}\n"}, {"source_code": "= 10) {\n echo $word[0].($b-2).$word[strlen($word)-1] , '
';\n }\n else{echo $word ,'
';}\n}\n"}, {"source_code": " 10) { \t$var1 = $var1[0] . ($num-2) . $var1[$num-1]; } echo $var1;} ?>"}, {"source_code": "= 1 && $number <= 100) {\n for ($i=1; $i <= $number; $i++) {\n $line[$i] = trim(fgets(STDIN)); \n } \n for ($i=1; $i <= $number; $i++) {\n if (strlen($line[$i]) > 10) { \n print(substr_replace($line[$i], strlen($line[$i])-2, 1, strlen($line[$i])-2) . \"\\n\"); \n } else { print ($line[$i]);}\n } \n} "}, {"source_code": " 10) {\n $w = $var[0].(strlen($var)-2).$var[strlen($var)-1];\n echo $w;\n }\n else{\n echo $var;\n }\n}"}, {"source_code": " $word)\n{\n if(strlen($word) > 10)\n {\n echo substr($word, 0,1) . (strlen($word)-2) . substr($word, -1) . PHP_EOL;\n }\n}"}, {"source_code": " 0)\n{\n\tfscanf(STDIN, \"%s\", $w);\n\tif(strlen($w) < 11)\n\t\tfprintf(STDOUT, \"%s\", $w);\n\telse\n\t\tfprintf(STDOUT, \"%s\", $w[0] . (strlen($w) - 2) . $w[strlen($w)-1]);\n\t$n--;\n}\n"}, {"source_code": " 10) {\n\t\t\techo $in[0].($len-2).$in[$len-1];\n\t\t} else {\n\t\t\techo $in;\n\t\t}\t\n\t}\n?>"}, {"source_code": "10) {\n echo $s{0}.(strlen($s)-2).$s{strlen($s)-1}.\"\\n\";\n } else echo $s.\"\\n\";\n}\n?>"}, {"source_code": "\n\n"}, {"source_code": " 10) {\n $x = str_split($item);\n echo $x[0] . ($l - 2) . $x[$l - 1];\n } else {\n echo $item;\n }\n echo \"\\n\";\n }\n}\n"}, {"source_code": " MAX_LENGTH) {\n return $s[0] . ($sl - 2) . $s[$sl - 1];\n }\n\n return $s;\n}\n\n$n = (int)trim(fgets($input, 3));\n\nfor ($i = 0; $i <= $n; $i++) {\n $s = trim(fgets($input, 101));\n\n $r = foo($s);\n $r .= PHP_EOL;\n\n echo ltrim($r);\n}\n"}, {"source_code": "';\n\t\tcontinue;\n\t}else{\n\t\t$t = strlen($s);\n\t\techo $s[0];\n\t\techo $t-2;\n\t\techo $s[$t - 1];\n\t}\n}"}, {"source_code": " 10) {\n\t\t\treturn $w[0] . ($l - 2) . $w[$l - 1];\n\t\t} else {\n\t\t\treturn $w;\n\t\t}\n\t}, $words);\n}\n\nfunction print_words($words, $split) {\n\tforeach ($words as $w) {\n\t\techo $w;\n\t}\n\techo \"\\n\";\n}\n\n$words = read_words();\n$abbr_words = abbreviate_words($words);\n\nprint_words($abbr_words, \"\\n\");\n\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++];}} \n\n\n$dxs = new stdIn(false);\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////// DECLARE VARIABLES ///////////////////////////////////////\n$n = $dxs->G();\n$arStr = $dxs->arr_txt;\nunset($arStr[0]);\n///////////////////////////////////// DECLARE FUNCTIONS ///////////////////////////////////////\n\n/////////////////////////////////// MAIN CODE /////////////////////////////////////////////////\nforeach ($arStr as $str)\n{\n\tif (strlen($str) > 4)\n\t\techo substr($str, 0, 1).(strlen($str)-2).substr($str, -1);\n\telse\n\t\techo $str;\n\techo \"\\n\";\n}\n////////////////////////////////// PRINT OUTPUT ////////////////////////////////////////////////\n// print_R($arStr);\n/////////////////////////////////////////////////////////////////////////////////////////////////\n?>"}, {"source_code": "\";\n else\n echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1).\"
\";\n }\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$in);\nlongWord($in);\n?>"}, {"source_code": " 10){\n echo substr($str, 0,1).(strlen($str)-4).substr($str, strlen($str)-3,1).PHP_EOL;\n }else{\n echo $str.PHP_EOL;\n } \n }\n}\n?>"}, {"source_code": " 10)? (substr($o[$i],0,1) . (strlen($o[$i]) - 3) . substr($o[$i],-2)) : $o[$i] ) ;\n}\n\n?>\n"}, {"source_code": ""}, {"source_code": " 10) {\n $first = $word{0};\n $last = $word{((int)strlen($word)-1)};\n return $first. (strlen($word) - 2) . $last;\n } else {\n if (!is_numeric($word)) {\n return $word;\n }\n }\n}\n\n$word = trim(fgets(STDIN));\necho solve($word);\n\n?>"}, {"source_code": " 10 )\n {\n echo $s[0] . \"\" . ( strlen($s)-2 ) . \"\" . $s[ strlen($s)-2] . \"\\n\" ;\n }\n else\n {\n echo $s . \"\\n\" ;\n }\n}\n\nfwrite($stdout);\n\nfclose($stdin);\nfclose($stdout);\n\n?>"}, {"source_code": "10){\n\t\t$first = $word[0];\n\t\t$last = $word[strlen($word)];\n\t\t$len = strlen($word)-2;\n\t\techo $first.$len.$last.\"\\n\";\n\t}\n\telse{\n\techo $word.\"\\n\";\n\t}\n}"}, {"source_code": " $value){\n\n// echo $value;\n if(strlen($value) < 10 ) echo $value;\n else{\n //\n echo $value[0];\n echo strlen($value) - 2;\n echo substr(\"$value\", -1); // returns \"s\"\n }\n\n// echo \"
\";\n }\n fclose($file);\n\n}\n?>"}, {"source_code": " 10)? (substr($o[$i],0,1) . (strlen($o[$i]) - 3) . substr($o[$i],-2,1)) : $o[$i] ) .\"\\n\";\n}\n\n?>\n"}, {"source_code": "= 10) {\n echo $a[0].($b-2).$a[strlen($a)-1];\n}\nelse{echo $a;}"}, {"source_code": " 0)\n{\n\tfscanf(STDIN, \"%s\", $w);\n\tif(strlen($w) < 11)\n\t\tfprintf(STDOUT, \"%s\". $w);\n\telse\n\t\tfprintf(STDOUT, \"%s\", $w[0] . (strlen($w) - 2) . $w[strlen($w)-1]);\n\t$n--;\n}\n//\n\n"}, {"source_code": "$a = fgets(STDIN);\necho $a{0}.(strlen($a)-2).$a{(strlen($a)-1)};"}, {"source_code": " $value){\n\n// echo $value;\n if(strlen($value) < 10 ) echo $value;\n else{\n //\n echo $value[0];\n echo strlen($value) - 2;\n echo substr(\"$value\", -1); // returns \"s\"\n }\n\n// echo \"
\";\n }\n fclose($file);\n\n}\n?>"}, {"source_code": " 10) {\n\t\techo $in[0].($len-2).$in[$len-1];\n\t} else {\n\t\techo $in;\n\t}\n?>"}, {"source_code": "10){\n echo $s[0].(strlen($s)-2).substr($s,-1,1).\"\\n\";\n } else echo \"$s\\n\";\n\n\n}\n\n\n\n\n\n"}, {"source_code": "#!/usr/bin/python\n# ------- start import ------- #\n# import sys \n# ------- end import ------- # \n\n# ------- start main func ------- # \ndef main():\n # ------- start grab input ------- #\n word_no = input()\n number = 0\n words = []\n for number in range (word_no):\n word = raw_input()\n print (word[0:4])\n # ------- end grab input ------- # \n\n# ------- end main func ------- # \n\n# ------- start declare main func ------- # \nif __name__ == \"__main__\" : main()\n# ------- end declare main func ------- # "}, {"source_code": "';\n\t\tcontinue;\n\t}else{\n\t\t$t = strlen($s);\n\t\techo $s[0];\n\t\techo $t-2;\n\t\techo $s[$t - 1];\n\t}\n}"}, {"source_code": "\";\n else\n echo substr($arr[$i],0,1).(strlen($arr[$i])-2).substr($arr[$i],strlen($arr[$i])-1,1).\"
\";\n }\n}\n$stdin = fopen(\"php://stdin\",\"r\");\nfscanf($stdin,\"%d\",$in);\nlongWord(4);\n?>"}, {"source_code": " 10) {\n\t\techo $in[0].$len.$in[$len-1];\n\t} else {\n\t\techo $in;\n\t}\n?>"}, {"source_code": " 10) {\n $y = 2;\n if ($i == $n - 1) $y = 1;\n echo $st[0].(strlen($st) - 2).$st[strlen($st) - $y];\n echo PHP_EOL;\n } else echo $st;\n }\n?>"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) -2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n\n}\n$counter;\nif($amount < count($dataClear)){\n $counter = $amount;\n}else{\n $counter = count($dataClear);\n}\n// echo(end($dataClear));\nfor($i = 0; $i < $counter ; $i++){\n if($dataClear[$i] == end($dataClear)){\n echo($dataClear[$i]);\n }else{\n echo($dataClear[$i]).\"\\n\";\n }\n}\n?>"}, {"source_code": "\";\n\t\t$i++;\n\t}\n?>"}, {"source_code": " 10) {\n\t\techo $in[0].($len-2).$in[$len-1].'\\n';\n\t} else {\n\t\techo $in.'\\n';\n\t}\n?>"}, {"source_code": "2){\n // array_shift($str);\n\n\n foreach ($str as $i => $word)\n {\n if(strlen($word) > 10)\n {\n echo substr($word, 0,1) . (strlen($word)-2) . substr($word, -1) . PHP_EOL;\n }\n } \n}\n?>"}, {"source_code": " $value){\n\n// echo $value;\n if(strlen($value) < 10 ) echo $value;\n else{\n //\n echo $value[0];\n echo strlen($value) - 2;\n echo substr(\"$value\", -1); // returns last\n }\n\n echo \"\\n\";\n }\n// fclose($file);\n\n}\n?>"}, {"source_code": " 10) {\n $result = \"{$string[0]}\" . $length . \"{$string[$length - 1]}\";\n array_push($resultArray, $string . \"1\");\n } else {\n array_push($resultArray, $string);\n }\n}\nforeach ($resultArray as $result) {\n echo $result . \"
\";\n}\n"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) -2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n \n}\n$counter;\nif($amount < count($dataClear)){\n $counter = $amount;\n}else{\n $counter = count($dataClear);\n}\nfor($i = 0; $i < $counter ; $i++){\n\n echo($dataClear[$i]);\n}\n?>"}, {"source_code": " 10) {\n $w=$w[0].(strlen($w)-2).$w[strlen($w)-1];\n echo $w;\n }\n \n}"}, {"source_code": "10)? $in[0].($length-2).$in[$length-1] : $in;\n\techo \"\\n\";\n?>"}, {"source_code": "10){\n\t\t$first = $word[0];\n\t\t$last = $word[strlen($word)];\n\t\t$len = strlen($word)-2;\n\t\techo $first.$len.$last;\n\t}\n}"}, {"source_code": " $value) {\n $stdIn[$key] = (int)$value;\n }\n }\n\n return $stdIn;\n}\n\n// word too long > 10 chars\n\n$words = getStdIn();\n\nforeach ($words as $key => $word) {\n if (($len = strlen($word)) > 10) {\n echo $word[0] . ($len - 2) . substr($word, -1) . PHP_EOL;\n } else {\n echo $word . PHP_EOL;\n }\n}\n"}, {"source_code": "= 10) {\n echo $word[0].($b-2).$word[strlen($word)-1] , \"\\n\";\n }\n else{echo $word ,\"\\n\";}\n}\n"}, {"source_code": " 10) { \t$var1 = $var1[0] . ($num-2) . $var1[$num-1]; } echo $var1;} ?>"}, {"source_code": "= 1 && $data[0] <= 100){\n $amount = array_shift($data);\n}\n\n$dataClear = array();\nforeach($data as $k){\n if(strlen(trim($k)) < 10){\n $dataClear[] = trim($k);\n }\n if(strlen(trim($k)) > 10){\n $lenght = (strlen(trim($k)) -2);\n $lChar = strtolower(substr(trim($k), 0, 1));\n $rChar = strtolower(substr(trim($k), -1));\n $dataClear[] = $lChar.$lenght.$rChar;\n }\n \n}\n$counter;\nif($amount < count($dataClear)){\n $counter = $amount;\n}else{\n $counter = count($dataClear);\n}\nfor($i = 0; $i < $counter ; $i++){\n echo($dataClear[$i]).\"\\n\";\n}\n\n?>"}, {"source_code": " MAX_LENGTH) {\n return $s[0] . ($sl - 2) . $s[$sl - 1];\n }\n\n return $s;\n}\n\n$n = trim(fgets($input, 3));\n\nfor ($i = 0; $i < $n; $i++) {\n $s = trim(fgets($input, 101));\n\n $r = foo($s);\n\n if ($i + 1 < $n) {\n $r .= PHP_EOL;\n }\n\n echo ltrim($r);\n}\n"}, {"source_code": "10){\n echo substr($nam,0,1);\n echo ($ln)-2;\n echo substr($nam,-1);\n }\n else echo $nam;\n }\n?>"}], "src_uid": "6639d6c53951f8c1a8324fb24ef68f7a"} {"source_code": " $el) {\n // if el is power of 2, source array lookup will give us a hard time\n $ar[] = $el % 200003;\n }\n\n $maxP = 1;\n $maxR = 0;\n\n $dm = array_fill(0, $n, 1);\n $dmStarts = array_keys($dm);\n $latestPosition = array_flip(array_reverse($ar, true));\n\n foreach ($ar as $currentPos => $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $sourceArr[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n", "positive_code": [{"source_code": " $el) {\n // if el is power of 2, source array lookup will give us a hard time\n $ar[] = $el % 200003;\n }\n\n $maxP = 1;\n $maxR = 0;\n\n $dm = array_fill(0, $n, 1);\n $dmStarts = array_keys($dm);\n $latestPosition = array_flip(array_reverse($ar, true));\n\n foreach ($ar as $currentPos => $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $sourceArr[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $el) {\n // if el is power of 2, source array lookup will give us a hard time\n $ar[] = $el % 100003;\n }\n\n $maxP = 1;\n $maxR = 0;\n\n $dm = array_fill(0, $n, 1);\n $dmStarts = array_keys($dm);\n $latestPosition = array_flip(array_reverse($ar, true));\n\n foreach ($ar as $currentPos => $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $sourceArr[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n //100003\n $latestPosition[$it] = $currentPos;\n }\n\n $afterLoop = microtime(true);\n $totalLoop += $afterLoop - $beforeLoop;\n\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n $maxIt = $sources[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n//\n// if ($n === 12500 && $t === 12) {\n// var_dump($totalRead, $totalPrepare, $totalLoop);\n// die;\n// }\n}\n// var_dump($totalRead, $totalPrepare, $totalLoop);\n\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}], "negative_code": [{"source_code": " $el) {\n // if el is power of 2, source array lookup will give us a hard time\n $ar[] = $el % 10007;\n }\n\n $maxP = 1;\n $maxR = 0;\n\n $dm = array_fill(0, $n, 1);\n $dmStarts = array_keys($dm);\n $latestPosition = array_flip(array_reverse($ar, true));\n\n foreach ($ar as $currentPos => $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $sourceArr[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n if (!isset($latestPosition[$it])) {\n $latestPosition[$it] = $currentPos;\n continue;\n }\n\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $afterLoop = microtime(true);\n $totalLoop += $afterLoop - $beforeLoop;\n\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n\n if ($n === 12500 && $t === 12) {\n var_dump($totalRead, $totalPrepare, $totalLoop);\n die;\n }\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $afterLoop = microtime(true);\n $totalLoop += $afterLoop - $beforeLoop;\n\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n\n if ($n === 12500 && $t === 12) {\n var_dump($totalRead, $totalPrepare, $totalLoop);\n die;\n }\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n }\n\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%d %d %d'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n\n if ((microtime(true) - $startTime) > 0.2) {\n die(500);\n break;\n }\n }\n\n sleep(1);\n\n fprintf(STDOUT, '%d', (microtime(true) - $startTime) * 100);\n\n die;\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%u %u %u'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": " $it) {\n $prevPos = $latestPosition[$it];\n $gap = $currentPos - $prevPos - 1;\n\n if (!~$gap) {\n continue;\n }\n\n $powerWithGap = 1 + $dm[$prevPos] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$currentPos] = $powerWithGap;\n $dmStarts[$currentPos] = $start = $dmStarts[$prevPos];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxR = $currentPos;\n }\n }\n\n $latestPosition[$it] = $currentPos;\n\n if ((microtime(true) - $startTime) > 0.2) {\n die(500);\n break;\n }\n }\n\n fprintf(STDOUT, '%d', microtime(true) * 1000);\n\n die;\n $maxL = $dmStarts[$maxR];\n $maxIt = $ar[$maxL];\n\n fprintf(STDOUT, '%u %u %u'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n// 1 1 1\n\n1\n5\n1 2 2 3 4\n// 2 2 3\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n// 3 3 3\n */\n"}, {"source_code": "> $pos */\n $pos = array_fill_keys($ar, []);\n\n foreach ($ar as $key => $it) {\n $pos[$it][] = $key;\n }\n\n $maxP = 1;\n $maxL = 0;\n $maxR = 0;\n $maxIt = $ar[0];\n\n foreach ($pos as $it => $occ) {\n $mI = count($occ);\n\n if ($maxP >= $mI) {\n continue;\n }\n\n // matrix, holding optimal powers if start from the index\n $dm = array_fill(0, $mI, 1);// array_fill_keys ($occ, 1);\n $dmStarts = array_keys($dm);\n\n $prevPos = $occ[0];\n foreach ($occ as $i => $currentPos) {\n $gap = $currentPos - $prevPos - 1;\n\n if (~$gap) {\n $powerWithGap = 1 + $dm[$i - 1] - $gap;\n\n if ($powerWithGap > 1) {\n $dm[$i] = $powerWithGap;\n $dmStarts[$i] = $start = $dmStarts[$i - 1];\n\n if ($maxP < $powerWithGap) {\n $maxP = $powerWithGap;\n $maxL = $occ[$start];\n $maxR = $currentPos;\n $maxIt = $it;\n }\n }\n }\n\n $prevPos = $currentPos;\n }\n }\n\n fprintf(STDOUT, '%u %u %u'.PHP_EOL, $maxIt, $maxL + 1, $maxR + 1);\n}\n/*\n\nWe would check every number and:\n- each idex will have weight\n\n1\n1\n1\n\n1\n5\n1 2 2 3 4\n\n1\n6\n1 2 2 3 2 2\n// 2 2 6\n\n1\n6\n2 2 3 2 2 1\n// 2 1 5\n\n1\n3\n1 2 3\n\n */\n"}], "src_uid": "a07c199ca02f0abaab6c73efdb2a5b2d"} {"source_code": " $val){\n sort($val);\n if($key >= $x){\n for($t = 0; $t < $key - $x; $t++){\n $res .= 'R';\n }\n $x = $key;\n } else {\n echo \"NO\\n\";\n continue 2;\n }\n foreach($val as $v){\n if($v >= $y){\n for($t = 0; $t < $v - $y; $t++){\n $res .= 'U';\n }\n $y = $v;\n } else {\n echo \"NO\\n\";\n continue 3;\n }\n }\n \n }\n echo \"YES\\n\";\n echo $res.\"\\n\";\n \n}", "positive_code": [{"source_code": " $j){\n sort($j) ;\n for(; $x < $i ; ++$x){\n $res .= 'R' ;\n }\n foreach($j as $k){\n if($k < $y){\n $ok = 0 ;\n break ;\n }\n for( ; $y < $k ; ++$y){\n $res .= 'U' ;\n }\n }\n }\n if($ok == 0)echo \"NO\\n\" ;\n else {\n echo \"YES\\n\". $res. \"\\n\" ;\n }\n}\n\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "$v)\n {\n if($v[0]<$lastx || $v[1]<$lasty)\n {$check=false;break;}\n for($l=$lastx;$l<$v[0];$l++)\n {\n $str=$str.\"R\";\n }\n for($l=$lasty;$l<$v[1];$l++)\n {\n $str=$str.\"U\";\n }\n $lastx=$v[0];\n $lasty=$v[1];\n }\n if($check)\n {\n echo \"YES\".\"\\n\";\n echo $str.\"\\n\";\n\n }else {\n echo \"NO\".\"\\n\";\n }\n\n\n}\n\n\n\n?>"}], "negative_code": [{"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n if($b == 1000)\n {\n print $k . \" \" . $l . \"\\n\";\n }\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n if($b == 1000)\n {\n print $y . \"\\n\";\n break;\n }\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($b == 1000)\n {\n print $k . \" \" . $j[$y] . \"\\n\";\n }\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n if($b == 1000)\n {\n print $k . \" \" . $l . \"\\n\";\n }\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($b == 1000)\n {\n print $k . \" \" . $j[$y] . \"\\n\";\n }\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n if($b == 1000)\n {\n print $h[$y] . \" \" . $l . \"\\n\";\n }\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n if($b == 1000)\n {\n print $k . \" \" . $l . \"\\n\";\n }\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n }\n }\n while(TRUE)\n {\n if($b == 1000)\n {\n print $k . \" \" . $j[$y] . \"\\n\";\n }\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "= $k) && ($h[$y] >= $l))\n {\n while(TRUE)\n {\n if($l == $h[$y])\n {\n break;\n }\n else\n {\n $n .= \"R\";\n $l++;\n if($b == 1000)\n {\n print $h[$y] . \" \" . $l . \"\\n\";\n }\n }\n }\n while(TRUE)\n {\n if($k == $j[$y])\n {\n break;\n }\n else\n {\n $n .= \"U\";\n $k++;\n if($b == 1000)\n {\n print $j[$y] . \" \" . $k . \"\\n\";\n }\n }\n }\n }\n else\n {\n $m = 1;\n break;\n }\n }\n if($m == 0)\n {\n print \"YES\\n\";\n print $n . \"\\n\";\n \n }\n else\n {\n print \"NO\\n\";\n }\n}\n?>"}, {"source_code": "3\n5\n1 3\n1 2\n3 3\n5 5\n4 3\n2\n1 0\n0 1\n1\n4 3\n"}], "src_uid": "b01c627abc00f97767c237e304f8c17f"} {"source_code": "", "positive_code": [{"source_code": " $e)\n {\n $d[count($d)] = $x;\n $f = $c - $e;\n for($y = 0; $y < count($d); $y++)\n {\n if($d[$y] == $f)\n {\n array_splice($d, $y, 1);\n break;\n }\n }\n break;\n }\n }\n print count($d) . \" \";\n print implode(\" \", $d);\n}\nelseif(($b2 == 1) && ($b3 == 1))\n{\n print \"1\\n\";\n $c = 0;\n $d = array();\n $e = floor(array_sum($b) / 2);\n for($x = 1; $x <= $a; $x++)\n {\n $c += $x;\n if($c < $e)\n {\n $d[count($d)] = $x;\n }\n elseif($c == $e)\n {\n $d[count($d)] = $x;\n break;\n }\n elseif($c > $e)\n {\n $d[count($d)] = $x;\n for($y = 0; $y < count($d); $y++)\n {\n $c -= $d[$y];\n if($e == $c)\n {\n array_splice($d, $y, 1);\n break;\n }\n else\n {\n $c += $d[$y];\n }\n }\n break;\n }\n }\n print count($d) . \" \";\n print implode(\" \", $d);\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $g)\n {\n $j = $i - array_sum($b) / 2;\n $k = array_search($h, $j);\n array_splice($h, $k, 1);\n break;\n }\n }\n print count($h) . \" \" . implode(\" \", $h);\n }\n}\nelse\n{\n print \"1\\n\";\n $f = $a % 2;\n if($f == 0)\n {\n $g = ceil($a / 4);\n $h = array();\n $i = 0;\n $j = $a - 1;\n for($x = 0; $x < $g; $x++)\n {\n $h[count($h)] = $b[$i];\n $i += 2;\n $h[count($h)] = $b[$j];\n $j -= 2;\n }\n array_splice($h, -1, 1);\n print count($h) . \" \" . implode(\" \", $h);\n }\n else\n {\n $g = ceil($a / 4);\n $h = array();\n $i = 0;\n $j = $a - 1;\n for($x = 0; $x < $g; $x++)\n {\n $h[count($h)] = $b[$i];\n $i += 2;\n $h[count($h)] = $b[$j];\n $j -= 2;\n }\n $k = $h[count($h) - 1] - 1;\n array_splice($h, -1, 1);\n array_splice($h, -1, 1);\n array_push($h, $k);\n print count($h) . \" \" . implode(\" \", $h);\n }\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "4c387ab2a0d028141634ade32ae97d03"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": "= $i)\n{\n printf(\"%.0f\", $f);\n}\nelse\n{\n printf(\"%.0f\", $h);\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $v) {\n if ($min == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo min($a) * min($b);\n } else {\n foreach($a AS $k=> $v) {\n if ($max == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo max($a) * max($b);\n }\n \n?>"}, {"source_code": " $v) {\n if ($min == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo min($a) * min($b);\n } else {\n foreach($a AS $k=> $v) {\n if ($max == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo max($a) * max($b);\n }\n \n?>"}, {"source_code": " $v) {\n if ($min == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo min($a) * min($b);\n } else {\n foreach($a AS $k=> $v) {\n if ($max == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo max($a) * max($b);\n }\n \n?>"}, {"source_code": " $v) {\n if ($max == $v) {\n unset($a[$k]);\n }\n }\n echo max($a) * max($b);\n?>"}, {"source_code": " $mina*$minb ) {\n foreach($a AS $k=> $v) {\n if ($maxa == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo max($a) * max($b);\n } else {\n foreach($a AS $k=> $v) {\n if ($mina == $v) {\n unset($a[$k]);\n break;\n }\n }\n echo min($a) * min($b);\n }\n \n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": " $mina*$minb ) {\n foreach($a AS $k=> $v) {\n if ($maxa == $v) {\n unset($a[$k]);\n break;\n }\n }\n $i = max($a) * max($b);\n echo (string)$i;\n } else {\n foreach($a AS $k=> $v) {\n if ($mina == $v) {\n unset($a[$k]);\n break;\n }\n }\n $i = min($a) * min($b);\n echo (string)$i;\n }\n \n?>"}], "src_uid": "c408b1d198c7c88fc635936d960c962a"} {"source_code": " $q) {\n if ($printed < $s) {\n $sP[] = \"S $p $q\";\n $printed++;\n }\n}\n$sP = array_reverse($sP);\necho implode(PHP_EOL, $sP).PHP_EOL;\n\n\n$printed = 0;\nforeach ($bArray as $p => $q) {\n if ($printed < $s) {\n echo \"B $p $q\".PHP_EOL;\n $printed++;\n }\n}", "positive_code": [{"source_code": "= 1)\n{\n print \"S \" . $r[$x] . \" \" . $w[$x] . \"\\n\";\n}\nfor($x = 0; $x < min($b, count($o)) - 1; $x++)\n{\n print \"B \" . $o[$x] . \" \" . $u[$x] . \"\\n\";\n}\nif(min($b, count($o)) != 0)\n{\n print \"B \" . $o[$x] . \" \" . $u[$x];\n}\n?>"}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 1)\n{\n print \"S \" . $r[$x] . \" \" . $w[$x] . \"\\n\";\n}\nfor($x = 0; $x < min($b, count($o)) - 1; $x++)\n{\n print \"B \" . $o[$x] . \" \" . $u[$x] . \"\\n\";\n}\nif(min($b, count($o)) != 0)\n{\n print \"B \" . $o[$x] . \" \" . $u[$x];\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "= 1)\n{\n print \"S \" . $r[$x] . \" \" . $w[$x] . \"\\n\";\n}\nfor($x = 0; $x < min($b, count($o)) - 1; $x++)\n{\n print \"B \" . $o[$x] . \" \" . $u[$x] . \"\\n\";\n}\nif(min($b, count($o)) != 0)\n{\n print \"B \" . $o[$x] . \" \" . $u[$x];\n}\n?>"}, {"source_code": ""}], "src_uid": "267c04c77f97bbdf7697dc88c7bfa4af"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "e61509d5f0bcd405b1a0c9ba74449df2"} {"source_code": "\n", "positive_code": [{"source_code": " $boxes_num/2)\n $actions_num = $boxes_num - $right_boxes_opened;\nelse\n $actions_num = $right_boxes_opened;\n \nif($left_boxes_opened > $boxes_num/2)\n $actions_num += $boxes_num - $left_boxes_opened;\nelse\n $actions_num += $left_boxes_opened;\n\necho $actions_num;"}, {"source_code": " 0) $leftOpen += 1;\n if ($line[1] > 0) $rightOpen += 1;\n}\n\n$ans = 0;\nif (($count/2) > $leftOpen) $ans += $leftOpen;\nelse $ans += $count-$leftOpen;\nif (($count/2) > $rightOpen ) $ans += $rightOpen;\nelse $ans += $count-$rightOpen;\n\necho $ans;"}, {"source_code": "\n\n\n"}, {"source_code": "= $e)\n{\n $h += $e;\n}\nelse\n{\n $h += $d;\n}\nif($f >= $g)\n{\n $h += $g;\n}\nelse\n{\n $h += $f;\n}\nprint $h;\n?>"}], "negative_code": [{"source_code": " $left_boxes_opened){\n $actions_num = $boxes_num - $right_boxes_opened;\n $actions_num += $left_boxes_opened;\n}\nelse{\n $actions_num = $boxes_num - $left_boxes_opened;\n $actions_num += $right_boxes_opened;\n}\n\necho $actions_num;"}, {"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$t = $ir->readInt();\nfor ($tt=0; $tt<$t; $tt++) {\n\t$n = $ir->readInt();\n\t$a = [];\n\tfor ($nn=0; $nn<$n; $nn++) {\n\t\t$a[] = $ir->readArrayOfInt(2);\n\t}\n\t\n\t$b = array_fill(0, $n, 2);\n\t\n\tuasort($a, function($x, $y) { return $x[0]<=>$y[0];});\n\t\n\treset($a);\n\t$x = current($a);\n\t//var_dump($a);\n\t$R = $x[1];\n\treset($a);\n\tforeach ($a as $k=>$v){\n\t\t//echo \"R = $R; checking {$v[0]} : {$v[1]}\\n\";\n\t\tif ($v[0]<=$R) {\n\t\t\t$R = max([$v[1], $R]);\n\t\t\t$b[$k] = 1;\n\t\t}\n\t\telse {\n\t\t\techo implode(' ', $b).\"\\n\";\n\t\t\tflush();\n\t\t\tcontinue 2;\n\t\t}\n\t}\n\t\n\techo \"-1\\n\";\n\tflush();\n}\n\n", "positive_code": [{"source_code": " $k)\n {\n $j = 1;\n $i[$g[$y]] = 2;\n }\n else\n {\n $i[$g[$y]] = 1;\n $k = max($k, $h[$y]);\n }\n }\n else\n {\n $i[$g[$y]] = 2;\n }\n }\n if($j == 0)\n {\n print \"-1\\n\";\n }\n else\n {\n ksort($i);\n print implode(\" \", $i) . \"\\n\";\n }\n}\n?>"}], "negative_code": [], "src_uid": "13fbcd245965ff6d1bf08915c4d2a2d3"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [], "src_uid": "4ca13794471831953f2737ca9d4ba853"} {"source_code": "= 0; $y--)\n {\n if($d[$y] > $d[$x])\n {\n $g++;\n }\n }\n $h = 0;\n for($y = $x; $y < $a; $y++)\n {\n if($d[$y] > $d[$x])\n {\n $h++;\n }\n }\n if(($b[$x] != $g) || ($c[$x] != $h))\n {\n $f = 1;\n break;\n }\n}\nif($f == 0)\n{\n print \"YES\\n\";\n print implode(\" \", $d) . \"\\n\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "positive_code": [{"source_code": "= 0; $y--)\n {\n if($d[$y] > $d[$x])\n {\n $g++;\n }\n }\n $h = 0;\n for($y = $x; $y < $a; $y++)\n {\n if($d[$y] > $d[$x])\n {\n $h++;\n }\n }\n if(($b[$x] != $g) || ($c[$x] != $h))\n {\n $f = 1;\n break;\n }\n}\nif($f == 0)\n{\n print \"YES\\n\";\n print implode(\" \", $d) . \"\\n\";\n}\nelse\n{\n print \"NO\";\n}\n?>"}], "negative_code": [], "src_uid": "fa531c38833907d619f1102505ddbb6a"} {"source_code": "", "positive_code": [{"source_code": ""}], "negative_code": [{"source_code": ""}], "src_uid": "e34f110440942a841624d0f42e0ddec4"} {"source_code": "", "positive_code": [{"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0435\u0437\u0434\u0430\n if ($v>$r) {\n $count = floor($ll/$v);\n $res[]=$count;\n continue;\n }\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431 \u0434\u043e \u043f\u043e\u0435\u0437\u0434\u0430\n if ($v<=$l) {\n $a = floor($l/$v);\n if (!($l%$v)) {\n $a--;\n }\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-($b-$a);\n $res[]=$count;\n continue;\n }\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u043e\u043d\u0430\u0440\u044c \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0435\u0437\u0434\u043e\u043c\n if ($l<$v && $v<=$r) {\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-$b;\n $res[]=$count;\n continue;\n }\n\n\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //686817107 73138233 67053564 180837627\n //7\n\n //868494849 135243336 281738625 468972539\n //5\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n /*\necho '______\n';\n */\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}], "negative_code": [{"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n if ($v>$r) {\n $count = floor($ll/$v);\n $res[]=$count;\n continue;\n }\n\n $i = $v;\n $count = 0;\n\n if ($i<$l) {\n $c = floor($l / $v);\n if (!($l%$v)) {\n $c--;\n }\n/*\n echo $c.' (1)\n';\n*/\n $count+=$c;\n }\n\n $k2 = 0;\n if ($r>$v){\n $k2 = floor($r / $v);\n }\n\n $k3 = ($k2+1) *$v;\n if ($ll>$k3 && !(($ll-$k3)%$v)) {\n $count+=1;\n/*\n echo '1 (2)\n';\n*/\n }\n\n if ($r<$ll) {\n $k = $ll - $k3;\n $c = floor($k / $v);\n if ($c<0){\n $c=0;\n }\n $count += $c;\n/*\n echo $c . ' (3)\n';\n*/\n\n }\n\n/*\n\n while ($i<=$ll) {\n if ($i<$l || $i>$r) {\n $count++;\n echo $i.'\n';\n }\n $i+=$v;\n\n }\n*/\n //echo $count;\n $res[]=$count;\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //717015345 487315007 292912925 350459609\n //1\n\n //913338581 325436058 378430701 728704378\n //1\n\n //1000000000 1 1 1000000000\n //0\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n /*\necho '______\n';\n */\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}, {"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n $i = $v;\n $count = 0;\n\n if ($i<$l) {\n $c = floor($l / $v);\n if (!($l%$v)) {\n $c--;\n }\n/*\n echo $c.' (1)\n';\n*/\n $count+=$c;\n }\n\n $k2 = 0;\n if ($r>$v){\n $k2 = floor($r / $v);\n }\n\n $k3 = ($k2+1) *$v;\n if ($ll>$k3 && !(($ll-$k3)%$v)) {\n $count+=1;\n/*\n echo '1 (2)\n';\n*/\n }\n\n if ($r<$ll) {\n $k = $ll - $k3;\n $c = floor($k / $v);\n if ($c<0){\n $c=0;\n }\n $count += $c;\n/*\n echo $c . ' (3)\n';\n*/\n\n }\n\n/*\n\n while ($i<=$ll) {\n if ($i<$l || $i>$r) {\n $count++;\n echo $i.'\n';\n }\n $i+=$v;\n\n }\n*/\n //echo $count;\n $res[]=$count;\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //913338581 325436058 378430701 728704378\n //1\n\n //1000000000 1 1 1000000000\n //0\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n /*\necho '______\n';\n */\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}, {"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n $i = $v;\n $count = 0;\n\n if ($i<$l) {\n $c = floor($l / $v);\n if (!($l%$v)) {\n $c--;\n }\n /*\n echo $c.'\n';\n */\n $count+=$c;\n }\n\n $k2 = 0;\n if ($r>$v){\n $k2 = floor($r / $v);\n }\n\n $k3 = ($k2+1) *$v;\n if ($ll>$k3 && !(($ll-$k3)%$v)) {\n $count+=1;\n /*\n echo '1\n';\n */\n }\n\n if ($r<$ll) {\n $k = $ll - $k3;\n $c = floor($k / $v);\n $count += $c;\n /*\n echo $c . '\n ';\n */\n }\n\n/*\n\n while ($i<=$ll) {\n if ($i<$l || $i>$r) {\n $count++;\n echo $i.'\n';\n }\n $i+=$v;\n\n }\n*/\n //echo $count;\n $res[]=$count;\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //1000000000 1 1 1000000000\n //0\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}, {"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0435\u0437\u0434\u0430\n if ($v>$r) {\n $count = floor($ll/$v);\n $res[]=$count;\n continue;\n }\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431 \u0434\u043e \u043f\u043e\u0435\u0437\u0434\u0430\n if ($v<$l) {\n $a = floor($l/$v);\n if (!($l%$v)) {\n $a--;\n }\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-($b-$a);\n $res[]=$count;\n continue;\n }\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u043e\u043d\u0430\u0440\u044c \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0435\u0437\u0434\u043e\u043c\n if ($l<$v && $v<$r) {\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-$b;\n $res[]=$count;\n continue;\n }\n\n/*\n\n while ($i<=$ll) {\n if ($i<$l || $i>$r) {\n $count++;\n echo $i.'\n';\n }\n $i+=$v;\n\n }\n*/\n //echo $count;\n $res[]=$count;\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //686817107 73138233 67053564 180837627\n //7\n\n //868494849 135243336 281738625 468972539\n //5\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n /*\necho '______\n';\n */\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}, {"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n if ($v>$r) {\n $count = floor($ll/$v);\n $res[]=$count;\n continue;\n }\n\n if ($v<$l && $r<$ll) {\n $a = floor($l/$v);\n if (!($l%$v)) {\n $a--;\n }\n\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-($b-$a);\n $res[]=$count;\n continue;\n }\n\n $i = $v;\n $count = 0;\n\n if ($i<$l) {\n $c = floor($l / $v);\n if (!($l%$v)) {\n $c--;\n }\n/*\n echo $c.' (1)\n';\n*/\n $count+=$c;\n }\n\n $k2 = 0;\n if ($r>$v){\n $k2 = floor($r / $v);\n }\n\n $k3 = ($k2+1) *$v;\n if ($ll>$k3 && !(($ll-$k3)%$v)) {\n $count+=1;\n/*\n echo '1 (2)\n';\n*/\n }\n\n if ($r<$ll) {\n $k = $ll - $k3;\n $c = floor($k / $v);\n if ($c<0){\n $c=0;\n }\n $count += $c;\n/*\n echo $c . ' (3)\n';\n*/\n\n }\n\n/*\n\n while ($i<=$ll) {\n if ($i<$l || $i>$r) {\n $count++;\n echo $i.'\n';\n }\n $i+=$v;\n\n }\n*/\n //echo $count;\n $res[]=$count;\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //868494849 135243336 281738625 468972539\n //5\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n /*\necho '______\n';\n */\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}, {"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n if ($v>$r) {\n $count = floor($ll/$v);\n $res[]=$count;\n continue;\n }\n\n if ($v<$l && $r<$ll) {\n $a = floor($l/$v);\n if (!($l%$v)) {\n $a--;\n }\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-($b-$a);\n $res[]=$count;\n continue;\n }\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u043e\u043d\u0430\u0440\u044c \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0435\u0437\u0434\u043e\u043c\n if ($l<$v && $v<$r) {\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-$b;\n $res[]=$count;\n continue;\n }\n\n $i = $v;\n $count = 0;\n\n if ($i<$l) {\n $c = floor($l / $v);\n if (!($l%$v)) {\n $c--;\n }\n/*\n echo $c.' (1)\n';\n*/\n $count+=$c;\n }\n\n $k2 = 0;\n if ($r>$v){\n $k2 = floor($r / $v);\n }\n\n $k3 = ($k2+1) *$v;\n if ($ll>$k3 && !(($ll-$k3)%$v)) {\n $count+=1;\n/*\n echo '1 (2)\n';\n*/\n }\n\n if ($r<$ll) {\n $k = $ll - $k3;\n $c = floor($k / $v);\n if ($c<0){\n $c=0;\n }\n $count += $c;\n/*\n echo $c . ' (3)\n';\n*/\n\n }\n\n/*\n\n while ($i<=$ll) {\n if ($i<$l || $i>$r) {\n $count++;\n echo $i.'\n';\n }\n $i+=$v;\n\n }\n*/\n //echo $count;\n $res[]=$count;\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //686817107 73138233 67053564 180837627\n //7\n\n //868494849 135243336 281738625 468972539\n //5\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n /*\necho '______\n';\n */\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}, {"source_code": "0){\n $str=fgets(STDIN);\n $str = explode(' ',$str);\n $ll=(int)$str[0];\n $v=(int)$str[1];\n $l=(int)$str[2];\n $r=(int)$str[3];\n\n if ($v>$r) {\n $count = floor($ll/$v);\n $res[]=$count;\n continue;\n }\n\n if ($v<$l && $r<$ll) {\n $a = floor($l/$v);\n if (!($l%$v)) {\n $a--;\n }\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-($b-$a);\n $res[]=$count;\n continue;\n }\n\n //\u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u043e\u043d\u0430\u0440\u044c \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0435\u0437\u0434\u043e\u043c\n if ($l<$v && $v<$r) {\n $b = floor($r/$v);\n $c = floor($ll/$v);\n $count = $c-$b;\n $res[]=$count;\n continue;\n }\n\n if ($v > $r) {\n $c = floor($ll/$v);\n $count = $c;\n $res[]=$count;\n continue;\n }\n\n $i = $v;\n $count = 0;\n\n if ($i<$l) {\n $c = floor($l / $v);\n if (!($l%$v)) {\n $c--;\n }\n/*\n echo $c.' (1)\n';\n*/\n $count+=$c;\n }\n\n $k2 = 0;\n if ($r>$v){\n $k2 = floor($r / $v);\n }\n\n $k3 = ($k2+1) *$v;\n if ($ll>$k3 && !(($ll-$k3)%$v)) {\n $count+=1;\n/*\n echo '1 (2)\n';\n*/\n }\n\n if ($r<$ll) {\n $k = $ll - $k3;\n $c = floor($k / $v);\n if ($c<0){\n $c=0;\n }\n $count += $c;\n/*\n echo $c . ' (3)\n';\n*/\n\n }\n\n/*\n\n while ($i<=$ll) {\n if ($i<$l || $i>$r) {\n $count++;\n echo $i.'\n';\n }\n $i+=$v;\n\n }\n*/\n //echo $count;\n $res[]=$count;\n\n //ll - \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\n //v - \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u043e\u043d\u0430\u0440\u044f\n //l - \u043d\u0430\u0447\u0430\u043b\u043e \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n //r - \u043a\u043e\u043d\u0435\u0446 \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0435\u0437\u0434\u0430\n\n //686817107 73138233 67053564 180837627\n //7\n\n //868494849 135243336 281738625 468972539\n //5\n\n //100 51 51 51\n //0\n\n //10 2 3 7\n //3\n\n //1234 1 100 199\n //1134\n\n //99 200\n }\n /*\necho '______\n';\n */\n foreach ($res as $r) {\n echo $r.'\n';\n }\n\n?>"}], "src_uid": "5194846a503c2087fcd299eaf3c20b2b"} {"source_code": " $n) {\n $bR = 0;\n for($j=1; $j<$n; $j++) {\n if($j + ceil($d/($j+1)) <= $n) {\n $bR++;\n break;\n }\n }\n if($bR > 0) {\n echo \"YES\\n\";\n }else{\n echo \"NO\\n\";\n }\n \n } else {\n echo \"YES\\n\";\n }\n \n \n }\n \n \n \n\n\n\n ", "positive_code": [{"source_code": "= $y + $e)\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 else\n {\n print \"YES\\n\";\n }\n}\n?>"}, {"source_code": "= $f)\n {\n break;\n }\n elseif($y + $d <= $b)\n {\n $e = 1;\n break;\n }\n $f = $y + $d;\n }\n if($e == 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n }\n}\n?>"}, {"source_code": "= $y + $e)\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 else\n {\n print \"YES\\n\";\n }\n}\n?>"}, {"source_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, $x, $y) = $ir->readArrayOfInt(3);\n$b = $ir->readArrayOfInt($n);\n\nif ($x>$y) {\n\t$cnt = $n;\n} else {\n\t$c = 0;\n\tfor ($i=0; $i<$n; $i++) {\n\t\tif ($b[$i]<=$x) {\n\t\t\t$c++;\n\t\t}\n\t}\n\t\n\t$cnt = ceil($c/2);\n}\n\necho $cnt;\n", "positive_code": [{"source_code": " $c)\n{\n print $a;\n}\n?>"}, {"source_code": " $y){\n fwrite(STDOUT, $n);\n}else{\n for($i = 0; $i<$n; $i++){\n if($a[$i] <= $x) $c++;\n }\n fwrite(STDOUT, round($c/2));\n}\n\n?>"}, {"source_code": " $y){\n echo $n;\n return false;\n}\n\nsort($a);\n\nfor($i = 0; $i<$n; ++$i){\n if ($a[$i] > $x) {\n echo floor(($i + 1) / 2);\n return false;\n }\n}\n\necho floor(($n + 1) / 2);\n\nfunction what($x){fprintf(STDERR, $x . \"\\n\");}\n?>\n"}], "negative_code": [], "src_uid": "c173e2695562dfa1f603e6a925a2e1f3"} {"source_code": "", "positive_code": [{"source_code": "=5) {$cel[$num-1]=$cel[$num-1]+1; echo $cel;}\n else echo $cel;\n} else{\n echo \"GOTO Vasilisa.\";\n}\n?>"}, {"source_code": "= 5) {\n $int = substr($int, 0, -1);\n $int .= $lastint + 1;\n }\n echo $int;\n}\n?>"}, {"source_code": ""}, {"source_code": "\n"}, {"source_code": "= 5){\n $intPart[$index] = $intPart[$index] + 1;\n }\n echo $intPart . PHP_EOL;\n}\n"}, {"source_code": ""}], "negative_code": [{"source_code": "= 0.5))\n{\n print implode(array_slice($b, 0, $c)) + 1;\n}\nelseif($b[$c - 1] == 9)\n{\n print \"GOTO Vasilisa.\";\n}\n?>"}, {"source_code": "= 0.5))\n{\n printf(\"%.0f\", implode(array_slice($b, 0, $c)) + 1);\n}\nelseif($b[$c - 1] == 9)\n{\n print \"GOTO Vasilisa.\";\n}\n?>"}, {"source_code": "= 0.5))\n{\n printf(\"%s\", implode(array_slice($b, 0, $c)) + 1);\n}\nelseif($b[$c - 1] == 9)\n{\n print \"GOTO Vasilisa.\";\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}, {"source_code": "=5) echo $arr[0]+1;\n} else{\n echo \"GOTO Vasilisa.\";\n}\n?>"}], "src_uid": "3060ecad253a2b4d4fac39e91fcd6c95"} {"source_code": ""}], "negative_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\nwhile($iQueryCount > 0) {\r\n $iQueryCount--;\r\n solve();\r\n}\r\nfunction solve() {\r\n $j = IO::str();\r\n $sum = 0;\r\n $count = 0;\r\n $n = 1;\r\n while ($sum < $j) {\r\n $count++;\r\n $sum = $sum + $n;\r\n $n += 2;\r\n }\r\n IO::line($count);\r\n}\r\n\r\n\r\n?>"}], "negative_code": [], "src_uid": "322792a11d3eb1df6b54e8f89c9a0490"} {"source_code": "", "positive_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "src_uid": "0e4ff955c1e653fbeb003987fa701729"} {"source_code": "= 0; $x--)\n{\n $k[$x] += $l;\n $l += 0.01;\n}\narsort($k);\n$m = array_keys($k);\nfor($x = 0; $x < count($j) - 1; $x++)\n{\n print $j[$m[$x]] . \"\\n\";\n}\nprint $j[$m[$x]];", "positive_code": [{"source_code": "$val){\n $new2[]=array($key,$val);\n}\nfunction cmp($a,$b) {\n if ($a[1]==$b[1]) \nreturn $a[0]>$b[0];\n else return $a[1]<$b[1];\n}\nusort($new2,'cmp');\n//print_r($newarr);\nforeach($new2 as $val){\n echo $val[0].\"\\n\";\n}\n//print_r($new2);"}, {"source_code": "$val){\n $new2[]=array($key,$val);\n}\nfunction cmp($a,$b) {\n if ($a[1]==$b[1]) \nreturn $a[0]>$b[0];\n else return $a[1]<$b[1];\n}\nusort($new2,'cmp');\n//print_r($newarr);\nforeach($new2 as $val){\n echo $val[0].\"\\n\";\n}\n//print_r($new2);\n\n?>"}, {"source_code": " $value) $arr[] = array($key, $value);\n function my_cmp($a, $b)\n {\n if($a[1]!= $b[1]) return $a[1] > $b[1] ? -1 : 1;\n return $a[0] < $b[0] ? -1 : 1;\n }\n usort($arr, \"my_cmp\");\n \n foreach($arr as $val) echo $val[0] . \"\\n\";\n fclose($in);\n?> "}, {"source_code": "=0; $i-=5)\n{\n\t$temp = array();\n\tforeach($friends as $key=>$value)\n\t{\n\t\tif($value == $i)\n\t\t\t$temp[] = $key;\n\t}\n\tprr($temp);\n}\n\n\n?>"}], "negative_code": [{"source_code": "= 0; $x--)\n{\n for($y = count($j) - 1; $y > 0; $y--)\n {\n if($k[$y] > $k[$x])\n {\n $l = $j[$y];\n $m = $j[$y - 1];\n $n = $k[$y];\n $o = $k[$y - 1];\n $j[$y] = $m;\n $j[$y - 1] = $l;\n $k[$y] = $o;\n $k[$y - 1] = $n;\n }\n }\n}\nfor($x = 0; $x < count($j) - 1; $x++)\n{\n print $j[$x] . \"\\n\";\n}\nprint $j[$x];\n?>"}, {"source_code": " $k[$y])\n {\n $l = $j[$x];\n $m = $j[$y];\n $n = $k[$x];\n $o = $k[$y];\n $j[$x] = $m;\n $j[$y] = $l;\n $k[$x] = $o;\n $k[$y] = $n;\n }\n }\n}\nfor($x = 0; $x < count($j) - 1; $x++)\n{\n print $j[$x] . \"\\n\";\n}\nprint $j[$x];\n?>"}, {"source_code": " $x_value) {\n echo $x . \"
\";\n }"}, {"source_code": " $x_value) {\n echo $x . \"
\";\n }"}, {"source_code": " $x_value) {\n echo $x . \"
\";\n }"}, {"source_code": "$value)\n\t{\n\t\tif($value == $i)\n\t\t\t$temp[] = $key;\n\t}\n\tprr($temp);\n}\n\n\n?>"}, {"source_code": "\n$val){\n $new2[]=array($key,$val);\n}\nfunction cmp($a,$b) {\n if ($a[1]==$b[1]) \n return $a[0]<$b[0];\n else return $a[1]>$b[1];\n}\nusort($new2,'cmp');\n//print_r($newarr);\nforeach($new2 as $val){\n echo $val[0].\"\\n\";\n}\n//print_r($new2);\n\n?>"}, {"source_code": "$val){\n $new2[]=array($key,$val);\n}\nfunction cmp($a,$b) {\n if ($a[0]==$b[0]) \n return $a[1]<$b[1];\n else return $a[0]>$b[0];\n}\nusort($new2,'cmp');\n//print_r($newarr);\nforeach($new2 as $val){\n echo $val[0].\"\\n\";\n}\n//print_r($new2);\n\n?>"}, {"source_code": "$val){\n $new2[]=array($key,$val);\n}\nfunction cmp($a,$b) {\n if ($a[1]==$b[1]) \nreturn $a[0]>$b[0];\n else return $a[1]<$b[1];\n}\nusort($new2,'cmp');\nforeach($new2 as $val){\n echo $val[0].\"\\n\";\n}\n?>"}, {"source_code": "$val){\n $new2[]=array($key,$val);\n}\nfunction cmp($a,$b) {\n if ($a[1]==$b[1]) \nreturn $a[0]>$b[0];\n else return $a[1]<$b[1];\n}\nusort($new2,'cmp');\n//print_r($newarr);\nforeach($new2 as $val){\n echo $val[0].\"\\n\";\n}\n//print_r($new2);\n\n?>"}], "src_uid": "b1a86308739067f2b6c9940b564e2648"} {"source_code": " $max){\n\t\t\t\t\t$max = $counter;\n\t\t\t\t\t$max_start = $start;\n\t\t\t\t}\n\t\t\t\t$counter = 0;\n\t\t\t}\n\t\t}\n\t\tif($counter > $max){\n\t\t\t$max = $counter;\n\t\t\t$max_start = $start;\n\t\t}else{\n\t\t\tif($debug) echo \"Counter ($counter) no es mayor a max ($max)\". PHP_EOL;\n\t\t}\n\n\t\tif($debug) echo \"Replacing from $max_start to $max\" . PHP_EOL;\n\t\t$str = substr_replace($str,'', $max_start, $max);\n\t\t$len = strlen($str);\n\t\tif($round % 2){\n\t\t\t$score += $max;\n\t\t\tif($debug) echo \"Round $t-$round: $str - Alice +$max\". PHP_EOL;\n\t\t}else{\n\t\t\t//$score += $max;\n\t\t\tif($debug) echo \"Round $t-$round: $str - Bob +$max\". PHP_EOL;\n\t\t}\n\n\t\tif($max == 0) break;\n\n\t}\n\t$answers[]= $score;\n\n\n}\nforeach ($answers as $a) echo $a.PHP_EOL;", "positive_code": [{"source_code": " 0) $consecutives[]= $counter;\n\t\t\t}else {\n\t\t\t\tif($counter > 0) $consecutives[]= $counter;\n\t\t\t\t$counter = 0;\n\t\t\t}\n\t\t}\n\n\t\trsort($consecutives);\n\n\n\t\t$alice = 0;\n\t\t$bob = 0;\n\t\tforeach ($consecutives as $round => $score){\n\t\t\tif($round == 0){\n\t\t\t\t$alice += $score;\n\t\t\t}else{\n\t\t\t\tif($round % 2) $bob += $score; else $alice+= $score;\n\t\t\t}\n\t\t}\n\n\n\n\n\t$answers[]= $alice;\n\n}\nforeach ($answers as $a) echo $a . PHP_EOL;"}, {"source_code": " $max) $max = $counter;\n }\n\n if ($j % 2 != 0) $points += $max;\n\n if ($max == 0) break;\n else {\n $search = str_repeat('1', $max);\n $line = preg_replace(\"/$search/\", '', $line, 1);\n }\n }\n\n echo \"$points\\n\";\n}"}, {"source_code": " 0)\n {\n $d += count(str_split($c[$y]));\n }\n }\n print $d . \"\\n\";\n}\n?>"}], "negative_code": [], "src_uid": "ebf0bf949a29eeaba3bcc35091487199"} {"source_code": "", "positive_code": [{"source_code": " $maxSize) {\n $maxSize = $queue;\n }\n $prevTime = $str[0];\n #echo $prevTime, ' ', $queue, PHP_EOL;\n $time += $str[0];\n}\nfclose($fIn);\necho ($prevTime + $queue), ' ', $maxSize;\n?>"}, {"source_code": "= 0)\n $tmp = $sms_now - ($a[0] - $time_last);\n else\n $tmp = 0;\n $sms_now = $tmp + $a[1];\n }\n else\n $sms_now = $a[1];\n if($max < $sms_now)\n $max = $sms_now;\n $time_last = $a[0];\n}\necho ($time_last+$sms_now) . ' ' . $max . '\n';\n?>"}, {"source_code": " $cnt) {\n $time_diff = $time - $last_time;\n $last_time = $time;\n $queue_cnt = max(0, $queue_cnt - $time_diff);\n\n $queue_cnt += $cnt;\n $queue_max = max($queue_cnt, $queue_max);\n \n $total_time += $time_diff;\n}\n\n$total_time += $queue_cnt;\n\necho $total_time, \" \", $queue_max;\n"}], "negative_code": [{"source_code": "= $b + $c)\n {\n $b = $d;\n $c = $e;\n $f = $b;\n }\n else\n {\n $c += $e;\n $h = $c - $x;\n array_push($g, $h);\n } \n }\n rsort($g);\n print $c + $f . \" \" . $g[0];\n}\n?>"}, {"source_code": "= $b + $c)\n {\n $b = $d;\n $c = $e;\n $f = $b;\n }\n else\n {\n $c += $e; \n $h = $c - ($d - $i + 1);\n $i = $d;\n array_push($g, $h);\n } \n }\n rsort($g);\n print $c + $f . \" \" . $g[0];\n}\n?>"}, {"source_code": "= $b + $c)\n {\n $b = $d;\n $c = $e;\n $f = $b;\n }\n else\n {\n $b = $d;\n $c += $e; \n $h = $c - $x;\n array_push($g, $h);\n } \n }\n rsort($g);\n print $c + $f . \" \" . $g[0];\n}\n?>"}, {"source_code": "= 0)\n$tmp = trim($a[0]) - $time_last;\nelse $tmp = 0;\n if($sms_now != 0)\n $sms_now = ($sms_now - $tmp) + trim($a[1]);\n else\n $sms_now = trim($a[1]);\n if($max < $sms_now)\n $max = $sms_now;\n $time_last = trim($a[0]);\n}\necho ($time_last+$sms_now) . ' ' . $max . '\n';\n?>"}, {"source_code": ""}, {"source_code": " $maxSize) {\n $maxSize = $queue;\n }\n $prevTime = $str[0];\n #echo $prevTime, ' ', $queue, PHP_EOL;\n $time += $str[0];\n}\nfclose($fIn);\nif ($queue == 0)\n $queue = $str[1];\necho ($prevTime + $queue), ' ', $maxSize;\n?>"}, {"source_code": " $maxSize) {\n $maxSize = $queue;\n }\n $prevTime = $str[0];\n #echo $prevTime, ' ', $queue, PHP_EOL;\n $time += $str[0];\n}\nfclose($fIn);\n\necho ($prevTime + $queue), ' ', $maxSize;\n?>"}, {"source_code": " $maxSize) {\n $maxSize = $queue;\n }\n $prevTime = $str[0];\n $time += $str[0];\n}\nfclose($fIn);\n\necho ($prevTime + $queue), ' ', $maxSize;\n?>"}], "src_uid": "608f8246bc6067e259898e8ed94db4c4"} {"source_code": ">1;\nwhile($z-->0)echo ($s=$f('*',$u=abs($z-$h))).$f('D',$n-($u*2)).$s.\"\\n\";\n?>", "positive_code": [{"source_code": ""}, {"source_code": "> 1;\n\nwhile ($z-- > 0) {\n echo ($s = str_repeat('*', $u = abs($z - $h))) . str_repeat('D', $n - ($u * 2)) . $s . \"\\n\";\n}"}, {"source_code": "=1;$i-=2){\n for($j=1;$j<=($n-$i)/2;$j++)echo \"*\";\n for($j=1;$j<=$i;$j++)echo \"D\";\n for($j=1;$j<=($n-$i)/2;$j++)echo \"*\";\n echo \"\\n\";\n}\n?>"}, {"source_code": " ceil($n / 2); $i--) {\n $a = ($n - $dsize) / 2;\n echo str_repeat(\"*\", $a);\n echo str_repeat(\"D\", $dsize);\n echo str_repeat(\"*\", $a).\"\\n\";\n $dsize = $dsize + 2;\n}\necho str_repeat(\"D\", $dsize).\"\\n\";\n$dsize = $dsize - 2;\n$top = ceil($n / 2) + 1;\nfor ($i = $top; $i <= $n; $i++) {\n $a = ($n - $dsize) / 2;\n echo str_repeat(\"*\", $a);\n echo str_repeat(\"D\", $dsize);\n echo str_repeat(\"*\", $a).\"\\n\";\n $dsize = $dsize - 2;\n}\n?>"}, {"source_code": ""}, {"source_code": ""}, {"source_code": ""}], "negative_code": [{"source_code": ""}, {"source_code": ""}, {"source_code": ">1;\nif(1==$z)die('D');\n$z+=$h-2;\nwhile($z-->-$h)echo $f('*',$u=abs(($z+1)-$h)).$f('D',1+(($h<<1)-$u-1<<1)).$f('*',$u).\"\\n\";\n?>"}], "src_uid": "a003d645999934c255f7b05d8494fa40"} {"source_code": " 0) && ($d == 0) && ($e == 0))\n {\n $b[0] = \"a\";\n $b[1] = \"A\";\n }\n elseif(($c == 0) && ($d > 0) && ($e == 0))\n {\n $b[0] = \"1\";\n $b[1] = \"A\";\n }\n elseif(($c == 0) && ($d == 0) && ($e > 0))\n {\n $b[0] = \"1\";\n $b[1] = \"a\";\n }\n elseif(($c > 0) && ($d > 0) && ($e == 0))\n {\n if($c > 1)\n {\n for($y = 0; $y < strlen($b); $y++)\n {\n if(is_numeric($b[$y]) == TRUE)\n {\n $b[$y] = \"A\";\n break;\n }\n }\n }\n elseif($d > 1)\n {\n for($y = 0; $y < strlen($b); $y++)\n {\n if(ctype_lower($b[$y]) == TRUE)\n {\n $b[$y] = \"A\";\n break;\n }\n }\n }\n }\n elseif(($c > 0) && ($d == 0) && ($e > 0))\n {\n if($c > 1)\n {\n for($y = 0; $y < strlen($b); $y++)\n {\n if(is_numeric($b[$y]) == TRUE)\n {\n $b[$y] = \"a\";\n break;\n }\n }\n }\n elseif($e > 1)\n {\n for($y = 0; $y < strlen($b); $y++)\n {\n if(ctype_upper($b[$y]) == TRUE)\n {\n $b[$y] = \"a\";\n break;\n }\n }\n }\n }\n elseif(($c == 0) && ($d > 0) && ($e > 0))\n {\n if($d > 1)\n {\n for($y = 0; $y < strlen($b); $y++)\n {\n if(ctype_lower($b[$y]) == TRUE)\n {\n $b[$y] = \"1\";\n break;\n }\n }\n }\n elseif($e > 1)\n {\n for($y = 0; $y < strlen($b); $y++)\n {\n if(ctype_upper($b[$y]) == TRUE)\n {\n $b[$y] = \"1\";\n break;\n }\n }\n }\n }\n print $b . \"\\n\";\n}\n?>", "positive_code": [{"source_code": " $b ? $b : $a;\n $b = $a == $b ? $t : $b;\n\n $insert = $insert[0];\n $str[0 < $a ? 0 : ($a + 1 == $b ? $b + 1 : $a + 1)] = $insert;\n }\n\n return implode($str);\n}\n\n$handle = fopen(\"php://stdin\", \"r\");\n$n = (int)fgets($handle);\n\n$list = [];\n\nfor ($i = 0; $i < $n; $i++) {\n $str = trim(fgets($handle));\n $list[] = process($str);\n}\n\nforeach ($list as $str) {\n echo $str, PHP_EOL;\n}"}], "negative_code": [], "src_uid": "81faa525ded9b209fb7d5d8fec95f38b"} {"source_code": " $a)\n {\n if($c[$x - 1] == FALSE)\n {\n $e = 1;\n break;\n }\n else\n {\n $d++;\n $f = $c[$x - 1] + 1;\n for($y = 0; $y < count($c); $y++)\n {\n $c[$y] -= $f;\n }\n array_splice($c, 0, $x);\n break;\n }\n }\n elseif(($c[$x] < $a) && ($x == (count($c) - 1)))\n {\n $d++;\n unset($c);\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n }\n}\nif($e == 0)\n{\n print $d;\n}\nelse\n{\n print \"Impossible\";\n}\n?>", "positive_code": [{"source_code": "$n)\n\t\t\t\t{\n\t\t\t\t\tprint \"Impossible\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($symbols>$n)\n\t\t\t\t{\n\t\t\t\t\tprint \"Impossible\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($total+$symbols<=$n)\n\t\t\t{\n\t\t\t\t$total+=$symbols;\n\t\t\t\t$second_round=true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$total=$symbols-1;\n\t\t\t\t$numb++;\n\t\t\t\t$second_round=true;\n\t\t\t}\n\t\t\t$symbols=0;\n\t\t}\n\t}\nprint $numb+1;\n\n?>\n"}, {"source_code": "$n){\n exit('Impossible');\n }\n if($cur+1+$last<=$n)\n $last+=$cur+1;\n else{\n ++$cnt;\n $last=$cur;\n }\n}\nprint $cnt;\n"}, {"source_code": "$n){\n exit('Impossible');\n }\n if($cur+1+$last<=$n)\n $last+=$cur+1;\n else{\n ++$cnt;\n $last=$cur;\n }\n}\nprint $cnt;"}], "negative_code": [{"source_code": " $a)\n {\n if($c[$x - 1] == FALSE)\n {\n $e = 1;\n break;\n }\n else\n {\n $d++;\n $f = $c[$x - 1] + 1;\n for($y = 0; $y < count($c); $y++)\n {\n $c[$y] -= $f;\n }\n array_splice($c, 0, $x);\n break;\n }\n }\n elseif(($c[$x] < $a) && ($x == (count($c) - 1)))\n {\n $d++;\n unset($c);\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n }\n}\nif($e == 0)\n{\n print $d;\n}\nelse\n{\n print \"Impossible\";\n}\n?>"}, {"source_code": " $a)\n {\n if($c[$x - 1] == FALSE)\n {\n $e = 1;\n break;\n }\n else\n {\n $d++;\n $f = $c[$x - 1] + 1;\n for($y = 0; $y < count($c); $y++)\n {\n $c[$y] -= $f;\n }\n array_splice($c, 0, $x);\n break;\n }\n }\n elseif(($c[$x] < $a) && ($x == (count($c) - 1)))\n {\n $d++;\n unset($c);\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n }\n}\nif($e == 0)\n{\n print $d;\n}\nelse\n{\n print \"Impossible\";\n}\n?>"}, {"source_code": " $a)\n {\n if($c[$x - 1] == FALSE)\n {\n $e = 1;\n break;\n }\n else\n {\n $d++;\n $f = $c[$x - 1] + 1;\n for($y = 0; $y < count($c); $y++)\n {\n $c[$y] -= $f;\n }\n array_splice($c, 0, $x + 1);\n break;\n }\n }\n elseif(($c[$x] < $a) && ($x == (count($c) - 1)))\n {\n $d++;\n unset($c);\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n }\n}\nif($e == 0)\n{\n print $d;\n}\nelse\n{\n print \"Impossible\";\n}\n?>"}, {"source_code": " $a)\n {\n if($c[$x - 1] == FALSE)\n {\n $e = 1;\n break;\n }\n else\n {\n $d++;\n $f = $c[$x - 1] + 1;\n for($y = 0; $y < count($c); $y++)\n {\n $c[$y] -= $f;\n }\n array_splice($c, 0, $x);\n break;\n }\n }\n elseif(($c[$x] < $a) && ($x == (count($c) - 1)))\n {\n $d++;\n unset($c);\n break;\n }\n }\n if($e == 1)\n {\n break;\n }\n }\n}\nif($e == 0)\n{\n print $d;\n}\nelse\n{\n print \"Impossible\";\n}\n?>"}, {"source_code": "$n)\n\t\t\t{\n\t\t\t\tprint \"Impossible\";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif($total+$symbols<=$n)\n\t\t\t{\n\t\t\t\t$total+=$symbols;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$total=$symbols-1;\n\t\t\t\t$numb++;\n\t\t\t}\n\t\t\t$symbols=0;\n\t\t}\n\t}\nprint $numb+1;\n\n?>\n"}, {"source_code": "$n)\n\t\t\t{\n\t\t\t\tprint \"Imbossible\";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif($total+$symbols<=$n)\n\t\t\t{\n\t\t\t\t$total+=$symbols;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$total=$symbols-1;\n\t\t\t\t$numb++;\n\t\t\t}\n\t\t\t$symbols=0;\n\t\t}\n\t}\nprint $numb+1;\n\n?>\n"}, {"source_code": "$n){\n exit('Impossible');\n }\n if($cur+1+$last<=$n)\n $last+=$cur+1;\n else{\n ++$cnt;\n $last=$cur;\n }\n}\nprint $cnt;\n"}, {"source_code": "$n){\n exit('Impossible');\n }\n if($cur+1+$last<=$n)\n $last+=$cur+1;\n else{\n ++$cnt;\n $last=$cur;\n }\n}\nprint $cnt;\n"}], "src_uid": "12b64f77fc9dd44a7e0287ff0a716a6a"} {"source_code": "", "positive_code": [{"source_code": "'; 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": "