题目中的输出格式是完全错误的,事实上两组数据之间要隔开一行。
这样是对的:
cout << ans << '\n'; if (testcase < T) cout << '\n';
这样似乎是错的:
cout << ans; if (testcase < T) cout << "\n\n";
这样似乎也是错的:
cout << ans << "\n\n";