#P8938. [DTOI 2023] A. 小狗哥哥

[DTOI 2023] A. 小狗哥哥

Background

luanmenglei has a glorious present: all the girls in his class call him Yi-jiang.

But who would have thought that luanmenglei has a sad past: his five-year-old younger brother used to call him Big Brother Puppy.

Problem Description

All parameters below are integers by default.

As a game developer (of 7k7k mini-games), you designed the following game (so crude that it is not even as good as Big Brother Puppy’s kindergarten graduation project). It has two elements:

  1. An enemy creature with health mm.
  2. The protagonist’s weapon, which has nn levels. The damage of level ii is i×pi \times p.

The game balance needs to be planned in advance, so you also have a sequence {an}\{a_n\}, defined as follows:

  • aia_i means the enemy creature will die after being hit exactly aia_i times by the level ii weapon.

Unfortunately, you forgot what pp exactly is, so you need to find the number of all possible values of pp.

If there can be infinitely many values of pp, output xiaogougege.

Input Format

The first line contains two positive integers n,mn, m.

The second line contains nn positive integers, representing the sequence {an}\{a_n\}.

Output Format

Output one line containing one integer, the number of possible values of pp, or the string xiaogougege. Its meaning is described in the statement.

3 3
3 2 1
1

Hint

Sample 1 Explanation

When the weapon is level 11, analysis shows that pp must satisfy 1p<321 \leq p < \frac{3}{2}.
When the weapon is level 22, analysis shows that pp must satisfy 34p<32\frac{3}{4} \leq p < \frac{3}{2}.
When the weapon is level 33, analysis shows that pp must satisfy 1p1 \leq p.

Also, pp is an integer. Therefore, only p=1p = 1 satisfies the conditions in the statement.

Sample 2

See game/game2.in and game/game2.out in the additional files.

This sample meets the constraints of test points 132013 \sim 20.

Constraints and Hints

For all testdata, it is guaranteed that 1n1051 \leq n \leq 10^5 and 1ai,m1091 \leq a_i, m \leq 10^9.

The detailed constraints for each test point are shown in the table below:

Test Point ID nn \leq m,aim, a_i \leq Special Property
191 \sim 9 10510^5 10910^9 The testdata is purely random
101210 \sim 12 33 55 None
132013 \sim 20 10510^5 10910^9

Note that the specific generator code for the purely random testdata is as follows:

#include <bits/stdc++.h>
using namespace std;

int n, m, w;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int rand(int l, int r) {
  assert(l <= r);
  return uniform_int_distribution<>(l, r)(rng);
} 

int main() {
  scanf("%d%d%d", &n, &m, &w);
  printf("%d %d\n", n, m);
  for (int i = 1; i <= n; i ++) printf("%d%c", rand(1, w), " \n"[i == n]);
  return 0;
}

Simply put, for given n,m,w(w109)n, m, w (w \leq 10^9), the generator randomly generates nn numbers in the range [1,w][1, w] as {an}\{a_n\}.

Translated by ChatGPT 5