#K4086. DNA Sequence Occurrence

    ID: 26736 Type: Default 1000ms 256MiB

DNA Sequence Occurrence

DNA Sequence Occurrence

Given a DNA strand represented by a sequence of lowercase alphabetic characters, your task is to determine how many times the specific pattern atgc occurs in the strand.

Formally, let \( S \) be the given DNA strand. You need to calculate \( n = \) the number of occurrences of the substring atgc in \( S \). The output should be:

  • "no occurrence" if \( n = 0 \),
  • "single occurrence" if \( n = 1 \),
  • "multiple occurrences" if \( n \geq 2 \).

For example, for \( S = \texttt{atgcatgcgcta} \), the substring atgc occurs more than once, hence the output should be "multiple occurrences".

inputFormat

A single line containing a DNA strand composed of lowercase alphabetic characters. The input is provided via standard input (stdin).

outputFormat

A single line string that is one of the following: "no occurrence", "single occurrence", or "multiple occurrences" based on the count of the substring "atgc" in the input. The output should be written to standard output (stdout).## sample

cggtaa
no occurrence