Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of hasan

hasan

hasan has asked 16 questions and find answers to 62 problems.

Stats

2.5k
EtPoint
929
Vote count
16
questions
62
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