number square, Computer Engineering

Assignment Help:
Ask question #MinimYour professor wants you to fill a two-dimensional N by N matrix with some numbers by following a specific pattern. According to his explanation as in the figure below, you have to fill the whole matrix by starting from the upper left corner. And then you continue by growing the size of the square matrix one by one. You start by filling a 1 by 1 matrix, then a 2 by 2 matrix until the n by n matrix is filled.



So, in the example given above, you have to fill a 10 by 10 matrix starting from number 4. Then, you continue from the next column (downwards) and from the next row (right to left) by incrementing the number and by storing it in the current position in the array.

Question: Given the dimension of the final matrix and the starting number, print all the elements of the final matrix.

Input specification
You will be given two integer n and s ( 5 <= n <= 100 and 1 <= s <= 100 ) where n represents the dimension of the final matrix and s represents the starting number in the upper left corner.

Output specification
Show all of the elements of the final matrix separated by a single space as in the given examples.um 100 words accepted#

Related Discussions:- number square

Software engineering, What are coupling and cohesion and why are they impor...

What are coupling and cohesion and why are they important concepts in software design?

Extra variables by which customers call for work to work out, What are the ...

What are the extra variables by which customers call for to work out? All customers who do not purchase Internet connectivity through a Service Provider do call for to work out

Define underflow and overflow, Define underflow and overflow. Underflow...

Define underflow and overflow. Underflow: If the result the arithmetic operation including n-bit numbers is too small to show by n-bits, underflow is said to occur. Overflow

When web pages containing emails are sent out, When web pages containing em...

When web pages containing emails are sent out they are prefixed by MIME Header. Why? Primarily email consisted messages having simple text written into English and expressed in

Overall computing time, Clustering has been existing since the 1980s when i...

Clustering has been existing since the 1980s when it was used in DEC's VMS systems. IBM's SYSLEX is a cluster approach for a mainframe system. Sun Microsystems, Microsoft, and othe

Delete command, When the user is inputting commands into your shell, it sho...

When the user is inputting commands into your shell, it should properly handle delete and backspace. When one of these characters is detected, you will need to remove one character

Illustrate high performance fortran, In 1993 High Performance FORTRAN Forum...

In 1993 High Performance FORTRAN Forum which is a group of academicians and many leading software and hardware vendors in field of parallel processing established an informal langu

Megaflops, Speed in scientific computing is measured in megaflops, gigaflop...

Speed in scientific computing is measured in megaflops, gigaflops, teraflops and petaflops. A megaflop is 10 6 floating point arithmetic operations (+, -, *, /) in one second What

In virtual memory system addresses used by the programmer, In a virtual mem...

In a virtual memory system, the addresses used by the programmer refers to  (A) Memory space.               (B) Physical addresses.   (C) Address space.                (D) M

What is input - output commands, Q. What is Input - Output commands? Th...

Q. What is Input - Output commands? There are four kinds of I/O commands which an I/O interface can receive when it's addressed by a processor: Control : This type of c

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd