#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair P; const ll MOD=1e9+7; ll dp[2][303][303][303]; int main() { int n, k; cin>>n>>k; for(int i=1; i<=min(k, n-1); i++){ dp[0][0][i][i+1]=1; } dp[1][0][k][k+1]=1; for(int i=0; i=k+2){ for(int i=0; i<=k; i++){ for(int j=i+1; j<=k+1; j++){ ll c=(n-k-1)*j+(ll)(n-k-1)*(n-k)/2; c%=MOD; (ans+=dp[1][k][i][j]*c)%=MOD; } } } cout<