2838. Cancer or Scorpio

单点时限: 5.0 sec

内存限制: 256 MB

Alice and Michael is a young couple who are planning on having their first child. Their wish their son Nelson was born on a special date for both of them.

Alice has investigated in the internet and has found that the period of gestation is forty weeks. These forty weeks begin to count on the first day of the last menstrual cycle.

Michael is passionate about astrology and even more about the zodiac signs, he has asked Alice to investigate the range of dates that correspond to each sign.

Alice and Michael ask for help to calculate the date of birth of their son Nelson and his zodiac sign.


The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of datasets that follow.

Each dataset consists of a single line of input that contains only eight digits that represent the date of the first day of the last menstrual cycle in format MMDDYYYY.


For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, the date of birth in format MM/DD/YYYY, a space, and the name (in lowercase) of zodiac sign that correspond according to the date of birth.

Note: Considers leap years.


1 10/30/2009 scorpio
2 10/29/2008 scorpio

32 人解决,43 人已尝试。

35 份提交通过,共有 129 份提交。

4.6 EMB 奖励。

创建: 9 年,3 月前.

修改: 2 年,4 月前.

最后提交: 1 年,7 月前.

来源: Mexico 2010