#include <stdio.h>
int main() {
int a=0;
int b=0;
int p1=22, p2=17;
int k1 = 4,k2 = 19;
int n1 = 26;
int running = 1;
k1 = k1 % n1;
k2 = k2 % n1;
while( running ){
int w1 = (p1*a + b)%n1;
int w2 = (p2*a + b)%n1;
if( w1 == k1 && w2 == k2 ){
printf( "a = %i, b = %i\n",a
,b
); puts( "continue? (y/n) "); if( anw == 'n' || anw == 'N' ) {
// running = 0;
break;
}
}
if( b!=0 && (b%n1)==0 ){
++a;
b = 0;
}
else
++b;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiAKaW50IG1haW4oKSB7CiAgaW50IGE9MDsKICBpbnQgYj0wOwogIGludCBwMT0yMiwgcDI9MTc7CiAgaW50IGsxID0gNCxrMiA9IDE5OwogIGludCBuMSA9IDI2OwogIGludCBydW5uaW5nID0gMTsKIAogIGsxID0gazEgJSBuMTsKICBrMiA9IGsyICUgbjE7CiAKICB3aGlsZSggcnVubmluZyApewogICAgaW50IHcxID0gKHAxKmEgKyBiKSVuMTsKICAgIGludCB3MiA9IChwMiphICsgYiklbjE7CiAKICAgIGlmKCB3MSA9PSBrMSAmJiB3MiA9PSBrMiApewogICAgICBwcmludGYoICJhID0gJWksIGIgPSAlaVxuIixhLGIgKTsKICAgICAgcHV0cyggImNvbnRpbnVlPyAoeS9uKSAiKTsKICAgICAgY2hhciBhbncgPSBnZXRjaGFyKCk7CiAgICAgIGlmKCBhbncgPT0gJ24nIHx8IGFudyA9PSAnTicgKSB7Ci8vICAgICAgICBydW5uaW5nID0gMDsKICAgICAgICBicmVhazsKICAgICAgfQogICAgfQogICAgaWYoIGIhPTAgJiYgKGIlbjEpPT0wICl7CiAgICAgICsrYTsKICAgICAgYiA9IDA7CiAgICB9CiAgICBlbHNlCiAgICAgICsrYjsKICAgIAogCiAgfSAgCiAgICAgICAgcmV0dXJuIDA7Cn0=