Sequential vs Parallel Time (Simulation)

JavaScript Medium 3 views
Back to Questions

Problem Description

You have n task durations. If done sequentially, total is sum. If done in parallel with unlimited workers, total is max. Print both totals.

Input Format

Line1: n. Line2: n integers durations.

Output Format

Two integers: sequential parallel.

Sample Test Case

Input:
5 3 2 4 1 2
Output:
12 4

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next