CCC '04 J3 - Smile with Similes

View as PDF

Submit solution

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

Problem type
Canadian Computing Competition: 2004 Stage 1, Junior #3

A simile is a combination of an adjective and noun that produces a phrase such as "Easy as pie" or "Cold as ice".

Write a program to input n adjectives (1 \le n \le 5) and m nouns (1 \le m \le 5), and print out all possible similes. The first two lines of input will provide the values of n and m, in that order followed, one per line, by n adjectives and m nouns.

Your program may output the similes in any order.

Sample Input


Sample Output

Easy as pie
Easy as rock
Smart as pie
Smart as rock
Soft as pie
Soft as rock


  • 2
    Airy  commented on Jan. 18, 2023, 7:53 a.m.


    • 38
      Vastaway  commented on March 30, 2023, 9:53 p.m.

      as pie

  • 12
    byronxz2030  commented on May 18, 2022, 3:23 a.m.

    I love pies. don't tell me that I'm weird

  • 18
    fireheartjerry  commented on May 1, 2022, 7:39 p.m.

    Pies are always known for their extremely high IQ

  • 34
    Someone_you_can_trust  commented on Dec. 3, 2021, 1:00 a.m.

    I do like it when rocks are soft

  • 1
    TimothyW553  commented on Dec. 26, 2017, 5:55 a.m.

    How come you guys don't have all the J3 problems?

    • 13
      wleung_bvg  commented on Dec. 26, 2017, 9:29 p.m.

      Some problems are shared between junior and senior. J3 is sometimes (but not always) the same problem as S1 and is listed as S1 on this site.

      • -14
        felixzhang25  commented on May 26, 2018, 11:50 p.m. edited

        This comment is hidden due to too much negative feedback. Show it anyway.