A-Nana in Wonderland series-Spooky piano

Source: Internet
Author: User

A-Nana in Wonderland Series-Spooky pianoTime Limit:2000/1000ms (java/others) Memory Limit: 128000/64000kb (java/others) Submit Statusproblem Description

Once upon a time, there was a Acdream kingdom, a princess lived in the kingdom, her name is Nana, Nana Princess had a very long dream one day ~ She said she had never met these wonderful things ~

Now standing in front of Nana is a piano, which is a seemingly normal piano, with 88 keys (frequency from 27 Hz to 4186 Hz) ~ but it doesn't matter. As a science bully, Nana knows the tone and frequency of the sound, the higher the frequency, the more sharp the voice, the lower the frequency, the more low The voice.

But this piano will make its own sound! This is so weird! Curiosity baby Nana to this magical piano research for a long time, found that the sound of the piano is composed of three frequency combinations, sometimes very passionate, sometimes very beautiful (please do not spit groove adjectives), and sometimes very harsh. Gradually she found, pitched called a major chord, the frequency ratio is exactly 4:5:6, (for example, we often say that the frequency of C major chords does mi so is 264:330:396=4:5:6, unit hertz), deep and beautiful called minor chords, frequency ratio is exactly 10 : 12:15 (for example, we often say that a minor chord la do mi frequency ratio is 220:264:330=10:12:15), the rest of the very harsh chord ratio does not match these two.

Then Nana would like to know the frequency of any given three tones, whether it is a major chord or a minor chord or a shrill chord.

Input

Multiple sets of data, first an integer T (t<=100) representing the number of data groups

Each set of data is three positive integer a,b,c (27<=a,b,c<=4186), which represents the frequency of the three tones, in Hertz.

Output for each set of data, if it is a major chord that frequency ratio is 4:5:6, then outputs "major", if it is a minor chord, then output "minor", if not, then output "noise", note that you do not need to output double quotes, in order to avoid spelling problems, it is recommended to copy. Sample Input
Sample Output
Majorminornoise
Hint264:330:396=4:5:6 for major chords
220:264:330=10:12:15 for minor chords
264:297:330=8:9:10 is neither a major chord nor a minor chord pure water problem, just need to pay attention to the input of the three number of the size is not ordered, from small to large to find, and then go to the proportion to find the note is good:
1#include <iostream>2#include <stdio.h>3 using namespacestd;4 intMain ()5 {6     intt,tmp,a,b,c,aa,bb,cc;7scanf"%d",&T);8      while(t--)9     {Tenscanf"%d%d%d",&aa,&bb,&cc); One         if(aa>BB) A         { -tmp=aa;aa=bb;bb=tmp; -         } the         if(CC&LT;=AA) {a=cc;b=aa;c=BB;} -         Else if(CC&GT;=BB) {a=aa;b=bb;c=cc;} -         Else{a=aa;b=cc;c=BB;} -         if(b%5==0) +         { -tmp=b/5; +             if(a==tmp*4&&c==tmp*6) A             { atprintf"major\n"); -                 Continue; -             } -         } -         if(b% A==0) -         { intmp=b/ A; -             if(a==tmp*Ten&&c==tmp* the) to             { +printf"minor\n"); -                 Continue; the             } *         } $printf"noise\n");Panax Notoginseng     } -     return 0; the}
View Code

A-Nana in Wonderland series-Spooky piano

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.