#B2111. DNA Similarity Check
DNA Similarity Check
DNA Similarity Check
To analyze the functional and structural similarity of gene sequences, it is common to compare several DNA sequences. In this problem, you are given two DNA sequences of equal length. A base pair is formed by taking one nucleotide from each sequence at the same position. If the nucleotides in a base pair are identical, the pair is considered matching.
Let \( \text{match}\) be the number of matching base pairs and \( n \) be the total number of base pairs. Then, the matching ratio is defined as
\( \frac{\text{match}}{n} \)
If this ratio is greater than or equal to a given threshold, the two DNA sequences are considered related; otherwise, they are not related.
inputFormat
The input consists of three lines:
- The first line contains the first DNA sequence.
- The second line contains the second DNA sequence (of equal length).
- The third line contains a decimal number representing the threshold.
outputFormat
Output a single word: YES if the ratio of matching base pairs is greater than or equal to the threshold, otherwise output NO.
sample
ACGT
ACGT
1.0
YES