日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
KillDemodogs——c++——pow-創(chuàng)新互聯(lián)
題目描述

Demodogs from the Upside-down have attacked Hawkins again. El wants to reach Mike and also kill as many Demodogs in the way as possible.

成都創(chuàng)新互聯(lián)是少有的網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站制作、營(yíng)銷型企業(yè)網(wǎng)站、小程序制作、手機(jī)APP,開發(fā)、制作、設(shè)計(jì)、賣友情鏈接、推廣優(yōu)化一站式服務(wù)網(wǎng)絡(luò)公司,2013年開創(chuàng)至今,堅(jiān)持透明化,價(jià)格低,無套路經(jīng)營(yíng)理念。讓網(wǎng)頁(yè)驚喜每一位訪客多年來深受用戶好評(píng)

Hawkins can be represented as an?n \times nn×n?grid. The number of Demodogs in a cell at the?ii?-th row and the?jj?-th column is?i \cdot ji?j?. El is at position?(1, 1)(1,1)?of the grid, and she has to reach?(n, n)(n,n)?where she can find Mike.

The only directions she can move are the right (from?(i, j)(i,j)?to?(i, j + 1)(i,j+1)?) and the down (from?(i, j)(i,j)?to?(i + 1, j)(i+1,j)?). She can't go out of the grid, as there are doors to the Upside-down at the boundaries.

Calculate the maximum possible number of Demodogs?\mathrm{ans}ans?she can kill on the way, considering that she kills all Demodogs in cells she visits (including starting and finishing cells).

Print?2022 \cdot \mathrm{ans}2022?ans?modulo?10^9 + 7109+7?. Modulo?10^9 + 7109+7?because the result can be too large and multiplied by?20222022?because we are never gonna see it again!

(Note, you firstly multiply by?20222022?and only after that take the remainder.)

輸入格式

Each test contains multiple test cases. The first line contains the number of test cases?tt?(?1 \leq t \leq 10^41≤t≤104?). Description of the test cases follows.

The first line of each test case contains one integer?nn?(?2 \leq n \leq 10^92≤n≤109?) — the size of the grid.

輸出格式

For each test case, print a single integer — the maximum number of Demodogs that can be killed multiplied by?20222022?, modulo?10^9 + 7109+7?.

題意翻譯

給定一個(gè)數(shù)nn,表示有一個(gè)?n \times nn×n?的方格。每個(gè)格子里都有一個(gè)數(shù),第?ii?行第?jj?列的格子值為?i?ji?j。現(xiàn)在Hawkins要從?(1,1)(1,1)?走到?(n,n)(n,n),每次只能從?(i,j)(i,j)?走到?(i,j+1)(i,j+1)?或?(i+1,j)(i+1,j), 每走到一個(gè)格子就能獲得格子中的一個(gè)數(shù),大化數(shù)字之和。

輸入格式

每個(gè)測(cè)試點(diǎn)包含多個(gè)測(cè)試樣例。第一行包含測(cè)試樣例的數(shù)量?tt, 接下來?tt?行每行一個(gè)數(shù)?nn。表示有?nn?行和?nn?列。

輸出格式

共?tt?行,每行一個(gè)數(shù),表所經(jīng)過的格子乘 2022 后除以?10^9 + 7109+7?的余數(shù)。

輸入輸出樣例

輸入 #1復(fù)制

4
2
3
50
1000000000

輸出 #1復(fù)制

14154
44484
171010650
999589541
說明/提示

In the first test case, for any path chosen by her the number of Demodogs to be killed would be?77?, so the answer would be?2022 \cdot 7 = 141542022?7=14154?.

題解
#importusing namespace std;
#define int long long
int p[4000040];
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
int ksm(int a,int b,int mod)
{
	int res=1;
	while(b)
	{
		if(b&1)
		res=res*a,res%=mod;
		a=a*a%mod;
		b>>=1;
	}
	return res;
}
int sum[20000020];
const int mod=1e9+7;
signed main() 
{
	int T;
	cin>>T;
	while(T--) 
    {
		int n;
		cin>>n;
		int ans=n*(n + 1)%mod*(4*n - 1)%mod*ksm(6,mod-2,mod)%mod;
		cout<

你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧


網(wǎng)站題目:KillDemodogs——c++——pow-創(chuàng)新互聯(lián)
本文地址:http://www.dlmjj.cn/article/djdghh.html