Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
239 B
7
Indexable
Never
#include <stdio.h>

int main()
{
    int n;
    scanf("%d", &n);

    int sum = 0;
    int k = 1;
    
    while (sum + k <= n) {
        sum += k;
        k++;
    }
    
    printf("%d %d", k - 1, sum);

    return 0;
}