## poj3734

maksyuki 发表于 oj 分类，标签:

Blocks

Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of painting. Suppose there are N blocks in a line and each block can be paint red, blue, green or yel >>继续阅读

## poj3233

maksyuki 发表于 oj 分类，标签: ,

Matrix Power Series

Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.

Input

The input contains exactly one test case. The first line of input contains three positive integers n (n ≤ 30), k (k ≤ 109) and  >>继续阅读

## hdu4549

maksyuki 发表于 oj 分类，标签: ,

M斐波那契数列

Problem Description

M斐波那契数列F[n]是一种整数数列，它的定义如下：

F = a

F = b >>继续阅读

## lightoj1131

maksyuki 发表于 oj 分类，标签:

1131 - Just Two Functions

Find fn % M and gn % M. (% stands for the modulo operation.)Let fn = a1 * fn-1 + b1 * fn-2 + c1 * gn-3 gn = a2 * gn-1 + b2 * gn-2 + c2 * fn-3

Input

Input starts with an integer T (≤ 50), denoting the number of test cas >>继续阅读

## lightoj1070

maksyuki 发表于 oj 分类，标签:

1070 - Algebraic Problem

InputGiven the value of a+b and ab you will have to find the value of an+bna and b not necessarily have to be real numbers.

Input starts with an integer T (≤ 10000), denoting the number of test cases.

Each case contai >>继续阅读