DWITE '07 R5 #1 - I heart you

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
DWITE Online Computer Programming Contest, February 2008, Problem 1

Just in time for Valentine's Day 2008, we require an ASCII heart generator. Based on Tony's horrible "artwork" below:

 ~.~ 
`   `
 \./ 

The input will contain 5 lines, integers 0 \le N \le 5.

The output will contain 5 sets of 3 lines, 15 in total. Each set will have a specified number of hearts generated. Refer to the sample output for examples.

Note: each heart is made up of 3 lines, 5 characters each. Don't forget to have all the spaces at the end.

Sample Input

1
0
3

Sample Output

 ~.~ 
`   `
 \./ 



 ~.~  ~.~  ~.~ 
`   ``   ``   `
 \./  \./  \./ 

Problem Resource: DWITE

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Comments