Cod sursa(job #2970546)
Utilizator | Data | 25 ianuarie 2023 15:06:21 | |
---|---|---|---|
Problema | Inundatii | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("inundatii.in");
ofstream fout("inundatii.out");
int n , x , y , z , lx , ly , lz ;
long long ans;
int main()
{
fin >> n >> lx >> ly >> lz;
for(int i = 1 ; i < n ; ++ i){
fin >> x >> y >> z;
x -= i , y -= i , z -= i;
ans = ans + lx + ly + lz - x - y - z;
}
fout << ans << '\n';
return 0;
}