{"source_code": " 0){\n if($number % 10 == 0){\n $number /= 10;\n }\n else{\n $number--;\n }\n }\n return $number;\n}\n\nfunction main()\n{\n $data = fread(STDIN, 4096);\n list($num, $k) = explode(\" \", $data);\n echo wrong_subtraction(intval($num), intval($k));\n}\n\nmain();", "src_uid": "064162604284ce252b88050b4174ba55"} {"source_code": " $x[$i+1]) {\n $answer = max($answer, $x[$i] - $c - $x[$i+1]);\n }\n}\n\nprint $answer;\n\nfunction get_line() {\n return trim(fgets(STDIN));\n}\n", "src_uid": "411539a86f2e94eb6386bb65c9eb9557"} {"source_code": "= $lim_left && $c <= $lim_right) {\n\t\techo 'yes';\n\t\texit;\n\t}\n\n\t$change = $c < $p && $p > $pp || $c > $p && $p < $pp;\n\n\tif ($change) {\n\t\tif ($nout) {\n\t\t\tif ($c > $p && $pp > $p && $c < $pp || $c < $p && $pp < $p && $c > $pp) {\n\t\t\t\tif ($c > $p) {\n\t\t\t\t\t$max_left = $p;\n\t\t\t\t} else {\n\t\t\t\t\t$max_right = $p;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo 'yes';\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($c > $p && $pp > $p && $c < $pp || $c < $p && $pp < $p && $c > $pp) {\n\t\t\t\t$nout = true;\n\t\t\t\tif ($c < $p) {\n\t\t\t\t\tif ($lim_right)\n\t\t\t\t\t\t$max_left = $lim_right;\n\t\t\t\t} else {\n\t\t\t\t\tif ($lim_left)\n\t\t\t\t\t\t$max_right = $lim_left;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($c < $max_left && $p==$max_right) {\n\t\t\t\t\t$lim_left = $max_left;\n\t\t\t\t\t$max_left = $c;\n\t\t\t\t\t$lim_right = $p;\n\t\t\t\t} elseif ($c > $max_right && $p==$max_left) {\n\t\t\t\t\t$lim_right = $max_right;\n\t\t\t\t\t$max_right = $c;\n\t\t\t\t\t$lim_left = $p;\n\t\t\t\t} else {\n\t\t\t\t\techo 'yes';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ($nout) {\n\t\t\tif ($c > $max_left && $c < $p || $c < $max_right && $c > $p) {\n\n\t\t\t\tif ($c > $max_left && $c < $p)\n\t\t\t\t\t$max_right = $p;\n\t\t\t\telseif ($c < $max_right && $c > $p)\n\t\t\t\t\t$max_left = $p;\n\t\t\t} else {\n\t\t\t\techo 'yes';\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($c > $p) {\n\t\t\t\t$max_right = $c;\n\t\t\t\t$lim_right = $p;\n\t\t\t\t$lim_left = $max_left;\n\t\t\t} else {\n\t\t\t\t$max_left = $c;\n\t\t\t\t$lim_left = $p;\n\t\t\t\t$lim_right = $max_right;\n\t\t\t}\n\t\t}\n\t}\n\t$pp = $p;\n\t$p = $c;\n}\n\n\necho 'no';", "src_uid": "f1b6b81ebd49f31428fe57913dfc604d"} {"source_code": " $max) {\n $max = $map[$twoGramm];\n $result = $twoGramm;\n }\n }\n return $result;\n}\n\n$n = intval(fgets(STDIN));\n$s = trim(fgets(STDIN));\nprint solution($s);\n", "src_uid": "e78005d4be93dbaa518f3b40cca84ab1"} {"source_code": " 0) {\n $check = false;\n }\n }\n if ($check) echo \"YES\";\n else echo \"NO\";", "src_uid": "b6456a39d38fabcd25267793ed94d90c"} {"source_code": "", "src_uid": "5551742f6ab39fdac3930d866f439e3e"} {"source_code": "", "src_uid": "e167dc35a0d3b98c0414c66099e35920"} {"source_code": " -1) {\n if ($a[$i] == $b[$j]) {\n $right[$j--] = $i;\n }\n $i--;\n }\n\n // Result is either distance from last char of the first substring to the end of \n // the string [length - last index of first substring ] or\n // distance from start to the first char of the last substring, [first index of last substring]\n // distance between $first[$i-1] to $last[$i] - 1 (index from 0). [between chars]\n $longestSequence = max($aLen- $left[$bLen - 1] - 1, $right[0]);\n for ($k=1; $k<$bLen; $k++) {\n $longestSequence = max($longestSequence, $right[$k] - $left[$k-1] - 1);\n }\n return $longestSequence;\n}\n\nfunction main() {\n $string = readline();\n $subString = readline();\n echo longestSubstring($string, $subString);\n}\n\nmain();\n?>", "src_uid": "0fd33e1bdfd6c91feb3bf00a2461603f"} {"source_code": "= 0; $x--)\n{\n if(($a[$x] != 0) && ($a[$x] != 1))\n {\n $e = array_slice($a, 0, $x);\n $f = $a[$x] - 1;\n $e = array_merge($e, array($f));\n for($y = $x + 1; $y < count($a); $y++)\n {\n $e[count($e)] = 9;\n }\n $g = array_product($e);\n if($g > $d)\n {\n $d = $g;\n }\n $a = $a2;\n }\n}\nprint max($b, $c, $d);\n?>", "src_uid": "38690bd32e7d0b314f701f138ce19dfb"} {"source_code": "\n", "src_uid": "a6e9405bc3d4847fe962446bc1c457b4"} {"source_code": "\", trim(fgets(STDIN)));\n\n\t$d += ($t[0] == $home);\n\t$a += ($t[1] == $home);\n}\n\nif($d == $a)\n echo \"home\";\nelse\n echo \"contest\";", "src_uid": "51d1c79a52d3d4f80c98052b6ec77222"} {"source_code": " $c)\n {\n break;\n }\n else\n {\n $d[count($d)] = $f;\n $f += $a;\n }\n}\nwhile(TRUE)\n{\n if($g > $c)\n {\n break;\n }\n else\n {\n $e[count($e)] = $g;\n $g += $b;\n }\n}\n$h = array_intersect($d, $e);\nprint count($h);\n?>", "src_uid": "e7ad55ce26fc8610639323af1de36c2d"} {"source_code": "= $b[$x] * 2)\n {\n $c[count($c)] = $x + 1;\n $e += $b[$x];\n unset($b[$x]);\n }\n};\nif($e > $d / 2)\n{\n print count($c) . \"\\n\";\n print implode(\" \", $c);\n}\nelse\n{\n print \"0\";\n}\n?>", "src_uid": "0a71fdaaf08c18396324ad762b7379d7"} {"source_code": "", "src_uid": "a661b6ce166fe4b2bbfd0ace56a7dc2c"} {"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 $arr = read_array();\n $n = $arr[0];\n $k = $arr[1];\n \n $min = $n - ceil($n/$k);\n $max = $n;\n \n function timeForVloop($v, $k)\n {\n $res = floor($v/$k);\n if($res>0) return $res + timeForVloop($res, $k);\n else return 0;\n }\n \n function timeForV($v ,$k)\n {\n return $v + timeForVloop($v, $k);\n }\n \n $v = $min;\n do\n { \n $v++;\n $time = timeForV($v, $k);\n \n } while ($time<$n);\n \n \n echo $v;\n \n //echo timeForV(54,9);\n?>", "src_uid": "41dfc86d341082dd96e089ac5433dc04"} {"source_code": " 0){\n $dist -= 2*$r;\n $res++;\n}\n\necho $res.\"\\n\";", "src_uid": "698da80c7d24252b57cca4e4f0ca7031"} {"source_code": " $v) {\n if ($v == 0) {\n unset($a[$k]);\n }\n }\n funcMax($a, max($a), array());\n function funcMax($a, $max, $count) {\n $count[] = $max;\n foreach ($a AS $key => $val) {\n if ((int)$val == (int)$max) {\n unset($a[$key]);\n }\n }\n if ($a) { \n funcMax($a, max($a), $count);\n } else {\n echo count($count);\n }\n }\n \n?>", "src_uid": "3b520c15ea9a11b16129da30dcfb5161"} {"source_code": "0) {\n if (substr($string, 0, 2)==='-.') {\n $result.='1';\n $string = substr($string, 2);\n }\n else if (substr($string, 0, 2)==='--') {\n $result.='2';\n $string = substr($string, 2);\n }\n else if (substr($string, 0, 1)==='.') {\n $result.='0';\n $string = substr($string, 1); \n }\n else break;\n}\necho $result;\n?>", "src_uid": "46b5a1cd1bd2985f2752662b7dbb1869"} {"source_code": "=(int)TenToTwo($i)){\n $ans+=1;\n }else{\n break;\n }\n}\nprint($ans.\"\\n\");\n?>", "src_uid": "64a842f9a41f85a83b7d65bfbe21b6cb"} {"source_code": "= $max) {\n $max = $int;\n }\n}\n\n$count = $m;\n$maxCount = 0;\n\nwhile($count > 0 && $maxCount < $n)\n{\n $maxCount = 0;\n\n for($i = 0; $i < $n && $count > 0; $i++)\n {\n if($list[$i] < $max)\n {\n $list[$i]++;\n $count--;\n }\n else\n {\n $maxCount++;\n }\n }\n}\n\necho $max + ceil($count / $n), ' ', $max + $m;\n", "src_uid": "78f696bd954c9f0f9bb502e515d85a8d"} {"source_code": " $b) {\n\t\t$s = $a - $b;\n\t\twhile ($a != $b) {\n\t\t\t$a--;\n\t\t\t$c++;\n\t\t\t$k = $k + $c;\n\t\t\tif ($a != $b) {\n\t\t\t\t$b++;\n\t\t\t\t$d++;\n\t\t\t\t$k = $k + $d;\n\t\t\t}\n\t\t}\n\t\techo $k;\n\t} else {\n\t\t$s = $b - $a;\n\t\twhile ($a != $b) {\n\t\t\t$a++;\n\t\t\t$c++;\n\t\t\t$k = $k + $c;\n\t\t\tif ($a != $b) {\n\t\t\t\t$b--;\n\t\t\t\t$d++;\n\t\t\t\t$k = $k + $d;\n\t\t\t}\n\t\t}\n\t\techo $k;\n\t}\n?>", "src_uid": "d3f2c6886ed104d7baba8dd7b70058da"} {"source_code": " $now) $ans = $now;\n }\n}\n\necho $ans\n\n?>", "src_uid": "d13c7b5b5fc5c433cc8f374ddb16ef79"} {"source_code": " 0; $t --) {\r\n $n = intval(trim(fgets(STDIN)));\r\n\r\n echo 100 / gcd($n, 100).\"\\n\";\r\n\r\n\r\n}", "src_uid": "19a2bcb727510c729efe442a13c2ff7c"} {"source_code": "", "src_uid": "4e57740be015963c190e0bfe1ab74cb9"} {"source_code": " 1 || $zc > $xc) {print 'illegal'; exit(0);}\n\n$win1 = false; $win2 = false;\n\nif($f1 === 'XXX' || $f2 === 'XXX' || $f3 === 'XXX' || $f1[0].$f2[0].$f3[0] === 'XXX' || $f1[1].$f2[1].$f3[1] === 'XXX' || $f1[2].$f2[2].$f3[2] === 'XXX' || $f1[0].$f2[1].$f3[2] === 'XXX' || $f1[2].$f2[1].$f3[0] === 'XXX') $win1 = true;\n\nif($f1 === '000' || $f2 === '000' || $f3 === '000' || $f1[0].$f2[0].$f3[0] === '000' || $f1[1].$f2[1].$f3[1] === '000' || $f1[2].$f2[2].$f3[2] === '000' || $f1[0].$f2[1].$f3[2] === '000' || $f1[2].$f2[1].$f3[0] === '000') $win2 = true;\n\nif($win1 && $win2) {print 'illegal'; exit(0);}\n\nif($win1 && ($zc == $xc)) {print 'illegal'; exit(0);}\n\nif($win2 && (($zc + 1) == $xc)) {print 'illegal'; exit(0);}\n\nif($win1 && !$win2) {print 'the first player won'; exit(0);}\n\nif(!$win1 && $win2) {print 'the second player won'; exit(0);}\n\nif(!$win1 && !$win2 && ($xc + $zc) == 9) {print 'draw'; exit(0);}\n\nif($xc > $zc) {print 'second'; exit(0);}else{print 'first'; exit(0);}\n\n?>", "src_uid": "892680e26369325fb00d15543a96192c"} {"source_code": " $a [1])\n$x=$a [1];\nelse\n$x=$a [0];\n$s=1;\n\nfor ($i=2; $i <=$x; $i++)\n$s=$s*$i;\n\necho $s;\n\n\n?>", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6"} {"source_code": " 0) {\n if($s % 10 != 4 && $s % 10 != 7) \n return false;\n $s = intval($s / 10);\n }\n return true;\n}\n\nfscanf(STDIN, \"%s\", $s);\necho islucky(substr_count($s, '4') + substr_count($s, '7')) ? \"YES\" : \"NO\";", "src_uid": "33b73fd9e7f19894ea08e98b790d07f1"} {"source_code": "", "src_uid": "5ebfad36e56d30c58945c5800139b880"} {"source_code": "", "src_uid": "f838fae7c98bf51cfa0b9bd158650b10"} {"source_code": "=ord(\"a\")?$cnt++:\"\";\necho $cnt>=(strlen($s)-$cnt)?strtolower($s):strtoupper($s); \n?>", "src_uid": "b432dfa66bae2b542342f0b42c0a2598"} {"source_code": " $unit) {\n break;\n }\n if ($j === $n - 1) {\n $flgLucky = true;\n }\n }\n }\n // var_dump($flgLucky);\n}\n\necho $flgLucky ? \"YES\" : \"NO\";\n", "src_uid": "410296a01b97a0a39b6683569c84d56c"} {"source_code": "= 0) {\n\t\tif ($d[$a] >= 0) {\n\t\t\tarray_push($b, $d[$a]);\n\t\t} else {\n\t\t\tarray_push($c, $d[$a]);\n\t\t}\n\t\t$a--;\n\t}\n\techo (array_sum($b) - array_sum($c));\n?>", "src_uid": "4b5d14833f9b51bfd336cc0e661243a5"} {"source_code": " $b){\n $iCount += $b*2 + 1;\n} elseif($a < $b) {\n $iCount += $a*2 + 1;\n} elseif($a == $b){\n $iCount += $a*2;\n}\necho $iCount;", "src_uid": "609f131325c13213aedcf8d55fc3ed77"} {"source_code": "\n", "src_uid": "098ade88ed90664da279fe8a5a54b5ba"} {"source_code": "", "src_uid": "01b50fcba4185ceb1eb8e4ba04a0cc10"} {"source_code": "", "src_uid": "8ab25ed4955d978fe20f6872cb94b0da"} {"source_code": "", "src_uid": "ba6ff507384570152118e2ab322dd11f"} {"source_code": "", "src_uid": "95cb79597443461085e62d974d67a9a0"} {"source_code": " $value) {\n if (!$array1[$key]) continue;\n if (($value % $prime == 0) and ($value != $prime)) $array1[$key] = false;\n if (($value % $prime == 0) and ($value == $prime)) $array1[$key] = true; \n }\n }\n return $array1;\n}\n\n$res = toPrime($nums, $act);\n\nforeach ($res as $key => $value) {\n if ($value) $primes[] = $nums[$key];\n}\n\n$almostPrimes = array();\n\nfor ($i = 6; $i <= $number; $i++) {\n if (!in_array($i, $primes)) {\n $primeIndex = 0;\n $divisorsCount = 0;\n $j = $i;\n while ($primes[$primeIndex] <= $j && $primes[$primeIndex] < $i) {\n if ($j % $primes[$primeIndex] == 0) {\n //echo $j.$primes[$primeIndex].\"\\n\";\n $divisorsCount++;\n if ($divisorsCount > 2) {\n break;\n }\n $j /= $primes[$primeIndex];\n }\n $primeIndex++;\n }\n if ($divisorsCount == 2) $almostPrimes[] = $divisorsCount;\n }\n}\n\necho(count($almostPrimes)).\"\\n\";\n\n?>", "src_uid": "356666366625bc5358bc8b97c8d67bd5"} {"source_code": " 1) {\n\t\t$res = ($n % 2) . $res;\n\t\t$n = ($n - ($n % 2)) / 2;\n\t}\n\t$res = $n . $res;\n\t$res = str_repeat(\"0\", $dig - strlen($res)) . $res;\n\treturn $res;\n}\n\nfor ($i = 1; $i <= 9; $i++) {\n\tfor ($j = 1; $j <= 9; $j++) {\n\t\t$nums[] = str_repeat($i, $j);\n\t}\n}\n$nums[] = \"1000000000\";\n\nfor ($len = 2; $len <= 9; $len++) {\n\tfor ($i = 1; $i < pow(2, $len) - 1; $i++) {\n\t\t$j = tobin($i, $len);\n\t\tfor ($x = 1; $x <= 9; $x++) {\n\t\t\tfor ($y = 0; $y < $x; $y++) {\n\t\t\t\tif (($y != 0) || (substr($j, 0, 1) == \"1\")) {\n\t\t\t\t\t$s = \"\";\n\t\t\t\t\tfor ($k = 0; $k < strlen($j); $k++) {\n\t\t\t\t\t\t$s .= (substr($j, $k, 1) == \"1\" ? $x : $y);\n\t\t\t\t\t}\n\t\t\t\t\t$nums[] = $s;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n$raw = g();\n$n = $raw[0];\n\n$ct = 0;\nforeach ($nums as $val) {\n\tif ($n >= $val) {$ct++;}\n}\n\necho $ct;\n\n// End of submission file\n// Submission by chaotic_iak\n?>", "src_uid": "0f7f10557602c8c2f2eb80762709ffc4"} {"source_code": "", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb"} {"source_code": "$d){\n echo \"-1\";\n}else{\n $j = floor(($d-$s)/5) + ($n-1)*2;\n echo \"$j\";\n}\n", "src_uid": "b16f5f5c4eeed2a3700506003e8ea8ea"} {"source_code": "", "src_uid": "d0f5174bb0bcca5a486db327b492bf33"} {"source_code": "", "src_uid": "8a8013f960814040ac4bf229a0bd5437"} {"source_code": ">1)die(strval($m-1));\nprint($m>$n+1>>1?$m-1:$m+1);", "src_uid": "f6a80c0f474cae1e201032e1df10e9f7"} {"source_code": " 3 * $c or $a > $b + $c) {\n if ($b + $c > 3 * $c) {\n echo 3 * $c;\n }else echo $b + $c;\n }else echo $a; \n\n}elseif ($x == 3) {\n if ($a + $b > $c and $c < (3 * $a)) {\necho $c; \n}elseif ($b + $a < (3 * $a)) {\n \n echo $a + $b;\n}else echo 3 * $a;\n \n}elseif ($x == 2) {\n if ($b < (2 * $a) and $b < 2 * $c) {\n echo $b;\n }elseif (2 * $c < $x * $a) { echo 2 * $c; }else echo $x * $a ;\n}\n\n?>", "src_uid": "c74537b7e2032c1d928717dfe15ccfb8"} {"source_code": " $value) {\n if ($sum+$arr[$key] > $k)\n break; \n $sum += $arr[$key];\n $o[] = $key+1; \n}\necho count($o).\"\\n\";\nfor ($i = 0; $i < count($o); $i++) {\n echo $o[$i].\" \"; \n}\n?>", "src_uid": "dbb164a8dd190e63cceba95a31690a7c"} {"source_code": "0 && isset($a[$x])){\n $count++;\n $k-=$a[$x];\n $x++;\n}\n\nif ($k>0){\n $count = -1;\n}\n\necho $count;\n\n", "src_uid": "59dfa7a4988375febc5dccc27aca90a8"} {"source_code": " 0){\n // $sum += $number % 10;\n // $number /= 10;\n // }\n $number = strval($number);\n for($x = 0; $x < strlen($number); $x++)\n {\n $sum += $number[$x];\n }\n return $sum;\n}\n\nfscanf(STDIN, \"%d\\n\", $k);\n$i = 2;\n$prefect = 19;\nwhile($k > 0){\n if(decompose($prefect) == 10){\n $k--;\n }\n if($k == 0) break;\n $prefect += 9;\n}\necho $prefect;", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a"} {"source_code": "", "src_uid": "7725f9906a1b87bf4e866df03112f1e0"} {"source_code": "=$mod)\n break;\n}\necho $i+1;\n?>", "src_uid": "007a779d966e2e9219789d6d9da7002c"} {"source_code": " $primes[$length-1] ) {\n break;\n }\n if (in_array($primes[$i] + $primes[$i+1] + 1,$primes)) {\n $count++;\n }\n}\nif ($count>=$k) {\n echo 'YES';\n} else {\n echo 'NO';\n}\n", "src_uid": "afd2b818ed3e2a931da9d682f6ad660d"} {"source_code": "in();\n\n\t$s_arr = str_split($s);\n\trsort($s_arr);\n\n\t$first = $s_arr[0];\n\t$ans = $first;\n\t\n\tfor ($i = 1; $i < count($s_arr); $i++)\n\t{\n\t\tif ($first === $s_arr[$i]) $ans .= $first;\n\t\telse break;\n\t}\n\n\tprintf($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\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": "9a40e9b122962a1f83b74ddee6246a40"} {"source_code": "= 3)\n{\n $e++;\n $b[\"n\"] -= 3;\n $e += floor($b[\"n\"] / 2);\n}\nelse\n{\n $e = 0;\n}\n$f = floor($b[\"t\"] / 1);\n$g = $b[\"n\"] % 3;\nprint min($c, $d, $e, $f);\n?>", "src_uid": "bb433cdb8299afcf46cb2797cbfbf724"} {"source_code": "= 0; $y--)\n {\n $h = $e[$x];\n $g[$y][$x] = $h[$y];\n }\n}\n$i = array();\nfor($x = 3; $x >= 0; $x--)\n{\n $j = $g[$x];\n $i[count($i)] = $j;\n}\nfor($x = 0; $x < 4; $x++)\n{\n for($y = 0; $y < 2; $y++)\n {\n if(($i[$x][$y] == \"x\") && ($i[$x][$y + 1] == \"x\") && ($i[$x][$y + 2] == \".\"))\n {\n $f = 1;\n break;\n }\n }\n for($y = 0; $y < 2; $y++)\n {\n if(($i[$x][$y] == \".\") && ($i[$x][$y + 1] == \"x\") && ($i[$x][$y + 2] == \"x\"))\n {\n $f = 1;\n break;\n }\n }\n for($y = 0; $y < 2; $y++)\n {\n if(($i[$x][$y] == \"x\") && ($i[$x][$y + 1] == \".\") && ($i[$x][$y + 2] == \"x\"))\n {\n $f = 1;\n break;\n }\n }\n}\nif(($e[0][1] == \"x\") && ($e[1][2] == \"x\") && ($e[2][3] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][1] == \".\") && ($e[1][2] == \"x\") && ($e[2][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][1] == \"x\") && ($e[1][2] == \".\") && ($e[2][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][0] == \"x\") && ($e[1][1] == \"x\") && ($e[2][2] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[1][1] == \"x\") && ($e[2][2] == \"x\") && ($e[3][3] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][0] == \"x\") && ($e[1][1] == \".\") && ($e[2][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][1] == \"x\") && ($e[2][2] == \".\") && ($e[3][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][0] == \"x\") && ($e[1][1] == \".\") && ($e[2][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][1] == \".\") && ($e[2][2] == \"x\") && ($e[3][3] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][0] == \"x\") && ($e[2][1] == \"x\") && ($e[3][2] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[1][0] == \".\") && ($e[2][1] == \"x\") && ($e[3][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][0] == \"x\") && ($e[2][1] == \".\") && ($e[3][2] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][2] == \"x\") && ($e[1][1] == \"x\") && ($e[2][0] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][2] == \".\") && ($e[1][1] == \"x\") && ($e[2][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][2] == \"x\") && ($e[1][1] == \".\") && ($e[2][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][3] == \"x\") && ($e[1][2] == \"x\") && ($e[2][1] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[0][3] == \".\") && ($e[1][2] == \"x\") && ($e[2][1] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[0][3] == \"x\") && ($e[1][2] == \".\") && ($e[2][1] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][2] == \"x\") && ($e[2][1] == \".\") && ($e[3][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][2] == \"x\") && ($e[2][1] == \".\") && ($e[3][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][2] == \".\") && ($e[2][1] == \"x\") && ($e[3][0] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \"x\") && ($e[2][2] == \"x\") && ($e[3][1] == \".\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \".\") && ($e[2][2] == \"x\") && ($e[3][1] == \"x\"))\n{\n $f = 1;\n}\nelseif(($e[1][3] == \"x\") && ($e[2][2] == \".\") && ($e[3][1] == \"x\"))\n{\n $f = 1;\n}\nif($f == 1)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917"} {"source_code": "", "src_uid": "76c8bfa6789db8364a8ece0574cd31f5"} {"source_code": "$value)\n{\n if ($value == 'halfplus')\n {\n $total = ($total + 0.5)*2;\n //print_r($total.'-');\n $count++;\n }\n else\n {\n $total = $total*2;\n }\n}\n\n\n$price = ($p*$total) - (($p*$count)/2);\n\n\nprintf('%.0f', $price);", "src_uid": "6330891dd05bb70241e2a052f5bf5a58"} {"source_code": " $m)\n swap($n, $m);\n \n if ($n & 1)\n fprintf($fo, \"Akshat\");\n else\n fprintf($fo, \"Malvika\");\n \n fclose($fi);\n fclose($fo);\n?>", "src_uid": "a4b9ce9c9f170a729a97af13e81b5fe4"} {"source_code": "", "src_uid": "c2e3aced0bc76b6484360563355d23a7"} {"source_code": "= min($c[$x], $i[$x])) && ($a <= max($c[$x], $i[$x])) && ($b >= min($f[$x], $l[$x])) && ($b <= max($f[$x], $l[$x])))\n {\n break;\n }\n}\nprint $x;\n?>", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382"} {"source_code": " 0) ? _merge(array_values($a)) : $a;\n}\n\n$n = trim(fgets(STDIN));\n$arr = array_fill(0, $n, 1);\n$o = _merge($arr);\n\nfor($i=0; $i", "src_uid": "757cd804aba01dc4bc108cb0722f68dc"} {"source_code": "", "src_uid": "a307b402b20554ce177a73db07170691"} {"source_code": "2)\n $nr = $i - 2;\n if($j<2)\n $nr += 2 - $j;\n elseif($j>2)\n $nr += $j - 2;\n }\n }\n}\n\necho $nr;", "src_uid": "8ba7cedc3f6ae478a0bb3f902440c8e9"} {"source_code": "", "src_uid": "7038d7b31e1900588da8b61b325e4299"} {"source_code": "", "src_uid": "7dbf58806db185f0fe70c00b60973f4b"} {"source_code": " 0) ? $sum-$n : 0);\n?>", "src_uid": "e87d9798107734a885fd8263e1431347"} {"source_code": "", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e"} {"source_code": "", "src_uid": "3f9980ad292185f63a80bce10705e806"} {"source_code": "0 && $x<10) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction checkResult($a, $b, $n, $k, $r, $c, $d) {\n if (($a+$b)==$r[0] \n && ($n+$k)==$r[1]\n && ($a+$n)==$c[0]\n && ($b+$k)==$c[1]\n && ($a+$k)==$d[0]\n && ($b+$n)==$d[1]\n && $a!=$b\n && $a!=$n\n && $a!=$k\n && $b!=$n\n && $b!=$k\n && $n!=$k) {\n \n return true;\n } else {\n return false;\n }\n}\n$file = file('php://stdin');\n$r = explode(' ', $file[0]); \n$c = explode(' ', $file[1]); \n$d = explode(' ', $file[2]);\nif ($r[0]==1 || $r[1]==1 || $d[0]==1 || $d[1]==1 || $c[0]==1 || $c[1]==1){\n echo '-1';\n exit;\n}\nfor ($a=1; $a<=min($r[0]-1, 9); $a++) {\n $b = $r[0]-$a;\n for ($n=1; $n<=min($r[1]-1, 9); $n++) {\n $k = $r[1]-$n;\n if (checkNumber($a) && checkNumber($b) && checkNumber($n) && checkNumber($k) && checkResult($a, $b, $n, $k, $r, $c, $d)) {\n echo \"$a $b\\n\";\n echo \"$n $k\";\n exit;\n }\n }\n}\necho '-1';\n\n\n?>", "src_uid": "6821f502f5b6ec95c505e5dd8f3cd5d3"} {"source_code": " 1) {\n $Ts /= $q;\n $t++;\n }\n\n echo $t;\n}\n\n$file = STDIN;\nlist($T, $S, $q) = explode(\" \", trim(fgets($file)));\npowCounter($T, $S, $q);\n", "src_uid": "0d01bf286fb2c7950ce5d5fa59a17dd9"} {"source_code": "", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223"} {"source_code": "", "src_uid": "775766790e91e539c1cfaa5030e5b955"} {"source_code": "", "src_uid": "245ec0831cd817714a4e5c531bffd099"} {"source_code": "", "src_uid": "db46a6b0380df047aa34ea6a8f0f93c1"} {"source_code": "= $p && $n > 0) {\n $ans++;\n $n--;\n $t -= $p;\n $p += 5;\n }\n\n echo $ans;\n", "src_uid": "41e554bc323857be7b8483ee358a35e2"} {"source_code": "= 97){\n\t\t$o -= 97;\n\t}\n\telse{\n\t\t$o -= 65;\n\t}\n\t$a[$o] = 1;\n}\nif(count($a) == 26) echo \"YES\";\nelse echo \"NO\";\n?>", "src_uid": "f13eba0a0fb86e20495d218fc4ad532d"} {"source_code": " $b[$a - 2])\n {\n print \"UP\";\n }\n elseif($b[$a - 1] < $b[$a - 2])\n {\n print \"DOWN\";\n }\n}\n?>", "src_uid": "8330d9fea8d50a79741507b878da0a75"} {"source_code": "", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11"} {"source_code": " 0) {\r\n $ans = $t == 4 ? 2 : 1;\r\n \r\n } else {\r\n $ans = 0;\r\n }\r\n \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}", "src_uid": "7336b8becd2438f0439240ee8f9610ec"} {"source_code": "\n ", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9"} {"source_code": "", "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72"} {"source_code": " 0)) {\n $p = true;\n print \"NO\";\n} else if (($b > $a) and ($c < 0)) {\n $p = true;\n print \"NO\";\n} else if (($a != $b) and ($c == 0)) {\n $p = true;\n print \"NO\";\n}\nif (!$p) {\n $i = ($b - $a) % $c;\n if ($i == 0) {\n print \"YES\";\n } else {\n print \"NO\";\n }\n}\n?>\n\n", "src_uid": "9edf42c20ddf22a251b84553d7305a7d"} {"source_code": "= 2) || (count($c) == 1))\n{\n print \"Yes\";\n}\nelse\n{\n print \"No\";\n}\n?>", "src_uid": "6b22e93f7e429693dcfe3c099346dcda"} {"source_code": "", "src_uid": "05cffd59b28b9e026ca3203718b2e6ca"} {"source_code": "$rez)\n $rez=$q;\n}\necho $rez;\n?>", "src_uid": "a254b1e3451c507cf7ce3e2496b3d69e"} {"source_code": "", "src_uid": "55485fe203a114374f0aae93006278d3"} {"source_code": " $b)\n {\n $d -= 3;\n $f--;\n if(($f == 0) && ($d == $b))\n {\n $e = 1;\n break;\n }\n elseif(($f == 0) && ($d != $b))\n {\n break;\n }\n }\n }\n if($e == 0)\n {\n print \"NO\\n\";\n }\n else\n {\n print \"YES\\n\";\n }\n}\n?>", "src_uid": "cfd1182be98fb5f0c426f8b68e48d452"} {"source_code": "", "src_uid": "46f051f58d626587a5ec449c27407771"} {"source_code": "", "src_uid": "24e8aaa7e3e1776adf342ffa1baad06b"} {"source_code": "= $a2)\n {\n sort($g);\n $h = 0;\n for($y = 0; $y < $a2; $y++)\n {\n $h += $g[$y];\n }\n $i[count($i)] = $h;\n }\n}\nprint min($i);\n?>", "src_uid": "ed1a2ae733121af6486568e528fe2d84"} {"source_code": "", "src_uid": "56da4ec7cd849c4330d188d8c9bd6094"} {"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\n$cnt = 0;\nfor ($a = 1; $a<=$n; $a++) {\n\tfor ($b=$a; $b<=$n; $b++) {\n\t\t$c = $a^$b;\n\t\tif ($c>=$b && $c<=$n && ($c+$a)>$b && ($a+$b)>$c && ($b+$c)>$a) {\n\t\t\t//echo \"$a, $b, $c, \" . ($a^$b^$c) . \"\\n\";\n\t\t\t$cnt++;\n\t\t}\n\t}\n}\n\necho $cnt;\n", "src_uid": "838f2e75fdff0f13f002c0dfff0b2e8d"} {"source_code": "= 1; $y--)\n {\n $g -= $x;\n if(((($f * $d) + ($g * $e)) == $a) && (($f + $g) == $b))\n {\n $h = 1;\n break;\n }\n }\n if($h == 1)\n {\n break;\n }\n $g = $b;\n }\n for($x = 1; $x <= $f; $x++)\n {\n array_push($i, $d);\n }\n for($x = 1; $x <= $g; $x++)\n {\n array_push($i, $e);\n }\n for($x = 0; $x < count($i); $x++)\n {\n if($i[$x] == \"2\")\n {\n $j++;\n }\n }\n print $j;\n}\n?>", "src_uid": "5a5e46042c3f18529a03cb5c868df7e8"} {"source_code": "", "src_uid": "ce0cb995e18501f73e34c76713aec182"} {"source_code": "= $d) && ($g <= $d + $e))\n{\n $h = $d + $e;\n $i = $h - $g;\n print number_format(($a / $c) + $i, 8, \".\", \"\");\n}\nelseif($g > ($d + $e))\n{\n $h = $g % ($d + $e);\n print number_format(($a / $c) + $h, 8, \".\", \"\");\n}\n?>", "src_uid": "e4a4affb439365c843c9f9828d81b42c"} {"source_code": "= 0))\n {\n $j = abs($f) + $g;\n }\n elseif(($f >= 0) && ($g > 0))\n {\n $j = $g - $f;\n }\n if(($h < 0) && ($i < 0))\n {\n $k = abs($h) - abs($i);\n }\n elseif(($h < 0) && ($i >= 0))\n {\n $k = abs($h) + $i;\n }\n elseif(($h >= 0) && ($i > 0))\n {\n $k = $i - $h;\n }\n print $j * $k;\n }\n}\nelseif($a > 2)\n{\n list($b, $c) = explode(\" \", trim(fgets(STDIN)));\n list($d, $e) = explode(\" \", trim(fgets(STDIN)));\n list($f, $g) = explode(\" \", trim(fgets(STDIN)));\n if(($b == $d) && ($c == $g))\n {\n $h = min($c, $e);\n $i = max($c, $e);\n $j = min($b, $f);\n $k = max($b, $f);\n if(($h < 0) && ($i < 0))\n {\n $l = abs($h) - abs($i);\n }\n elseif(($h < 0) && ($i >= 0))\n {\n $l = abs($h) + $i;\n }\n elseif(($h >= 0) && ($i > 0))\n {\n $l = $i - $h;\n }\n if(($j < 0) && ($k < 0))\n {\n $m = abs($j) - abs($k);\n }\n elseif(($j < 0) && ($k >= 0))\n {\n $m = abs($j) + $k;\n }\n elseif(($j >= 0) && ($k > 0))\n {\n $m = $k - $j;\n }\n print $l * $m;\n }\n elseif(($b == $d) && ($e == $g))\n {\n $h = min($c, $e);\n $i = max($c, $e);\n $j = min($d, $f);\n $k = max($d, $f);\n if(($h < 0) && ($i < 0))\n {\n $l = abs($h) - abs($i);\n }\n elseif(($h < 0) && ($i >= 0))\n {\n $l = abs($h) + $i;\n }\n elseif(($h >= 0) && ($i > 0))\n {\n $l = $i - $h;\n }\n if(($j < 0) && ($k < 0))\n {\n $m = abs($j) - abs($k);\n }\n elseif(($j < 0) && ($k >= 0))\n {\n $m = abs($j) + $k;\n }\n elseif(($j >= 0) && ($k > 0))\n {\n $m = $k - $j;\n }\n print $l * $m;\n }\n elseif(($b == $f) && ($c == $e))\n {\n $h = min($c, $g);\n $i = max($c, $g);\n $j = min($b, $d);\n $k = max($b, $d);\n if(($h < 0) && ($i < 0))\n {\n $l = abs($h) - abs($i);\n }\n elseif(($h < 0) && ($i >= 0))\n {\n $l = abs($h) + $i;\n }\n elseif(($h >= 0) && ($i > 0))\n {\n $l = $i - $h;\n }\n if(($j < 0) && ($k < 0))\n {\n $m = abs($j) - abs($k);\n }\n elseif(($j < 0) && ($k >= 0))\n {\n $m = abs($j) + $k;\n }\n elseif(($j >= 0) && ($k > 0))\n {\n $m = $k - $j;\n }\n print $l * $m;\n }\n elseif(($b == $f) && ($g == $e))\n {\n $h = min($c, $g);\n $i = max($c, $g);\n $j = min($d, $f);\n $k = max($d, $f);\n if(($h < 0) && ($i < 0))\n {\n $l = abs($h) - abs($i);\n }\n elseif(($h < 0) && ($i >= 0))\n {\n $l = abs($h) + $i;\n }\n elseif(($h >= 0) && ($i > 0))\n {\n $l = $i - $h;\n }\n if(($j < 0) && ($k < 0))\n {\n $m = abs($j) - abs($k);\n }\n elseif(($j < 0) && ($k >= 0))\n {\n $m = abs($j) + $k;\n }\n elseif(($j >= 0) && ($k > 0))\n {\n $m = $k - $j;\n }\n print $l * $m;\n }\n elseif(($d == $f) && ($e == $c))\n {\n $h = min($g, $e);\n $i = max($g, $e);\n $j = min($b, $d);\n $k = max($b, $d);\n if(($h < 0) && ($i < 0))\n {\n $l = abs($h) - abs($i);\n }\n elseif(($h < 0) && ($i >= 0))\n {\n $l = abs($h) + $i;\n }\n elseif(($h >= 0) && ($i > 0))\n {\n $l = $i - $h;\n }\n if(($j < 0) && ($k < 0))\n {\n $m = abs($j) - abs($k);\n }\n elseif(($j < 0) && ($k >= 0))\n {\n $m = abs($j) + $k;\n }\n elseif(($j >= 0) && ($k > 0))\n {\n $m = $k - $j;\n }\n print $l * $m;\n }\n elseif(($d == $f) && ($g == $c))\n {\n $h = min($e, $g);\n $i = max($e, $g);\n $j = min($b, $f);\n $k = max($b, $f);\n if(($h < 0) && ($i < 0))\n {\n $l = abs($h) - abs($i);\n }\n elseif(($h < 0) && ($i >= 0))\n {\n $l = abs($h) + $i;\n }\n elseif(($h >= 0) && ($i > 0))\n {\n $l = $i - $h;\n }\n if(($j < 0) && ($k < 0))\n {\n $m = abs($j) - abs($k);\n }\n elseif(($j < 0) && ($k >= 0))\n {\n $m = abs($j) + $k;\n }\n elseif(($j >= 0) && ($k > 0))\n {\n $m = $k - $j;\n }\n print $l * $m;\n }\n}\n?>", "src_uid": "ba49b6c001bb472635f14ec62233210e"} {"source_code": "", "src_uid": "df48af9f5e68cb6efc1214f7138accf9"} {"source_code": "0 OR $k>0) echo \"\".($c+1);\n else\n echo \"\".$c;\n?>", "src_uid": "578bae0fe6634882227ac371ebb38fc9"} {"source_code": "", "src_uid": "f22267bf3fad0bf342ecf4c27ad3a900"} {"source_code": "", "src_uid": "a993069e35b35ae158d35d6fe166aaef"} {"source_code": " 1) {\n break;\n }\n}\nif ($counter == 0) {\n if (strlen($str) % 2 == 1) {\n echo \"YES\";\n } else {\n\n echo \"NO\";\n }\n} else if ($counter == 1) {\n echo \"YES\";\n} else {\n echo \"NO\";\n}\n", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52"} {"source_code": "\n", "src_uid": "980f4094b3cfc647d6f74e840b1bfb62"} {"source_code": "", "src_uid": "082b31cc156a7ba1e0a982f07ecc207e"} {"source_code": "=0;$i--)\n{\n if($a[$i]!=0){ \n break;\n }\n}\n$c=$i+1;\n//echo $c;\n//print_r($a);\n$sum=0;\nfor($i=0;$i<(int)($c/2);$i++)\n{\n //echo $a[$i].\"/\".$a[($c-1-$i)].\"\\n\";\n if($a[$i]!=$a[($c-1-$i)]) \n {$sum=1;\n break; }\n\n}\n//echo $sum;\nif($sum) echo \"NO\";\n else echo \"YES\";\n?>", "src_uid": "d82278932881e3aa997086c909f29051"} {"source_code": "", "src_uid": "c7aa8a95d5f8832015853cffa1374c48"} {"source_code": " 2) ? print(\"YES\") : print(\"NO\");", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2"} {"source_code": " 1)\n{\n $matches += floor($current_participants / 2);\n $current_participants = ceil($current_participants / 2);\n}\n\n$total_bottles = ($matches * ($bottles_per_player * 2)) + $matches;\n$total_towels = ($participants * $towels_per_player);\n\necho $total_bottles . \" \" . $total_towels;\n", "src_uid": "eb815f35e9f29793a120d120968cfe34"} {"source_code": " 20000) {\n exit('NO');\n }\n\n // echo \"{$d} {$dir} {$pos}\\n\";\n }\n\n if ($pos % 40000 == 0) {\n echo \"YES\";\n } else {\n echo \"NO\";\n }", "src_uid": "11ac96a9daa97ae1900f123be921e517"} {"source_code": " 0){\n\t\t$c++;\n\t}\n\tif($a[$i] < 0){\n\t\t$d++;\n\t}\n}\n\nif($c >= $n/2 || $d >= $n/2){\n\tfwrite(STDOUT, ($c>$d ? 2 : -2));\n}else{\n\tfwrite(STDOUT, 0);\n}\n\n?>", "src_uid": "a13cb35197f896cd34614c6c0b369a49"} {"source_code": "\n", "src_uid": "5d4f38ffd1849862623325fdbe06cd00"} {"source_code": "Karen", "src_uid": "1649d2592eadaa8f8d076eae2866cffc"} {"source_code": "$a[1]){\n print 'Valera';\n}\nelse{\n print 'Vladik';\n}\n?>", "src_uid": "87e37a82be7e39e433060fd8cdb03270"} {"source_code": "", "src_uid": "5e74750f44142624e6da41d4b35beb9a"} {"source_code": "", "src_uid": "44fdf71d56bef949ec83f00d17c29127"} {"source_code": "= $a)\n{\n print $f;\n}\nelse\n{\n while(TRUE)\n {\n $g += min($c - $e, $b + ($f * $d) - $e);\n $f++;\n if($g >= $a)\n {\n break;\n }\n }\n print $f;\n}\n?>", "src_uid": "b743110117ce13e2090367fd038d3b50"} {"source_code": "=2)&&($curMaxLen\n", "src_uid": "13b5cf94f2fabd053375a5ccf3fd44c7"} {"source_code": "", "src_uid": "d3c10d1b1a17ad018359e2dab80d2b82"} {"source_code": " $time2) echo 'Second';\nif ($time1 == $time2) echo 'Friendship';", "src_uid": "10226b8efe9e3c473239d747b911a1ef"} {"source_code": "", "src_uid": "031e53952e76cff8fdc0988bb0d3239c"} {"source_code": "\n\n= 1; $i --) {\n\t\tprintf(\"%d \", $i);\n\t}\n}\n\n?>", "src_uid": "fe8a0332119bd182a0a5b7758716317e"} {"source_code": "= $l && $p2 * $p3 <= $r)\n ++$ans;\n\necho $ans . \"\\n\";", "src_uid": "05fac54ed2064b46338bb18f897a4411"} {"source_code": " $count1){\n $b=false;\n }else {\n $i++;\n }\n }\n echo $i;\n?>", "src_uid": "d215b3541d6d728ad01b166aae64faa2"} {"source_code": " $max) $max = $cur;\n\t\t} else {\n\t\t\t$cur = 0;\t\t\t\n\t\t}\n\t}\n\tif ($max > $b) {\n\t\t$poss = false;\n\t}\n\t\n\tif ($poss == true) {\n\t\techo 'YES';\n\t} else {\n\t\techo 'NO';\n\t}\n?>", "src_uid": "5bd578d3da5837c259b222336a194d12"} {"source_code": "", "src_uid": "e66ecb0021a34042885442b336f3d911"} {"source_code": " $n) {\n\t$b = $b % $n;\n\t$b_abs = $b_abs % $n;\n}\n\nif ($b < 0)\n\t$iRes = $n + $b + $a;\nelse\n\t$iRes = $a + $b;\n\nif ($iRes > $n)\n\t$iRes = $iRes - $n;\n\necho $iRes;\n\n?>", "src_uid": "cd0e90042a6aca647465f1d51e6dffc4"} {"source_code": "\", \"v\", \"<\");\n $e = $c % 4;\n if($b == $d[$e])\n {\n print \"cw\";\n }\n else\n {\n $f = array(\"^\", \"<\", \"v\", \">\");\n $g = $c % 4;\n if($b == $f[$g])\n {\n print \"ccw\";\n }\n }\n}\nelseif($a == \">\")\n{\n $d = array(\">\", \"v\", \"<\", \"^\");\n $e = $c % 4;\n if($b == $d[$e])\n {\n print \"cw\";\n }\n else\n {\n $f = array(\">\", \"^\", \"<\", \"v\");\n $g = $c % 4;\n if($b == $f[$g])\n {\n print \"ccw\";\n }\n }\n}\nelseif($a == \"v\")\n{\n $d = array(\"v\", \"<\", \"^\", \">\");\n $e = $c % 4;\n if($b == $d[$e])\n {\n print \"cw\";\n }\n else\n {\n $f = array(\"v\", \">\", \"^\", \"<\");\n $g = $c % 4;\n if($b == $f[$g])\n {\n print \"ccw\";\n }\n }\n}\nelseif($a == \"<\")\n{\n $d = array(\"<\", \"^\", \">\", \"v\");\n $e = $c % 4;\n if($b == $d[$e])\n {\n print \"cw\";\n }\n else\n {\n $f = array(\"<\", \"v\", \">\", \"^\");\n $g = $c % 4;\n if($b == $f[$g])\n {\n print \"ccw\";\n }\n }\n}\n?>", "src_uid": "fb99ef80fd21f98674fe85d80a2e5298"} {"source_code": "in();\n\t$t = (int)$Input->in();\n\t$a = (int)$Input->in();\n\t$b = (int)$Input->in();\n\t$da = (int)$Input->in();\n\t$db = (int)$Input->in();\n\n\t$ok = false;\n\t\n\tfor ($i = 0; $i < $t + 1; $i++) {\n\t\t\n\t\tfor ($j = 0; $j < $t + 1; $j++)\n\t\t{\n\n\t\t\tif ($i !== $t && $j !== $t) $sum = $a - $da * $i + $b - $db * $j;\n\t\t\telse if ($i === $t && $j !== $t) $sum = $b - $db * $j;\n\t\t\telse if ($i !== $t && $j === $t) $sum = $a - $da * $i;\n\t\t\telse if ($i === $t && $j === $t) $sum = 0;\n\n\t\t\tif ($sum < $x) break;\n\t\t\telse if ($sum === $x)\n\t\t\t{\n\t\t\t\t$ok = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif ($ok) print(\"YES\");\n\telse {\n\t\tprint(\"NO\");\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": "f98168cdd72369303b82b5a7ac45c3af"} {"source_code": "= 0; $x--)\n{\n $d = ord($a[$x]);\n $d++;\n for($y = $d; $y <= 122; $y++)\n {\n $a[$x] = chr($y);\n if($a < $b)\n {\n $c = TRUE;\n break;\n }\n }\n if($c == TRUE)\n {\n break;\n }\n else\n {\n $a[$x] = \"a\";\n }\n}\nif($c == TRUE)\n{\n print $a;\n}\nelse\n{\n print \"No such string\";\n}\n?>", "src_uid": "47618510d2a17b1cc1e6a688201d51a3"} {"source_code": "$s) {\necho \"Second\";\n}\nelse echo \"First\";\n?>\n", "src_uid": "90b9ef939a13cf29715bc5bce26c9896"} {"source_code": " $d[0])\n {\n break;\n }\n else\n {\n $c++;\n $d[0]--;\n $e++;\n rsort($d);\n }\n}\nprint $e;\n?>", "src_uid": "aa8fabf7c817dfd3d585b96a07bb7f58"} {"source_code": "", "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43"} {"source_code": "", "src_uid": "f726133018e2149ec57e113860ec498a"} {"source_code": " 1){\n break;\n }\n// if (strpos($i, $i[$n], $n + 1) !== FALSE){\n// break;\n// }\n \n if ($n == 3){ \n $flag = 1;\n break;\n }\n }\n \n if ($flag){\n echo $i . \"\\n\";\n break;\n }\n $i = (int)($i);\n }\n}", "src_uid": "d62dabfbec52675b7ed7b582ad133acd"} {"source_code": " 0) {\n $c = intVal($a / $b);\n $h += $c;\n \n $a -= $c * $b;\n $a += $c;\n}\n\necho $h;\n", "src_uid": "a349094584d3fdc6b61e39bffe96dece"} {"source_code": " 0, B => 1, C => 2, D => 3, E => 4, F => 5, G => 6, H => 7, I => 8, J => 9, K => 10, L => 11, M => 12, N => 13, O => 12, P => 11, Q => 10, R => 9, S => 8, T => 7, U => 6, V => 5, W => 4, X => 3, Y => 2, Z => 1);\n$d = array(A => 2, B => 1, C => 0, D => 1, E => 2, F => 3, G => 4, H => 5, I => 6, J => 7, K => 8, L => 9, M => 10, N => 11, O => 12, P => 13, Q => 12, R => 11, S => 10, T => 9, U => 8, V => 7, W => 6, X => 5, Y => 4, Z => 3);\n$e = array(A => 7, B => 8, C => 9, D => 10, E => 11, F => 12, G => 13, H => 12, I => 11, J => 10, K => 9, L => 8, M => 7, N => 6, O => 5, P => 4, Q => 3, R => 2, S => 1, T => 0, U => 1, V => 2, W => 3, X => 4, Y => 5, Z => 6);\n$f = array(A => 6, B => 5, C => 4, D => 3, E => 2, F => 1, G => 0, H => 1, I => 2, J => 3, K => 4, L => 5, M => 6, N => 7, O => 8, P => 9, Q => 10, R => 11, S => 12, T => 13, U => 12, V => 11, W => 10, X => 9, Y => 8, Z => 7);\n$g = 1000;\nfor($x = 0; $x < $a - 3; $x++)\n{\n $h = 0;\n $h += $c[$b[$x]];\n $h += $d[$b[$x + 1]];\n $h += $e[$b[$x + 2]];\n $h += $f[$b[$x + 3]];\n $g = min($g, $h);\n}\nprint $g;\n?>", "src_uid": "ee4f88abe4c9fa776abd15c5f3a94543"} {"source_code": "= $str[$i]) {\n $str[$i] = $current;\n $current = incrementChar($current);\n if ($str[$i] == 'z') {\n return implode($str);\n }\n }\n }\n return -1;\n}\n\nfunction incrementChar($char)\n{\n return chr(ord($char) + 1);\n}\n\nfscanf(STDIN, \"%s\", $string);\nprint solution($string);\n", "src_uid": "f8ad543d499bcc0da0121a71a26db854"} {"source_code": "", "src_uid": "7bd5521531950e2de9a7b0904353184d"} {"source_code": "", "src_uid": "e8148140e61baffd0878376ac5f3857c"} {"source_code": "", "src_uid": "d1e381b72a6c09a0723cfe72c0917372"} {"source_code": "", "src_uid": "a4b3da4cb9b6a7ed0a33a862e940cafa"} {"source_code": " 0; $i--) {\n if ($summ % $i == 0 && $count % $i == 0) {\n $summ /= $i;\n $count /= $i;\n }\n}\n\necho $summ . '/' . $count;\n\nfunction get_summ($num, $base) {\n $result = 0;\n while ($num) {\n $result += $num % $base;\n $num = floor($num / $base);\n }\n return $result;\n}\n", "src_uid": "1366732dddecba26db232d6ca8f35fdc"} {"source_code": "= 0; $y -= $b)\n{\n if(($c[$y] == FALSE) || ($c[$y] == \"#\"))\n {\n break;\n }\n elseif($c[$y] == \"T\")\n {\n $d = 1;\n }\n}\nfor($y = $x; $y < $a; $y += $b)\n{\n if(($c[$y] == FALSE) || ($c[$y] == \"#\"))\n {\n break;\n }\n elseif($c[$y] == \"T\")\n {\n $d = 1;\n }\n}\nif($d == 1)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "src_uid": "189a9b5ce669bdb04b9d371d74a5dd41"} {"source_code": " 0 && $n2 > 0);\n\nif ($n1 == 0)\n\t$result = 'Second';\nelse\n\t$result = 'First';\n\n\nfprintf(STDOUT, $result);", "src_uid": "aed24ebab3ed9fd1741eea8e4200f86b"} {"source_code": "", "src_uid": "a593016e4992f695be7c7cd3c920d1ed"} {"source_code": "';\n// echo $black;\n if($white == $black){\n fwrite(STDOUT, 'Draw'); \n } elseif($white > $black){\n fwrite(STDOUT, 'White'); \n } else {\n fwrite(STDOUT, 'Black'); \n }\n \n \n ?>", "src_uid": "44bed0ca7a8fb42fb72c1584d39a4442"} {"source_code": "", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910"} {"source_code": " $rad) {\n echo 'Limak';\n} elseif ($rad > $lim) {\n echo 'Radewoosh';\n} else {\n echo 'Tie';\n}\n\nif (LOCAL_ENV) {\n echo PHP_EOL, $lim, PHP_EOL, $rad;\n}", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a"} {"source_code": "", "src_uid": "fe6301816dea7d9cea1c3a06a7d1ea7e"} {"source_code": "= $f) && ($e <= $g))\n {\n $h = bcsub($g, $f);\n print $h;\n }\n else\n {\n $h = bcsub($g, $f);\n $i = bcadd($h, 1);\n print $i;\n }\n }\n else\n {\n $g = $b;\n if(($e >= $f) && ($e <= $g))\n {\n $h = bcsub($g, $f);\n print $h;\n }\n else\n {\n $h = bcsub($g, $f);\n $i = bcadd($h, 1);\n print $i;\n }\n }\n}\nelseif($c <= $b)\n{\n $f = $c;\n if($d < $a)\n {\n print \"0\";\n }\n elseif($d <= $b)\n {\n $g = $d;\n if(($e >= $f) && ($e <= $g))\n {\n $h = bcsub($g, $f);\n print $h;\n }\n else\n {\n $h = bcsub($g, $f);\n $i = bcadd($h, 1);\n print $i;\n }\n }\n else\n {\n $g = $b;\n if(($e >= $f) && ($e <= $g))\n {\n $h = bcsub($g, $f);\n print $h;\n }\n else\n {\n $h = bcsub($g, $f);\n $i = bcadd($h, 1);\n print $i;\n }\n }\n}\nelse\n{\n print \"0\";\n}\n?>", "src_uid": "9a74b3b0e9f3a351f2136842e9565a82"} {"source_code": "Scan();\n\t$inp_N = $Scanner->Scan();\n\t$nums = str_split($inp_N);\n\n\t$LUCY = true;\n\tfor ($i = 0; $i < $inp_LEN; $i++) {\n\t\tif ($nums[$i] !== '4' && $nums[$i] !== '7') {\n\t\t\t$LUCY = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfor ($i = 0; $i < $inp_LEN; $i++) {\n\t\tif ($i < $inp_LEN / 2) $first_sum += $nums[$i];\n\t\telseif ($i >= $inp_LEN / 2) $second_sum += $nums[$i];\n\t}\n\tif ($first_sum !== $second_sum) $LUCY = false;\n\n\tif ($LUCY) print(\"YES\");\n\telseif (!$LUCY) print(\"NO\");\n\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": "435b6d48f99d90caab828049a2c9e2a7"} {"source_code": "= 22 && $y>=2) {\n $who = !$who;\n if ($who) {\n if ($x>=2) {\n $x-=2;\n $y-=2;\n } elseif ($x) {\n $x-=1;\n $y-=12;\n } else {\n $y-=22;\n }\n } else {\n if ($y>=22) {\n $y-=22;\n } elseif ($y>=12) {\n $y-=12;\n $x-=1;\n } else {\n $x-=2;\n $y-=2;\n }\n }\n}\nif ($who) echo \"Ciel\"; else echo \"Hanako\";\n?>", "src_uid": "8ffee18bbc4bb281027f91193002b7f5"} {"source_code": " $f)\n{\n print \"Misha\";\n}\n?>", "src_uid": "95b19d7569d6b70bd97d46a8541060d0"} {"source_code": "", "src_uid": "ac6971f4feea0662d82da8e0862031ad"} {"source_code": " 19,\r\n 11 => 29,\r\n 12 => 39,\r\n 13 => 49,\r\n 14 => 59,\r\n 15 => 69,\r\n 16 => 79,\r\n 17 => 89,\r\n 18=> 189,\r\n 19=> 289,\r\n 20 => 389,\r\n 21=> 489,\r\n 22=>589,\r\n 23=>689,\r\n 24=>789,\r\n 25=>1789,\r\n 26=>2789,\r\n 27=>3789,\r\n 28=>4789,\r\n 29=>5789,\r\n 30=>6789,\r\n 31=>16789,\r\n 32=>26789,\r\n 33=>36789,\r\n 34=>46789,\r\n 35=>56789,\r\n 36=>156789,\r\n 37=>256789,\r\n 38=>356789,\r\n 39=>456789,\r\n 40=>1456789,\r\n 41=>2456789,\r\n 42=>3456789,\r\n 43=>13456789,\r\n 44=>23456789,\r\n 45=>123456789\r\n ];\r\n $ans = $a[$n];\r\n \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}", "src_uid": "fe126aaa93acaca8c8559bc9e7e27b9f"} {"source_code": " $c)\n {\n $a -= $c;\n $b[count($b)] = $c;\n $c++;\n }\n}\nprint count($b) . \"\\n\";\nprint implode(\" \", $b);\n?>", "src_uid": "356a7bcebbbd354c268cddbb5454d5fc"} {"source_code": "", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db"} {"source_code": "solution($data1, $data2);\n\n// End of interface\n\n\nclass MainClass {\n\t// 978В.File name\n\t//public $problemLink = 'https://codeforces.com/problemset/problem/978/B';\n\t//public $submissionLink = '';\n\n\tpublic function solution($n, $string)\n\t{\n\t\t$res=0;\n\t\t$counter=0;\n\t\tfor ($i=0; $i<$n; $i++){\n\t\t\tif ($string[$i] === 'x'){\n\t\t\t\t$counter++;\n\t\t\t} else {\n\t\t\t\t$counter=0;\n\t\t\t}\n\t\t\tif($counter>2){\n\t\t\t\t$res++;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}\n}\n", "src_uid": "8de14db41d0acee116bd5d8079cb2b02"} {"source_code": "", "src_uid": "3a0c1b6d710fd8f0b6daf420255d76ee"} {"source_code": "= array_sum($second)) {\n echo 'Yes';\n} else {\n echo 'No';\n}", "src_uid": "e0ddac5c6d3671070860dda10d50c28a"} {"source_code": "= $f)\n {\n $g = $a * $d;\n $b -= $g;\n $c -= $f;\n $e++;\n if($b <= 0)\n {\n break;\n }\n }\n elseif($c > 0)\n {\n $g = ($c + 1) * $d;\n $b -= $g;\n $c = 0;\n $e++;\n if($b <= 0)\n {\n break;\n }\n }\n elseif($c == 0)\n {\n $b -= $d;\n $e++;\n if($b <= 0)\n {\n break;\n }\n }\n}\nprint $e;\n?>", "src_uid": "7cff20b1c63a694baca69bdf4bdb2652"} {"source_code": "= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n print $c;\n}\nelseif($a == 2)\n{\n $e = $b;\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n print $c;\n}\nelseif($a == 3)\n{\n $e = $b;\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 2)\n {\n $c++;\n $b -= 2;\n $d = floor($b / 5);\n $c += $d;\n }\n print $c;\n}\nelseif($a == 4)\n{\n $e = $b;\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 2)\n {\n $c++;\n $b -= 2;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 1)\n {\n $c++;\n $b -= 1;\n $d = floor($b / 5);\n $c += $d;\n }\n print $c;\n}\nelseif($a == 5)\n{\n $e = $b;\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 2)\n {\n $c++;\n $b -= 2;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 1)\n {\n $c++;\n $b -= 1;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 5)\n {\n $d = floor($b / 5);\n $c += $d;\n }\n print $c;\n}\nelseif($a > 5)\n{\n $e = $b;\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 2)\n {\n $c++;\n $b -= 2;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 1)\n {\n $c++;\n $b -= 1;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 5)\n {\n $d = floor($b / 5);\n $c += $d;\n }\n $f = floor($a / 5);\n $g = $a % 5;\n $c *= $f;\n if($g == 1)\n {\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n }\n elseif($g == 2)\n {\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n }\n elseif($g == 3)\n {\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 2)\n {\n $c++;\n $b -= 2;\n $d = floor($b / 5);\n $c += $d;\n }\n }\n elseif($g == 4)\n {\n $b = $e;\n if($b >= 4)\n {\n $c++;\n $b -= 4;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 3)\n {\n $c++;\n $b -= 3;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 2)\n {\n $c++;\n $b -= 2;\n $d = floor($b / 5);\n $c += $d;\n }\n $b = $e;\n if($b >= 1)\n {\n $c++;\n $b -= 1;\n $d = floor($b / 5);\n $c += $d;\n }\n }\n print $c;\n}\n?>", "src_uid": "df0879635b59e141c839d9599abd77d2"} {"source_code": "$number) {\n\tif($number == \"+\"){\n\t\tunset($toArr[$key]);\n\n\t}\n}\n$reIndex = array_values($toArr);\nsort($reIndex);\n\necho join(\"+\",$reIndex);\n", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8"} {"source_code": " 1) && ($f[0] == 0)) || ((strlen($g) > 1) && ($g[0] == 0)) || ((strlen($h) > 1) && ($h[0] == 0)) || ($f > 1000000) || ($g > 1000000) || ($h > 1000000))\n {\n continue;\n }\n else\n {\n $c = 1;\n $b = max($b, $f + $g + $h);\n }\n }\n }\n if($c == 0)\n {\n print \"-1\";\n }\n else\n {\n printf(\"%.0f\", $b);\n }\n}\n?>", "src_uid": "bf4e72636bd1998ad3d034ad72e63097"} {"source_code": "", "src_uid": "35a4be326690b58bf9add547fb63a5a5"} {"source_code": " 0 and $a2 > 0) {\n if ($a1 == 1 and $a2 == 1) {\n break;\n } else if ($a1 <= $a2) {\n $a1 += 1;\n $a2 -= 2;\n } else {\n $a2 += 1;\n $a1 -= 2;\n }\n $m += 1;\n}\nprint $m;\n?>", "src_uid": "ba0f9f5f0ad4786b9274c829be587961"} {"source_code": "", "src_uid": "ec5e3b3f5ee6a13eaf01b9a9a66ff037"} {"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 = $a[0];\nfor($x = 1; $x < strlen($a); $x++)\n{\n if($c[$b[0]] <= $c[$a[$x]])\n {\n $d .= $b[0];\n break;\n }\n else\n {\n $d .= $a[$x];\n }\n}\nprint $d;\n?>", "src_uid": "aed892f2bda10b6aee10dcb834a63709"} {"source_code": "", "src_uid": "54cb2e987f2cc06c02c7638ea879a1ab"} {"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$s = $ir->readString();\n$k = $ir->readInt();\n\n$stars = [];\n$bars = [];\n$sss = [];\nfor ($i=0; $i 0) {\n\t$lastStar = array_slice($stars, -1, 1, true);\n\n\tforeach ($bars as $index=>$c) {\n\t\tunset($sss[$index-1]);\n\t\tunset($sss[$index]);\n\t}\n\t\n\tforeach ($stars as $index=>$c) {\n\t\tunset($sss[$index-1]);\n\t\tunset($sss[$index]);\n\t}\n\t\n\tif ($k >= count($sss)) {\n\t\tforeach ($lastStar as $key=>$v) {\n\t\t\t$sss[$key] = str_repeat($v, $k - count($sss));\n\t\t}\n\t\tksort($sss);\n\t} else {\n\t\techo 'Impossible';\n\t\texit();\n\t}\n} else {\n\t$cnt = (strlen($s) - count($bars)) - $k;\n\tif ($cnt<0 || $cnt>count($bars)) {\n\t\techo 'Impossible';\n\t\texit();\n\t}\n\t\n\tforeach ($bars as $index=>$c) {\n\t\tunset($sss[$index]);\n\t\tif ($cnt) {\n\t\t\t$cnt -= 1;\n\t\t\tunset($sss[$index-1]);\n\t\t}\n\t}\n}\n\necho implode('', $sss);\n\n\n\n", "src_uid": "90ad5e6bb5839f9b99a125ccb118a276"} {"source_code": "= 0)\n {\n $c2--;\n $g++;\n if($a2 == 0)\n {\n break;\n }\n }\n else\n {\n $e2 += $c;\n break;\n }\n }\n $b2 = $b;\n for($x = 1; $x <= $b; $x++)\n {\n $e2 -= $d;\n if($e2 >= 0)\n {\n $b2--;\n $g++;\n if($b2 == 0)\n {\n break;\n }\n }\n else\n {\n $e2 += $d;\n break;\n }\n }\n print $g;\n}\nelse\n{\n $b2 = $b;\n $e2 = $e;\n $g = 0;\n for($x = 1; $x <= $b; $x++)\n {\n $e2 -= $d;\n if($e2 >= 0)\n {\n $b2--;\n $g++;\n if($b2 == 0)\n {\n break;\n }\n }\n else\n {\n $e2 += $d;\n break;\n }\n }\n $a2 = $a;\n for($x = 1; $x <= $a; $x++)\n {\n $e2 -= $c;\n if($e2 >= 0)\n {\n $c2--;\n $g++;\n if($a2 == 0)\n {\n break;\n }\n }\n else\n {\n $e2 += $c;\n break;\n }\n }\n print $g;\n}\n?>", "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91"} {"source_code": "= $m){\n $result = $n - $m;\n}else{\n $result = 0;\n while($m != $n){\n if($m % 2 == 1 || $m < $n){\n $m++;\n }else{\n $m = $m/2;\n }\n $result++;\n }\n}\necho $result;", "src_uid": "861f8edd2813d6d3a5ff7193a804486f"} {"source_code": "= $maxb) {\n $res = $r; // нет выгоды\n} else {\n $act = ($r - ($r % $mins)) / $mins;\n $r -= $act*$mins;\n\n $r += $act*$maxb;\n $res = $r;\n}\necho $res;\n\n\n/*–––––––––––––––––––––––––––––––––––––––––––––––––––––––*/\nif ($debag === 1) {\n echo '
' . round(microtime(true) - $t1, 3) . ' sec';\n}\n", "src_uid": "42f25d492bddc12d3d89d39315d63cb9"} {"source_code": " \n ", "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a"} {"source_code": "\n", "src_uid": "3041b1240e59341ad9ec9ac823e57dd7"} {"source_code": " 36)\n{\n print \"-1\";\n}\nelse\n{\n $b = \"\";\n while(TRUE)\n {\n if($a >= 2)\n {\n $b .= \"8\";\n $a -= 2;\n }\n elseif($a == 1)\n {\n $b .= \"9\";\n $a -= 1;\n }\n else\n {\n break;\n }\n }\n print $b;\n}\n?>", "src_uid": "0c9973792c1976c5710f88e3520cda4e"} {"source_code": "", "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a"} {"source_code": " $b) {\n echo $b + 1;\n} elseif ($front == $b) {\n echo $b;\n} else {\n echo $front;\n}\n?>", "src_uid": "51a072916bff600922a77da0c4582180"} {"source_code": " 3) {\n echo -1;\n die;\n}\n\n$numbers = array_map('intval', $numbers);\nsort($numbers);\n\n$numbers = array_values($numbers);\n\n$d = -1;\nswitch (count($numbers)) {\n case 1:\n $d = 0;\n break;\n case 2:\n $diff = $numbers[1] - $numbers[0];\n if ($diff % 2) {\n $d = $diff;\n } else {\n $d = $diff / 2;\n }\n break;\n case 3:\n if (($numbers[2] - $numbers[1]) !== ($numbers[1] - $numbers[0])) {\n $d = -1;\n } else {\n $d = $numbers[2] - $numbers[1];\n }\n break;\n}\n\nif ($d < -1) {\n $d = -1;\n}\n\necho $d;\n\n", "src_uid": "d486a88939c132848a7efdf257b9b066"} {"source_code": "= $f[count($f) - 2])\n{\n print array_sum($f);\n}\nelse\n{\n $f = array_reverse($f);\n for($x = 1; $x < count($f); $x++)\n {\n $h = $f[$x] - $f[$x - 1];\n if($h > $d)\n {\n $f[$x] = $f[$x - 1] + $d;\n }\n else\n {\n break;\n }\n }\n print array_sum($f);\n}\n?>", "src_uid": "9246aa2f506fcbcb47ad24793d09f2cf"} {"source_code": "", "src_uid": "158eae916daa3e0162d4eac0426fa87f"} {"source_code": "=$s1)\n {\n $range=min($v,min($j,$c));\n $left=min($v,min($j,$c))*$s2;\n $right=min(($j-$range),$t)*$s1;\n echo $left+$right;\n }else\n {\n $range=min($j,$t);\n $left=$range*$s1;\n $right=min(($j-$range),min($v,min($j,$c)))*$s2;\n echo $left+$right;\n }\n\n\n\n}\n\n\nsolve();\n?>", "src_uid": "84d9e7e9c9541d997e6573edb421ae0a"} {"source_code": "", "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5"} {"source_code": "$n) ? -1 : $step;\n?>", "src_uid": "0fa526ebc0b4fa3a5866c7c5b3a4656f"} {"source_code": "", "src_uid": "12d451eb1b401a8f426287c4c6909e4b"} {"source_code": " true,\n \"o\" => true,\n \"y\" => true,\n \"e\" => true,\n \"u\" => true,\n \"i\" => true,\n];\n\n$new = '';\n\n$input = readline();\n\nfor ($i = 0, $iMax = strlen($input); $i < $iMax; $i++) {\n $c = strtolower($input[$i]);\n\n if(isset($glas[$c]) ) {\n continue;\n }\n\n $new .= '.' . $c;\n}\n\necho $new;", "src_uid": "db9520e85b3e9186dd3a09ff8d1e8c1b"} {"source_code": " value\n$k;\n$v;\n\nfor ($i = 0; $i < $n; $i++) { \n\tfscanf(STDIN, \"%d%d\", $k, $v);\n\t$colors[$i] = [$k, $v];\n}\n\n\n\n$result = 0;\n\n\n\nfor ($i = 0; $i < $n; $i++) { \n\tfor ($j = 0; $j < $n; $j++) { \n\t\t// проверяем совпадения слева-направо\n\t\tif($colors[$i][0] == $colors[$j][1]){\n\t\t\t$result++;\n\t\t}\n\t}\n\n\t\n\n}\n\n\nfor ($i=0; $i < $n; $i++) { \n\tfor ($j = 0; $j < $n; $j++) { \n\t\t// проверяем совпадения справа-налево\n\t\tif($colors[$i][1] == $colors[$j][0]){\n\t\t\t$result++;\n\t\t}\n\t}\n}\n\n\n\nprint_r($result / 2);", "src_uid": "745f81dcb4f23254bf6602f9f389771b"} {"source_code": "", "src_uid": "075f83248f6d4d012e0ca1547fc67993"} {"source_code": "", "src_uid": "42b25b7335ec01794fbb1d4086aa9dd0"} {"source_code": "", "src_uid": "6c85175d334f811617e7030e0403f706"} {"source_code": " $m && $p > $n2) {\n echo '+';\n} else if ($n1 < $m && $n2 > $p) {\n echo '-';\n} else {\n echo '?';\n}", "src_uid": "66398694a4a142b4a4e709d059aca0fa"} {"source_code": "", "src_uid": "6e5011801ceff9d76e33e0908b695132"} {"source_code": "= $m)\n{\n print $i - $m;\n}\nelse\n{\n print $m - $i;\n}\n?>", "src_uid": "bdf99d78dc291758fa09ec133fff1e9c"} {"source_code": "", "src_uid": "f30329023e84b4c50b1b118dc98ae73c"} {"source_code": " $e[$h[$x]])\n {\n $g = $e[$h[$x]] * $f[$h[$x]];\n array_push($i, $g);\n }\n else\n {\n $g = $a * $f[$h[$x]];\n array_push($i, $g);\n break;\n }\n $a -= $e[$h[$x]];\n}\nprint array_sum($i);\n?>", "src_uid": "c052d85e402691b05e494b5283d62679"} {"source_code": "", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7"} {"source_code": "", "src_uid": "fa163c5b619d3892e33e1fb9c22043a9"} {"source_code": "", "src_uid": "9c5b6d8a20414d160069010b2965b896"} {"source_code": "", "src_uid": "069d0cb9b7c798a81007fb5b63fa0f45"} {"source_code": " $y1)\n $ans1 = $y1;\n $n -= $ans1;\n $ans2 = $n - $x3;\n if($ans2 > $y2)\n $ans2 = $y2;\n $ans3 = $n - $ans2;\n echo $ans1;\n echo \" \";\n echo $ans2;\n echo \" \";\n echo $ans3;\n?>\n", "src_uid": "3cd092b6507079518cf206deab21cf97"} {"source_code": "", "src_uid": "4c999b7854a8a08960b6501a90b3bba3"} {"source_code": " 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0);\nfor($x = 0; $x < count($b); $x++)\n{\n $e[$b[$x]]++;\n $e[$c[$x]]++;\n}\n$f = 0;\nfor($x = 1; $x <= 5; $x++)\n{\n if($e[$x] != 0)\n {\n $g = $e[$x] % 2;\n if($g != 0)\n {\n $f = 1;\n break;\n }\n }\n}\nif($f == 1)\n{\n print \"-1\";\n}\nelse\n{\n $h = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0);\n $i = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0);\n for($x = 0; $x < count($b); $x++)\n {\n $h[$b[$x]]++;\n }\n for($x = 0; $x < count($c); $x++)\n {\n $i[$c[$x]]++;\n }\n $j = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0);\n for($x = 1; $x <= 5; $x++)\n {\n $k += (max($h[$x], $i[$x]) - min($h[$x], $i[$x])) / 2;\n }\n print $k / 2;\n}\n?>", "src_uid": "47da1dd95cd015acb8c7fd6ae5ec22a3"} {"source_code": "0; $i--) {\n if ($map[$i][$j]=='B') {\n $bm = min($bm, 7-$i);\n break;\n }elseif ($map[$i][$j]=='W') {\n break;\n }\n }\n}\nif ($wm>$bm) {\n echo 'B';\n}else{\n echo 'A';\n}", "src_uid": "0ddc839e17dee20e1a954c1289de7fbd"} {"source_code": "= $c[$e])\n {\n $d++;\n $e++;\n }\n elseif($b >= $c[$f])\n {\n $d++;\n $f--;\n }\n else\n {\n break;\n }\n if(($e == $f) && ($b >= $c[$e]))\n {\n $d++;\n break;\n }\n}\nprint $d;\n?>", "src_uid": "ecf0ead308d8a581dd233160a7e38173"} {"source_code": "=27){\n print $m;\n}\nelse print ($m % (1<<$n));\n \n?>", "src_uid": "c649052b549126e600691931b512022f"} {"source_code": "", "src_uid": "969b24ed98d916184821b2b2f8fd3aac"} {"source_code": "= 0; $i -= $k) {\n $array[$i] = 0;\n }\n for ($i = $b; $i <= count($array); $i += $k) {\n $array[$i] = 0;\n }\n return abs(array_sum($array));\n}", "src_uid": "6119258322e06fa6146e592c63313df3"} {"source_code": " log($y) * $x )\n echo '>';\n else if(log($x) * $y < log($y) * $x)\n echo '<';\n else echo '=';\n?>", "src_uid": "ec1e44ff41941f0e6436831b5ae543c6"} {"source_code": "\n\n\n", "src_uid": "ca65e023be092b2ce25599f52acc1a67"} {"source_code": "\n", "src_uid": "a8d992ab26a528f0be327c93fb499c15"} {"source_code": "\n\n", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc"} {"source_code": "\n", "src_uid": "2896aadda9e7a317d33315f91d1ca64d"} {"source_code": "' . round(microtime(true) - $t1, 3) . ' sec';\n}\n", "src_uid": "bb6fb9516b2c55d1ee47a30d423562d7"} {"source_code": "= 12) $n1 -= 12;\n $ans1 = $n1 * 30 + $n2 / 2; \n $ans2 = $n2 * 6;\n echo $ans1.\" \". $ans2;\n?>\n", "src_uid": "175dc0bdb5c9513feb49be6644d0d150"} {"source_code": " $a || $x + $y > $a + $b || $x + $y + $z > $a + $b + $c) {\n return 1;\n } else {\n return 0;\n }\n}\n\nlist($x, $y, $z) = explode(' ', trim(fgets(STDIN)));\nlist($a, $b, $c) = explode(' ', trim(fgets(STDIN)));\n\n$ans = solve($x, $y, $z, $a, $b, $c);\necho ['YES', 'NO'][$ans];\n", "src_uid": "d54201591f7284da5e9ce18984439f4e"} {"source_code": " 0, R => 0, D => 0, U => 0);\n$d = array(\"L\", \"R\", \"D\", \"U\");\n$e = 0;\nfor($x = 0; $x < $a; $x++)\n{\n $c[$b[$x]]++;\n}\n$f = min($c);\n$e += ($f * 4);\nfor($x = 0; $x < 4; $x++)\n{\n $c[$d[$x]] -= $f;\n}\n$g = min($c[L], $c[R]);\n$h = min($c[D], $c[U]);\n$e += ($g * 2);\n$e += ($h * 2);\nprint $e;\n?>", "src_uid": "b9fa2bb8001bd064ede531a5281cfd8a"} {"source_code": " $maxx ? $x2 : $maxx) : $x2;\n\t$miny = isset($miny) ? ($y1 < $miny ? $y1 : $miny) : $y1;\n\t$maxy = isset($maxy) ? ($y2 > $maxy ? $y2 : $maxy) : $y2;\n\t$allpoints = array_merge($allpoints, array(\"$x1 $y1\", \"$x2 $y2\"));\n}\nif ($minx == $maxx || $miny == $maxy) {\n\tdie('NO');\n}\n\nif ($xx != 2 || $yy != 2) {\n\tdie('NO');\n}\n\n$counts = array_count_values($allpoints);\nif (count($counts) != 4) {\n\tdie('NO');\n}\nforeach ($counts as $val) {\n\tif ($val != 2) {\n\t\tdie('NO');\n\t}\n}\n\necho 'YES';\n//fclose($r);\n", "src_uid": "ad105c08f63e9761fe90f69630628027"} {"source_code": " $value)\n {\n if (!empty($value))\n {\n $sum = array_sum($value);\n $max = max($value);\n $min = min($value);\n\n if ($sum <= $r && $sum >= $l && $x <= ($max - $min))\n {\n $count++;\n }\n }\n }\n}\n\necho $count;\n\n/**\n * Get all the sub arrays of a given array\n *\n * @param array $difficulties The given array\n *\n * @return array All the sub arrays\n */\nfunction subArrays($difficulties)\n{\n $len = count($difficulties);\n $list = array();\n\n for ($i = 1; $i < (1 << $len); $i++)\n {\n $subArray = array();\n\n for ($j = 0; $j < $len; $j++)\n {\n if ($i & (1 << $j))\n {\n $subArray[] = (int)$difficulties[$j];\n }\n }\n\n $list[] = $subArray;\n }\n\n return $list;\n}", "src_uid": "0d43104a0de924cdcf8e4aced5aa825d"} {"source_code": "= $i) {$res += (($r - ($r % 3)) / 3) + (($g - ($g % 3)) / 3) + (($b - ($b % 3)) / 3) - $i;}\n\t$max = ($max < $res) ? $res : $max;\n\t$res = $min;\n\t$r -= $i;\n\t$g -= $i;\n\t$b -= $i;\n}\n\necho $max;", "src_uid": "acddc9b0db312b363910a84bd4f14d8e"} {"source_code": "", "src_uid": "04c067326ec897091c3dbcf4d134df96"} {"source_code": "\n", "src_uid": "eb8212aec951f8f69b084446da73eaf7"} {"source_code": "= $b * 2) && ($a >= $c * 2) && ($a >= $d * 2))\n{\n $e++;\n $f = \"A\";\n}\nelseif(($a <= $b / 2) && ($a <= $c / 2) && ($a <= $d / 2))\n{\n $e++;\n $f = \"A\";\n}\nif(($b >= $a * 2) && ($b >= $c * 2) && ($b >= $d * 2))\n{\n $e++;\n $f = \"B\";\n}\nelseif(($b <= $a / 2) && ($b <= $c / 2) && ($b <= $d / 2))\n{\n $e++;\n $f = \"B\";\n}\nif(($c >= $a * 2) && ($c >= $b * 2) && ($c >= $d * 2))\n{\n $e++;\n $f = \"C\";\n}\nelseif(($c <= $a / 2) && ($c <= $b / 2) && ($c <= $d / 2))\n{\n $e++;\n $f = \"C\";\n}\nif(($d >= $a * 2) && ($d >= $b * 2) && ($d >= $c * 2))\n{\n $e++;\n $f = \"D\";\n}\nelseif(($d <= $a / 2) && ($d <= $b / 2) && ($d <= $c / 2))\n{\n $e++;\n $f = \"D\";\n}\nif(($e == 0) || ($e >= 2))\n{\n print \"C\";\n}\nelse\n{\n print $f;\n}\n?>", "src_uid": "30725e340dc07f552f0cce359af226a4"} {"source_code": " $price) {\n $hooks[] = array(\n 'id' => $index+1,\n 'price' => $price\n );\n}\n\nusort($hooks, function($a, $b) {\n return ($a['price'] < $b['price']) ? -1 : 1;\n});\n\n$rubles = 0;\n$min = min($m, $n);\nfor ($i = 0; $i < $min; $i++) {\n $rubles += $hooks[$i]['price'];\n}\n\nif ($m > $n) {\n $rubles -= ($m-$n)*$d;\n}\n\necho $rubles.\"\\n\";\n\n?>", "src_uid": "5c21e2dd658825580522af525142397d"} {"source_code": " 0 && $value <= $k && abs($key - $m + 1)*10 < $min) {\n $min = abs($key - $m + 1)*10;\n }\n}, ARRAY_FILTER_USE_BOTH);\n\necho $min;", "src_uid": "57860e9a5342a29257ce506063d37624"} {"source_code": "", "src_uid": "29c4d5fdf1328bbc943fa16d54d97aa9"} {"source_code": "= 10)\n {\n return;\n }\n $lucky[] = $str + 0;\n LuckyNumber($str . \"4\", $lucky);\n LuckyNumber($str . \"7\", $lucky);\n}\n\n?>", "src_uid": "6a10bfe8b3da9c11167e136b3c6fb2a3"} {"source_code": "= 5)\n {\n $g[count($g)] = $j;\n }\n}\nfor($x = 9; $x >= 0; $x--)\n{\n $h = $x;\n $i = 9;\n $j = array();\n while(TRUE)\n {\n if($i == $x)\n {\n $j[count($j)] = $a[$h][$i];\n break;\n }\n else\n {\n $j[count($j)] = $a[$h][$i];\n $h++;\n $i--;\n }\n }\n if(count($j) >= 5)\n {\n $g[count($g)] = $j;\n }\n}\nfor($x = 0; $x < count($g); $x++)\n{\n $d = $g[$x];\n for($y = 0; $y < 6; $y++)\n {\n $e = 0;\n $f = 0;\n for($z = $y; $z < $y + 5; $z++)\n {\n if($d[$z] == \"X\")\n {\n $e++;\n }\n elseif($d[$z] == \".\")\n {\n $f++;\n }\n }\n if(($e == 4) && ($f == 1))\n {\n $c = 1;\n break;\n }\n }\n if($c == 1)\n {\n break;\n }\n}\n$g = array();\nfor($x = 0; $x < 10; $x++)\n{\n $h = $x;\n $i = 9;\n $j = array();\n while(TRUE)\n {\n if($h == 0)\n {\n $j[count($j)] = $a[$h][$i];\n break;\n }\n else\n {\n $j[count($j)] = $a[$h][$i];\n $h--;\n $i--;\n }\n }\n if(count($j) >= 5)\n {\n $g[count($g)] = $j;\n }\n}\nfor($x = 9; $x >= 0; $x--)\n{\n $h = $x;\n $i = 0;\n $j = array();\n while(TRUE)\n {\n if($h == 9)\n {\n $j[count($j)] = $a[$h][$i];\n break;\n }\n else\n {\n $j[count($j)] = $a[$h][$i];\n $h++;\n $i++;\n }\n }\n if(count($j) >= 5)\n {\n $g[count($g)] = $j;\n }\n}\nfor($x = 0; $x < count($g); $x++)\n{\n $d = $g[$x];\n for($y = 0; $y < 6; $y++)\n {\n $e = 0;\n $f = 0;\n for($z = $y; $z < $y + 5; $z++)\n {\n if($d[$z] == \"X\")\n {\n $e++;\n }\n elseif($d[$z] == \".\")\n {\n $f++;\n }\n }\n if(($e == 4) && ($f == 1))\n {\n $c = 1;\n break;\n }\n }\n if($c == 1)\n {\n break;\n }\n}\nif($c == 1)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "src_uid": "d5541028a2753c758322c440bdbf9ec6"} {"source_code": "1) {\n for($i=2;$i<=$n;++$i) if($n%$i==0) { $n/=$i; break; }\n echo \"$n \";\n}", "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63"} {"source_code": "", "src_uid": "80520be9916045aca3a7de7bc925af1f"} {"source_code": " 0) ? 1 : 0;\n\t\t}\n\t\treturn $div;\n\t}\n\t\n\tmain();\n?>\n", "src_uid": "033068c5e16d25f09039e29c88474275"} {"source_code": " 0)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "src_uid": "ab8a2070ea758d118b3c09ee165d9517"} {"source_code": "", "src_uid": "c30b372a9cc0df4948dca48ef4c5d80d"} {"source_code": " 0)\n\t{\n\t\t$ans += $n & 1;\n\t\t$n /= 2;\n\t}\n\techo $ans;\n?>", "src_uid": "03e4482d53a059134676f431be4c16d2"} {"source_code": " 0){\n\tif(floor($dist)%2 == 0){\n\t\techo 'black';\n\t}else{\n\t\techo 'white';\n\t}\n}else{\n\tif(floor($dist)%2 == 0){\n\t\techo 'white';\n\t}else{\n\t\techo 'black';\n\t}\n}\n?>", "src_uid": "8c92aac1bef5822848a136a1328346c6"} {"source_code": " 1) {\n\t$small_min = bcsub($b, $a);\n} else {\n\t$small_min = 1;\n}\n\n// echo \"{$small_min} {$small_max}\\n\";\n\n$f3 = bcadd(bcsub($small_max, $small_min), 1);\n\nif ($f3 > 0) {\n\techo $f3;\n} else {\n\techo \"0\";\n}\n", "src_uid": "98624ab2fcd2a50a75788a29e04999ad"} {"source_code": "\n", "src_uid": "47c07e46517dbc937e2e779ec0d74eb3"} {"source_code": "= (int)$restrict[$j][0] && $i + 1 <= (int)$restrict[$j][1] && (int)$restrict[$j][2] <= $minn) {\n $profit = (int)$restrict[$j][2] * (int)$restrict[$j][2];\n if ($minn == (int)$restrict[$j][2]) {\n $temp = ($temp < $profit) ? $profit : $temp;\n } else {\n $temp = $profit;\n }\n \n $minn = (int)$restrict[$j][2];\n $isrestrict = true;\n }\n }\n if (!$isrestrict) {\n $max += $hotel[1] * $hotel[1];\n } else {\n $max += $temp;\n }\n}\necho $max; // your code goes here \n", "src_uid": "f22b6dab443f63fb8d2d288b702f20ad"} {"source_code": " $b) {\n $m = $a;\n } else {\n $m = $b;\n }\n $result = 1;\n for($i = 2; $i<=$m; ++$i) {\n while($a%$i == 0 || $b%$i == 0) {\n $result *= $i;\n if($a%$i == 0) {\n $a = floor($a/$i);\n }\n if($b%$i == 0) {\n $b = floor($b/$i);\n }\n }\n }\n //fprintf(STDOUT,\"mincd(%d,%d) = %d\\n\",$sa,$sb,$result);\n return $result;\n}\n\nfscanf(STDIN,\"%d\",$k);\nfscanf(STDIN,\"%d\",$l);\nfscanf(STDIN,\"%d\",$m);\nfscanf(STDIN,\"%d\",$n);\nfscanf(STDIN,\"%d\",$d);\n//fprintf(STDOUT,\"%d %d %d %d %d\",$k,$l,$m,$n,$d);\n\n$count = 0;\n$count += floor($d/$k);\n$count += floor($d/$l);\n$count += floor($d/$m);\n$count += floor($d/$n);\n\n$count -= floor($d/mincd($k,$l));\n$count -= floor($d/mincd($k,$m));\n$count -= floor($d/mincd($k,$n));\n$count -= floor($d/mincd($l,$m));\n$count -= floor($d/mincd($l,$n));\n$count -= floor($d/mincd($m,$n));\n\n$count += floor($d/mincd($k,mincd($l,$m)));\n$count += floor($d/mincd($k,mincd($l,$n)));\n$count += floor($d/mincd($k,mincd($m,$n)));\n$count += floor($d/mincd($l,mincd($m,$n)));\n\n$count -= floor($d/mincd(mincd($k,$l),mincd($m,$n)));\n\nfprintf(STDOUT, $count);\n\n?>", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7"} {"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\t/*public 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\n/* counter for saiki\nclass Counter{\n\t\n\tprivate $counter;\n\t\n\tpublic function __construct($counter){\n\t\t$this->counter = $counter;\n\t}\n\t\n\tpublic function setCount($counter){\n\t\t$this->counter = $counter;\n\t}\n\t\n\tpublic function getCount(){\n\t\treturn $this->counter;\n\t}\n\t\n\tpublic function doCount(){\n\t\t$this->counter++;\n\t}\n}\n*/\n\n//arr for n�~m\n/*class Arr{\n\t\n\tprivate $arr;\n\t\n\tpublic function __construct($m, $n){\n\t\tfor ($i = 0; $i < $m; $i++) {\n\t\t\tfor ($j = 0; $j < $n; $j++) {\n\t\t\t\t//$this->arr[\"$i\"][\"$j\"] = -1;\n\t\t\t\t$this->arr[$i][$j] = -1;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic function getarr(){\n\t\treturn $this->arr;\n\t}\n\t\n\tpublic function setarrel($i, $j, $num){\n\t\t//$this->arr[\"$i\"][\"$j\"] = $num;\n\t\t$this->arr[$i][$j] = $num;\n\t}\n\t\n\tpublic function getarrel($i, $j){\n\t\t//return $this->arr[\"$i\"][\"$j\"];\n\t\treturn $this->arr[$i][$j];\n\t}\n}\n*/\n\n//use + 30ms\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/*\n/*for arr printting\nfunction TDarray_printf(array $array){\n\tforeach ($array as $value) {\n\t\tforeach ($value as $i) { \n\t\t\tif (is_float($i)) {\n\t\t\t\tprintf(\"%f\\n\", $i);\n\t\t\t}\n\t\t\tif (is_int($i)) {\n\t\t\t\tprintf(\"%d\\n\", $i);\n\t\t\t\t//echo $i;\n\t\t\t\t//echo \"$i\";\n\t\t\t\t//$m = \"$i\" echo $m;\n\t\t\t}\n\t\t}\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//use Arr class key [\"$i\"][\"$j\"] + initilize 1780ms\n//use Arr class key [$i][$j] +initilize 720ms\n//do not use(&$arr) 310ms\n/*function calc($W, $B, $Arr){\n\tif ($W === 0) return 0;\n\tif ($B === 0) return 1;\n\tif ($B < 0) return 0;\n\n\t//$el = $Arr->getarrel($W, $B);\n\tif ($Arr->getarrel($W, $B) !== -1) {\n\t\treturn $Arr->getarrel($W, $B);\n\t}\n\n\t$x = 0;\n\tif ($B > 1) {\n\t\t$x = (($B - 2.0) * calc($W, $B - 3.0, $Arr) / ($W + $B - 2.0))\n\t\t\t\t\t+ ($W * calc($W - 1.0, $B - 2.0, $Arr) / ($W + $B - 2.0));\n\t}\t\n\t\t$p = ($W * 1.0 / ($W + $B));\n\t\t$el = $p + (1.0 - $p) * $x * (($B - 1.0) / ($W + $B - 1.0));\n\t\t$Arr->setarrel($W, $B ,$el);\n\t\treturn $el;\n}\n*/\n\nfunction calc($W, $B, &$arr){\n\tif ($W === 0) return 0;\n\tif ($B === 0) return 1;\n\tif ($B < 0) return 0;\n\t//$el = $Arr->getarrel($W, $B);\n\t//if ($arr[$W][$B] !== false) {\n\tif ($arr[$W][$B] !== null) {\n\t\treturn $arr[$W][$B];\n\t}\n\n\t$x = 0;\n\tif ($B > 1) {\n\t\t$x = (($B - 2.0) * calc($W, $B - 3.0, $arr) / ($W + $B - 2.0))\n\t\t\t\t\t+ ($W * calc($W - 1.0, $B - 2.0, $arr) / ($W + $B - 2.0));\n\t}\t\n\t\t$p = ($W * 1.0 / ($W + $B));\n\t\t$el = $p + (1.0 - $p) * $x * (($B - 1.0) / ($W + $B - 1.0));\n\t\t$arr[$W][$B] = $el;\n\t\treturn $el;\n}\n\nfunction solve(){\n\t$Token = new Token(rtrim(fgets(STDIN), \"\\n\"), \" \");\n\t$W_first = $Token->nextInt();\n\t$B_first = $Token->nextInt();\n\t//$Arr = new Arr($W_first + 1, $B_first + 1);\n //$posibility = calc($W_first, $B_first, $Arr);\n\n\t$array = array();\n\t$posibility = calc($W_first, $B_first, $array);\n\t\n\tnum_printf($posibility);\n\t//printf(\"%.10f\", $posibility);\n\n}\n\nfunction run(){\n\tsolve();\n}\n\nob_end_clean();\nrun();\n?>", "src_uid": "7adb8bf6879925955bf187c3d05fde8c"} {"source_code": "= 0; $x--)\n{\n if($b[$x] == $e)\n {\n $d++;\n $e--;\n }\n else\n {\n $d--;\n $e2 = 1;\n break;\n }\n}\nif($e2 == 0)\n{\n $d--;\n}\n$f = 0;\n$g = 0;\nfor($x = 0; $x < $a - 1; $x++)\n{\n if($b[$x + 1] - $b[$x] == 1)\n {\n $g++;\n }\n elseif($g > 0)\n {\n $f = max($f, $g - 1);\n $g = 0;\n }\n}\nif($g > 0)\n{\n $f = max($f, $g - 1);\n}\nprint max($c, $d, $f);\n?>", "src_uid": "858b5e75e21c4cba6d08f3f66be0c198"} {"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$board = array();\n\nfor ($i = 0; $i < 8; $i++) {\n $board[] = g();\n}\n\n$xCnt = 0;\n$yCnt = 0;\nfor ($i = 0; $i < 8; $i++) {\n $xLine = 1;\n $yLine = 1;\n\n for ($j = 0; $j < 8; $j++) {\n if(substr($board[$i], $j, 1) == 'W') {\n $xLine = 0;\n }\n if(substr($board[$j], $i, 1) == 'W') {\n $yLine = 0;\n }\n }\n\n $xCnt += $xLine;\n $yCnt += $yLine;\n}\n\nif($xCnt < 8) {\n echo $xCnt + $yCnt;\n} else {\n echo 8;\n}\n\n?>", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0"} {"source_code": " 0, B => 0, Y => 0, G => 0);\n$c = 0;\n$d = 0;\nfor($x = 0; $x < count($a); $x++)\n{\n if($a[$x] != \"!\")\n {\n $d++; \n }\n else\n {\n $c = max($c, $d);\n $d = 0;\n }\n}\n$c = max($c, $d);\nif($c == count($a))\n{\n print implode(\" \", $b);\n}\nelseif($c == 1)\n{\n $d2 = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] == \"!\")\n {\n $d2++;\n }\n }\n $e = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $e++;\n if(($e == 1) && ($x > 1))\n {\n break;\n }\n }\n else\n {\n $e = 0;\n }\n }\n $f = array(R => 0, B => 0, Y => 0, G => 0);\n $f[$a[$x]]++;\n asort($f);\n $g = array_keys($f);\n $h = $g[0];\n $i = $g[1];\n $j = $g[2];\n for($w = 1; $w <= 1; $w++)\n {\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $h;\n $a2[$x - 2] = $i;\n $b2[$h]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $h;\n $a2[$x + 2] = $i;\n $b2[$h]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $h;\n $a2[$x - 2] = $j;\n $b2[$h]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $h;\n $a2[$x + 2] = $j;\n $b2[$h]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $i;\n $a2[$x - 2] = $h;\n $b2[$i]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $i;\n $a2[$x + 2] = $h;\n $b2[$i]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $i;\n $a2[$x - 2] = $j;\n $b2[$i]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $i;\n $a2[$x + 2] = $j;\n $b2[$i]++;\n $b2[$j]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $j;\n $a2[$x - 2] = $h;\n $b2[$j]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $j;\n $a2[$x + 2] = $h;\n $b2[$j]++;\n $b2[$h]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x - 1] == \"!\") && ($a2[$x - 2] == \"!\"))\n {\n $a2[$x - 1] = $j;\n $a2[$x - 2] = $i;\n $b2[$j]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n $a2 = $a;\n $b2 = $b;\n if(($a2[$x + 1] == \"!\") && ($a2[$x + 2] == \"!\"))\n {\n $a2[$x + 1] = $j;\n $a2[$x + 2] = $i;\n $b2[$j]++;\n $b2[$i]++;\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n if(array_sum($b2) == $d2)\n {\n print implode(\" \", $b2);\n break;\n }\n }\n }\n}\nelseif($c == 2)\n{\n $d2 = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] == \"!\")\n {\n $d2++;\n }\n }\n $e = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $e++;\n if($e == 2)\n {\n break;\n }\n }\n else\n {\n $e = 0;\n }\n }\n $f = array(R => 0, B => 0, Y => 0, G => 0);\n $f[$a[$x]]++;\n $f[$a[$x - 1]]++;\n asort($f);\n $g = array_keys($f);\n $h = $g[0];\n $i = $g[1];\n $a2 = $a;\n $b2 = $b;\n if($a[$x - 2] == \"!\")\n {\n $a[$x - 2] = $h;\n $b[$h]++;\n }\n if($a[$x + 1] == \"!\")\n {\n $a[$x + 1] = $i;\n $b[$i]++;\n }\n if($a2[$x - 2] == \"!\")\n {\n $a2[$x - 2] = $i;\n $b2[$i]++;\n }\n if($a2[$x + 1] == \"!\")\n {\n $a2[$x + 1] = $h;\n $b2[$h]++;\n }\n $d = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $d++;\n if($c == $d)\n {\n break;\n }\n }\n else\n {\n $d = 0;\n }\n }\n for($y = $x; $y >= 0; $y--)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n for($y = $x; $y < count($a); $y++)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a[$z]]++;\n }\n if(($e[R] > 1) || ($e[B] > 1) || ($e[Y] > 1) || ($e[G] > 1))\n {\n break;\n }\n elseif($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n if(array_sum($b) == $d2)\n {\n print implode(\" \", $b);\n }\n else\n {\n for($y = $x; $y >= 0; $y--)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a2[$z]]++;\n }\n if($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n for($y = $x; $y < count($a2); $y++)\n {\n if($a2[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a2[$z]]++;\n }\n if($e[R] == 0)\n {\n $a2[$y] = \"R\";\n $b2[R]++;\n }\n elseif($e[B] == 0)\n {\n $a2[$y] = \"B\";\n $b2[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a2[$y] = \"Y\";\n $b2[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a2[$y] = \"G\";\n $b2[G]++;\n }\n }\n }\n print implode(\" \", $b2);\n }\n}\nelseif($c >= 3)\n{\n $d = 0;\n for($x = 0; $x < count($a); $x++)\n {\n if($a[$x] != \"!\")\n {\n $d++;\n if($c == $d)\n {\n break;\n }\n }\n else\n {\n $d = 0;\n }\n }\n for($y = $x; $y >= 0; $y--)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y + 1; $z <= $y + 3; $z++)\n {\n $e[$a[$z]]++;\n }\n if($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n for($y = $x; $y < count($a); $y++)\n {\n if($a[$y] == \"!\")\n {\n $e = array(R => 0, B => 0, Y => 0, G => 0);\n for($z = $y - 1; $z >= $y - 3; $z--)\n {\n $e[$a[$z]]++;\n }\n if($e[R] == 0)\n {\n $a[$y] = \"R\";\n $b[R]++;\n }\n elseif($e[B] == 0)\n {\n $a[$y] = \"B\";\n $b[B]++;\n }\n elseif($e[Y] == 0)\n {\n $a[$y] = \"Y\";\n $b[Y]++;\n }\n elseif($e[G] == 0)\n {\n $a[$y] = \"G\";\n $b[G]++;\n }\n }\n }\n print implode(\" \", $b);\n}\n?>", "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33"} {"source_code": "($n/2)-1; $i--){\n\t\t\t$rev .= $s[$i].$s[$n-$i-1];\n\t\t}\n\t\techo strrev($rev);\n\t}else{\n\t\tfor($i = 0; $i<($n/2); $i++){\n\t\t\t$rev .= $s[$i].$s[$n-$i-1];\n\t\t}\n\t\techo substr(strrev($rev), 1);\n\t}", "src_uid": "992ae43e66f1808f19c86b1def1f6b41"} {"source_code": "\n", "src_uid": "d561436e2ddc9074b98ebbe49b9e27b8"} {"source_code": " 1)\n{ \n $rx = $rx/$nod;\n $ry = $ry/$nod;\n $nod = nod($rx, $ry);\n}\n\n\n\nwhile(true)\n{ \n if($x + $rx > $arr[0])\n break;\n if($y + $ry > $arr[1])\n break;\n $x += $rx;\n $y += $ry;\n}\n$out = $x.' '.$y;\n\nfunction nod($x,$y)\n{\n while($x!=0 && $y!=0)\n {\n if($x>=$y) $x=$x%$y;\n else $y=$y%$x;\n }\n return $x+$y;\n}\n\n\n$stdout=fopen('php://stdout','w');\nfwrite($stdout,$out);\nfclose($stdout);\n\n?>", "src_uid": "97999cd7c6de79a4e39f56a41ff59e7a"} {"source_code": "", "src_uid": "382475475427f0e76c6b4ac6e7a02e21"} {"source_code": "=$new[7])\n echo \"4\";\n else echo \"7\"; \n} else echo \"-1\";\n?>", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a"} {"source_code": "^' || $t == '>^", "src_uid": "4ebed264d40a449602a26ceef2e849d1"} {"source_code": "", "src_uid": "072c7d29a1b338609a72ab6b73988282"} {"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 $arr = read_array();\n $n=$arr[0];\n $m=$arr[1];\n \n $count = $n*$m; \n $ans = floor($count/2);\n echo $ans;\n?>", "src_uid": "e840e7bfe83764bee6186fcf92a1b5cd"} {"source_code": "", "src_uid": "488e809bd0c55531b0b47f577996627e"} {"source_code": "0){echo'Impossible';return;}\nif($b!=0)$d=$a+$b-1;else$d=$a;echo max($a,$b).' '.$d;", "src_uid": "1e865eda33afe09302bda9077d613763"} {"source_code": "", "src_uid": "0515ac888937a4dda30cad5e2383164f"} {"source_code": "", "src_uid": "8152daefb04dfa3e1a53f0a501544c35"} {"source_code": "", "src_uid": "556684d96d78264ad07c0cdd3b784bc9"} {"source_code": "= $t + $p && ($w -$t) % $p == 0) || \n($w >= $t + $p + 1 && ($w -$t -1) % $p == 0)) \necho 'YES';\nelse echo 'NO';", "src_uid": "3baf9d841ff7208c66f6de1b47b0f952"} {"source_code": "=0;$i--){\n\tif($first%$arr[$i]!=0||$arr[$i]==$arr[$i+1]){\n\t\t$second = $arr[$i];\n\t\tbreak;\n\t}\n}\n\necho $first.\" \".$second.\"\\n\";", "src_uid": "868407df0a93085057d06367aecaf9be"} {"source_code": "", "src_uid": "cad8283914da16bc41680857bd20fe9f"} {"source_code": " $d[$x])\n {\n $f++;\n }\n}\nif(($e == $a) || ($f == $a))\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "src_uid": "e4419bca9d605dbd63f7884377e28769"} {"source_code": "", "src_uid": "b5d44e0041053c996938aadd1b3865f6"} {"source_code": "= 1 && !$ready; --$c) {\n for ($y = 0; $y < 6 && !$ready; ++$y) {\n for ($x = 0; $x < 8 && !$ready; ++$x) {\n if ($array[$y][$x] == '.' && $comf[$y][$x] == $c) {\n $array[$y][$x] = 'P';\n $ready = true;\n break;\n }\n }\n }\n}\n\nfor ($i = 0; $i < 6; ++$i) {\n\tprintf(\"%s\\n\", $array[$i]);\n}\n?>", "src_uid": "35503a2aeb18c8c1b3eda9de2c6ce33e"} {"source_code": " $d - $e) {\n echo -1;\n exit;\n}\n\n\nksort($exs);\n\n$schedule = [];\n\nfor ($i = 1; $i <= $d; $i++) {\n\n if (isset($req[$i])) {\n\n if ($req[$i] != 0) {\n echo -1;\n exit;\n }\n\n $schedule[] = $e + 1;\n } else {\n\n $needBrake = true;\n\n foreach ($exs as $ex => $p) {\n\n if ($req[$ex] != 0 && $open[$ex] <= $i) {\n\n $needBrake = false;\n\n $req[$ex]--;\n $schedule[] = $p + 1;\n break;\n }\n }\n\n if ($needBrake) {\n $schedule[] = 0;\n }\n }\n}\n\necho implode(' ', $schedule);\n", "src_uid": "02d8d403eb60ae77756ff96f71b662d3"} {"source_code": " 1)\n\t{\n\t\t$needArrow = true;\n\t\tfor ($j = 1; $j <= $shift; $j++)\n\t\t{\n\t\t\t$leftPage = $currentPage - $j;\n\t\t\t$result = \"$leftPage \" . $result;\n\t\t\tif ($leftPage === 1)\n\t\t\t{\n\t\t\t\t$needArrow = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($needArrow)\n\t\t{\n\t\t\t$result = '<< ' . $result;\n\t\t}\n\t}\n\n\t# making right\n\tif ($currentPage < $totalPages)\n\t{\n\t\t$needArrow = true;\n\t\tfor ($j = 1; $j <= $shift; $j++)\n\t\t{\n\t\t\t$nextPage = $currentPage + $j;\n\t\t\t$result .= \" $nextPage\";\n\t\t\tif ($nextPage === $totalPages)\n\t\t\t{\n\t\t\t\t$needArrow = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ($needArrow)\n\t\t{\n\t\t\t$result .= ' >>';\n\t\t}\n\t}\n\treturn $result;\n}\n\n\nfwrite(STDOUT, getResult(fgets(STDIN)));", "src_uid": "526e2cce272e42a3220e33149b1c9c84"} {"source_code": " 0) {\n $x = array_shift($cost);\n $B -= $x;\n if ($B >= 0) {\n $ans++;\n } else {\n break;\n }\n}\necho $ans;", "src_uid": "b3f8e769ee7719ea5c9f458428b16a4e"} {"source_code": "= 0) {\n $id = $mid;\n $r = $mid - 1;\n } else {\n $l = $mid + 1;\n }\n}\n$max = $n - $id;\necho $min . ' ' .$max;", "src_uid": "daf0dd781bf403f7c1bb668925caa64d"} {"source_code": "=$n-$i+1) {\n break;\n }\n\n $mess+=2*($rem-1)-1;\n $rem=$rem-2;\n \n}\n\necho $mess;", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0"} {"source_code": "8){\n\t\t$sum+=8;\n\t\t$arr[$i+1]+=($arr[$i] - 8);\n\t}\n\telse{\n\t\t$sum+=$arr[$i];\n\t}\n\t//print $sum . ' ';\n\tif($sum>=$val[1]){\n\t\t$hold = $i+1;\n\t\tbreak;\n\t}\n\n}\nprint $hold;\n?>", "src_uid": "24695b6a2aa573e90f0fe661b0c0bd3a"} {"source_code": "", "src_uid": "ff6b3fd358c758324c19a26283ab96a4"} {"source_code": "", "src_uid": "60dbfc7a65702ae8bd4a587db1e06398"} {"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$f = array();\n$g = -1;\nfor($x = 0; $x < count($d); $x++)\n{\n if($e[$d[$x]] - $g > 1)\n {\n $f[count($f)] = $d[$x];\n $g = $e[$d[$x]];\n }\n}\nif(count($f) < $b)\n{\n print \"-1\";\n}\nelse\n{\n $h = 0;\n for($x = 0; $x < $b; $x++)\n {\n $h += $e[$f[$x]];\n }\n print $h;\n}\n?>", "src_uid": "56b13d313afef9dc6c6ba2758b5ea313"} {"source_code": " $b[$x + 1]) && ($c == 0))\n {\n $c = 2;\n }\n }\n elseif($c == 1)\n {\n if(($b[$x] < $b[$x + 1]) && ($c == 1))\n {\n $d = 1;\n break;\n }\n elseif(($b[$x] == $b[$x + 1]) && ($c == 1))\n {\n $c = 1;\n }\n elseif(($b[$x] > $b[$x + 1]) && ($c == 1))\n {\n $c = 2;\n }\n }\n elseif($c == 2)\n {\n if(($b[$x] < $b[$x + 1]) && ($c == 2))\n {\n $d = 1;\n break;\n }\n elseif(($b[$x] == $b[$x + 1]) && ($c == 2))\n {\n $d = 1;\n break;\n }\n elseif(($b[$x] > $b[$x + 1]) && ($c == 2))\n {\n $c = 2;\n }\n }\n}\nif($d == 0)\n{\n print \"YES\";\n}\nelse\n{\n print \"NO\";\n}\n?>", "src_uid": "5482ed8ad02ac32d28c3888299bf3658"} {"source_code": "= max(1, $a - 1 - 100000); $x--)\n{\n $c = str_split($x);\n $d = array_sum($c);\n $e = $x + $d;\n if($a == $e)\n {\n $b[count($b)] = $x;\n }\n}\nif(count($b) == 0)\n{\n print \"0\";\n}\nelse\n{\n sort($b);\n print count($b) . \"\\n\";\n for($x = 0; $x < count($b); $x++)\n {\n print $b[$x] . \"\\n\";\n }\n}\n?>", "src_uid": "ae20ae2a16273a0d379932d6e973f878"} {"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, $m) = readStringExplodeNum($f, ' ', true);\n\t$replace = array(\n\t\t'W' => '',\n\t\t'G' => '',\n\t\t'B' => '',\n\t\t' ' => '',\n\t);\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$s = trim(readString($f));\n\t\t$s = strtr($s, $replace);\n\t\tif (!empty($s)) {\n\t\t\techo '#Color';\n\t\t\treturn;\n\t\t}\n\t}\n\techo '#Black&White';\n\t/* / end body */\n}\n\nif (empty($is_test))\n\tgetAnswer();\t", "src_uid": "19c311c02380f9a73cd477e4fde27454"} {"source_code": " ", "src_uid": "20c2d9da12d6b88f300977d74287a15d"} {"source_code": "= 0 ; $j--) { \n $pos -= $i;\n if ($pos < $n) {\n $out = $a[$j];\n break;\n }\n}\n\necho $out;\n\n?>", "src_uid": "023b169765e81d896cdc1184e5a82b22"} {"source_code": "", "src_uid": "be6d4df20e9a48d183dd8f34531df246"} {"source_code": " $d)\n{\n $e = ($a - 1) - $d;\n print max($c, $e);\n}\n?>", "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4"} {"source_code": "$c[1]){if($c[0]>$c[2]){echo \"chest\";}}\nif($c[1]>$c[0]){if($c[1]>$c[2]){echo \"biceps\";}}\nif($c[2]>$c[0]){if($c[2]>$c[1]){echo \"back\";}}\n?>", "src_uid": "579021de624c072f5e0393aae762117e"} {"source_code": "", "src_uid": "db0eb44d8cd8f293da407ba3adee10cf"} {"source_code": "", "src_uid": "6994331ca6282669cbb7138eb7e55e01"} {"source_code": "$max) {$max=$c;} \n //echo $i.'-'.$j.'='.$c.\"\\n\";\n }\n\n}\necho $max;\n?>", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99"} {"source_code": "=1&&$m<=100000) {\n if($a>=0){\n if($b<=1000){\n if($r[0]<=$m&&$r[0]>=0){ */ \n for($t=0;;$t++){\n if($res==1)break;\n if($r[$t]>$m||$r[$t]<0){break;}\n (int)$r[$t+1]=($r[$t]*$a+$b)%$m; \n \n if($t==1000000){\n for($tx=1;$tx<$t;$tx++){\n // echo $r[$t-$tx].' == '.$r[$t].'-----|||';\n if($r[$t-$tx]==$r[$t]){echo ($tx);$res=1;break;}\n if($res==1)break;\n } \n }elseif($t>1000000){echo 1;$res=1;}\n else{\n if($r[$t+1]==$r[$t]){echo 1;$res=1;break;}\n }\n }\n /* }\n }\n }\n}*/\n?>", "src_uid": "9137197ee1b781cd5cc77c46f50b9012"} {"source_code": " 0 && $y > 0) {\n $answer = array(0, $x + $y, $x + $y, 0);\n}\nelseif ($x > 0 && $y < 0) {\n $answer = array(0, -$x + $y, $x - $y, 0);\n}\nelseif ($x < 0 && $y > 0) {\n $answer = array($x - $y, 0, 0, -$x + $y);\n}\nelseif ($x < 0 && $y < 0) {\n $answer = array($x + $y, 0, 0, $x + $y);\n}\n\nprint implode(' ', $answer);\n\nfunction line() {\n return trim(fgets(STDIN));\n}\n", "src_uid": "e2f15a9d9593eec2e19be3140a847712"} {"source_code": "", "src_uid": "a081d400a5ce22899b91df38ba98eecc"} {"source_code": "", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f"} {"source_code": "", "src_uid": "6e006ae3df3bcd24755358a5f584ec03"} {"source_code": "", "src_uid": "9a955ce0775018ff4e5825700c13ed36"} {"source_code": "\n $b) list($a,$b) = array($b,$a);\n\techo floor(($a + min($b,$a*2))/3);\n?>", "src_uid": "0718c6afe52cd232a5e942052527f31b"} {"source_code": " 6) $b = 'YES';\n}\nprint($b);\n?>", "src_uid": "ed9a763362abc6ed40356731f1036b38"} {"source_code": "", "src_uid": "dc891d57bcdad3108dcb4ccf9c798789"} {"source_code": " $h)\n{\n print \">\";\n}\n?>", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67"} {"source_code": "", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27"} {"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);\nfor($x = 0; $x < $a; $x++)\n{\n $d[$c[$x]]++;\n}\nrsort($d);\nif($d[0] > $b)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>", "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be"} {"source_code": "", "src_uid": "ee0aaa7acf127e9f3a9edafc58f4e2d6"} {"source_code": "x = $x;\n\t\t$this->y = $y;\n\t}\n\tstatic function read() {\n\t\t$x = readInt();\n\t\t$y = readInt();\n\t\treturn new Point($x, $y);\n\t}\n\tfunction eps($d) {\n\t\tfor ($dx = -$d; $dx <= $d; $dx++)\n\t\t\tfor ($dy = -$d; $dy <= $d; $dy++)\n\t\t\t\tif (abs($dx) + abs($dy) <= $d)\n\t\t\t\t\tyield new Point($this->x + $dx, $this->y + $dy);\n\t}\n}\n\nfunction pr($a, $b, $c) {\n\treturn ($a->x - $b->x) * ($c->x - $b->x) + ($a->y - $b->y) * ($c->y - $b->y) == 0;\n}\nfunction area($a, $b, $c) {\n\treturn ($a->x - $b->x) * ($c->y - $b->y) - ($a->y - $b->y) * ($c->x - $b->x);\n}\nfunction isRight($a, $b, $c) {\n\treturn (pr($a, $b, $c) || pr($b, $c, $a) || pr($c, $a, $b)) && area($a, $b, $c) != 0;\n}\nfunction d($a, $b) {\n\treturn abs($a->x - $b->x) + abs($a->y - $b->y);\n}\n\nfunction check($maxDiff) {\n\tglobal $a;\n\tforeach($a[0]->eps($maxDiff) as $p0)\n\t\tforeach($a[1]->eps($maxDiff) as $p1)\n\t\t\tforeach($a[2]->eps($maxDiff) as $p2)\n\t\t\t\tif (isRight($p0, $p1, $p2) && d($p0, $a[0]) + d($p1, $a[1]) + d($p2, $a[2]) <= $maxDiff)\n\t\t\t\t\treturn true;\n\treturn false;\n}\n\n$a = array_map(function() { return Point::read(); }, range(0, 2));\nif (check(0))\n\tprintf(\"RIGHT\\n\");\nelse if (check(1))\n\tprintf(\"ALMOST\\n\");\nelse\n\tprintf(\"NEITHER\\n\");\n?>\n", "src_uid": "8324fa542297c21bda1a4aed0bd45a2d"} {"source_code": " 100){\n $sCheck = false;\n} else {\n for ($i = 1; $i <= $x; $i++) {\n for ($j = 1; $j <= $x; $j++) {\n if (($i * $j > $x) && ($i % $j == 0) && ($j % $i == 0) && (($i / $j) < $x)) {\n $iA = $i;\n $iB = $j;\n $sCheck = true;\n break;\n }\n }\n if($sCheck) break;\n }\n}\n\nif($sCheck){\n echo $iA . ' ' . $iB;\n} else {\n echo -1;\n}\n\n", "src_uid": "883f67177474d23d7a320d9dbfa70dd3"} {"source_code": "", "src_uid": "3d931684ca11fe6141c6461e85d91d63"} {"source_code": "$item){\n if($key == count($way)-1){\n echo $item;\n break;\n }\n echo $item.' ';\n }\n return;\n }\n if($ch % 10 == 1){\n array_push($way, $ch);\n return back(substr($ch, 0, -1));\n }else if($ch % 2 == 0){\n array_push($way, $ch);\n return back($ch/2);\n }else{\n echo \"NO\";\n return;\n }\n}\nback($line1[1]);", "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3"} {"source_code": "", "src_uid": "8909ac99ed4ab2ee4d681ec864c7831e"} {"source_code": "= $i)\n{ \n $m = $m - $i;\n if ($i == $n)\n {\n $i = 0;\n }\n $i++;\n $k = $m;\n}\necho $k\n?>", "src_uid": "5dd5ee90606d37cae5926eb8b8d250bb"} {"source_code": "", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd"} {"source_code": "= 0) {\n if ($d1 == $h || $d2 == $h) {\n if ($d1 == $h) {\n $res = $res - $u1 + $h;\n }\n if ($d2 == $h) {\n $res = $res - $u2 + $h;\n }\n if ($res < 0) {\n $res = 0;\n }\n } else {\n $res += $h;\n }\n $h--;\n}\necho $res;\n", "src_uid": "084a12eb3a708b43b880734f3ee51374"} {"source_code": " strtolower($s2) )\n echo '1';\n else\n echo '0';\n \n?>", "src_uid": "ffeae332696a901813677bd1033cf01e"} {"source_code": " $e) && ($a[1] == $b[1]))\n {\n $d--;\n print \"L\\n\";\n }\n if(($d == $e) && ($a[1] < $b[1]))\n {\n $a[1] = $a[1] + 1;\n print \"U\\n\";\n }\n if(($d == $e) && ($a[1] > $b[1]))\n {\n $a[1] = $a[1] - 1;\n print \"D\\n\";\n }\n if(($d < $e) && ($a[1] < $b[1]))\n {\n $d++;\n $a[1] = $a[1] + 1;\n print \"RU\\n\";\n }\n if(($d < $e) && ($a[1] > $b[1]))\n {\n $d++;\n $a[1] = $a[1] - 1;\n print \"RD\\n\";\n }\n if(($d > $e) && ($a[1] > $b[1]))\n {\n $d--;\n $a[1] = $a[1] - 1;\n print \"LD\\n\";\n }\n if(($d > $e) && ($a[1] < $b[1]))\n {\n $d--;\n $a[1] = $a[1] + 1;\n print \"LU\\n\";\n }\n}\n?>", "src_uid": "d25d454702b7755297a7a8e1f6f36ab9"} {"source_code": "", "src_uid": "e4b3a2707ba080b93a152f4e6e983973"} {"source_code": " 2 * $k) $good = false;\n}\nif ($good) printf (\"YES\\n\");\nelse printf (\"NO\\n\");\n?>", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16"} {"source_code": "", "src_uid": "4b0a8798a6d53351226d4f06e3356b1e"} {"source_code": " 1){\n if($x[0] > 1){\n if($x[1] == 9){\n $last9StreakPosition = findLast9StreakPosition($x);\n $xMax .= $x[0];\n $xMax .= str_repeat('9', $last9StreakPosition);\n\n $xMaxLen = strlen($xMax);\n if($xLen > $xMaxLen){\n $xMax[$last9StreakPosition] = $xMax[$last9StreakPosition] - 1;\n $xMax .= str_repeat('9', $xLen - $xMaxLen);\n }\n }else{\n $xMax = $x[0] - 1;\n $xMax .= str_repeat('9', $xLen - 1);\n }\n\n $xMaxSum = array_sum(str_split($xMax));\n $xSum = array_sum(str_split($x));\n\n if($xMaxSum > $xSum){\n $xResult = $xMax;\n }\n }else{\n if($x[1] > 0){\n if($x[1] < 8){\n $xMax = $x[0] - 1;\n $xMax .= str_repeat('9', $xLen - 1);\n $xMax = (string)intval($xMax);\n }\n else{\n if($x[1] == 9){\n $last9StreakPosition = findLast9StreakPosition($x);\n $xMax .= $x[0];\n $xMax .= str_repeat('9', $last9StreakPosition);\n\n $xMaxLen = strlen($xMax);\n if($xLen > $xMaxLen){\n $xMax[$last9StreakPosition] = $xMax[$last9StreakPosition] - 1;\n $xMax .= str_repeat('9', $xLen - $xMaxLen);\n }\n }else{\n $xMax = $x[0] - 1;\n $xMax .= str_repeat('9', $xLen - 1);\n $xMax = (string)intval($xMax);\n }\n }\n\n $xMaxSum = array_sum(str_split($xMax));\n $xSum = array_sum(str_split($x));\n\n if($xMaxSum > $xSum){\n $xResult = $xMax;\n }\n }else{\n $xMax .= str_repeat('9', $xLen - 1);\n\n $xMaxSum = array_sum(str_split($xMax));\n $xSum = array_sum(str_split($x));\n\n if($xMaxSum > $xSum){\n $xResult = $xMax;\n }\n }\n }\n}\n\necho $xResult.PHP_EOL;\n", "src_uid": "e55b0debbf33c266091e6634494356b8"} {"source_code": "= $f)\n {\n break;\n }\n}\nprint $x / $b;\n?>", "src_uid": "7dd098ec3ad5b29ad681787173eba341"} {"source_code": "= $e)\n {\n print $h;\n break;\n }\n else\n {\n $h++;\n $i = $f / $b;\n $i += $d;\n $j = $a * $i;\n $f += $j;\n }\n}\n?>", "src_uid": "c9c03666278acec35f0e273691fe0fff"} {"source_code": "", "src_uid": "bda4b15827c94b526643dfefc4bc36e7"} {"source_code": "", "src_uid": "6e7ee0da980beb99ca49a5ddd04089a5"} {"source_code": "", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92"} {"source_code": "\n\n 100000) {\n continue;\n }\n $a[0][0] = $x;\n\n $y = $sum - $a[0][1] - $a[2][1];\n if ($y < 0 || $y > 100000) {\n continue;\n }\n $a[1][1] = $y;\n\n $z = $sum - $a[0][2] - $a[1][2];\n if ($z < 0 || $z > 100000) {\n continue;\n }\n $a[2][2] = $z;\n\n if (isMagic($a, $sum)) {\n break;\n }\n}\n\nfor ($i = 0; $i < 3; $i ++) {\n for ($j = 0; $j < 3; $j ++) {\n printf(\"%d \", $a[$i][$j]);\n }\n printf(\"\\n\");\n}\n\nfunction isMagic($a, $sum) {\n for ($i = 0; $i < 3; $i ++) {\n $h[$i] = 0;\n $v[$i] = 0;\n }\n $d[0] = 0;\n $d[1] = 0;\n\n for ($i = 0; $i < 3; $i ++) {\n for ($j = 0; $j < 3; $j ++) {\n $h[$i] += $a[$i][$j];\n $v[$j] += $a[$i][$j];\n }\n $d[0] += $a[$i][$i];\n $d[1] += $a[$i][2 - $i];\n }\n\n if ($sum != $d[0] || $sum != $d[1]) {\n return false;\n }\n for ($i = 0; $i < 3; $i ++) {\n if ($h[$i] != $sum || $v[$i] != $sum) {\n return false;\n }\n }\n\n return true;\n}\n\n\n?>\n", "src_uid": "0c42eafb73d1e30f168958a06a0f9bca"} {"source_code": "\n\n\n", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee"} {"source_code": " 0){\n $r += $c;\n $c--;\n }\n echo $r.\"\\n\";\n }\n \n \n \n \n \n \n \n?>\n", "src_uid": "289a55128be89bb86a002d218d31b57f"} {"source_code": "", "src_uid": "193ec1226ffe07522caf63e84a7d007f"} {"source_code": "", "src_uid": "a1583b07a9d093e887f73cc5c29e444a"} {"source_code": " 31, 2 => 28, 3 => 31, 4 => 30, 5 => 31, 6 => 30, 7 => 31, 8 => 31, 9 => 30, 10 => 31, 11 => 30, 12 => 31);\n$m_2 = array(1 => 31, 2 => 29, 3 => 31, 4 => 30, 5 => 31, 6 => 30, 7 => 31, 8 => 31, 9 => 30, 10 => 31, 11 => 30, 12 => 31);\n$n = 0;\nif($c % 4 == 1)\n{\n if($g[1] <= 12)\n {\n if($g[0] <= $m[intval($g[1])])\n {\n if(($g[0] == 29) && ($g[1] == 2) && ($g[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($g[0] == 29) && ($g[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $g[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $g[0];\n $p = $g[1];\n $r = $g[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($h[1] <= 12)\n {\n if($h[0] <= $m[intval($h[1])])\n {\n if(($h[0] == 29) && ($h[1] == 2) && ($h[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($h[0] == 29) && ($h[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $h[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $h[0];\n $p = $h[1];\n $r = $h[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($i[1] <= 12)\n {\n if($i[0] <= $m[intval($i[1])])\n {\n if(($i[0] == 29) && ($i[1] == 2) && ($i[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($i[0] == 29) && ($i[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $i[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $i[0];\n $p = $i[1];\n $r = $i[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($j[1] <= 12)\n {\n if($j[0] <= $m[intval($j[1])])\n {\n if(($j[0] == 29) && ($j[1] == 2) && ($j[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($j[0] == 29) && ($j[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $g[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $j[0];\n $p = $j[1];\n $r = $j[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($k[1] <= 12)\n {\n if($k[0] <= $m[intval($k[1])])\n {\n if(($k[0] == 29) && ($k[1] == 2) && ($k[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($k[0] == 29) && ($k[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $k[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $k[0];\n $p = $k[1];\n $r = $k[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($l[1] <= 12)\n {\n if($l[0] <= $m[intval($l[1])])\n {\n if(($l[0] == 29) && ($l[1] == 2) && ($l[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($l[0] == 29) && ($l[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $l[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $l[0];\n $p = $l[1];\n $r = $l[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($n == 1)\n {\n print \"YES\";\n }\n else\n {\n print \"NO\";\n }\n}\nelse\n{\n if($g[1] <= 12)\n {\n if($g[0] <= $m_2[intval($g[1])])\n {\n if(($g[0] == 29) && ($g[1] == 2) && ($g[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($g[0] == 29) && ($g[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $g[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $g[0];\n $p = $g[1];\n $r = $g[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($h[1] <= 12)\n {\n if($h[0] <= $m_2[intval($h[1])])\n {\n if(($h[0] == 29) && ($h[1] == 2) && ($h[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($h[0] == 29) && ($h[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $h[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $h[0];\n $p = $h[1];\n $r = $h[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($i[1] <= 12)\n {\n if($i[0] <= $m_2[intval($i[1])])\n {\n if(($i[0] == 29) && ($i[1] == 2) && ($i[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($i[0] == 29) && ($i[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $i[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $i[0];\n $p = $i[1];\n $r = $i[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($j[1] <= 12)\n {\n if($j[0] <= $m_2[intval($j[1])])\n {\n if(($j[0] == 29) && ($j[1] == 2) && ($j[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($j[0] == 29) && ($j[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $g[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $j[0];\n $p = $j[1];\n $r = $j[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($k[1] <= 12)\n {\n if($k[0] <= $m_2[intval($k[1])])\n {\n if(($k[0] == 29) && ($k[1] == 2) && ($k[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($k[0] == 29) && ($k[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $k[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $k[0];\n $p = $k[1];\n $r = $k[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($l[1] <= 12)\n {\n if($l[0] <= $m_2[intval($l[1])])\n {\n if(($l[0] == 29) && ($l[1] == 2) && ($l[2] % 4 != 0))\n {\n $n = 0;\n }\n elseif(($l[0] == 29) && ($l[1] == 2))\n {\n $o = 1;\n $p = 3;\n $r = $l[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n else\n {\n $o = $l[0];\n $p = $l[1];\n $r = $l[2] + 18;\n if($c > $r)\n {\n $n = 1;\n }\n elseif($c == $r)\n {\n if($b > $p)\n {\n $n = 1;\n }\n elseif($b == $p)\n {\n if($a >= $o)\n {\n $n = 1;\n }\n }\n }\n }\n }\n }\n if($n == 1)\n {\n print \"YES\";\n }\n else\n {\n print \"NO\";\n }\n}\n?>", "src_uid": "5418c98fe362909f7b28f95225837d33"} {"source_code": " 0)\n {\n if($b > 1)\n {\n if($c > 3)\n {\n $a -= 1;\n $b -= 2;\n $c -= 4;\n $d += 7;\n }\n else\n {\n break;\n }\n }\n else\n {\n break;\n }\n }\n else\n {\n break;\n }\n}\nprint $d;\n?>", "src_uid": "82a4a60eac90765fb62f2a77d2305c01"} {"source_code": "", "src_uid": "f5a907d6d35390b1fb11c8ce247d0252"} {"source_code": "", "src_uid": "32b59d23f71800bc29da74a3fe2e2b37"} {"source_code": " $a))\n {\n print $x;\n break;\n }\n $c++;\n }\n}\n?>", "src_uid": "18644c9df41b9960594fdca27f1d2fec"} {"source_code": "= max($b, $d)) || ($f <= min($b, $d))))\n{\n print \"2\";\n}\nelseif(($c == $e) && (($b >= max($d, $f)) || ($b <= min($d, $f))))\n{\n print \"2\";\n}\nelseif(($a == $e) && (($d >= max($b, $f)) || ($d <= min($b, $f))))\n{\n print \"2\";\n}\nelseif(($b == $d) && (($e >= max($a, $c)) || ($e <= min($a, $c))))\n{\n print \"2\";\n}\nelseif(($d == $f) && (($a >= max($c, $e)) || ($a <= min($c, $e))))\n{\n print \"2\";\n}\nelseif(($b == $f) && (($c >= max($a, $e)) || ($c <= min($a, $e))))\n{\n print \"2\";\n}\nelse\n{\n print \"3\";\n}\n?>", "src_uid": "36fe960550e59b046202b5811343590d"} {"source_code": "0, 'ya'=>0));\n$xa = array_fill(0,$n,0);\n$ya = array_fill(0,$n,0);\n\nfor($i=0;$i<$n;++$i)\n{\n\tfscanf($fl, \"%d%d\", $x, $y);\n $b[$i] = array ('xa'=>$x, 'ya'=>$y);\n $xa[$i] = $x;\n $ya[$i] = $y;\n}\n\narray_multisort($xa, SORT_DESC, $ya, SORT_ASC, $b);\n\n$c = array_fill(0,$m, array('xa'=>0, 'ya'=>0));\n$xa = array_fill(0,$m,0);\n$ya = array_fill(0,$m,0);\n\nfor($i=0;$i<$m;++$i)\n{\n\tfscanf($fl, \"%d%d\", $x, $y);\n $c[$i] = array ('xa'=>$x, 'ya'=>$y);\n $xa[$i] = $x;\n $ya[$i] = $y;\n}\narray_multisort($xa, SORT_DESC, $ya, SORT_ASC, $c);\n\n\n\n$prefx = array_fill(0,$m, '0');\n$prefy = array_fill(0,$m, '0');\n$i = 0;\n$curx = '0';\n$cury = '0';\nforeach ($c as $key => $row) {\n $prefx[$i] = bcadd($curx, strval($row['xa']));\n $prefy[$i] = bcadd($cury, strval($row['ya']));\n $curx = $prefx[$i];\n $cury = $prefy[$i];\n $i = $i + 1;\n}\n\n\n$curx = '0';\n$cury = '0';\n$ans = '0';\n\n$l = $m - 1;\nforeach ($b as $key => $row) {\n $cury = bcadd($cury, strval($row['ya']));\n $curx = bcadd($curx, strval($row['xa']));\n //printf (\"%s\\n\", strval($row['xa']));\n while ($l >= 0 && bccomp(bcadd($prefy[$l], $cury), $d) == 1) {\n $l = $l - 1;\n }\n /*$r = $m; $l = -1;\n while ($r - $l > 1) {\n $t = floor(($r + $l) / 2);\n if (bccomp(bcadd($prefy[$t], $cury), $d) != 1) $l = $t;\n else $r = $t;\n }*/\n if ($l > -1) {\n $res = bcadd($prefx[$l], $curx);\n if (bccomp ($res, $ans) == 1){\n $ans = $res;\n }\n }\n}\nprintf (\"%s\\n\", $ans);\n\n/*for($i=0;$i<$n;++$i) {\n printf (\"%d %d\\n\", $b[i]['xa'], $b[i]['ya']);\n}*/\n//printf(\"%d\\n\", $n);", "src_uid": "da573a39459087ed7c42f70bc1d0e8ff"} {"source_code": "", "src_uid": "dc3817c71b1fa5606f316e5e94732296"} {"source_code": "", "src_uid": "4b51b99d1dea367bf37dc5ead08ca48f"} {"source_code": " $m || $n > $k) {\n echo 'No';\n} else {\n echo 'Yes';\n}", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4"} {"source_code": " 0,1 => 0,2 => 0,3 => 0,4 => 0,5 => 0,6 => 0,7 => 0,8 => 0,9 => 0);\n$b = array(\"6\", \"2\", \"5\", \"5\", \"4\", \"5\", \"6\", \"3\", \"7\", \"6\");\nlist($c, $d) = explode(\" \", trim(fgets(STDIN)));\nif(($c == 1) && ($d == 1000000))\n{\n print \"28733372\";\n}\nelseif(($c == 2) && ($d == 1000000))\n{\n print \"28733370\";\n}\nelseif(($c == 1) && ($d == 999999))\n{\n print \"28733334\";\n}\nelse\n{\n for($x = $c; $x <= $d; $x++)\n {\n $e = str_split($x);\n for($y = 0; $y < count($e); $y++)\n {\n $a[$e[$y]]++;\n }\n }\n $f = 0;\n for($x = 0; $x <= 9; $x++)\n {\n $g = $a[$x] * $b[$x];\n $f += $g;\n }\n print $f;\n}\n?>", "src_uid": "1193de6f80a9feee8522a404d16425b9"} {"source_code": " $a)\n {\n $d--;\n print $d;\n break;\n }\n elseif($e < $a)\n {\n $c++;\n $b += $c;\n $e += $b;\n $d++;\n }\n}\n?>", "src_uid": "873a12edffc57a127fdfb1c65d43bdb0"} {"source_code": " 0); $i++)\n\t{\n\t\tif(ctype_lower($in_s[$i]))\n\t\t{\n\t\t\t$in_s[$i] = 'X';\n\t\t\t$o--;\n\t\t}\n\t}\n\t\n\techo implode($in_s);\n\treturn;\n}\n\n$o = $s - $c;\n\necho $o . PHP_EOL;\nfor($i = 0; $i < sizeof($in_s) && $o > 0; $i++)\n{\n\tif(ctype_upper($in_s[$i]))\n\t{\n\t\t$in_s[$i] = 'x';\n\t\t$o--;\n\t}\n}\n\necho implode($in_s);", "src_uid": "fa6311c72d90d8363d97854b903f849d"} {"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);\nfor($x = $a - 1; $x >= 0; $x--)\n{\n $d[$c[$x]] = $x + 1;\n}\nfor($x = 0; $x < $a; $x++)\n{\n $e[$c[$x]] = $x + 1;\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\");\nfor($x = 0; $x < 26; $x++)\n{\n if($d[$f[$x]] == 0)\n {\n unset($d[$f[$x]]);\n }\n if($e[$f[$x]] == 0)\n {\n unset($e[$f[$x]]);\n }\n}\nasort($d);\n$g = array_keys($d);\n$h = array();\nfor($x = 0; $x < count($d); $x++)\n{\n $h[$x] = $e[$g[$x]];\n}\nsort($d);\n$i = array();\nfor($x = 0; $x < count($d); $x++)\n{\n $j = 1;\n for($y = 0; $y < count($h); $y++)\n {\n if($x != $y)\n {\n if(($d[$x] > $d[$y]) && ($d[$x] < $h[$y]))\n {\n $j++;\n }\n }\n }\n $i[count($i)] = $j;\n $j = 1;\n for($y = 0; $y < count($h); $y++)\n {\n if($x != $y)\n {\n if(($h[$x] > $d[$y]) && ($h[$x] < $h[$y]))\n {\n $j++;\n }\n }\n }\n $i[count($i)] = $j;\n}\n$k = max($i);\nif($k <= $b)\n{\n print \"NO\";\n}\nelse\n{\n print \"YES\";\n}\n?>", "src_uid": "216323563f5b2dd63edc30cb9b4849a5"} {"source_code": " $int ? $int+=1 : null;\n\n\necho $int;\n", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74"}