#include #define mod 998244353 #define N 253 using namespace std; int power(int x,int y){ int res=1; while(y){ if(y&1) res=1ll*res*x%mod; x=1ll*x*x%mod; y=y/2; } return res; } int n,ra[N],rb[N],A,B,ans; int f[N][N][N],tmp[N],g[N][N],h[N][N]; int main(){ scanf("%d",&n); for(int i=1,u,v,l;i0){ for(int x=0;x<=B;x++) tmp[x]=(tmp[x]+1ll*(mod-wd)*f[i-1][j][x])%mod; } if(j>0){ for(int x=0;x<=B;x++) tmp[x]=(tmp[x]+1ll*(mod-wl)*f[i][j-1][x])%mod; } if(j=0;i--){ for(int j=i+1;j