REP ( i, N) {
newt[ i] [ 0 ] = newt[ i] [ i] = 1 ;
}
RE ( i, N - 1 ) {
FOR ( j, 1 , i - 1 ) {
newt[ i] [ j] = ( newt[ i - 1 ] [ j] + newt[ i - 1 ] [ j - 1 ] ) % P;
}
}
make2( int , n, k) ;
int ans = 0 ;
dp[ 1 ] [ 1 ] [ 1 ] = 1 ;
pref[ 1 ] [ 1 ] [ 1 ] = 1 ;
RE ( check, n) {
int c = check % 2 ;
FOR ( all, 1 , n) {
if ( check == 1 && all == 1 ) { continue ; }
RE ( ord, all) {
dp[ all] [ ord] [ c] = ( pref[ all - 1 ] [ ord - 1 ] [ c] + pref[ all - 1 ] [ all - 1 ] [ c ^ 1 ] - pref[ all - 1 ] [ ord - 1 ] [ c ^ 1 ] + P) % P;
debug4( all, ord, check, dp[ all] [ ord] [ c] ) ;
pref[ all] [ ord] [ c] = ( pref[ all] [ ord - 1 ] [ c] + dp[ all] [ ord] [ c] ) ;
}
}
RE ( o1, k) {
RE ( o2, n - k + 1 ) {
ans + = dp[ k] [ o1] [ c] * dp[ n - k + 1 ] [ o2] [ c] % P * newt[ o1 + o2 - 2 ] [ o1 - 1 ] % P * newt[ n + 1 - o1 - o2] [ k - o1] % P;
ans % = P;
}
}
debug2( check, ans) ;
}
cout << ans<< "\n " ;
UkVQIChpLCBOKSB7CiAgICBuZXd0W2ldWzBdID0gbmV3dFtpXVtpXSA9IDE7CiAgfQogIFJFIChpLCBOIC0gMSkgewogICAgRk9SIChqLCAxLCBpIC0gMSkgewogICAgICBuZXd0W2ldW2pdID0gKG5ld3RbaSAtIDFdW2pdICsgbmV3dFtpIC0gMV1baiAtIDFdKSAlIFA7CiAgICB9CiAgfQogIG1ha2UyKGludCwgbiwgayk7CiAgaW50IGFucyA9IDA7CiAgZHBbMV1bMV1bMV0gPSAxOwogIHByZWZbMV1bMV1bMV0gPSAxOwogIFJFIChjaGVjaywgbikgewogICAgaW50IGMgPSBjaGVjayAlIDI7CiAgICBGT1IgKGFsbCwgMSwgbikgewogICAgICBpZiAoY2hlY2sgPT0gMSAmJiBhbGwgPT0gMSkgeyBjb250aW51ZTsgfQogICAgICBSRSAob3JkLCBhbGwpIHsKICAgICAgICBkcFthbGxdW29yZF1bY10gPSAocHJlZlthbGwgLSAxXVtvcmQgLSAxXVtjXSArIHByZWZbYWxsIC0gMV1bYWxsIC0gMV1bYyBeIDFdIC0gcHJlZlthbGwgLSAxXVtvcmQgLSAxXVtjIF4gMV0gKyBQKSAlIFA7CiAgICAgICAgZGVidWc0KGFsbCwgb3JkLCBjaGVjaywgZHBbYWxsXVtvcmRdW2NdKTsKICAgICAgICBwcmVmW2FsbF1bb3JkXVtjXSA9IChwcmVmW2FsbF1bb3JkIC0gMV1bY10gKyBkcFthbGxdW29yZF1bY10pOwogICAgICB9CiAgICB9CiAgICBSRSAobzEsIGspIHsKICAgICAgUkUgKG8yLCBuIC0gayArIDEpIHsKICAgICAgICBhbnMgKz0gZHBba11bbzFdW2NdICogZHBbbiAtIGsgKyAxXVtvMl1bY10gJSBQICogbmV3dFtvMSArIG8yIC0gMl1bbzEgLSAxXSAlIFAgKiBuZXd0W24gKyAxIC0gbzEgLSBvMl1bayAtIG8xXSAlIFA7CiAgICAgICAgYW5zICU9IFA7CiAgICAgIH0KICAgIH0KICAgIGRlYnVnMihjaGVjaywgYW5zKTsKICB9CiAgY291dDw8YW5zPDwiXG4iOw==
compilation info
prog.cpp:1:5: error: expected constructor, destructor, or type conversion before '(' token
REP (i, N) {
^
prog.cpp:4:6: error: expected constructor, destructor, or type conversion before '(' token
RE (i, N - 1) {
^
stdout