Skip to content

Mirko at construction site (python,cpp,java) #109

Open

Description

@ArmanKumar21

Mirko is monitoring a construction site. He monitors buildings enumerated from to , starting from the left. For each building, he knows the current number of floors and the number of floors built on each day. He needs to know the answer to queries. The answer to each query is the index of the tallest building after days, as defined by the query. Your task is to help Mirko find the answers to these queries.

Input Format

The first line consists of the numbers and . The second line consists of integers, where the integer represents the initial height of the building. The third line consists of integers, where the integer represents the number of floors erected in one day for the building. The following lines consist of the integer, , representing the day in the query.

Output Format

For each query, output one number which represents the index of the tallest building after days. If there is more than one building, output the building with the greatest index in the input array (with indexes starting at 1).

Constraints:
-> 1<= N<= 10^5
-> 1<= Q<= 10^5

Every other integer in the input will fit in a 32-bit signed integer. And they will be non-negative integers.
Sample Input

3 6
7 5 1
1 2 3
0
1
2
3
4
5
Sample Output

1
1
2
2
3
3

Activity

  1. Sakshi2002-Sinha commented on Oct 15, 2022

    @Sakshi2002-Sinha
    Contributor

    Heyy @anomekumar08 Can you please assign me this issue?

  2. ArmanKumar21 commented on Oct 15, 2022

    @ArmanKumar21
    OwnerAuthor

    I have already assigned you two issue...When your both pr will get merged after verifying then I will assign you next issue.

  3. Sakshi2002-Sinha commented on Oct 15, 2022

    @Sakshi2002-Sinha
    Contributor

    I have already assigned you two issues...When your both pr will get merged after verifying then I will assign you next issue.

    okay.
    I have already completed the other two assigned issues.
    how about you assign this also :)

  4. ArmanKumar21 commented on Oct 15, 2022

    @ArmanKumar21
    OwnerAuthor

    Okk...I have assigned you @Sakshi2002-Sinha

  5. ArmanKumar21 commented on Oct 15, 2022

    @ArmanKumar21
    OwnerAuthor

    Hey! @Sakshi2002-Sinha ..you can join me on discord -> @AmanPandey#8132

  6. Sakshi2002-Sinha commented on Oct 15, 2022

    @Sakshi2002-Sinha
    Contributor

    Hey! @Sakshi2002-Sinha ..you can join me on discord -> @AmanPandey#8132

    Sure!

  7. Ashwin-5100 commented on Oct 29, 2022

    @Ashwin-5100

    Helllo Sir ,
    Can you please assign me this task

  8. Abhigitlog commented on Aug 31, 2023

    @Abhigitlog

    Good morning ,
    We are a team of 3 members from St Francis Institute of Technology (Mumbai , Maharashtra).
    For our Resource open source project Lab (ROSPL) , we are interested to work on the given issue.
    Kindly assign this (Mirko at construction site) issue to us .
    Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions