Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prime Triangle In this problem, you are given a simple task. Denote pi as the first digit of the i-th prime. You need to output

Prime Triangle

In this problem, you are given a simple task. Denote pi as the first digit of the i-th prime. You need to output a prime triangle with the size of N. A prime triangle with the size N can be constructed as follows:

the first line contains the first digit of the first prime, which is p1

the second line contains the first digit of the next two primes, which are p2 and p3

the third line contains the first digit of the next three primes, which are p4, p5, and p6

. . .

the N-th line contains the first digit of the next N primes, which are image text in transcribed

Format Input

The first line consists of an integer T which represents the number of testcases. For each testcase, there is a line containing an integer N, which represent the size of the prime triangle.

Format Output For each testcase, output Case #X: where X indicates the testcase number started from 1. Then, it is followed in the next line with the asked prime triangle.

Constraints

1 T 100

1 N 100

Sample Input 1 (standard input)

2

4

1

Sample Output 1 (standard output)

Case #1:

2

35

713

7939

Case #2:

2 Note : Use Standard C Language, If can, Dont use printf("2 ");

N(N+1) N(N +1) N(N +1) p - N +1,p- - N +2, ...,P 2 2 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

=+j Understand different types of regions in the world.

Answered: 1 week ago