random answer. Computer science. Today the kindergarten has another gathering of n kids who should be situated during supper. The seats at the table are numbered from 1 to 4n. Two children can't sit on a similar seat. It is realized that two children who sit on seats with numbers an and b (a≠b) will enjoy if:    gcd(a,b)=1 or,

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

Correct answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science.

Today the kindergarten has another gathering of n kids who should be situated during supper. The seats at the table are numbered from 1 to 4n. Two children can't sit on a similar seat. It is realized that two children who sit on seats with numbers an and b (a≠b) will enjoy if: 

 

gcd(a,b)=1 or, 

 

a partitions b or b separates a. 

 

gcd(a,b) — the greatest number x with the end goal that an is distinct by x and b is detachable by x. 

 

For instance, if n=3 and the children sit on seats with numbers 2, 3, 4, then, at that point, they will enjoy since 4 is isolated by 2 and gcd(2,3)=1. On the off chance that children sit on seats with numbers 4, 6, 10, they won't enjoy. 

 

The educator truly doesn't need the wreck at the table, so she needs to situate the children so there are no 2 of the child that can enjoy. All the more officially, she needs no pair of seats an and b that the children possess to satisfy the condition above. 

 

Since the educator is extremely occupied with the diversion of the children, she requested that you tackle this issue. 

 

Input 

 

The principal line contains one integer t (1≤t≤100) — the number of experiments. Then, at that point, t experiments follow. 

 

Each experiment comprises of one line containing an integer n (1≤n≤100) — the number of children. 

 

Output 

 

Output t lines, which contain n unmistakable integers from 1 to 4n — the numbers of seats that the children ought to involve in the comparing experiment. In case there are different replies, print any of them. You can print n numbers in any request.

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole