#include "cstdio" #include "algorithm" using namespace std; long long n,tab[1000005],k; int main() { scanf ("%lld", &n); for (int i=0; i