Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of hasan

hasan

hasan has asked 14 questions and find answers to 61 problems.

Stats

2.4k
EtPoint
925
Vote count
14
questions
61
answers

About

// http://www.spoj.com/problems/ANARC08H/
int n,k,d,i;
while (cin>>n>>k && n != 0) {
    for (d=1,i=1; i<=n; d = (d + k) % i++);
    cout << n << " " << k << " " << d+1 << endl;
}

Virgin Mobile UAE

hasanal_bukhari [AT] hotmail [DOT] com

http://poj.org/userstatus?user_id=hasan83