Integer to Roman

View as PDF

Submit solution


Points: 20 (partial)
Time limit: 1.0s
Memory limit: 32M

Authors:
Problem type
Allowed languages
Python

Problem Statement

You are given a non-negative integer N, converts it into Roman numeral.You may assume that the integer is in the range of 1..3999.

See this site for an explanation.

Input Specification

The first line of the input gives the number of test cases, T, T test cases follow. Each test case consists of a line.

The line contains a non-negative integer N.

Limits

Memory limits: 32MB.

Time limits: 1 second.

1 \leq T \leq 100

1 \leq N \leq 3999

Test Set 1

Sample Case.

Test Set 2

1 \leq N \leq 50

Test Set 3

1 \leq N \leq 1000

Test Set 4

1 \leq N \leq 3999

Output Specification

For each test case, output one line containing Case #x: y, where x is the case number(starting from 1) and y is the number represented in Roman numeral.

Sample Input

2
9
5

Sample Output

Case #1: IX
Case #2: V

Hint

dictionary roman numerals


Comments

There are no comments at the moment.