Asadullohil Ghalib

Setelah Kutahu Ternyata yang Kutahu Masih Sedikit…?

#176 – Family Problems [Soal Warming Up Gemastik]

dengan satu komentar

Created by : PCLP

Asif and Nafisa are very interested in solving puzzles.They always try to give one another puzzles to see who is the best.So ,as usual, one day, Nafisa gave Asif a matrix.

The matrix is as follows

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C ......
B C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D ......
C D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E ......
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C D E F ......
................................................................

Assume that the matrix is very huge (both row and column wise). Nafisa describes a special sequence as a sequence  whose first term is ‘A’ [element at (0,0)], second term is ‘B’ [element at  (0,1)], third term is ‘B’ [element at (1,0)], fourth term is ‘C’ [element at (2,0)]. Now,she asks Asif to find the nth term of this special sequence. Help Asif To solve the problem.

Input

There will be multiple test cases with number N(1<=N<=1000000) per line.

Output

A character ['A'-'Z'] per line for each number N representing the Nth number in the special sequence.

Example

Input:
3
6
10
Output:
B
C
D

Problem Requirement

Runtime Limit : 1 seconds
Memory Limit : 50000 bytes

Ditulis oleh kubaat

14 September 2011 pada 3:26 pm

Ditulis dalam Event, Gemastik

Satu Tanggapan

Berlangganan komentar dengan RSS.

  1. [...] 176 – Family Problems [...]


Tinggalkan Balasan

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Ubah )

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.

Bergabunglah dengan 38 pengikut lainnya.