Ching North Academy 2017NOIP Winter School Entrance Test P4744 a ' s problem (a)

Source: Internet
Author: User

P4744 A ' s problem (a)Time: 1000ms/Space: 655360kib/java class name: main background

Winter School Entrance test, every three days to settle the results. Participate in benefits

Describe

This is a subject of background, small A is also a person with a story. But unfortunately the paper is too small, small a can not tell the story in detail to everyone. Maybe small a himself also can not tell his own story, because if it is clear, there is no such a problem ...

The problem with small A is this, it found n different jobs, I work every month to have AI wages, each job needs a small a 8 hours a day, work 7 days a week. Little A would like to know the number of jobs with the highest cost performance (one months ' wages divided by the total length). If there are multiple copies, the output number is the smallest.

Input format

The first row is a number n, which indicates that there is n job.

The next n number represents AI.

Output format

Output a number to indicate the answer.

Note

Input sample

5

3 3 4) 5 5

Output sample

4

Data range

For data n<=100,1<=ai<=1000 of 100%.

Because each job looks and so on, so cost-effective = wages/hours only see wages. So this method is the first to find the largest number in the past

#include <cstdio>using namespacestd;intn,maxn,ans,x;intMain () {scanf ("%d",&N);  for(intI=1; i<=n;i++) {scanf ("%d",&x); if(x>MAXN) {MAXN=x; Ans=i; }} printf ("%d", ans); return 0;}

Ching North Academy 2017NOIP Winter School Entrance Test P4744 a ' s problem (a)

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.