MAGIC - Magic Program

Here is a magic program (in C++).

#include <cstdio>
int main(){
    unsigned seed=A;
    for(int i=0;i<10000;i++)
        printf("%u\n",seed=(seed*B+i)%C);
    return 0;
}

A,B,C are three magic numbers in range [1,65536).

Now you are given the output of the program. You should submit a program to print the output.


Added by:Bin Jin
Date:2008-02-17
Time limit:1s
Source limit:200B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: CPP
Resource:own problem

hide comments
2013-03-16 13:38:07 Jay H. Bosamiya
i don't really understand the question... Do we find A,B,C and replace in the given program and then submit?
2011-07-17 03:58:57 robot
interesting, brute forth though ;-)
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.