{"raw_statement":[{"iden":"statement","content":"中国科学院大学的著名 JB 选手 bibibibi，想当年还在北理工打算法竞赛时候就是一个全能王，所有的算法题目里就没有他不能嘴巴 AC 的。这天他听说 Paul（lu）Lu（pao）学长挺会数数的，于是决定出一道数数的题目来考一考他：\n\n已知在一个 $n times n$ 的棋盘里，每个格子都可以填上一个范围为 $[ 1, k ]$ 的正整数。定义棋盘中的某个格点是 _bi点_ 当且仅当满足：\n\n设 $B_i$ 为棋盘中恰好 $i$ 个 _bi点_ 的方案数，请你计算 $sum limits_{i = 0}^(n^2) (i^2 dot.op B_i)$，答案可能很大，请取模 $10^9 + 7$。\n\n第一行输入一个正整数 $T \" \"(1 <= T <= 20)$，表示数据组数。\n\n接下来 $T$ 组数据，每组数据输入两个正整数 $n$ 和 $k \" \"(1 <= n, k <= 200)$，由空格间隔开，分别表示棋盘的大小和每个格点内可填数的范围上限。\n\n对于每组数据，请输出一行，表示计算结果取模 $10^9 + 7$ 的答案，注意换行。\n\n"},{"iden":"input","content":"第一行输入一个正整数 $T \" \"(1 <= T <= 20)$，表示数据组数。接下来 $T$ 组数据，每组数据输入两个正整数 $n$ 和 $k \" \"(1 <= n, k <= 200)$，由空格间隔开，分别表示棋盘的大小和每个格点内可填数的范围上限。"},{"iden":"output","content":"对于每组数据，请输出一行，表示计算结果取模 $10^9 + 7$ 的答案，注意换行。"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, k \\in \\mathbb{Z}^+ $. Consider an $ n \\times n $ grid where each cell is assigned a value in $ [1, k] $. A cell is a *bi-point* if it is the unique maximum in its row and column.  \nLet $ B_i $ be the number of grid assignments with exactly $ i $ bi-points.\n\n**Constraints**  \n1. $ 1 \\leq T \\leq 20 $  \n2. For each test case: $ 1 \\leq n, k \\leq 200 $\n\n**Objective**  \nCompute:  \n$$\n\\sum_{i=0}^{n^2} i^2 \\cdot B_i \\mod (10^9 + 7)\n$$","simple_statement":"Count the sum of i² × (number of ways to have exactly i \"bi-points\") over all possible fillings of an n×n grid with numbers from 1 to k.  \nA \"bi-point\" is a cell that is the maximum in its row and column.  \nAnswer modulo 10⁹+7.","has_page_source":false}