Skip to content

Instantly share code, notes, and snippets.

@tsuzu
Last active December 11, 2016 13:47
Show Gist options
  • Save tsuzu/2290cd20f9dc39d451e8a4ca92e05e06 to your computer and use it in GitHub Desktop.
Save tsuzu/2290cd20f9dc39d451e8a4ca92e05e06 to your computer and use it in GitHub Desktop.
JOI 2017 Yo 1st
#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