// 2008–Í‹[’n‹æ—\‘I B : Headstrong Student #include #include using namespace std; int main(){ int x, y; static int pos[1000000]; while(cin >> x >> y, x){ memset(pos, -1, sizeof(pos)); pos[x] = 0; x *= 10; for(int i=1; ;i++){ x %= y; if(x==0){ cout << i << " " << 0 << endl; break; } if(pos[x]!=-1){ cout << pos[x] << " " << i-pos[x] << endl; break; } pos[x] = i; x *= 10; } } }