2579.cpp (104B)
1 class Solution { 2 public: 3 long long coloredCells(int n) const { return 1 + 2ll * n * (n - 1); } 4 };