CPU: 0.5s
Memory: 1024MB
একটি শ্রেণিতে Nটি ছাত্র আছে। কিছুদিন আগেই তারা একটি পরীক্ষা দিয়েছিল এবং আজকে তাদের পরীক্ষার খাতা দেখান হচ্ছে। এখন শিক্ষক জানতে চান কোন নম্বরটি সবচেয়ে বেশি সংখ্যক ছাত্র পেয়েছে এবং কত জন পেয়েছে।
In a class, there are N students. Recently they gave an exam and today teacher is giving away their exam copies. The teacher wants to find the number which is obtained by most of the students and the number of students who obtained that number.
ইনপুটের বর্ণনা
প্রথম লাইনে একটি ধনাত্মক সংখ্যা T দেওয়া আছে, যেটি হল কতগুলো কেস আছে তার মান। তার পরে Tটি লাইন আছে, যার প্রথমে আছে একটি সংখ্যা, N, ছাত্রদের সংখ্যার মান। N-এর পরে আছে Nটি সংখ্যা যেগুলো হল ছাত্রদের মার্ক। ছাত্ররা ০ থেকে ১০০ এর ভিতরেই মার্ক পেয়েছে।
সাবটাস্ক ১: 1<= N <= 1000, ৫০ পয়েন্টের জন্য।
সাবটাস্ক ২: 1<= N <= 100000, ৫০ পয়েন্টের জন্য।
Input Specification
The first line contains a positive integer T ( T <= 100 ), number of test case. In the following T lines, the first integer will be N, the number of students. After that N integers will follow which are the marks of students. A student will obtain mark between 0 and 100 inclusive.
Subtask 1: 1 <= N <= 1000, for 50 points.
Subtask 1: 1 <= N <= 100000, for 50 points.
আউটপুটের বর্ণনা
প্রতিটি কেসের জন্যে প্রথমে কেস এর মান প্রিন্ট দিতে হবে, তারপর দুইটি পূর্ণসংখ্যা যেটি হল কোন নাম্বারটি সবচেয়ে বেশি সংখ্যক ছাত্র পেয়েছে এবং কতজন ছাত্র ঐ নম্বরটি পেয়েছে। যদি এরকম দুইটি নাম্বার থাকে তাহলে বড়টি উত্তর হিসাবে দিতে হবে।
Output Specification
For each case print the case number, then two integers where first one is the number with maximum frequency and then the frequency of that marks. If several such outputs are possible, output the one with maximizes marks.
Sample
Input | Output |
---|---|
3 5 1 2 3 4 5 3 100 20 20 4 0 0 100 100 | Case 1: 5 1 Case 2: 20 2 Case 3: 100 2 |
Large input file. Use scanf/printf.