private static void Main() { int remainingTestCases = FastIO.ReadNonNegativeInt(); while (remainingTestCases-- > 0) { int studentCount = FastIO.ReadNonNegativeInt(); bool[,] studentPreferences = new bool[studentCount, studentCount]; for (int s = 0; s < studentCount; ++s) { for (int t = 0; t < studentCount; ++t) { studentPreferences[s, t] = FastIO.ReadNonNegativeInt() == 1; } } FastIO.WriteNonNegativeLong( ASSIGN.Solve(studentCount, studentPreferences)); FastIO.WriteLine(); } FastIO.Flush(); }