Quotient and remainder#8837

Quotient and remainder (Editorial)

Algorithm Analysis

The quotient of dividing numbers by equals .

The remainder of dividing numbers by equals .

Algorithm Implementation

Read the input data. Calculate and output the quotient and remainder of dividing by .

scanf("%d %d", &a, &b);
printf("%d %d\n", a / b, a % b);

Java Implementation

import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Scanner con = new Scanner(System.in);
        int a = con.nextInt();
        int b = con.nextInt();
        System.out.println(a / b + " " + a % b);
        con.close();
    }
}

Python Implementation

a, b = map(int, input().split())
print(a // b, a % b)