CSES – Two Knights

數學

#include<bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define f first
#define s second
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
using namespace std;
//declare
int t;
//
signed main(){
    fastio;
    cin>>t;
    cout<<0<<"\n"; //x = 1
    for(int i=2;i<=t;i++){
        cout<<(i*i) * (i*i-1) / 2 - (4 * (i-2) * (i-1))<<"\n";
    }
    return 0;
}

相關文章

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *