N-th Prime

In this problem, you will have to print the n-th prime number. The first few prime numbers are given...

Exponential Growth

You will be given two integers X and N, you have to calculate XN modulo 1000000007.

I Did Not Do the Assignment

Professor Petr is very angry over some of his students now-a-days for not doing assignment. He wants...

Easy Prime!

There are N numbers in an array. You will have Q queries. In each query, you can make 2 operations. ...

Prime Range

Prime Numbers are such numbers which are only divided by 1 and the number itself. 2, 3, 5, 7, 11, 13...

Is It a Perfect Square?

Given some numbers, can you tell, if the product of these numbers are a perfect square or not? A num...

Correct the Sieve

Sieve of Eratosthenes is a fast algorithm for finding prime numbers in larger ranges. According to W...

Left Prime

Prime numbers are the ones which can only be divided by 1 and the number itself. 2, 3, 5, 7, 11, 13 ...

Sofdor Ali and the Puzzle of Weights

Sofdor Ali is one of the most famous scientists of Bangladesh. He is also well known for his puzzle ...

Laali Vs Bessie

One day Raju discovered USACO and from that day he would spend all his time solving problems. Laali ...

Relatively Prime

Given a positive integer N, determine how many of the integers between 1 and N are co-prime with N. ...

Perfect Points

Perfect lines are the lines y=mx+c such that m and c are positive integers. Perfect points are the p...

Karim Meets Gollum

After hearing about Bilbo’s Ring that he found in the Misty Mountains, Karim the Hobbit decided to e...

Largest Prime

A positive integer number n is called a prime number, if it is only divisible by 1 and n itself, whe...

Zacob The Batsman

It’s known that Zacob is a reliable batsman of LU CSE Cricket Team. Also as long as he is on the cre...

The Greedy Mathematician

Once upon a time, there lived a man called Mahi the mathematician. He was banned from his kingdom be...

Arrange the Bricks!

You have N bricks two dimensional bricks of the dimension 1 \times 2. The bricks are rotatable i.e. ...

Birthday Gift for SJ

Today is your best friend SJ’s birthday. You want to buy a birthday present for her. You want to buy...

Magician's Offer!

Rosi Vidmun is a greedy landlord who likes to grab as much land as he can. Currently he has P square...

Equation Equals Hazards

You are given the equation, GCD(A,M) = 1. You have to determine whether there exists at least one in...