Question
pLEASE CODE IN JAVA The Girls in Tech Hackathon is a code-a-thon where developers, designers, scientists, students, entrepreneurs and educators gather to collaborate on projects
pLEASE CODE IN JAVA
The Girls in Tech Hackathon is a code-a-thon where developers, designers, scientists, students, entrepreneurs and educators gather to collaborate on projects including applications, software, hardware, data visualization and platform solutions.
The Participants are sitting around a round table, and they are numbered from team 1 to team n in the clockwise direction.This means that the Participant are numbered 1,2...,n-1,n and participants 1 and n are sitting next to each other. After the Hackathon duration, judges started reviewing the performance of each participant. However, some of participants haven't finished the project. Each participant i needs ti extra minutes to complete their Project.
Judges started reviewing the projects sequentially in the clockwise direction, starting with team x, and it takes them exactly 1 minute to review each project. This means the team x gets no extra time to work, whereas team x+1 gets 1 min more to work and so on. Even if the project is not completed by participant, but still the judges spend 1 min to understand the idea and rank the participant.
Input Format: The first line contains a single positive integer, n, denoting the number of participants in the hackathon. given the values of t1, t2, t3.. tn extra time requires by each participant to complete the project.You have to guide judges in selecting the best team x to start reviewing the project so that number of participants able to complete their projects are maximal.
Output Format: Print x on a new line. If there are multiple such teams, select the smallest one.
Constraints: 1<=n<=9*10^5 0<=ti<=n
Sample Input: 3 1 0 0 Sample Output: 2
Description: Entire hackathon has 3 teams if x =1 then only 2 teams will finish. The first team needs 1 extra minute to complete their project. If judges starts reviewing here, this team will never finish their project. teams 2 and 3's project are already finished, so their projects are ready when judges review them in the second and third minutes.
if x=2 and x=3 then all 3 teams can complete their project as x=2 is smallest then return x=2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started