This page is still under construction.

Parts of this page are still being built. What you see may change.

Numbers Between Characters

Time limit2sMemory limit1024 MB

Summary
Read an integer N and a four-character string, then print N times each digit found, or N/A if there are no digits.
Level

Easy2 of 10

Topics
String, Implementation, Brute force
Solved
No attempts yet

Problem

Write a program called nums_between_chars that reads the following input and produces the following output.

Input

The first line of the standard input contains a single integer N. The second line contains a sequence of exactly four characters with no spaces between them. Each character is a letter of the Latin alphabet or a digit.

Output

On separate lines of the standard output, the program must print the product of N with each number found in the sequence.

If the sequence contains only letters, the program must print "N/A" (without the quotes).

Constraints

  • 0 ≤ N < 100

Examples4

  1. Example 1

    Input
    3
    j15Q
    
    Expected output
    45
    
  2. Example 2

    Input
    12
    S2t3
    
    Expected output
    24
    36
    
  3. Example 3

    Input
    0
    L837
    
    Expected output
    0
    
  4. Example 4

    Input
    5
    gUsq
    
    Expected output
    N/A