Medium Beginners Problems > Ad-hoc

Once a day **Habib** was under an apple tree. He was thinking about how to do a better performance in sport programming. He was thinking and thinking. Suddenly, a bird commonly called **Samsu** in his region sat on the apple tree he was sitting. Unlike, **Newton’s apple story** that time Samsu evacuated from the apple tree and that felled on his shirt. This time Habib was very serious thinking that he could do better because his scenario under apple tree nearly similar to Newton. So, he would can! At that moment a problem came to his mind that he want to solve. According to his speech the problem was so easy. From his special permission, I can tell the problem description to you. In his problem, there was a **square grid** with integers. He had to print the integers in a sequence that start from the lower left element and continue to print elements in a sequence as described by the figure bellow. ![Grid][1] ***See the sample I/O for more clarity.*** Input: ------ You will be given the testcase number T , ***1<=T<=10*** and for every case length of the square , ***1<=n<=1000***. Next there will be **n** lines and for each line there will be **n** integers ***-10000 <= ni <=10000.***. Output: ------- For every case and for every square print the integers separated by space in a single line followed by Case number as in the sample output. Sample Input ------------ 2 3 1 2 3 4 5 6 7 8 9 2 2 4 7 8 Sample Output ------------- Case #1: 7 8 4 1 5 9 6 2 3 Case #2: 7 8 2 4 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/8c70056f-c2f4-c0ae-4099-08d432421fa0_750abaf8ea6e41f9845b3433a01f6dc7_W248xH151.png

Habibur Rahman

Language |
Time Limit (seconds) |

C | 1.00 |

C++ | 1.00 |

C++14 | 1.00 |

C# | 2.00 |

Go | 2.00 |

Java | 2.00 |

JavaScript | 2.00 |

Objective-C | 2.00 |

Perl | 2.00 |

PHP | 2.00 |

Python | 2.00 |

Python3 | 2.00 |

Ruby | 2.00 |

VB.Net | 2.00 |

Solve/Submission

# | User | Language | Timing |
---|---|---|---|

01 | feodorv | Cpp14 | 0.03s |

02 | Morass | Cpp14 | 0.03s |

03 | Robbinb1993 | Cpp14 | 0.04s |

04 | ksohan | Cpp14 | 0.06s |

05 | BlueEye | Cpp14 | 0.06s |

06 | khatribiru | Cpp14 | 0.06s |

07 | sahedsohel | Cpp14 | 0.06s |

08 | Nirjhor | Cpp14 | 0.06s |

09 | I_See_You | Cpp14 | 0.06s |

10 | jahid_ict | Cpp14 | 0.06s |

11 | pulak_ict_mbstu | Cpp14 | 0.06s |

12 | Dark_Ocean | Cpp14 | 0.06s |

13 | Mahbub_Rahman | Cpp14 | 0.06s |

14 | subhashis_cse | Cpp14 | 0.06s |

15 | orpib | Cpp14 | 0.07s |

16 | Islam_Rafat | Cpp14 | 0.07s |

17 | emrul | Cpp14 | 0.07s |

18 | Emdadul_Hoque | Cpp14 | 0.07s |

19 | habib_rahman | Cpp14 | 0.07s |

20 | KAMO1 | Cpp14 | 0.07s |

21 | Pure_Protea | Cpp14 | 0.07s |

22 | Koushik_12 | Cpp14 | 0.07s |

23 | alamin39 | Cpp14 | 0.07s |

24 | snow_man | Cpp14 | 0.07s |

25 | ____ | Cpp14 | 0.07s |

26 | tithi_ruet | Cpp14 | 0.07s |

27 | Double_O | Cpp14 | 0.07s |

28 | Dragon_Curve | Cpp14 | 0.07s |

29 | Protap_Ghose | Cpp14 | 0.07s |

30 | SbrTa | Cpp14 | 0.07s |

31 | Rajib_119 | Cpp14 | 0.07s |

32 | mamun4122 | Cpp14 | 0.07s |

33 | astinaam | Cpp14 | 0.07s |

34 | as_couple | Cpp14 | 0.07s |

35 | moshiur_cse15 | Cpp14 | 0.07s |

36 | mir003 | Cpp14 | 0.07s |

37 | Optimus_primeV2 | Cpp14 | 0.07s |

38 | Titanium_Owner | Cpp14 | 0.07s |

39 | prottoy919 | Cpp14 | 0.07s |

40 | tariqiitju | Cpp14 | 0.07s |

41 | askfarid | Cpp14 | 0.07s |

42 | seyedssz | Cpp14 | 0.08s |

43 | daihan_mbstu | Cpp14 | 0.08s |

44 | shakil_ruet | Cpp14 | 0.08s |

45 | SleepyBrain | Cpp14 | 0.08s |

46 | imAnik | Cpp14 | 0.08s |

47 | last_man | Cpp14 | 0.08s |

48 | njrafi | Cpp14 | 0.08s |

49 | ssavi | Cpp14 | 0.08s |

50 | skmonir | Cpp14 | 0.08s |

Copyright © 2015-2016 Dev Skill.

Feedback
#### Your feedback is our precious!

## Thank you for providing feedback! Our developers will be happy :)

## Sorry there was a problem when submitting the feedback. Please try again. :(