#include<iostream> using namespace std; long root(long x,long y,int k){ int result=1; while(y!=0){ if(y%2==1){ result *= x; result %= k; &...