//https://www.nowcoder.com/practice/afe7c043f0644f60af98a0fba61af8e7?tab=answerKey #include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; while (cin >> n) { if(n==0) continue; vector<int&g...