题目
Jamie has recently found undirected weighted graphs with the following properties very interesting:
- The graph is connected and contains exactly n vertices and m edges.
- All edge weights are integers and are in range [ 1 , 1 0 9 ] [1, 10^9] [1, 109] inclusive.
- The length of shortest path from 1 to n is a prime number.
- The sum of edges’ weights in the minimum spanning tree (MST) of the graph is a prime number.
- The graph contains no loops or multi-edges.
Help Jamie construct any graph with given number of vertices and edges that is interesting!
Input
First line of input contains 2 integers n , m ( 2 ≤ n ≤ 1 0 5 , n − 1 ≤ m ≤ min ( n ( n − 1 ) 2 , 1 0 5 ) ) n, m( 2\leq n\leq 10^{5},n-1\leq m\leq \min ( \dfrac {n\left( n-1\right) }{2},10^{5})) n,m(2≤n≤105,n−1≤m≤min(