Tanmoy1228's blog

By Tanmoy1228, history, 8 years ago, In English

can not understand the Editorial.(Second Part).

Problem : Gravity Tree

Editorial: Editorial

can any one help..........

Thanks in advance.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: Tree Edges Coloring

Can anyone give me the solution approach in details please.

Thanks in advance.

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: Pairs Forming LCM

can anyone give me any idea to solve the problem

with the mathematical proof.

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: 1846. GCD 2010

Verdict: WA

can not get the problem

please help someone

Code: CODE

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: Light OJ — Lining up Students

can anyone give me any idea

how can i solve this problem with Binary Index Tree or Segment Tree???

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: A simple task

can anyone give me any idea to solve the problem

with the mathematical proof

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: Walls of the North

can not understand the solution in editorial

can anyone give me any idea of solution in deails???

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: 610D - Vika and Segments

can not understand the solution in editorial

can anyone give me any idea of solution in deails???

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: 312B - Archer

can not understand the solution in editorial

can anyone give me any idea of solution in deails???

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem: 453A - Little Pony and Expected Maximum

can not understand the solution in editorial

can anyone give me any idea of solution in deails???

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

Problem:

A certain strange mathematician, Rasyak, considers a particular set of prime numbers beautiful. He also calls a composite number beautiful, if it is divisible by at least one prime number in his chosen set of beautiful primes. Given Rasyak’s set of M beautiful primes and an integer N, you have to find the number of beautiful numbers (both primes and composites) between 1 and N. For example, given a set of 2 beautiful primes, {2, 5}, there are 6 beautiful numbers between 1 and 10 (i.e. 2, 4, 5, 6, 8 and 10).

Input

The first line of the input gives the number of test cases, T (1 <= T <= 100). T test cases follow. Each will consist of one line containing a single integer M, followed by a line containing M space-separated prime numbers mi, followed by another line containing a single integer N.

1 <= M <= 25

1 <= mi <= 1000

1 <= N <= 2*10^9

Output

For each test case, output one line containing a single integer X, where X is the number of beautiful numbers between 1 and N.

Input

3

2
2 5
10

3
2 5 13
100

25
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
2000000000

Output

6

63

1759360857

How can i solve this problem???

any idea????

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By Tanmoy1228, history, 9 years ago, In English

can anyone give me any idea for this problem.

problem: Shil and Wave seqeunce

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By Tanmoy1228, history, 10 years ago, In English

can anyone give me any idea for this problem.

Problem: The Great Ball

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, history, 10 years ago, In English

Problem: Largest Rectangle in a Histogram

Verdict: WA

can not get the problem

please help someone

code: CODE

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, history, 10 years ago, In English

can anyone give me any idea for this problem.

Problem: Election Posters

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, 10 years ago, In English
  • Vote: I like it
  • -18
  • Vote: I do not like it

By Tanmoy1228, 10 years ago, In English

Problem: 295A - Greg and Array

can not understand this problem

please help someone

Full text and comments »

  • Vote: I like it
  • -16
  • Vote: I do not like it

By Tanmoy1228, 10 years ago, In English

Problem: 383A - Milking cows

can not understand this problem's editorial

please someone make it easily...

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it

By Tanmoy1228, 10 years ago, In English

Problem: 383A - Milking cows

can not understand this problem's editorial

please someone make it easily...

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, 10 years ago, In English

Problem: 158C - Команды cd и pwd

Verdict: WA

can not get the problem

please help someone

code: 10699164

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By Tanmoy1228, 10 years ago, In English

problem: (http://www.spoj.com/problems/MATSUM/)

code: (http://ideone.com/4cPZi4)

Verdict: WA

can not get why WA.

please help...

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it