Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- int main()
- {
- unsigned long long int d,a,b,n;
- ifstream f("planta.in");
- f>>d>>a>>b>>n;
- f.close();
- unsigned long long int h=d+(a-b)*(n/2);
- if(n%2==1)
- h+=a;
- ofstream g("planta.out");
- g<<h<<'\n';
- g.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement