#include #define int long long using namespace std; signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); const int n=8; vectora(n); for(int i=0;i>a[i]; int lim=1; for(int j=0;j<7;j++)lim*=n; for(int d=0;dtime; int now=d; for(int i=0;i