are two potential results of a game:    the game might bring about a tie, then, at that point, the two groups get 1 point;    one group may dominate in a match, then, at that point, the triumphant group gets 3 focuses and the losing group gets 0 focuses.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Correct answer will be upvoted else downvoted. Computer science.

 

 

There are two potential results of a game: 

 

the game might bring about a tie, then, at that point, the two groups get 1 point; 

 

one group may dominate in a match, then, at that point, the triumphant group gets 3 focuses and the losing group gets 0 focuses. 

 

The score of a group is the number of focuses it acquired during all games that it played. 

 

You are keen on a theoretical circumstance when all groups get a similar score toward the finish of the title. A basic illustration of that circumstance is the point at which all games bring about ties, however you need to limit the number of ties too. 

 

Your assignment is to depict a circumstance (pick the aftereffect of each game) so that all groups get a similar score, and the number of ties is the base conceivable. 

 

Input 

 

The main line contains one integer t (1≤t≤100) — the number of experiments. 

 

Then, at that point, the experiments follow. Each experiment is portrayed by one line containing one integer n (2≤n≤100) — the number of groups. 

 

Output 

 

For each experiment, print n(n−1)2 integers portraying the aftereffects of the games in the accompanying request: the primary integer ought to compare to the match between group 1 and group 2, the second — between group 1 and group 3, then, at that point, 1 and 4, ..., 1 and n, 2 and 3, 2 and 4, ..., 2 and n, etc, until the game between the group n−1 and the group n. 

 

The integer relating to the game between the group x and the group y ought to be 1 if x successes, −1 if y wins, or 0 if the game outcomes in a tie. 

 

All groups ought to get a similar score, and the number of ties ought to be the base conceivable. In case there are numerous ideal replies, print any of them. It tends to be shown that there consistently exists a way of making all groups have a similar score

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY