Skip to content

Instantly share code, notes, and snippets.

@fredbr

fredbr/piso.cpp Secret

Created May 21, 2018 20:40
Show Gist options
  • Save fredbr/e2784deefd9f5b9413b3783648b5e756 to your computer and use it in GitHub Desktop.
Save fredbr/e2784deefd9f5b9413b3783648b5e756 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int x, y;
cin >> x >> y;
// numero de pisos do tipo 1
int ar = x*y + (x-1)*(y-1);
// numero de pisos do tipo 2
int per = 2*(x + y - 2);
cout << ar << "\n";
cout << per << "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment