Тръби в басейн . Междинен тест 26 Март (Judge ми дава 20/100 и нямам идея защо, проверих официалното решение, но пак не намирам разлика.)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pipes_in_pool
{
class Program
{
static void Main(string[] args)
{
var vPool = int.Parse(Console.ReadLine());
var p1 = int.Parse(Console.ReadLine());
var p2 = int.Parse(Console.ReadLine());
var time = double.Parse(Console.ReadLine());
var vPipes = (p1 * time) + (p2 * time);
var pipeOnePercent = (p1 * time) / vPipes * 100;
var pipeTwoPercent = (p2 * time) / vPipes * 100;
var vFullPool = vPipes / vPool * 100;
var overflow = vFullPool - vPool;
var pipeTwoPercentExact = pipeTwoPercent - (pipeTwoPercent / 100);
if (vPipes <= vPool)
{
Console.WriteLine($"The pool is {Math.Round(vFullPool)}% full. Pipe 1: {Math.Round(pipeOnePercent)}%. Pipe 2: {Math.Round(pipeTwoPercentExact)}%.");
}
else if (vPipes > vPool)
{
Console.WriteLine($"For {time} hours the pool overflows with {overflow} liters.");
}
}
}
}
///////////////////////////////////////////////////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Условие - http://prntscr.com/as5e9e
Официалното решение - http://pastebin.com/zDNJV8Kp