This page is still under construction.

Parts of this page are still being built. What you see may change.

Simple Graph

Time limit1sMemory limit512 MB

Summary
Sum x^k over all simple graphs on n labeled vertices, where x counts the tree components, modulo 998244353.
Level

Hard9 of 10

Topics
Combinatorics, Dynamic programming, Math, Graph
Solved
No attempts yet

Problem

An undirected simple graph GG can be divided into connected components. Let xx be the number of trees among these components. Then the value of graph GG is defined as xkx^k.

Given nn and kk, calculate the sum of values of all undirected simple graphs with exactly nn labeled vertices. Print the answer modulo 998 244 353998\,244\,353.

A simple graph is an undirected graph in which both multiple edges and loops are disallowed. A connected component (or just component) of an undirected graph is a subgraph in which any two vertices are connected to each other by paths, and which is not connected to any other vertex in the graph.

Input

The first line contains an integer T≤100T \le 100, denoting the number of test cases. Each of the next TT lines contains two space-separated integers nn and kk (1≤n≤1041 \le n \le 10^4, 1≤k≤201 \le k \le 20).

Output

For each test case, print a single line containing the answer.

Examples1

  1. Example 1

    Input
    2
    3 1
    4 2
    
    Expected output
    12
    150