This commit is contained in:
fzorb 2025-05-08 18:42:16 +03:00
parent 292c95eaca
commit 053fb458ce
2 changed files with 21 additions and 0 deletions

3
.gitignore vendored
View file

@ -252,3 +252,6 @@ dkms.conf
a.out a.out
*.swp *.swp
a.exe
*.in
*.out

18
390/solutie.cpp Normal file
View file

@ -0,0 +1,18 @@
#include <fstream>
using namespace std;
ifstream fin("planta.in");
ofstream fout("planta.out");
int main() {
int d,a,b,n,i;
fin >> d >> a >> b >> n;
int z = n / 2;
d = d + a * z - b * z;
if (n % 2 == 1) {
d = d + a;
}
fout << d;
return 0;
}