# 2020 Multi-University Training Contest 5---- HDU--6814、Tetrahedron （数学，推式子）

V = 1 6 a b c = 1 3 S h V=\dfrac{1}{6}abc=\dfrac{1}{3}Sh

1 h 2 = 1 a 2 + 1 b 2 + 1 c 2 \dfrac{1}{h^2}=\dfrac{1}{a^2}+\dfrac{1}{b^2}+\dfrac{1}{c^2}

E ( 1 h 2 ) = 3 ∗ E ( 1 a 2 ) E(\dfrac{1}{h^2})=3*E(\dfrac{1}{a^2})

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
#include<bitset>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<set>
#include<ctime>
#define ui unsigned int
#define ll long long
#define llu unsigned ll
#define ld long double
#define pr make_pair
#define pb push_back
//#define lc (cnt<<1)
//#define rc (cnt<<1|1)
#define len(x)  (t[(x)].r-t[(x)].l+1)
#define tmid ((l+r)>>1)
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)>(y)?(y):(x))
using namespace std;

const int inf=0x3f3f3f3f;
const ll lnf=0x3f3f3f3f3f3f3f3f;
const double dnf=1e18;
const double alpha=0.75;
const int mod=998244353;
const double eps=1e-8;
const double pi=acos(-1.0);
const int hp=13331;
const int maxn=6000100;
const int maxm=100100;
const int maxp=100100;
const int up=1100;

ll inv[maxn],sum[maxn];

int main(void)
{
inv[1]=1;
sum[1]=3*inv[1]*inv[1];
for(int i=2;i<maxn;i++)
{
inv[i]=(mod-mod/i)*inv[mod%i]%mod;
sum[i]=(sum[i-1]+3*inv[i]*inv[i])%mod;
}
int tt,n;
scanf("%d",&tt);
while(tt--)
{
scanf("%d",&n);
printf("%lld\n",sum[n]*inv[n]%mod);
}
return 0;
}


• 点赞
• 评论
• 分享
x

海报分享

扫一扫，分享海报

• 收藏
• 手机看

分享到微信朋友圈

x

扫一扫，手机阅读

• 打赏

打赏

_Shmily

你的鼓励将是我创作的最大动力

C币 余额
2C币 4C币 6C币 10C币 20C币 50C币
• 一键三连

点赞Mark关注该博主, 随时了解TA的最新博文
10-24