GCD Plus LCM

In this problem you will be given two integers a, b. You have to answer if GCD(a, b) + LCM(a, b) = a...

Magic Number

Jack loves to play with numbers. One day, while he was playing with numbers he found something inter...

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...

Karim Meets Gollum

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

N-th Prime

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

Correct the Sieve

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

Omae Wa Mou Shindeiru

Itachi and Sasuke are trying to beat Kabuto, the caster of an awesome magical spell (or you can say ...

Unique Relief

Thanos has now figured out how to visit all the houses in the flood-affected area. However, now he h...

Jhamela, Once Again

You are given n positive integers as an array. Also, you are given an integer k. Now, try to find a ...

Love Letters!

Lately Fahim is getting a lot of love letters. A LOT of love letters. Since he is confused about whi...

Playing With Aladdin

Aladdin is a fictional character and the titular protagonist of Walt Disney Pictures’ 31st animated ...

Life of Phi

The Great Khami is learning Number Theory. He is very excited to know that Euler’s Totient Function ...

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...

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 ...

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...

Fast Co-Prime

Two numbers A and B are called co-prime if the only common positive factor of the two numbers is 1. ...

Meera and Solo Chocolates

Meera bought candies from the store. She is now going to distribute those among her N friends. She m...

Co-Prime Enemy Pair

Two integers A and B are known as co-prime or relatively prime if their greatest common divisor GCD ...