| 3 | using namespace std; |
| 4 | |
| 5 | void Josh(vector<int> person, int k, int index) |
| 6 | { |
| 7 | if (person.size() == 1) { |
| 8 | cout << person[0] << endl; |
| 9 | return; |
| 10 | } |
| 11 | index = ((index + k) % person.size()); |
| 12 | person.erase(person.begin() + index); |
| 13 | Josh(person, k, index); |
| 14 | } |
| 15 | |
| 16 | int main() |
| 17 | { |