#include <stdio.h>
#include <math.h>

struct Bullet {
    int startX;
    int startY;
    int speed;
};

struct Target {
    int positionX;
    int positionY;
};

void trackBullet(struct Bullet bullet, struct Target target) {
    float distance = 0;
    float time = 0;

    while (distance >= 0) {
        bullet.startX += bullet.speed;
        bullet.startY += bullet.speed;

        distance = sqrt(pow(target.positionX - bullet.startX, 2) + pow(target.positionY - bullet.startY, 2));

        time += 1;

        if (distance < bullet.speed) {
            printf("Bullet hit the target at time: %.2f seconds\n", time);
            break;
        }
    }

    if (distance >= 0) {
        printf("Bullet missed the target.\n");
    }
}

int main() {
    struct Bullet bullet;
    bullet.startX = 100;
    bullet.startY = 200;
    bullet.speed = 10;

    struct Target target;
    target.positionX = 500;
    target.positionY = 300;

    trackBullet(bullet, target);

    return 0;
}