Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[Python] Blocks on Blocks If you know the game tetris , you may be familiar with the following figures: These figures contains rows of squares.

[Python] Blocks on Blocks

If you know the game tetris, you may be familiar with the following figures:

image text in transcribed

These figures contains rows of squares. In each row, squares are consecutive. Adjacent rows share at least one side of a square, so the following figures are not allowed:

image text in transcribed

Given the number of squares, count the number of figures. Since the number may be huge, the answer is the number of figures modulo 10000. That is, the output will always be between 0 and 9999.

Input

The first line of input contains a single integer image text in transcribed , the number of test cases. Each test case contains a single integer image text in transcribed, the number of squares.

Output

For each test case, print the case number followed by the answer for that case. Use the format in the sample output below.

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

LO12.3 Explain how demand is seen by a pure monopoly.

Answered: 1 week ago