#P8622. [蓝桥杯 2014 国 B] 生物芯片
[蓝桥杯 2014 国 B] 生物芯片
Problem Description
Dr. X is studying a kind of biochip whose logic density and capacity are far higher than ordinary semiconductor chips.
The doctor designs tiny light sources on the chip. Each time a light source is operated once, its state changes: on turns to off, or off turns to on.
These light sources are numbered from to . At the beginning, all light sources are off.
Dr. X plans to perform the following actions on the chip:
Operate once on all light sources whose indices are multiples of , that is, turn on the light sources with indices .
Operate once on all light sources whose indices are multiples of , that is, operate on the light sources with indices . Note that at this time, light source is turned off again.
Operate once on all light sources whose indices are multiples of .
...
Continue until operating once on all light sources whose indices are multiples of .
Dr. X wants to know: after these operations, which light sources in a certain interval are on.
Input Format
Three integers separated by spaces: , , . ()
is the number of light sources, is the left boundary of the interval, and is the right boundary of the interval.
Output Format
Output one integer, which is the number of light sources that are on in the interval after all operations.
5 2 3
2
10 3 6
3
Hint
Translated by ChatGPT 5