#include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #define eps 1e-10 #define LL unsigned long long using namespace std; const int INF=0x3f3f3f3f; const int N=100000+100; const int mod=998244353; int a[N],b[N]; struct node{ int k,p; }val[N]; ll dp[1010][20]; ll minn[N]; bool cmp(node a,node b) { return a.k-a.p