結果
| 問題 | 
                            No.128 お年玉(1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-10-04 13:36:04 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 777 bytes | 
| コンパイル時間 | 13,029 ms | 
| コンパイル使用メモリ | 377,272 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-01 11:07:56 | 
| 合計ジャッジ時間 | 14,193 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}
fn main() {
    let budget: i64 = getline().trim().parse().unwrap();
    let number_of_child: i64 = getline().trim().parse().unwrap();
    let otoshidama_unit: i64 = 1000;
    let otoshidama_per_person: i64;
    if budget / number_of_child < otoshidama_unit {
        otoshidama_per_person = 0;
    } else {
        if budget % number_of_child == 0 {
            otoshidama_per_person = budget / number_of_child;
        } else {
            let number_of_thousand_yen = (budget / number_of_child) / 1000;
            otoshidama_per_person = number_of_thousand_yen * otoshidama_unit;
        }
    }
    println!("{}", otoshidama_per_person);
}