提交时间:2024-01-25 08:03:14

运行 ID: 127142

#include <bits/stdc++.h> using namespace std; const int N =1e5+10; const int INF =0x3f3f3f3f; int n; int main () { while(cin>>n && n!=0) { long long c=pow(2,n-1); if(n!=1)cout<<c%n+1<<endl; else cout<<0<<'\n'; } return 0; }