#include <stdio.h>
void process(int a, int b)
{
int x=0, y=0;
int count = 0;
for (;a > b;)
{
a -= b;
count++;
}
if (a == b)
{
x = ++count;
y = 0;
}
if (a < b)
{
x = count;
y = a;
}
printf("%d %d\n", x, y);
}
int main()
{
int a, b;
scanf("%d%d", &a,&b);
process(a, b);
return 0;
}
void process(int a, int b)
{
int x=0, y=0;
int count = 0;
for (;a > b;)
{
a -= b;
count++;
}
if (a == b)
{
x = ++count;
y = 0;
}
if (a < b)
{
x = count;
y = a;
}
printf("%d %d\n", x, y);
}
int main()
{
int a, b;
scanf("%d%d", &a,&b);
process(a, b);
return 0;
}