Created
December 3, 2014 03:53
-
-
Save nakaji/c3d9febce365e680f52e to your computer and use it in GitHub Desktop.
paizaオンラインハッカソン4 Lite ミッション2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Hello{ | |
public static void Main(){ | |
// 自分の得意な言語で | |
// Let's チャレンジ!! | |
var line = int.Parse(System.Console.ReadLine()); | |
long total = 0; | |
for (var i=0; i<line; i++) | |
{ | |
var buf = System.Console.ReadLine().Split(' '); | |
var needs = int.Parse(buf[0]); | |
var current = int.Parse(buf[1]); | |
var amount = int.Parse(buf[2]); | |
if (current < needs) | |
{ | |
total += (needs - current) * amount; | |
} | |
} | |
System.Console.WriteLine("{0}", total); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment