#include #include using namespace std; using ll=long long; int main(){ ll n; cin >> n; ll a[n]; for(ll i=0;i> a[i]; for(ll i=1;ia[i-p]&&i-p