/ XMU_ACM / 题库 /

E

E

Description

设 \(A=(\frac{3+\sqrt{5}}{2})^n, B=1004535809\)。
请计算:\(\left \lfloor A \right \rfloor\ mod\ B\)

(\(\left \lfloor A \right \rfloor\)表示向下取整)

Format

Input

第一行一个整数\(T(T \leq 10^5)\)代表数据组数
接下来\(T\)行,每一行包含一个整数\(n(0 \leq n \leq 10^{18})\),含义如题意

Output

\(T\)行按顺序输出所要求的答案

Sample 1

Input

3
0
31
46628530146249129

Output

1
283568813
691291102

Limitation

1s, 256Mb for each test case.

Hint

Free Pascal Code

var a,b:longint;
begin
    readln(a,b);
    writeln(a+b);
end.

C Code

#include <stdio.h>
int main(void)
{
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d\n", a + b);
    return 0;
}

C++ Code

#include <iostream>
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
    return 0;
}

Python Code

a, b = [int(i) for i in raw_input().split()]
print(a + b)

Java Code

import java.io.*;
import java.util.Scanner;

public class Main {

    /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(a + b);
    }
}

Source

Vijos Original

信息

难度
(无)
分类
(无)
标签
(无)
递交数
0
已通过
0
通过率
?
上传者