Task Manager X42792


Statement
 

pdf   zip

html

Input

The input will consist of two lines The first line contains the names of the problems The second line contains integers with the time needed to evaluate the problem. Each number corresponds to a unique problem.

> Both lines must have the same size

Output

The output should be a list of problems sorted by priority with the time they had to wait and the total time waited.

> NOTE: in case two problems have the same priority, sort in the order they were read from input.

Public test cases
  • Input

    Task1 Task2
    3 2
    

    Output

    Task2 wait time: 2
    Task1 wait time: 5
    Total time waited: 7
    
  • Input

    Prob1 Prob2 Prob3 Prob4
    3 1 1 2
    

    Output

    Prob2 wait time: 1
    Prob3 wait time: 2
    Prob4 wait time: 4
    Prob1 wait time: 7
    Total time waited: 14
    
  • Input

    A B C D E F G H I J K L
    9 2 5 3 1 1 4 10 3 5 4 3
    

    Output

    E wait time: 1
    F wait time: 2
    B wait time: 4
    D wait time: 7
    I wait time: 10
    L wait time: 13
    G wait time: 17
    K wait time: 21
    C wait time: 26
    J wait time: 31
    A wait time: 40
    H wait time: 50
    Total time waited: 222
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    C++ Python
    User solutions
    C++ Python