Create a gist now

Instantly share code, notes, and snippets.

@cs3238-tsuzu /1.cpp
Last active Dec 11, 2016

What would you like to do?
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