Any hints to solve this problem ?

I tried to get the least common multiple (lcm) of the increasing factors of these two sequences but there was a bug which is that the starting points are not always equal

Any help please?

Before contest

CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!)

16:52:47

Register now »

CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!)

16:52:47

Register now »

*has extra registration

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

1 | Benq | 3783 |

2 | jiangly | 3772 |

3 | tourist | 3706 |

4 | maroonrk | 3609 |

5 | Um_nik | 3591 |

6 | fantasy | 3526 |

7 | ko_osaga | 3500 |

8 | inaFSTream | 3477 |

9 | cnnfls_csy | 3427 |

10 | zh0ukangyang | 3423 |

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

1 | Um_nik | 185 |

2 | awoo | 182 |

3 | nor | 172 |

4 | -is-this-fft- | 170 |

5 | adamant | 169 |

6 | maroonrk | 165 |

7 | antontrygubO_o | 160 |

8 | SecondThread | 158 |

9 | dario2994 | 152 |

10 | kostka | 151 |

Any hints to solve this problem ?

I tried to get the least common multiple (lcm) of the increasing factors of these two sequences but there was a bug which is that the starting points are not always equal

Any help please?

↑

↓

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/31/2023 00:42:15 (h1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

If you've found the LCM of the increasing factors and the first number x which is in both sequences, then find the maximum terms of each sequence m1 and m2. The answer is 1 + (min(m1, m2) — x)/LCM.