#include <iostream> using namespace std; int main() { int arr[100][100]{0}, n, i, j ,k, x, y, cnt=0; cin>>n; for(k=1;k<=n;k++) { cin>>x>>y; for(i=0;i<=9;i++) { for(j=0;j<=9;j++) { if(arr[x+j][y+i]==0) { arr[x+j][y+i]++; cnt++; } } } } cout<<cnt; return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter