intdet() { int res = 1; for (int i = 1; i <= n; i++) for (int j = i + 1; j <= n; j++) { while (A[i][i]) { int t = A[j][i] / A[i][i]; for (int k = i; k <= n; k++) (A[j][k] -= (LL)t * A[i][k] % mod) %= mod; swap(A[i], A[j]); res *= -1; } swap(A[i], A[j]); res *= -1; } for (int i = 1; i <= n; i++) res = (LL)res * A[i][i] % mod; return res; }