0% found this document useful (0 votes)
51 views

I2P Homework4b: Problem Description

The document provides the problem description, input, and output format for generating a circulant matrix from a vector. Given a vector size N < 20 and its N components, the task is to create an N×N matrix where each row is the previous row circularly shifted to the right by one position, and print the matrix with two decimal places per element and a new line after each row. A sample 5×5 circulant matrix generated from the vector [8,7,4,6,2] is provided.

Uploaded by

yankev
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

I2P Homework4b: Problem Description

The document provides the problem description, input, and output format for generating a circulant matrix from a vector. Given a vector size N < 20 and its N components, the task is to create an N×N matrix where each row is the previous row circularly shifted to the right by one position, and print the matrix with two decimal places per element and a new line after each row. A sample 5×5 circulant matrix generated from the vector [8,7,4,6,2] is provided.

Uploaded by

yankev
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

10/8/14, 14:45

10099 - I2P homework4b


Time limit: s
Memory limit: MB

Problem Description
Given a vector of dimension N, use it to create an N-by-N circulant matrix. An example of circulant
matrix:
15432
21543
32154
43215
54321

Input
The first line contains a positive integer N indicating the size of the matrix. (0<N<20)
The second line contains N numbers indicating the components of the vector. Note that each component
of the vector is a one-digit number.

Output
The N-by-N circulant matrix. Print the elements of the matrix using the format "%2d". Each row is ended
with a newline character '\n'.

Sample Input
5
87462

Sample Output
82647
78264
47826
64782
26478

http://140.114.86.238/problem_print.php?pid=10099

Page 1 of 1

You might also like