The problem number is 148A-"Insomnia Cure", i can not understand the problem...

# | User | Rating |
---|---|---|

1 | Um_nik | 3459 |

2 | tourist | 3438 |

3 | maroonrk | 3359 |

4 | ecnerwala | 3347 |

5 | Benq | 3317 |

6 | ksun48 | 3309 |

7 | boboniu | 3300 |

8 | Petr | 3293 |

9 | Radewoosh | 3289 |

10 | TLE | 3223 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 206 |

2 | Monogon | 195 |

3 | SecondThread | 191 |

4 | pikmike | 187 |

5 | antontrygubO_o | 186 |

6 | vovuh | 184 |

7 | Ashishgup | 182 |

8 | Um_nik | 181 |

9 | Radewoosh | 169 |

10 | pashka | 167 |

The problem number is 148A-"Insomnia Cure", i can not understand the problem...

↑

↓

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/24/2020 02:38:28 (h3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

In simpler words you will be given k, l, m, n and d as inputs. now you need to count the numbers starting from 1 and ending at d, which are divisible by atleast one of k,l,m,n;

Explanation of sample input 1 :

here d=12, so you need to count numbers from 1,2,3,.....,12 which are divisible by atleast one of (1,2,3,4). You can observe that count = 12.

Thank you,achaitanyasai! It was very helpful.

My pleasure :)

But why do we have to count like that , can you clearly explain how did you figure out why such an approach is required to be followed

check my commnet

why i divide by k,l,m,n??I could not understand.

check my comment

Every k-th dragon got punched in the face with a frying pan..it means from 1-d if a number is divisible by k then it suffered moral or physical damage.....

same thing in l , m , n th....if a number from 1-d is divisible by any of 4 number then that dragon will suffer moral or physical damage..... so just you have to find the count how many number are divisible by k/l/m/n from 1 to d...and that's the answer

ok.I understand this.Thank you.