Monocarp's realm has n urban communities. To vanquish new grounds he intends to construct one Monument in every city. The game is turn-based and, since Monocarp is as yet beginner, he fabricates precisely one Monument for each turn.    Monocarp has m focuses on the guide he'd prefer to control utilizing the developed Monuments

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will be upvoted else downvoted.

 

 

Monocarp's realm has n urban communities. To vanquish new grounds he intends to construct one Monument in every city. The game is turn-based and, since Monocarp is as yet beginner, he fabricates precisely one Monument for each turn. 

 

Monocarp has m focuses on the guide he'd prefer to control utilizing the developed Monuments. For each point he knows the distance among it and every city. Landmarks work in the accompanying manner: when implicit some city, a Monument controls all focuses at distance all things considered 1 to this city. Next turn, the Monument controls all focuses at distance all things considered 2, the turn after — at distance all things considered 3, etc. Monocarp will construct n Monuments in n turns and his domain will overcome all focuses that are constrained by somewhere around one Monument. 

 

Monocarp can't sort out any system, so during each turn he will pick a city for a Monument arbitrarily among every leftover city (urban areas without Monuments). Monocarp needs to know the number of focuses (among m of them) he will vanquish toward the finish of turn number n. Assist him with working out the normal number of vanquished focuses! 

 

Input 

 

The principal line contains two integers n and m (1≤n≤20; 1≤m≤5⋅104) — the number of urban communities and the number of focuses. 

 

Next n lines contains m integers each: the j-th integer of the I-th line di,j (1≤di,j≤n+1) is the distance between the I-th city and the j-th point. 

 

Output 

 

It very well may be shown that the normal number of focuses Monocarp vanquishes toward the finish of the n-th turn can be addressed as an unchangeable portion xy. Print this part modulo 998244353, I. e. esteem x⋅y−1mod998244353 where y−1 is such number that y⋅y−1mod998244353=1.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education