A special site for solving fun programming problems and challenges, interested in computer science, programming, basics, data structure and algorithms

 V. PUM

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Given a number N. Print N lines that describes PUM game.

For more clarification see the examples.

Input

Only one line containing a number N (1 ≤ N ≤ 20).

Output

Print the answer according to the required above.

Examples
input
Copy
7
output
Copy
1 2 3 PUM
5 6 7 PUM
9 10 11 PUM
13 14 15 PUM
17 18 19 PUM
21 22 23 PUM
25 26 27 PUM
input
Copy
3
output
Copy
1 2 3 PUM
5 6 7 PUM
9 10 11 PUM
Note

Don't print any extra spaces.

my code:

#include<iostream>
using namespace std;

int main()
{
	int n, t{ 1 };
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cout << t << " " << t+1 << " " << t+2 << " " << "PUM\n";
		t += 4;
	}
	
	return 0;
}

No comments:

Post a Comment