#include <iostream> #include <string> #include <algorithm> using namespace std; // 1 3 // 2 6 // 3 6 int main() { int t; while (cin >> t) { int a[4] = { 0, 3, 6, 6 }; if (t <= 3) cout << a[t] << endl; else { cout << 3 * 2 * (t - 3) * 3 << endl; } } return 0; } |
Double click to view unformatted code.