Exemplo n.º 1
0
        static void Main()
        {
            var ss = new StreamScanner(new StreamReader(Console.OpenStandardInput()));
            var sw = new StreamWriter(Console.OpenStandardOutput())
            {
                AutoFlush = false
            };

            new Program().Solve(ss, sw);
            sw.Flush();
        }
Exemplo n.º 2
0
        void Solve(StreamScanner ss, StreamWriter sw)
        {
            //---------------------------------
            var A = ss.Next(int.Parse);
            var B = ss.Next(int.Parse);
            var C = ss.Next(int.Parse);
            var X = ss.Next(long.Parse);
            var Y = ss.Next(long.Parse);

            var ans = 0L;

            ans += Math.Min(A + B, C * 2) * Math.Min(X, Y);
            if (X > Y)
            {
                ans += Math.Min(A, C * 2) * (X - Y);
            }
            if (Y > X)
            {
                ans += Math.Min(B, C * 2) * (Y - X);
            }
            sw.WriteLine(ans);
            //---------------------------------
        }