|
|
back to boardDo you wanna know what is WA5? Posted by Hikmat 20 Aug 2011 14:56 Answer: Start Volume Number > Stop Volume Number You assume that worm start at lower volume and stops at higher volume but DO NOT. Here is a code in C#: using System; class Program { static void Main() { string[] ss = Console.ReadLine().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); int Thickness = int.Parse(ss[0]); int CoverThickness = int.Parse(ss[1]); int Start = int.Parse(ss[2]); int Finish = int.Parse(ss[3]); int route = Math.Abs((Finish - Start - 1) * (Thickness + 2 * CoverThickness) + 2 * CoverThickness); Console.WriteLine(route); } } |
|
|