CodeChef is a non-commercial competitive programming community
Login
Username (New User? Signup) Password (Forgot Password?)
Signup
Login or
Signup with
Connect
Note
  • Publicize your achievements on your Facebook Wall.
  • Challenge your friends or ask them for help.

Site Navigation

  • PRACTICE
    • Easy
    • Medium
    • Hard
    • Challenge
    • Peer
  • COMPETE
    • All Contests
    • June Long 2012
    • May Cook-Off
    • May Long 2012
  • DISCUSS
    • Wiki
    • Forums
    • Blog
    • Facebook
    • Twitter
  • COMMUNITY
    • CodeChef Meetups
    • Campus Chapters
    • Host your Contest
    • User Groups
    • CodeChef TechTalks
    • All Educational Initiatives
    • Event Calendar
  • HELP
    • Frequently Asked Questions
    • FAQ for problem setters
    • Problem Setting
    • Tutorials
    • Long Contest Ranks
    • Short Contest Ranks
  • ABOUT
    • About CodeChef
    • Team CodeChef
    • Press Room
    • CodeChef Financials
    • CodeChef Sponsorships
    • CEO's Corner
    • Contact Us
    • About Directi
Home » Compete » CE 2010 » Spyrographs

Spyrographs

Problem code: CE04

  • All Submissions

A Spyrograph is the output of a 2 D array in spiral form as shown below,from the given example below WAP to find the spyrograph of a given 2D array.

Input

The first line will consist of the total number of test cases T(1<=T<=10). The next T lines will consist of one number on each line. These are the elements of the 2D array

Output

For each test case print out each element of the spyrograph.

Example

Input:


1
156
25
3
4
54
62
7
82
9
210
311
142
143
14
15
45
Output:

624
100
12
16
328
568
0
60
56
572
36
216
248
28
1244
840


Author: cerebration
Date Added: 22-03-2010
Time Limit: 1 sec
Source Limit: 50000 Bytes
Languages: BF, CLOJ, CPP 4.3.2, F#, GO, ICK, JS, PERL6, PRLG, PYTH 3.1.2, TEXT, WSPC


  • Submit

Comments

  • Login or Register to post a comment.

@Admin:.. Q nt so clear!!

geopaulm @ 26 Mar 2010 01:58 AM

@Admin:.. Q nt so clear!!

"The first line will consist

DevGeeK @ 26 Mar 2010 01:59 AM

"The first line will consist of the total number of test cases T(1<=T<=10). The next T lines will consist of one number on each line."

On the first line there is a 1, which means there is only one test case or there is only one line, but as i can see there are 16 lines. Please correct this.

considering that there are 16

mehrotra.akash @ 27 Mar 2010 09:34 PM

considering that there are 16 lines, I guess that it is a 4x4 matrix which is taken as input for each test case, still dont understand the output

If anyone can figure out what

mehrotra.akash @ 28 Mar 2010 10:22 AM

If anyone can figure out what the relation between the input and output is please explain it here

@admin :   the output seems

tapan.thaker @ 28 Mar 2010 12:36 PM

@admin :

 

the output seems to be incorrect for 2 numbers

 

for 89 and 45 as inputs ....

hey thapan how to get the end

tmvipinster @ 28 Mar 2010 02:51 PM

hey thapan how to get the end of the input

solved it anyhow :D

tmvipinster @ 28 Mar 2010 05:08 PM

solved it anyhow :D

@tmadda..explain the

aansu @ 28 Mar 2010 05:30 PM

@tmadda..explain the question!!!

Can someone pls give some

mehrotra.akash @ 28 Mar 2010 05:34 PM

Can someone pls give some hint as to what needs to be done in this question?

Again, the sample output is

Manoharprabhu @ 28 Mar 2010 06:13 PM

Again, the sample output is bullshit.

Print the 4X4 matrix in spiral order to get your solution accepted.

@manohar tried it..please

aansu @ 28 Mar 2010 06:42 PM

@manohar tried it..please post a sample input and output

SITZ plz can u tell wheter

heeropunjab @ 28 Mar 2010 09:55 PM

SITZ plz can u tell wheter the octal program test case is correct or not

@Punjabi : NO !! Its

SITZ @ 28 Mar 2010 09:58 PM

@Punjabi : NO !! Its absolutely wrong ... Just do what is given in the statement of problem...

nothing else . . :)

@Punjabi what is the size of

SITZ @ 28 Mar 2010 10:00 PM

@Punjabi what is the size of input matrix... and how we have to output them...

please give a sample test input/output data . . .

@Manohar prabhu Even printing

chang @ 28 Mar 2010 11:43 PM

@Manohar prabhu

Even printing 4x4 mat in spiral form isnt wrking. can u clear what exactly is meant by spiral ?

Is first line the number of

rahulakaneo @ 29 Mar 2010 12:07 AM

Is first line the number of testcases? And, is each matrix a 4 X 4 one?

what are the correct test

code.freak @ 29 Mar 2010 07:15 PM

what are the correct test cases and  how do we end our input????

Admins where r u????

@rohan Plz reply

chang @ 29 Mar 2010 07:54 PM

@rohan

Plz reply admin....correct the test data for bouncy no and spyrograph.

 

thanx

The first line is the number

cerebration @ 29 Mar 2010 08:45 PM

The first line is the number of 4x4 matrix youll need to enter

The next lines are the elements of the matrix entered in Row major order.

Also the output is encoded as with the previous questions,please program accordingly.

can you plz let me know what

Sachin Midha @ 30 Mar 2010 09:08 AM

can you plz let me know what do you mean by output is encoded???

output is wrong!!! 180 is

aviator @ 30 Mar 2010 01:39 PM

output is wrong!!!

180 is there instead of 0 in output

How careless...

Manoharprabhu @ 31 Mar 2010 04:35 PM

How careless...

abe kya natak laga

akashheart02 @ 31 Mar 2010 08:59 PM

abe kya natak laga rakha

suno yaar tumhe pahele batana chahiye tha ya email karna chahiye tha

this is not fair with us.

I spent my whole day for solving these problems now you are saying you haven't registred.

sending information of this much value throungh comment is not good.

please be fair in judging.

:(

:(

:(

SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:

Programming Competition Fetching successful submissions
Directi Go for Gold
CodeChef is a global programming communityCodeChef hosts online programming competitions
CodeChef is a non-commercial competitive programming community
  • About CodeChef
  • About Directi
  • CEO's Corner
  • C-Programming
  • Programming Languages
  • Contact Us
© 2009 Directi Group. All Rights Reserved. CodeChef uses SPOJ © by Sphere Research Labs
In order to report copyright violations of any kind, send in an email to copyright@codechef.com
CodeChef a product of Directi
The time now is:
CodeChef - A Platform for Aspiring Programmers

CodeChef was created as a platform to help programmers make it big in the world of computer programming. At CodeChef we work hard to revive the geek in you by hosting programming contests on a monthly basis. We also aim to have training sessions and events related to online programming for programmers around the world. Apart from providing a platform for programming competitions, CodeChef also has various tutorials and forum discussions to help those who are new to the world of computer programming.

Practice Section - A Place to hone your 'Computer Programming Skills'

Try your hand at one of our many practice problems and submit your solution in a language of your choice. Our judge accepts solutions in over 35+ programming languages. Online programming was never this much fun! Receive points, and move up through the CodeChef ranks. Use our practice section to better prepare yourself for the multiple programming competitions that take place through-out the month on CodeChef.

Compete - Monthly Programming Contests and Cook-offs

Here is where you can show off your computer programming skills. Take part in our 10 day long monthly programming contests and the shorter format Cook-off programming contests. Put yourself up for recognition and win great prizes. Prizes worth up to Rs.20,000 and $700 are up for grabs every month along with lots more CodeChef goodies.

Discuss

Are you new to computer programming? Do you need help with algorithms? Then be part of CodeChefs Forums and interact with all our programmers love helping out other programmers and share their ideas.

CodeChef Community

As part of our Educational initiative, we give institutes the opportunity to associate with CodeChef in the form of Campus Chapters. Hosting online programming competitions is not the only feature on CodeChef. Be a part of the CodeChef community through CodeChef meetups and techtalks. You can also host a programming contest for your institute on CodeChef and be a guest author on our blog.

Go For Gold

The Go for Gold Initiative was launched about a year after CodeChef was incepted, to help prepare Indian students for the ACM ICPC World Finals competition. In the run up to the ACM ICPC competition, the Go for Gold initiative uses CodeChef as a platform to train students for the ACM ICPC competition via multiple warm up contests. As an added incentive the Go for Gold initiative is also offering over Rs.8 lacs to the Indian team that beats the 29th position at the ACM ICPC world finals. Find out more about the Go for Gold and the ACM ICPC competition here.

Domain Name Registration, Web hosting, and Website Design provided by BigRock.com