Question
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
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 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started