<?php
$pupils = 30;
$rhyme = 5;
$presentPupils = range(1, $pupils);
for ($i = 1; count($presentPupils) >= $rhyme; ) { foreach ($presentPupils as $key => $value) {
if ($i == $rhyme) {
unset($presentPupils[$key]); $i = 1;
continue;
}
$i++;
}
}
$winners = implode(', ', $presentPupils); echo "Выигрышные места: $winners.";
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2ludGVybmFsX2VuY29kaW5nKCdVVEYtOCcpOwoKJHB1cGlscyA9IDMwOwokcmh5bWUgPSA1OwokcHJlc2VudFB1cGlscyA9IHJhbmdlKDEsICRwdXBpbHMpOwoKZm9yICgkaSA9IDE7IGNvdW50KCRwcmVzZW50UHVwaWxzKSA+PSAkcmh5bWU7ICkgewogICAgZm9yZWFjaCAoJHByZXNlbnRQdXBpbHMgYXMgJGtleSA9PiAkdmFsdWUpIHsKICAgICAgICBpZiAoJGkgPT0gJHJoeW1lKSB7CiAgICAgICAgICAgIHVuc2V0KCRwcmVzZW50UHVwaWxzWyRrZXldKTsKICAgICAgICAgICAgJGkgPSAxOwogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICB9CiAgICAgICAgJGkrKzsKICAgIH0KfQokd2lubmVycyA9IGltcGxvZGUoJywgJywgJHByZXNlbnRQdXBpbHMpOwplY2hvICLQktGL0LjQs9GA0YvRiNC90YvQtSDQvNC10YHRgtCwOiAkd2lubmVycy4iOw==