題目:ios
連接:https://ac.nowcoder.com/acm/contest/283/D
來源:牛客網
ide
#include<stdio.h> #include<iostream> #include<algorithm> #include<map> #include<math.h> typedef long long LL; using namespace std; int dfs(LL n,LL m,int a) { if(n<m) { LL temp; temp=n,n=m,m=temp; } if(n%m==0) { return a; } if(n/m>=2) return a; else { return dfs(n-(n/m)*m,m,-a); } } int main() { LL n,m; int t; cin>>t; while(t--) { cin>>n>>m; int l=dfs(n,m,1); if(l==1) printf("wula\n"); else printf("mmp\n"); } }