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 | Radewoosh | 3759 |

2 | orzdevinwang | 3697 |

3 | jiangly | 3662 |

4 | Benq | 3644 |

5 | -0.5 | 3545 |

6 | ecnerwala | 3505 |

7 | tourist | 3486 |

8 | inaFSTream | 3478 |

9 | maroonrk | 3454 |

10 | Rebelz | 3415 |

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

1 | adamant | 173 |

2 | awoo | 168 |

3 | nor | 163 |

3 | SecondThread | 163 |

5 | BledDest | 162 |

5 | Um_nik | 162 |

7 | maroonrk | 161 |

8 | -is-this-fft- | 150 |

9 | Geothermal | 146 |

10 | TheScrasse | 143 |

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: Dec/04/2023 09:46:17 (l3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|