#include <iostream>
using namespace std;
int main(){
unsigned long long int n, m, s;
cin >> n >> m;
s=4+(n-1)*3+(m-1)*3+(n*m-n-m+1)*2;
cout<<s;
}
Должно работать
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main(){
unsigned long long int n, m, s;
cin >> n >> m;
s=4+(n-1)*3+(m-1)*3+(n*m-n-m+1)*2;
cout<<s;
}
Должно работать