#include #include #include using namespace atcoder; using mint = modint; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000001 int dp[205]; int visited[205]; int get(int n){ if(n==0)return 1; if(visited[n])return dp[n]; visited[n] = 1; int ans = 0; int cur = 1; while(true){ if(n-cur<0)break; if(get(n-cur)==0){ ans = 1; break; } cur *= 3; } dp[n] = ans; return ans; } int main(){ /* for(int i=0;i<=50;i++){ cout<>n; if(n%2==1)cout<<"NO"<