#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>

int main() {
    unsigned int target_secret = 1930152082;
    unsigned int guessed_secret, secret,second_secret;


    // 現在時刻周辺の範囲で総当たり
    time_t current_time = time(NULL);
    time_t start_time = current_time - 120;  // 現在時刻の60秒前から試す
    time_t end_time = current_time + 120;    // 現在時刻の60秒後まで試す

    for (time_t t = start_time; t <= end_time; ++t) {
        srand(t); // 現在の時刻 t で srand を初期化

        // 元のプログラムの計算を再現
        guessed_secret = rand();

        // 推測した secret がターゲットと一致するか確認
        if (guessed_secret == target_secret) {
        	secret = guessed_secret;
        	printf("First Secret: %u\n", secret);
        	second_secret = rand();
        	secret *= second_secret;
        	printf("Second Value: %u\n", second_secret);
        	printf("Second Secret: %u\n", secret);
        	
        	secret *= 0x5EC12E7;
        	printf("Final Secret: %u\n", secret);
        	
        	
            return 0; // 見つかったらプログラムを終了
        }
    }

    printf("Seed not found within the specified range.\n");
    return 1; // 見つからなかった場合
}