#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ srand((unsigned)time(NULL)); int n; cin >> n; vector a(n); for(int i=0; i> a[i]; a[i]--; } int k=0; vector s(n); vector used(n, false); for(int i=0; i