Spot It!

saitama SCB-PA Inter School and C...
Limits 1s, 512 MB

Have you played the game Spot it!? Though there are many ways to play this game, the basic rule is the same for all - find the matching element between two cards.

In a classic deck of Spot it! there are 55 cards, each containing 8 different symbols. And there is a very interesting property. Any 2 cards have exactly one symbol in common.

This makes many people wonder: how many symbols are sufficient to make those 55 cards?

Let us be more generic and find out:
How many symbols are sufficient to make a deck of N cards?
So that in a deck of N cards:

  • All cards contain the same number of symbols.
  • Any 2 of the cards has exactly 1 symbol in common.
  • Each card has more than 1 symbol and
  • All symbols in a single card are different.


An integer $T$ ($1 \le T \le 100$) denoting the number of test cases to follow.

Each of the next T lines will have an integer $N$ ($1 \le N \le 10^4$).


For each test case, print the minimum number of symbols required in a new line.




Login to submit.


12% Solution Ratio
AmsiamEarliest, Apr '20
AmsiamFastest, 0.0s
AmsiamLightest, 0 B
Yasir_ArafatShortest, 335B
Toph uses cookies. By continuing you agree to our Cookie Policy.