bishalbiswas

1110

Apr 12th, 2014
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5. int n,m,y,x,count=0;
  6. long long int power;
  7. scanf("%d %d %d",&n,&m,&y);
  8. for(x=0;x<m;x++)
  9. {
  10. power=pow(x,n);
  11. if(power%m==y)
  12. {
  13. printf("%d ",x);
  14. count++;
  15. }
  16.  
  17. }
  18. if(count==0)
  19. printf("-1");
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment