#P4176. [HNOI2006] 花仙子的魔法

[HNOI2006] 花仙子的魔法

Description

Legend says that in the primordial era when heaven and earth first formed, there was only one kind of flower in the world, called “Yuan” (yuan). Later, a Flower Fairy with magic appeared. She could add attributes to flowers, and from then on “Yuan” kept mutating, giving rise to countless diverse flowers. It is said that the Flower Fairy can exist in two-dimensional space (plane), three-dimensional space (solid), and even nn-dimensional space (imagination). A point in two-dimensional space can be represented by the vector (x1,x2)\left(x_1,x_2\right), a point in three-dimensional space by (x1,x2,x3)\left(x_1,x_2,x_3\right), and in general, a point in nn-dimensional space by (x1,x2,,xn)\left(x_1,x_2,\cdots,x_n\right). The distance between two points (x1,x2,,xn)\left(x_1,x_2,\cdots,x_n\right) and (w1,w2,,wn)\left(w_1,w_2,\cdots,w_n\right) in nn-dimensional space is defined as i=1n(XiWi)2\sqrt{\sum_{i=1}^{n}(X_i-W_i)^2}.

In nn-dimensional space, every time the Flower Fairy performs magic, she chooses a reference point (w1,w2,,wn)\left(w_1,w_2,\cdots,w_n\right) and an action radius rr, and both the position of the reference point and the size of the radius can be chosen arbitrarily. At this time, all flowers in nn-dimensional space whose distance to the reference point (w1,w2,,wn)\left(w_1,w_2,\cdots,w_n\right) is less than rr will be affected by this spell. Each spell gives different attributes to the affected flowers, and the effects can be stacked.

In general, if the Flower Fairy performs mm spells in total, then the attributes of the flower located at any point in nn-dimensional space can be described by a binary string of length mm, (a1,a2,,an)\left(a_1,a_2,\cdots,a_n\right). For 1im1 \le i \le m, if the flower is affected by the ii-th spell, then aia_i is 11; otherwise aia_i is 00. Obviously, different attributes correspond to different kinds of flowers. The problem is: after the Flower Fairy performs mm spells in nn-dimensional space, what is the maximum number of different kinds of flowers she can obtain?

Input Format

Contains two integers separated by a space. The first integer mm is the number of spells performed, and the second integer nn is the dimension of the space. Constraints: 1m1001 \le m \le 100, 1n151 \le n \le 15.

Output Format

Output one line with a single integer representing the answer.

3 1
6

Hint

Translated by ChatGPT 5