#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define PB push_back #define SIZE(x) (int)x.size() #define clr(x,y) memset(x,y,sizeof(x)) #define MP(x,y) make_pair(x,y) #define ALL(t) (t).begin(),(t).end() #define FOR(i,n,m) for (int i = n; i <= m; i ++) #define ROF(i,n,m) for (int i = n; i >= m; i --) #define RI(x) scanf ("%d", &(x)) #define RII(x,y) RI(x),RI(y) #define RIII(x,y,z) RI(x),RI(y),RI(z) typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; const ll mod = 1e9+7; const ll LINF = 1e18; const int INF = 1e9; const double EPS = 1e-8; /**************************************END************************************/ void ext_gcd(ll a,ll b,ll &d,ll &x,ll &y) { if(!b) { x=1; y=0; d=a; return ; } else { ext_gcd(b,a%b,d,y,x); y-=a/b*x; } } vector a, b; ll solve()///x=b[i](mod a[i]) { ll ta=a[0],tb=b[0]; bool flag=true; for(int i=1; i> T; while (T --){ a.clear (); b.clear (); int n; cin >> n; vector vis(n); int now = -1; vector vec(n+1); FOR (i, 1, n){ int t; cin >> t; vec[t] = i; } ROF (i, n, 1){ int cnt = 0; int t = vec[n-i+1]; t --; while (now != t){ now ++; if (now >= n){ now = 0; } if (!vis[now]){ cnt ++; } } vis[t] = true; a.PB (i); b.PB (cnt-1); } // FOR (i, 0, n-1){ // cout << a[i] << " "; // } // cout << endl; // FOR (i, 0, n-1){ // cout << b[i] << " "; // } // cout << endl; ll ans = solve () + 1; if (ans == 0){ puts ("Creation August is a SB!"); }else{ cout << ans << endl; } } }