Last active
December 11, 2016 13:47
-
-
Save tsuzu/2290cd20f9dc39d451e8a4ca92e05e06 to your computer and use it in GitHub Desktop.
JOI 2017 Yo 1st
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
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
#include <vector> | |
#include <functional> | |
#include <queue> | |
#include <cmath> | |
#include <cstring> | |
int main() { | |
int a, b, c, d, e; | |
std::cin >> a >> b >> c >> d >> e; | |
if(a < 0) { | |
std::cout << c * (0 - a) + d + e * b << std::endl; | |
}else { | |
std::cout << e * (b - a) << std::endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment