GO Solution For UVa 362 - 18,000 Seconds Remaining. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

A feature of many file transfer programs is the ability to estimate the amount of time remaining in the transfer. These programs estimate the time remaining based on the number of bytes left to be transferred and the rate of transfer in previous seconds. You are to write a program to simulate this b

...

You can find the full details of the problem 18,000 Seconds Remaining at UVa Online Judge

Sample Input

100
10
20
20
0
10
0
10
0
10
0
20
200
60
30
100
10
50
5
5
5
5
25
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0

Sample Output

Output for data set 1, 100 bytes:
   Time remaining: 4 seconds
   Time remaining: 5 seconds
Total time: 11 seconds

Output for data set 2, 200 bytes:
Total time: 4 seconds

Output for data set 3, 50 bytes:
   Time remaining: 1 seconds
   Time remaining: stalled
   Time remaining: stalled
   Time remaining: 0 seconds
Total time: 20 seconds

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985