There are **1 billion** stars and you are standing at earth. Form the earth you know the distance of all **1 billion** stars. Find the nearest **1 million** stars from the earth.

Thanks in advance.

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

1 | jiangly | 3860 |

2 | Benq | 3783 |

3 | maroonrk | 3627 |

4 | fantasy | 3526 |

5 | ko_osaga | 3500 |

6 | Um_nik | 3496 |

7 | tourist | 3487 |

8 | inaFSTream | 3477 |

9 | Radewoosh | 3437 |

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 | 151 |

9 | kostka | 151 |

There are **1 billion** stars and you are standing at earth. Form the earth you know the distance of all **1 billion** stars. Find the nearest **1 million** stars from the earth.

Thanks in advance.

I have 3 numbers A, B, and C. `where A = 97830131475, B = 587117 and C = 109546051211.`

`I wanna get A * B (mod C) without overflow using c++. I used this formula:

```
unsigned long long x = A % C * B % C;
x %= C;
```

but still getting overflow. `where x = 0.`

can someone help me!! Thanks in advance. :)

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/02/2023 02:35:30 (h1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|