刷水题。
看似高精而非高精乃是此题最大亮点。
边读边取模技能get~
1 #include<cstdio> 2 #define ll long long 3 #define mod 19260817 4 5 ll read() 6 { 7 ll ret=0;char c=getchar(); 8 while(c<'0'||c>'9')c=getchar(); 9 while(c>='0'&&c<='9')ret=(10*ret+c-'0')%mod,c=getchar(); 10 return ret; 11 } 12 13 ll ksm(ll b,int p) 14 { 15 ll ret=1; 16 while(p) 17 { 18 if(p&1)ret=(ret*b)%mod; 19 b=(b*b)%mod; 20 p>>=1; 21 } 22 return ret; 23 } 24 25 int main() 26 { 27 ll a=read(),b=read(); 28 ll inv=ksm(b,mod-2); 29 if(!inv)printf("Angry!"); 30 else printf("%lld",a*inv%mod); 31 return 0; 32 }