当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6913:Chord

题目描述
Lvat is studying music. In this week, he has to figure out what chords are. First of all, he needs to learn the two kinds of most basic chords - the major triad chord and the minor triad chord.

In music theory, every 12 successive notes form a loop (or formally, an octave). Practically, we denote each note in an octave from low to high as C, C#, D, D#, E, F, F#, G, G#, A, A# and B. The pitch distance between every two adjacent notes is the same,which is called a semitone. Specifically,thepitchdistance between note C in the higher octave and note B in the adjacent lower octave is also one semitone. To conceptualize this, we can mark them on the piano keyboard, one key one note, as the figure shown below. As mentioned, the pitch distance between every two adjacent key is one semitone:



Now Lvat can easily make out the two kinds of most basic chords. You can think of a chord simply as a group of different notes. Specifically, the major triad chord and the minor triad chordare both composed of three different notes, and we denote them from low to high as $N_1, N_2$ and $N_3$:

$\qquad$$\cdot$ If the pitch distance between $N_1$ and $N_2$ is exactly 4 semitones, and that between $N_2$ and $N_3$ is exactly 3 semitones, we call the group of notes a major triad chord.

$\qquad$$\cdot$ If the pitch distance between $N_1$ and $N_2$ is exactly 3 semitones, and that between $N_2$ and $N_3$ is exactly 4 semitones, we call the group of notes a minor triad chord.

For example, consider a group of notes of <$N_1$ = C, $N_2$ = E, $N_3$ = G> in the same octave. Note C and note E have a pitch distance of 4, while note E and note G have a pitch distance of 3, so it is a major triad chord.

Next consider a group of notes of <A, C, E>, where note A is in the lower octave, and note C and E are in the adjacent higher octave. Note A and note C have a pitch distance of 3, while note C and note E have a pitch distance of 4, so it is a minor triad chord.

Now Lvat needs you to help him decide which groups of notes are major triads and which ones are minor triads.
输入解释
The first line is a single number T (T ≤ 2000), indicating the number of groups of notes.

For the following T lines, each line contains a group of three notes $N_1, N_2$ and $N_3$ (denoted as described before), separated by a single space. It is guaranteed that the three notes are given from low to high, and the pitch distance between $N_1$ and $N_2$ is no more than 11 semitones, so is $N_2$ and $N_3$.
输出解释
Output T lines.

The i-th line indicates the answer for the i-th group of notes. If the i-th group constitutes a major triad chord, output “Major triad” (without quotation marks), or if it constitutes a minor triad chord, output “Minor triad” (without quotation marks), otherwise output “Dissonance” (without quotation marks).
输入样例
5
C E G
A C E
B D F#
C F A
E D C
输出样例
Major triad
Minor triad
Minor triad
Dissonance
Dissonance
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6913

最后修改于 2021-06-22T18:18:51+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/262144K(Java/Others)