ABC 048, finished all with help of editorial
This commit is contained in:
21
atcoder/beginner_contests/abc048/src/bin/b.rs
Normal file
21
atcoder/beginner_contests/abc048/src/bin/b.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use proconio::input;
|
||||
|
||||
fn f(n: i64, x: i64) -> i64 {
|
||||
if n == -1 {
|
||||
0
|
||||
} else {
|
||||
n / x + 1
|
||||
}
|
||||
}
|
||||
|
||||
fn main(){
|
||||
input!{
|
||||
a: i64,
|
||||
b: i64,
|
||||
x: i64,
|
||||
};
|
||||
|
||||
let result = f(b, x) - f(a - 1, x);
|
||||
|
||||
println!("{}", result);
|
||||
}
|
||||
Reference in New Issue
Block a user