#include<stdio.h> int func(int n) { int sum;int a1;int an; a1=2; an=2+(n-1)*3; sum=n*(a1+an)/2; return sum; } int main() { int n; while(scanf("%d",&n)!=EOF) { printf("%d\n",func(n)); } return 0; }
#include<stdio.h> int func(int n) { int sum;int a1;int an; a1=2; an=2+(n-1)*3; sum=n*(a1+an)/2; return sum; } int main() { int n; while(scanf("%d",&n)!=EOF) { printf("%d\n",func(n)); } return 0; }