diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 8168560..60a8056 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ my_radar .idea .vscode +.direnv +*.o diff --git a/Makefile b/Makefile index 89e6915..280d679 100644 --- a/Makefile +++ b/Makefile @@ -5,31 +5,56 @@ ## Makefile to build project ## -NAME = my_radar +NAME = my_radar + +LIB = libmy.a + +LIB_DIR = lib/my SRCS = src/main.c \ - src/utils/print_usages.c + src/main2.c \ + src/map.c \ + src/simulation.c \ + src/script.c \ + src/events.c \ + src/simulation2.c \ + src/file_handling.c \ + src/aircraft.c \ + src/collision.c \ + src/init_graphics.c \ + src/control_tower.c \ + src/window.c + +OBJS = $(SRCS:.c=.o) + +LIB_SRCS = $(wildcard $(LIB_DIR)/*.c) + +LIB_OBJS = $(LIB_SRCS:.c=.o) CC = gcc -CFLAGS = -Iinclude -Llib/my -lmy -l csfml-graphics -l csfml-system -l csfml-window +CFLAGS = -lasan -Iinclude -all: $(NAME) +LDFLAGS = -L$(LIB_DIR) -lmy -lcsfml-graphics -lcsfml-window -lcsfml-system -lm -$(NAME): - cd lib/my && make - $(CC) $(SRCS) -o $(NAME) $(CFLAGS) +all: $(LIB) $(NAME) + +$(LIB): $(LIB_OBJS) + ar rc $(LIB_DIR)/$(LIB) $(LIB_OBJS) + rm -f $(LIB_OBJS) + +$(NAME): $(OBJS) + $(CC) $(OBJS) -o $(NAME) $(LDFLAGS) + +%.o: %.c + $(CC) -c $< -o $@ $(CFLAGS) clean: $(RM) *.o $(RM) $(OBJS) -fclean: clean - cd lib/my && make fclean +fclean: clean + $(RM) $(LIB_DIR)/$(LIB) $(RM) $(NAME) -re: fclean all - -asan: fclean - cd lib/my && make - $(CC) $(SRCS) -o $(NAME) -lasan -g3 $(CFLAGS) +re: fclean all diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..36d1936 --- /dev/null +++ b/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "epiflake": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712528066, + "narHash": "sha256-JGHzUhdMitSxrS2fQ4Zts9YWrcykpMXm5IjSW0cPcNM=", + "owner": "Savapitech", + "repo": "EpiFlake", + "rev": "39ba7f99f449519e65381aaf6a738a11aa31104e", + "type": "github" + }, + "original": { + "owner": "Savapitech", + "repo": "EpiFlake", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "epiflake": "epiflake", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..49b0a20 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + epiflake = { + url = "github:Savapitech/EpiFlake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, epiflake, nixpkgs, flake-utils }: + flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + rec { + formatter = pkgs.nixpkgs-fmt; + + devShells.default = pkgs.mkShell { + hardeningDisable = [ "all" ]; + packages = with (epiflake.lib.ShellPkgs pkgs); + base ++ debug; + }; + }); +} diff --git a/include/CSFML.h b/include/CSFML.h new file mode 100644 index 0000000..e65ab9f --- /dev/null +++ b/include/CSFML.h @@ -0,0 +1,17 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** csfml.h +*/ + +#ifndef CSFML_H + #define CSFML_H + #include + +typedef struct { + sfRenderWindow* window; + sfSprite* map; +} csfml; + +#endif diff --git a/include/ControlTower.h b/include/ControlTower.h new file mode 100644 index 0000000..8e47cd6 --- /dev/null +++ b/include/ControlTower.h @@ -0,0 +1,22 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** ControlTower.h +*/ + +#ifndef CONTROLTOWER_H + #define CONTROLTOWER_H + + #include + +typedef struct { + sfVector2f pos; + sfSprite* sprite; + int radius; +} ControlTower; +void process_tower_line(char *line); +int is_in_control_area(int i); +float babylonian_sqrt(float number); + +#endif diff --git a/include/aircraft.h b/include/aircraft.h new file mode 100644 index 0000000..d53d6b3 --- /dev/null +++ b/include/aircraft.h @@ -0,0 +1,25 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** aircraft.h +*/ + +#ifndef AIRCRAFT_H + #define AIRCRAFT_H + + #include + +typedef struct { + sfVector2f pos; + sfVector2f dest; + sfVector2f direction; + sfSprite* sprite; + int speed; + int delay; +} Aircraft; +void configure_aircraft_sprite(Aircraft *aircraft); +void process_aircraft_line(char *line); +void destroy_aircraft(int i); + +#endif diff --git a/include/collision.h b/include/collision.h new file mode 100644 index 0000000..60cb627 --- /dev/null +++ b/include/collision.h @@ -0,0 +1,27 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** collision.h +*/ + +#ifndef COLLISION_H + #define COLLISION_H + + #include + #include "simulation.h" + #include "map.h" + #include "init_CSFML.h" + #include "script.h" + #include "../lib/my/lib.h" + #include "ControlTower.h" + #include "aircraft.h" + +void handle_aircraft_collision(int i, int j); +void handle_aircraft_landing(int i, float deltaTime); +void draw_hitbox(csfml *csfml, int i); +void destroy_aircraft(int i); +int is_in_control_area(int i); +void destroy_aircraft(int i); + +#endif diff --git a/include/events.h b/include/events.h new file mode 100644 index 0000000..7a43fdc --- /dev/null +++ b/include/events.h @@ -0,0 +1,24 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** events.h +*/ + + +#ifndef EVENTS_H + #define EVENTS_H + + #include + #include "simulation.h" + #include "map.h" + #include "init_CSFML.h" + #include "script.h" + #include "ControlTower.h" + #include "aircraft.h" + +void handle_window_events_simulation(csfml *csfml, int *should_close); +float babylonian_sqrt(float num); + + +#endif diff --git a/include/init_CSFML.h b/include/init_CSFML.h new file mode 100644 index 0000000..52488dd --- /dev/null +++ b/include/init_CSFML.h @@ -0,0 +1,21 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** init_csfml.h +*/ + +#ifndef INIT_csfml_H + #define INIT_csfml_H + + #include + #include "CSFML.h" + +csfml* create_csfml(void); +sfRenderWindow* create_window(void); +sfSprite* load_map_sprite(char *map_filepath, sfRenderWindow* window); +void set_map_scale(sfSprite* map, sfRenderWindow* window); +void set_window_framerate(sfRenderWindow* window); +csfml* init_csfml(char *map_filepath); + +#endif diff --git a/include/map.h b/include/map.h new file mode 100644 index 0000000..6acfb12 --- /dev/null +++ b/include/map.h @@ -0,0 +1,17 @@ +/* +** EPITECH PROJECT, 2023 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** map.h +*/ + +#ifndef MAP_H + #define MAP_H + + #include + +sfSprite* load_map(char *map_filepath); +void unload_map(sfSprite* map); +void draw_map(sfRenderWindow* window, sfSprite* map); + +#endif diff --git a/include/my.h b/include/my.h new file mode 100644 index 0000000..9d5dc77 --- /dev/null +++ b/include/my.h @@ -0,0 +1,18 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-savinien.petitjean +** File description: +** my.h +*/ + +#ifndef MY_H_ + #define MY_H_ + #include "../lib/my/lib.h" + #include "CSFML.h" + +int check_args(int, char *argv[]); +void run_csfml(csfml *, sfText *, int *); +void print_usage(void); +void initialize_and_run_simulation(csfml *, sfText *, int *, int); +void handle_window_events(sfEvent, csfml **, int *, int); +#endif //MY_H_ diff --git a/include/script.h b/include/script.h new file mode 100644 index 0000000..8a5177a --- /dev/null +++ b/include/script.h @@ -0,0 +1,27 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** script.h +*/ + +#ifndef SCRIPT_H + #define SCRIPT_H + + #include + #include "simulation.h" + #include "aircraft.h" + #include "ControlTower.h" + #include "init_CSFML.h" + +extern Aircraft* aircrafts; +extern ControlTower* towers; +extern int num_aircrafts; +extern int num_towers; +extern int num_landed_aircrafts; +extern int num_destroyed_aircrafts; + +void handle_event(sfEvent event, csfml **csfml, int *should_close); +int read_script(char *filepath); + +#endif diff --git a/include/simulation.h b/include/simulation.h new file mode 100644 index 0000000..cfa4110 --- /dev/null +++ b/include/simulation.h @@ -0,0 +1,29 @@ +/* +** EPITECH PROJECT, 2023 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** simulation.h +*/ + +#ifndef SIMULATION_H + #define SIMULATION_H + + #include + #include "script.h" + #include "CSFML.h" + +typedef struct { + csfml* csfml; + sfText* timerText; + int* should_close; + float deltaTime; + float elapsed_time; +} SimulationData; +int init_simulation(char *script_filepath); +void init_run_sim(csfml *csfml, sfText* timerText, int *should_close); +void run_simulation(csfml* csfml, sfText *timerText, int *should_close); +void run_simulation_loop(SimulationData simData, csfml *csfml); +void check_end_simulation(csfml *csfml); +void end_simulation(csfml *csfml, sfSprite*); + +#endif diff --git a/include/window.h b/include/window.h new file mode 100644 index 0000000..867cb11 --- /dev/null +++ b/include/window.h @@ -0,0 +1,28 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet (V4 marche pas) +** File description: +** window.h +*/ + +#ifndef WINDOW_H + #define WINDOW_H + + #include + #include "simulation.h" + #include "map.h" + #include "init_CSFML.h" + #include "script.h" + #include "ControlTower.h" + #include "aircraft.h" + +void draw_aircraft(csfml *csfml, int i); +void update_and_draw_aircrafts(csfml *csfml, float deltaTime); +void draw_towers(csfml *csfml); +void update_and_draw(SimulationData simData); +void draw_aircraft_hitbox(csfml *csfml, int i); +void handle_aircraft_interactions(int i, float deltaTime); +void draw_tower_radius(csfml* csfml, int i); +void update_timer(sfRenderWindow *window, sfText *timerText, float elapsed_time); + +#endif diff --git a/lib/my/Makefile b/lib/my/Makefile index 99db42d..d989aa7 100644 --- a/lib/my/Makefile +++ b/lib/my/Makefile @@ -20,6 +20,7 @@ SRCS = my_compute_power_rec.c \ my_put_octal.c \ my_putchar.c \ my_putstr.c \ + my_puterr.c \ my_revstr.c \ my_show_word_array.c \ my_strcat.c \ @@ -32,7 +33,6 @@ SRCS = my_compute_power_rec.c \ my_swap.c \ my_printf.c \ my_format.c \ - my_error.c \ my_strpop.c diff --git a/lib/my/lib.h b/lib/my/lib.h index 846e61c..4b15af9 100644 --- a/lib/my/lib.h +++ b/lib/my/lib.h @@ -21,7 +21,6 @@ int my_put_unsigned_nbr(unsigned int); int my_put_hexa(int); int my_put_address(int); int my_put_hexa_upper(int); -void my_error(char *); int my_put_octal(int); int my_swap(int *, int *); int my_put_float(float); @@ -29,6 +28,7 @@ int my_put_float_upper(float); void my_put_float2(int *, int, int, int); void my_put_float2_upper(int *, int, int, int); int my_putstr(char const *); +int my_puterr(char const *); int my_strlen(char const *); int my_getnbr(char const *); int my_sort_int_array(int *, int); diff --git a/lib/my/my_puterr.c b/lib/my/my_puterr.c new file mode 100644 index 0000000..ca4835d --- /dev/null +++ b/lib/my/my_puterr.c @@ -0,0 +1,20 @@ +/* +** EPITECH PROJECT, 2023 +** CPoolDay07 +** File description: +** ./my_putstr.c +*/ + +#include "lib.h" + +int my_puterr(char const *str) +{ + int count; + + count = 0; + for (int i = 0; str[i] != '\0'; i++) { + my_putchar(str[i]); + count++; + } + return (count); +} diff --git a/lib/my/my_putstr.c b/lib/my/my_putstr.c index 1e78213..8ade347 100644 --- a/lib/my/my_putstr.c +++ b/lib/my/my_putstr.c @@ -9,8 +9,9 @@ int my_putstr(char const *str) { - int count = 0; + int count; + count = 0; for (int i = 0; str[i] != '\0'; i++) { my_putchar(str[i]); count++; diff --git a/resources/fonts/Roboto-Black.ttf b/resources/fonts/Roboto-Black.ttf new file mode 100644 index 0000000..689fe5c Binary files /dev/null and b/resources/fonts/Roboto-Black.ttf differ diff --git a/resources/img/background.png b/resources/img/background.png new file mode 100644 index 0000000..ec1489b Binary files /dev/null and b/resources/img/background.png differ diff --git a/resources/img/plane.png b/resources/img/plane.png new file mode 100644 index 0000000..b028988 Binary files /dev/null and b/resources/img/plane.png differ diff --git a/resources/img/tower.png b/resources/img/tower.png new file mode 100644 index 0000000..5b0c29c Binary files /dev/null and b/resources/img/tower.png differ diff --git a/script.rdr b/script.rdr new file mode 100644 index 0000000..19a7f2c --- /dev/null +++ b/script.rdr @@ -0,0 +1,1920 @@ +A 1896 762 753 236 4 1 +A 493 1341 49 883 5 21 +A 779 284 1318 453 15 33 +A 1243 34 1734 935 6 2 +A 1727 338 243 255 11 46 +A 1737 983 921 752 4 35 +A 233 744 481 41 8 33 +A 1855 298 86 95 4 47 +A 653 249 1299 93 18 3 +A 1261 1379 1541 833 2 14 +A 839 552 63 341 8 11 +A 396 584 749 83 14 56 +A 1559 569 225 529 19 21 +A 1249 538 349 233 17 37 +A 919 753 535 673 17 22 +A 1266 641 426 454 6 17 +A 63 832 943 779 3 25 +A 1822 439 352 1323 19 3 +A 1116 536 1234 228 9 28 +A 778 767 353 956 9 54 +A 1787 23 1393 887 5 11 +A 23 431 1283 763 12 23 +A 1532 633 512 728 6 35 +A 1247 319 287 345 19 27 +A 563 437 1377 427 3 42 +A 797 1337 1645 937 18 37 +A 1333 222 1431 937 12 42 +A 938 283 56 385 14 14 +A 233 732 216 1325 9 49 +A 1149 695 1319 986 3 45 +A 13 632 1328 948 16 58 +A 828 374 1443 686 17 53 +A 883 274 225 869 6 39 +A 735 947 699 796 3 32 +A 458 294 449 733 8 43 +A 1224 96 1459 4 23 2 +A 1471 665 1625 75 19 48 +A 617 845 1333 264 12 29 +A 315 499 666 765 6 36 +A 1554 845 631 251 14 23 +A 796 515 458 228 33 13 +A 1272 566 31 239 11 52 +A 444 631 236 391 13 5 +A 1316 669 346 223 6 37 +A 283 111 241 477 18 63 +A 951 375 1824 333 13 54 +A 785 636 1338 621 19 3 +A 473 498 961 698 19 63 +A 1397 438 67 898 2 35 +A 563 872 1734 671 19 38 +A 13 335 39 918 11 17 +A 311 754 1583 1313 4 28 +A 1555 724 697 13 15 3 +A 617 217 473 577 13 13 +A 1339 286 437 54 1 14 +A 1592 248 1415 1355 2 14 +A 1639 376 644 666 12 43 +A 1339 417 1814 816 7 57 +A 397 842 1299 438 8 23 +A 1149 945 1689 334 13 13 +A 275 96 832 826 4 55 +A 948 619 844 938 8 46 +A 1415 855 334 4 18 53 +A 1386 223 1343 488 5 39 +A 1278 936 1633 465 2 51 +A 1698 955 257 967 6 25 +A 1335 624 471 42 12 47 +A 1853 759 1382 1368 11 44 +A 1288 283 813 646 13 6 +A 864 3 1188 275 19 52 +A 845 122 1939 443 7 44 +A 419 1318 432 731 13 47 +A 1293 833 913 662 13 54 +A 1395 886 1234 872 13 43 +A 1241 453 1541 526 16 32 +A 1683 422 234 774 13 59 +A 563 334 1556 656 14 33 +A 1639 939 1779 695 5 29 +A 1147 83 898 738 13 8 +A 621 969 378 736 11 14 +A 1324 392 457 499 16 28 +A 262 384 1866 221 3 33 +A 861 973 1267 83 5 5 +A 613 276 838 152 5 43 +A 739 713 1671 533 2 43 +A 1553 894 493 852 19 43 +A 1334 589 542 815 2 32 +A 319 959 237 839 15 34 +A 1281 333 1474 182 5 21 +A 547 1373 772 57 8 33 +A 119 737 1734 913 6 33 +A 123 353 937 799 9 43 +A 384 1333 1354 937 18 52 +A 1823 573 979 1342 18 33 +A 1378 969 443 1377 6 6 +A 272 483 1334 752 5 53 +A 214 631 23 833 6 49 +A 1124 589 1311 1319 14 54 +A 1713 674 1464 871 15 39 +A 1541 833 196 365 5 1 +A 813 125 732 896 8 42 +A 1654 917 1327 13 6 53 +A 261 233 832 1336 19 35 +A 1694 82 693 347 4 57 +A 522 933 981 132 7 13 +A 355 532 1548 1341 9 4 +A 316 217 272 689 2 33 +A 981 84 1344 747 18 7 +A 1423 235 718 377 16 45 +A 383 36 1413 611 9 34 +A 1653 57 1136 886 15 48 +A 1339 547 742 851 11 12 +A 662 746 765 877 11 41 +A 399 655 1163 423 3 26 +A 1852 116 1838 533 14 37 +A 569 535 1741 558 2 46 +A 145 894 1372 1347 33 57 +A 1264 1324 653 823 11 31 +A 555 532 1792 239 8 9 +A 1362 717 1268 423 4 27 +A 1726 924 1437 424 19 17 +A 1299 463 1223 883 17 49 +A 1343 796 785 447 33 3 +A 1639 793 1893 23 23 47 +A 1659 413 1413 625 15 24 +A 1586 972 1665 597 4 2 +A 741 539 1743 762 8 58 +A 128 39 1883 169 4 45 +A 1599 335 392 18 18 11 +A 1345 185 1917 531 17 17 +A 1622 571 1153 1335 13 29 +A 1233 633 231 639 14 44 +A 1399 597 1233 658 5 42 +A 455 782 823 633 8 43 +A 317 936 563 11 9 35 +A 1612 642 333 562 17 16 +A 72 115 1282 233 4 58 +A 1539 413 1889 164 15 43 +A 1675 165 431 665 3 19 +A 373 544 1737 665 18 33 +A 1396 11 1221 83 18 33 +A 1423 818 64 434 3 29 +A 859 449 469 966 6 3 +A 1673 448 143 1375 12 31 +A 1693 967 919 138 19 56 +A 1337 1343 21 483 14 46 +A 1157 934 478 1348 16 5 +A 182 1338 758 524 8 7 +A 163 578 1779 1333 5 33 +A 836 751 272 854 15 53 +A 1481 963 643 118 17 6 +A 33 373 886 838 13 18 +A 1262 135 1484 814 13 33 +A 1653 546 1511 927 18 36 +A 1157 934 478 1348 16 5 +A 182 1338 758 524 8 7 +A 163 578 1779 1333 5 33 +A 836 751 272 854 15 53 +A 1481 963 643 118 17 6 +A 33 373 886 838 13 18 +A 1262 135 1484 814 13 33 +A 1653 546 1511 927 18 36 +A 573 628 1659 734 3 8 +A 1831 528 1155 754 13 11 +A 835 926 1687 649 13 48 +A 1436 66 393 176 5 6 +A 1183 71 476 68 11 42 +A 1435 463 313 228 11 43 +A 685 627 977 552 5 29 +A 1518 779 736 764 17 46 +A 632 617 1668 825 13 58 +A 1634 935 1379 519 8 46 +A 71 936 1361 628 15 1 +A 1781 336 1413 411 17 33 +A 835 735 331 1377 13 46 +A 135 146 623 269 11 55 +A 731 442 1339 923 18 6 +A 533 523 1434 536 23 35 +A 99 983 1726 686 19 9 +A 1632 538 1371 439 7 43 +A 253 83 131 532 5 23 +A 695 564 1168 141 7 63 +A 1541 334 837 441 17 47 +A 1836 622 723 943 3 29 +A 442 1373 333 564 13 29 +A 351 1327 1155 1338 11 33 +A 1231 923 1339 972 6 13 +A 164 652 973 672 6 48 +A 1661 655 337 415 5 26 +A 1193 624 118 933 12 4 +A 1675 1362 383 986 14 35 +A 221 43 364 25 7 29 +A 1713 858 1454 367 5 17 +A 1932 473 82 332 13 38 +A 1894 19 953 239 13 55 +A 895 883 537 748 3 6 +A 1133 873 1455 195 3 14 +A 1363 343 1585 82 16 22 +A 338 284 832 192 3 36 +A 1376 823 633 824 59 63 +A 583 792 538 385 17 28 +A 533 814 535 472 9 46 +A 518 891 721 496 16 21 +A 1831 88 1383 88 53 6 +A 83 1342 676 295 14 32 +A 372 551 532 264 6 53 +A 1427 651 683 25 3 17 +A 1751 673 3 574 13 57 +A 333 751 238 882 13 14 +A 139 793 889 31 5 9 +A 933 433 1257 533 4 37 +A 1899 577 1362 642 7 37 +A 437 815 1863 279 18 53 +A 231 729 1613 122 14 13 +A 1779 64 1754 642 17 57 +A 1334 263 1353 353 12 36 +A 519 936 165 468 3 57 +A 1621 762 468 44 3 16 +A 1798 729 672 97 14 29 +A 443 21 1417 97 17 52 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 573 628 1659 734 3 8 +A 1831 528 1155 754 13 11 +A 835 926 1687 649 13 48 +A 1436 66 393 176 5 6 +A 1183 71 476 68 11 42 +A 1435 463 313 228 11 43 +A 685 627 977 552 5 29 +A 1518 779 736 764 17 46 +A 632 617 1668 825 13 58 +A 1634 935 1379 519 8 46 +A 71 936 1361 628 15 1 +A 1781 336 1413 411 17 33 +A 835 735 331 1377 13 46 +A 135 146 623 269 11 55 +A 731 442 1339 923 18 6 +A 533 523 1434 536 23 35 +A 99 983 1726 686 19 9 +A 1632 538 1371 439 7 43 +A 253 83 131 532 5 23 +A 695 564 1168 141 7 63 +A 1541 334 837 441 17 47 +A 1836 622 723 943 3 29 +A 442 1373 333 564 13 29 +A 351 1327 1155 1338 11 33 +A 1231 923 1339 972 6 13 +A 164 652 973 672 6 48 +A 1661 655 337 415 5 26 +A 1193 624 118 933 12 4 +A 1675 1362 383 986 14 35 +A 221 43 364 25 7 29 +A 1713 858 1454 367 5 17 +A 1932 473 82 332 13 38 +A 1894 19 953 239 13 55 +A 895 883 537 748 3 6 +A 1133 873 1455 195 3 14 +A 1363 343 1585 82 16 22 +A 338 284 832 192 3 36 +A 1376 823 633 824 59 63 +A 583 792 538 385 17 28 +A 533 814 535 472 9 46 +A 518 891 721 496 16 21 +A 1831 88 1383 88 53 6 +A 83 1342 676 295 14 32 +A 372 551 532 264 6 53 +A 1427 651 683 25 3 17 +A 1751 673 3 574 13 57 +A 333 751 238 882 13 14 +A 139 793 889 31 5 9 +A 933 433 1257 533 4 37 +A 1899 577 1362 642 7 37 +A 437 815 1863 279 18 53 +A 231 729 1613 122 14 13 +A 1779 64 1754 642 17 57 +A 1334 263 1353 353 12 36 +A 519 936 165 468 3 57 +A 1621 762 468 44 3 16 +A 1798 729 672 97 14 29 +A 443 21 1417 97 17 52 +A 539 361 1911 931 9 43 +A 1112 968 1277 1345 11 57 +A 1174 328 437 452 17 54 +A 643 733 1334 367 4 29 +A 773 757 1731 82 18 44 +A 127 553 1865 991 19 1 +A 1832 783 139 688 11 29 +A 631 23 595 164 3 13 +A 1119 96 972 692 13 1 +A 763 578 1262 762 8 17 +A 1919 253 1493 113 16 43 +A 1183 193 487 461 3 13 +A 1936 295 1261 617 3 26 +A 988 136 155 671 14 46 +A 1715 936 293 866 9 42 +A 1618 857 1894 518 7 63 +A 642 575 1716 143 23 48 +A 165 293 536 193 19 55 +A 1845 511 1193 443 8 55 +A 1339 738 471 1337 15 48 +A 1914 778 448 539 5 18 +A 47 934 567 324 17 21 +A 788 759 45 713 11 12 +A 71 913 1485 423 11 44 +A 478 953 49 134 3 29 +A 1148 855 1863 835 13 49 +A 238 127 343 658 7 5 +A 353 415 1918 1321 23 22 +A 1883 791 93 441 4 43 +A 827 873 1511 775 33 34 +A 741 388 225 132 15 14 +A 1874 132 1442 784 9 16 +A 389 35 223 352 6 45 +A 42 683 1322 261 16 41 +A 1716 679 1793 173 7 38 +A 1395 532 964 239 14 27 +A 1495 1379 1695 684 7 22 +A 845 937 725 43 13 29 +A 979 1341 253 647 13 44 +A 1343 923 271 747 12 33 +A 1719 995 615 694 6 7 +A 53 621 1319 891 8 32 +A 713 245 984 249 6 31 +A 351 387 1346 244 7 51 +A 1551 574 1343 993 9 43 +A 35 1318 1856 231 11 36 +A 879 164 87 269 9 5 +A 368 536 1523 1379 5 36 +A 624 644 267 255 13 33 +A 11 67 283 647 5 5 +A 196 138 484 137 3 4 +A 1672 434 1591 483 12 58 +A 1239 818 947 25 14 21 +A 137 54 1519 148 23 43 +A 1798 1345 1867 336 3 31 +A 1486 146 1253 271 13 3 +A 65 68 1815 427 18 58 +A 765 369 845 1322 15 21 +A 768 553 1118 518 15 34 +A 979 641 1229 177 19 16 +A 152 632 712 813 15 52 +A 1459 1374 249 544 16 39 +A 1633 211 336 332 23 23 +A 1397 832 1337 816 13 7 +A 1652 83 354 237 15 11 +A 1438 218 1384 459 4 63 +A 1512 148 281 596 13 33 +A 1482 136 442 471 13 3 +A 1825 433 114 229 5 48 +A 1221 199 1333 131 17 9 +A 1213 443 633 236 3 16 +A 1783 877 1474 377 5 39 +A 1125 413 1161 1333 12 43 +A 617 47 1598 273 6 29 +A 1495 1321 1771 939 4 11 +A 128 1374 1421 463 12 3 +A 1337 1367 826 243 9 33 +A 1581 614 1557 279 23 44 +A 1533 23 313 955 23 24 +A 818 491 1283 938 5 6 +A 1469 295 1378 467 3 56 +A 72 591 1719 454 5 3 +A 299 913 1746 1379 13 2 +A 1126 664 515 624 7 3 +A 64 287 1268 454 14 34 +A 1697 891 775 933 23 35 +A 883 731 1133 931 16 51 +A 1331 131 1628 928 15 57 +T 1333 533 133 +T 1533 733 333 +T 2333 833 333 +T 2533 433 433 \ No newline at end of file diff --git a/src/aircraft.c b/src/aircraft.c new file mode 100644 index 0000000..e9dbc1c --- /dev/null +++ b/src/aircraft.c @@ -0,0 +1,73 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** aircraft.c +*/ + +#include +#include +#include +#include +#include "../include/simulation.h" +#include +#include "../include/my.h" + +void configure_aircraft_sprite(Aircraft *aircraft) +{ + sfTexture* texture; + sfVector2u spriteSize; + + aircraft->sprite = sfSprite_create(); + texture = sfTexture_createFromFile("resources/img/plane.png", NULL); + sfSprite_setTexture(aircraft->sprite, texture, sfTrue); + spriteSize = sfTexture_getSize(texture); + sfSprite_setOrigin(aircraft->sprite, + (sfVector2f){spriteSize.x / 2, spriteSize.y / 2}); + sfSprite_setScale(aircraft->sprite, (sfVector2f){0.10, 0.10}); +} + +void calculate_aircraft_direction(Aircraft *aircraft) +{ + sfVector2f diff; + float length; + + diff = (sfVector2f){aircraft->dest.x - aircraft->pos.x, + aircraft->dest.y - aircraft->pos.y}; + length = sqrt(diff.x * diff.x + diff.y * diff.y); + aircraft->direction = (sfVector2f){diff.x / length, diff.y / length}; + aircraft->speed *= 10; +} + +void process_aircraft_line(char *line) +{ + Aircraft* new_aircrafts; + + new_aircrafts = malloc((num_aircrafts + 1) * sizeof(Aircraft)); + if (aircrafts != NULL) { + memcpy(new_aircrafts, aircrafts, num_aircrafts * sizeof(Aircraft)); + (aircrafts); + } + aircrafts = new_aircrafts; + sscanf(line, "A %f %f %f %f %d %d", &aircrafts[num_aircrafts].pos.x, + &aircrafts[num_aircrafts].pos.y, + &aircrafts[num_aircrafts].dest.x, &aircrafts[num_aircrafts].dest.y, + &aircrafts[num_aircrafts].speed, &aircrafts[num_aircrafts].delay); + configure_aircraft_sprite(&aircrafts[num_aircrafts]); + calculate_aircraft_direction(&aircrafts[num_aircrafts]); + num_aircrafts++; +} + +void draw_aircraft_hitbox(csfml *csfml, int i) +{ + sfRectangleShape* hitbox = sfRectangleShape_create(); + sfVector2f hitboxPos = {aircrafts[i].pos.x - 10, aircrafts[i].pos.y - 10}; + + sfRectangleShape_setPosition(hitbox, hitboxPos); + sfRectangleShape_setSize(hitbox, (sfVector2f){20, 20}); + sfRectangleShape_setOutlineColor(hitbox, sfRed); + sfRectangleShape_setOutlineThickness(hitbox, 1.0); + sfRectangleShape_setFillColor(hitbox, sfTransparent); + sfRenderWindow_drawRectangleShape(csfml->window, hitbox, NULL); + sfRectangleShape_destroy(hitbox); +} diff --git a/src/collision.c b/src/collision.c new file mode 100644 index 0000000..b62953b --- /dev/null +++ b/src/collision.c @@ -0,0 +1,80 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** collision.c +*/ + +#include +#include +#include "../include/simulation.h" +#include +#include "../include/events.h" +#include "../include/my.h" + +void handle_aircraft_collision(int i, int j) +{ + if (!is_in_control_area(i) && !is_in_control_area(j)) { + /*my_printf( + "Collision detected between aircraft %d and %d\n", i, j);*/ + if (i < j) { + destroy_aircraft(i); + destroy_aircraft(j - 1); + } else { + destroy_aircraft(j); + destroy_aircraft(i - 1); + } + //my_printf("Nombre d'avions après collision : %d\n", num_aircrafts); + } +} + +void handle_aircraft_landing(int i, float deltaTime) +{ + float distance; + + distance = babylonian_sqrt(pow(aircrafts[i].pos.x + - aircrafts[i].dest.x, 2) + + pow(aircrafts[i].pos.y - aircrafts[i].dest.y, 2)); + if (distance <= aircrafts[i].speed * deltaTime) { + sfSprite_destroy(aircrafts[i].sprite); + aircrafts[i].sprite = NULL; + for (int j = i; j < num_aircrafts - 1; j++) + aircrafts[j] = aircrafts[j + 1]; + num_aircrafts--; + num_landed_aircrafts++; + //my_printf("Nombre d'avions après atterrissage : %d\n", num_aircrafts); + } else { + aircrafts[i].pos.x += aircrafts[i].direction.x * + aircrafts[i].speed * deltaTime; + aircrafts[i].pos.y += aircrafts[i].direction.y * + aircrafts[i].speed * deltaTime; + } +} + +void draw_hitbox(csfml *csfml, int i) +{ + sfRectangleShape* hitbox = sfRectangleShape_create(); + sfVector2f hitboxPos = { + aircrafts[i].pos.x - 10, + aircrafts[i].pos.y - 10 + }; + + sfRectangleShape_setPosition(hitbox, hitboxPos); + sfRectangleShape_setSize(hitbox, (sfVector2f){20, 20}); + sfRectangleShape_setOutlineColor(hitbox, sfRed); + sfRectangleShape_setOutlineThickness(hitbox, 1.0); + sfRectangleShape_setFillColor(hitbox, sfTransparent); + sfRenderWindow_drawRectangleShape(csfml->window, hitbox, NULL); + sfRectangleShape_destroy(hitbox); +} + +void destroy_aircraft(int i) +{ + sfSprite_destroy(aircrafts[i].sprite); + aircrafts[i].sprite = NULL; + for (int j = i; j < num_aircrafts - 1; j++) { + aircrafts[j] = aircrafts[j + 1]; + } + num_aircrafts--; + num_destroyed_aircrafts++; +} diff --git a/src/control_tower.c b/src/control_tower.c new file mode 100644 index 0000000..e517b5a --- /dev/null +++ b/src/control_tower.c @@ -0,0 +1,70 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** control_tower.c +*/ + +#include +#include +#include +#include +#include "../include/simulation.h" +#include "../include/my.h" + + +void process_tower_line(char *line) +{ + sfTexture* texture; + ControlTower* new_towers; + + new_towers = malloc((num_towers + 1) * sizeof(ControlTower)); + if (towers != NULL) { + memcpy(new_towers, towers, num_towers * sizeof(ControlTower)); + (towers); + } + towers = new_towers; + sscanf(line, "T %f %f %d", &towers[num_towers].pos.x, + &towers[num_towers].pos.y, &towers[num_towers].radius); + towers[num_towers].sprite = sfSprite_create(); + texture = sfTexture_createFromFile("resources/img/tower.png", NULL); + sfSprite_setTexture(towers[num_towers].sprite, texture, sfTrue); + sfSprite_setScale(towers[num_towers].sprite, (sfVector2f){0.10, 0.10}); + sfSprite_setPosition(towers[num_towers].sprite,(sfVector2f){towers[num_towers].pos.x - 25.6, towers[num_towers].pos.y - 25.6}); + num_towers++; +} + +int is_in_control_area(int i) +{ + int k; + float dx; + float dy; + float distance; + + for (k = 0; k < num_towers; k++) { + dx = towers[k].pos.x - aircrafts[i].pos.x; + dy = towers[k].pos.y - aircrafts[i].pos.y; + distance = babylonian_sqrt(dx * dx + dy * dy); + if (distance <= towers[k].radius) { + return 1; + } + } + return 0; +} + +void draw_tower_radius(csfml* csfml, int i) +{ + sfCircleShape* radius = sfCircleShape_create(); + sfVector2f circlePos = { + towers[i].pos.x - towers[i].radius, + towers[i].pos.y - towers[i].radius + }; + + sfCircleShape_setPosition(radius, circlePos); + sfCircleShape_setRadius(radius, towers[i].radius); + sfCircleShape_setOutlineColor(radius, sfBlue); + sfCircleShape_setOutlineThickness(radius, 1.0); + sfCircleShape_setFillColor(radius, sfTransparent); + sfRenderWindow_drawCircleShape(csfml->window, radius, NULL); + sfCircleShape_destroy(radius); +} diff --git a/src/events.c b/src/events.c new file mode 100644 index 0000000..4a688dc --- /dev/null +++ b/src/events.c @@ -0,0 +1,31 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** events.c +*/ + +#include +#include +#include "../include/simulation.h" +#include "../include/events.h" +#include "../include/my.h" + +void handle_window_events_simulation(csfml *csfml, int *should_close) +{ + sfEvent event; + + while (sfRenderWindow_pollEvent(csfml->window, &event)) + handle_event(event, &csfml, should_close); +} + +float babylonian_sqrt(float num) +{ + const float epsilon = 0.00001; + float guess = num / 2.0; + + while (abs(guess * guess - num) >= epsilon) { + guess = (guess + num / guess) / 2.0; + } + return guess; +} diff --git a/src/file_handling.c b/src/file_handling.c new file mode 100644 index 0000000..e240529 --- /dev/null +++ b/src/file_handling.c @@ -0,0 +1,40 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** file_handling.c +*/ + +#include +#include "../include/simulation.h" +#include "../include/my.h" + +void process_script_line(char *line) +{ + if (line[0] == 'A') { + process_aircraft_line(line); + } else if (line[0] == 'T') { + process_tower_line(line); + } +} + +int read_script(char *filepath) +{ + FILE *file = fopen(filepath, "r"); + char line[256]; + + if (!file) { + my_printf("Failed to open the script file: %s\n", filepath); + return 84; + } + while (fgets(line, sizeof(line), file)) { + process_script_line(line); + } + if (ferror(file)) { + my_printf("Error reading the script file: %s\n", filepath); + fclose(file); + return 84; + } + fclose(file); + return 0; +} diff --git a/src/init_graphics.c b/src/init_graphics.c new file mode 100644 index 0000000..eecfb1d --- /dev/null +++ b/src/init_graphics.c @@ -0,0 +1,78 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-savinien.petitjean +** File description: +** init_csfml.c +*/ + +#include +#include +#include +#include "../include/map.h" +#include "init_CSFML.h" +#include "../include/my.h" + +csfml* create_csfml(void) +{ + csfml* csfml = malloc(sizeof(csfml)); + + if (!csfml) { + my_printf("Failed to allocate memory for csfml\n"); + } + return csfml; +} + +sfRenderWindow* create_window(void) +{ + sfVideoMode mode = {1920, 1080, 32}; + sfRenderWindow* window = sfRenderWindow_create(mode, + "Air Traffic Simulation", sfResize | sfClose, NULL); + + return window; +} + +sfSprite* load_map_sprite(char *map_filepath, sfRenderWindow* window) +{ + sfSprite* map = load_map(map_filepath); + + if (!map) { + sfRenderWindow_destroy(window); + } + return map; +} + +void set_map_scale(sfSprite* map, sfRenderWindow* window) +{ + sfVector2u windowSize = sfRenderWindow_getSize(window); + sfFloatRect mapBounds = sfSprite_getLocalBounds(map); + sfSprite_setScale(map, (sfVector2f){windowSize.x / + mapBounds.width, windowSize.y / mapBounds.height}); +} + +void set_window_framerate(sfRenderWindow* window) +{ + sfRenderWindow_setFramerateLimit(window, 60); +} + +csfml* init_csfml(char *map_filepath) +{ + csfml* csfml = create_csfml(); + + if (!csfml) { + return NULL; + } + csfml->window = create_window(); + if (!csfml->window) { + (csfml); + return NULL; + } + csfml->map = load_map_sprite(map_filepath, csfml->window); + if (!csfml->map) { + sfRenderWindow_destroy(csfml->window); + (csfml); + return NULL; + } + set_map_scale(csfml->map, csfml->window); + set_window_framerate(csfml->window); + return csfml; +} diff --git a/src/main.c b/src/main.c index 9ff09f7..73a6f4a 100644 --- a/src/main.c +++ b/src/main.c @@ -1,69 +1,111 @@ /* ** EPITECH PROJECT, 2023 -** B-MUL-100-REN-1-1-myradar-savinien.petitjean +** B-MUL-100-REN-1-1-myradar-nathan.barbet ** File description: ** main.c */ -#include "../include/radar.h" -#include -#include #include +#include +#include +#include "../include/simulation.h" +#include "../include/map.h" +#include "../include/init_CSFML.h" +#include "../include/my.h" -int main(int ac, char **av) +int show_hitboxes = 0; + +void print_usage(void) { + my_printf("Air traffic simulation panel\n"); + my_printf("USAGE\n"); + my_printf(" ./my_radar [OPTIONS] path_to_script\n"); + my_printf(" path_to_script The path to the script file.\n"); + my_printf("OPTIONS\n"); + my_printf(" -h print the usage and quit.\n"); + my_printf("USER INTERACTIONS\n"); + my_printf(" ‘L’ key enable/disable hitboxes and a\n"); +} - sfVideoMode mode = {1920, 1080, 32}; - sfRenderWindow* window; - sfTexture* txt_background; - sfSprite* sprt_background; - sfTexture* txt_tower; - sfSprite* sprt_tower; - sfEvent event; - - sfCircleShape* circle = sfCircleShape_create(); - sfCircleShape_setRadius(circle, 50); - sfCircleShape_setOutlineThickness(circle, 2); - sfCircleShape_setOutlineColor(circle, sfBlue); - sfCircleShape_setFillColor(circle, sfTransparent); - sfCircleShape_setPosition(circle, (sfVector2f){960, 540}); - sfCircleShape_setScale(circle, (sfVector2f){2, 2}); - - if (ac == 2 && my_strcmp(av[1], "-h") == 0) { - print_usages(); - return (0); +void handle_events_main(sfEvent event, csfml **csfml, int *shouldClose) +{ + if (!csfml || !*csfml || !(*csfml)->window) { + return; } - window = sfRenderWindow_create(mode, "My Radar", sfResize | sfClose, NULL); - if (!window) - return EXIT_FAILURE; - txt_background = sfTexture_createFromFile("resources/background.png", NULL); - if (!txt_background) - return EXIT_FAILURE; - txt_tower = sfTexture_createFromFile("resources/tower.png", NULL); - if (!txt_tower) - return EXIT_FAILURE; - sprt_background = sfSprite_create(); - sprt_tower = sfSprite_create(); - sfSprite_setPosition(sprt_tower, (sfVector2f){960, 540}); - sfSprite_setScale(sprt_tower, (sfVector2f){0.2, 0.2}); - sfSprite_setTexture(sprt_background, txt_background, sfTrue); - sfSprite_setTexture(sprt_tower, txt_tower, sfTrue); - while (sfRenderWindow_isOpen(window)) - { - while (sfRenderWindow_pollEvent(window, &event)) - { - if (event.type == sfEvtClosed) - sfRenderWindow_close(window); - } - sfRenderWindow_clear(window, sfWhite); - sfRenderWindow_drawSprite(window, sprt_background, NULL); - sfRenderWindow_drawSprite(window, sprt_tower, NULL); - sfRenderWindow_drawCircleShape(window, circle, NULL); - sfRenderWindow_display(window); + if (event.type == sfEvtClosed) { + *shouldClose = 1; } - sfSprite_destroy(sprt_background); - sfTexture_destroy(txt_background); - sfRenderWindow_destroy(window); - sfCircleShape_destroy(circle); - return EXIT_SUCCESS; -} \ No newline at end of file + if (event.type == sfEvtKeyPressed && event.key.code == sfKeyL) + show_hitboxes = !show_hitboxes; +} + +csfml* initialize_csfml(void) +{ + csfml* csfml = init_csfml("resources/img/background.png"); + + if (!csfml) + my_printf("Failed to initialize csfml\n"); + return csfml; +} + +int initialize_simulation(char *script_filepath) +{ + if (init_simulation(script_filepath) != 0) { + my_printf("Failed to initialize simulation\n"); + return 84; + } + return 0; +} + +sfText* create_timer_text(void) +{ + sfText* timerText = sfText_create(); + sfFont* font = sfFont_createFromFile("resources/fonts/Roboto-Black.ttf"); + + sfText_setPosition(timerText, (sfVector2f){1550, 0}); + sfText_setColor(timerText, sfBlack); + sfText_setCharacterSize(timerText, 72); + if (!font) { + my_printf("Failed to load font\n"); + return NULL; + } + sfText_setFont(timerText, font); + return timerText; +} + +void handle_window_events(sfEvent event, csfml **csfml, int *should_close, int show_hitboxes) +{ + if (!csfml || !*csfml || !(*csfml)->window) + return; + if (event.type == sfEvtClosed) + *should_close = 1; + if (event.type == sfEvtKeyPressed && event.key.code == sfKeyL) + show_hitboxes = !show_hitboxes; +} + +int main(int argc, char *argv[]) +{ + int show_hitboxes = 0; + sfText* timer_text = create_timer_text(); + csfml* csfml = initialize_csfml(); + int should_close = 0; + + if (check_args(argc, argv) != 1) + return 84; + if (!csfml) + return 84; + if (initialize_simulation(argv[1]) != 0) { + if (csfml->window) + sfRenderWindow_destroy(csfml->window); + (csfml); + return 84; + } + if (!timer_text) + return 84; + if (csfml && csfml->window) + initialize_and_run_simulation(csfml, timer_text, &should_close, show_hitboxes); + if (timer_text) + sfText_destroy(timer_text); + (csfml); + return 0; +} diff --git a/src/main2.c b/src/main2.c new file mode 100644 index 0000000..8abba5f --- /dev/null +++ b/src/main2.c @@ -0,0 +1,70 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-savinien.petitjean +** File description: +** main2 +*/ + +#include +#include +#include +#include "../include/simulation.h" +#include "../include/map.h" +#include "../include/init_CSFML.h" +#include "../include/my.h" + +int check_args(int argc, char *argv[]) +{ + if (argc > 1 && my_strcmp(argv[1], "-h") == 0) { + print_usage(); + return 0; + } + if (argc < 2) { + my_printf("Usage: %s \n", argv[0]); + return 84; + } + return 1; +} + +void run_csfml(csfml *csfml, sfText *timerText, int *shouldClose) +{ + if (csfml && csfml->window) { + while (csfml && csfml->window) { + sfRenderWindow_clear(csfml->window, sfBlack); + draw_map(csfml->window, csfml->map); + run_simulation(csfml, timerText, shouldClose); + if (csfml->window == NULL) { + break; + } + if (sfRenderWindow_isOpen(csfml->window)) { + sfRenderWindow_display(csfml->window); + } + } + } else { + my_printf("csfml or window is null\n"); + return; + } +} + +void initialize_and_run_simulation(csfml *csfml, sfText *timer_text, int *should_close, int show_hitboxes) +{ + sfEvent event; + + if (!csfml) { + return; + } + while (csfml && csfml->window && sfRenderWindow_isOpen(csfml->window) && !*should_close) { + while (csfml && csfml->window && sfRenderWindow_pollEvent(csfml->window, &event)) { + handle_window_events(event, &csfml, should_close, show_hitboxes); + if (!csfml || !csfml->window || !sfRenderWindow_isOpen(csfml->window)) { + free(csfml); + break; + } + } + if (!csfml || !csfml->window || !sfRenderWindow_isOpen(csfml->window) || *should_close) { + free(csfml); + break; + } + run_csfml(csfml, timer_text, should_close); + } +} diff --git a/src/map.c b/src/map.c new file mode 100644 index 0000000..231a788 --- /dev/null +++ b/src/map.c @@ -0,0 +1,36 @@ +/* +** EPITECH PROJECT, 2023 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** map.c +*/ + +#include +#include +#include "../include/map.h" +#include "../include/my.h" + +sfSprite* load_map(char *filepath) +{ + sfSprite* sprite = sfSprite_create(); + sfTexture* texture = sfTexture_createFromFile(filepath, NULL); + + if (!texture) + return NULL; + sfSprite_setTexture(sprite, texture, sfTrue); + return sprite; +} + +void draw_map(sfRenderWindow* window, sfSprite* map) +{ + if (map != NULL) + sfRenderWindow_drawSprite(window, map, NULL); +} + +void unload_map(sfSprite* map) +{ + const sfTexture* texture = sfSprite_getTexture(map); + + sfSprite_destroy(map); + sfTexture_destroy((sfTexture*)texture); +} diff --git a/src/script.c b/src/script.c new file mode 100644 index 0000000..9d7aecb --- /dev/null +++ b/src/script.c @@ -0,0 +1,64 @@ +/* +** EPITECH PROJECT, 2023 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** script.c +*/ + +#include +#include +#include "../include/simulation.h" +#include "../include/init_CSFML.h" +#include "../include/script.h" +#include "../include/ControlTower.h" +#include "../include/aircraft.h" +#include "../include/window.h" +#include "../include/collision.h" +#include "../include/my.h" + +Aircraft* aircrafts; +ControlTower* towers; +int num_aircrafts = 0; +int num_towers = 0; +int num_landed_aircrafts = 0; +int num_destroyed_aircrafts = 0; +extern int show_hitboxes; + +void handle_event(sfEvent event, csfml **csfml, int *should_close) +{ + if (!csfml || !*csfml || !(*csfml)->window) { + return; + } + if (event.type == sfEvtClosed) { + *should_close = 1; + } + if (event.type == sfEvtKeyPressed && event.key.code == sfKeyL) + show_hitboxes = !show_hitboxes; +} + +void update_timer(sfRenderWindow *window, + sfText *timerText, float elapsed_time) +{ + char timerString[50] = ""; + + my_printf(timerString, "Time: %.2f", elapsed_time); + sfText_setString(timerText, timerString); + sfRenderWindow_drawText(window, timerText, NULL); +} + +void handle_aircraft_interactions(int i, float deltaTime) +{ + sfFloatRect hitbox1; + sfFloatRect hitbox2; + int j; + + hitbox1 = (sfFloatRect){aircrafts[i].pos.x - 10, + aircrafts[i].pos.y - 10, 20, 20}; + for (j = i + 1; j < num_aircrafts; j++) { + hitbox2 = (sfFloatRect){aircrafts[j].pos.x - 10, + aircrafts[j].pos.y - 10, 20, 20}; + if (sfFloatRect_intersects(&hitbox1, &hitbox2, NULL)) + handle_aircraft_collision(i, j); + } + handle_aircraft_landing(i, deltaTime); +} diff --git a/src/simulation.c b/src/simulation.c new file mode 100644 index 0000000..eb7aa16 --- /dev/null +++ b/src/simulation.c @@ -0,0 +1,84 @@ +/* +** EPITECH PROJECT, 2023 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** simulation.c +*/ + +#include +#include +#include "../include/simulation.h" +#include "../include/map.h" +#include "../include/init_CSFML.h" +#include "../include/script.h" +#include "../include/ControlTower.h" +#include "../include/aircraft.h" +#include "../include/window.h" +#include "../include/events.h" +#include "../include/my.h" + +extern Aircraft* aircrafts; +extern ControlTower* towers; +extern int num_aircrafts; +extern int num_towers; +extern int num_landed_aircrafts; +extern int num_destroyed_aircrafts; +extern int show_hitboxes; +float babylonian_sqrt(float num); + +int init_simulation(char *script_filepath) +{ + if (read_script(script_filepath) != 0) { + my_printf( "Failed to read the script file: %s\n", + script_filepath); + return 84; + } + return 0; +} + +void init_run_sim(csfml *csfml, sfText* timerText, int *should_close) +{ + SimulationData simData; + + simData.csfml = csfml; + simData.timerText = timerText; + simData.should_close = should_close; + run_simulation_loop(simData, csfml); +} + +void run_simulation(csfml* csfml, sfText *timerText, int *should_close) +{ + if (!csfml || !csfml->window) { + my_printf( "Failed to initialize csfml\n"); + return; + } + init_run_sim(csfml, timerText, should_close); + if (csfml) { + sfText_destroy(timerText); + if (csfml->map) + unload_map(csfml->map); + if (csfml->window) + sfRenderWindow_destroy(csfml->window); + (csfml); + } +} + +void run_simulation_loop(SimulationData simData, csfml *csfml) +{ + sfClock* clock = sfClock_create(); + float deltaTime = 0; + float elapsed_time = 0; + + while (simData.csfml && simData.csfml->window && + sfRenderWindow_isOpen(simData.csfml->window)) { + handle_window_events_simulation(simData.csfml, simData.should_close); + if (*simData.should_close) + break; + deltaTime = sfTime_asSeconds(sfClock_restart(clock)); + elapsed_time += deltaTime; + simData.deltaTime = deltaTime; + simData.elapsed_time = elapsed_time; + update_and_draw(simData); + } + sfClock_destroy(clock); +} diff --git a/src/simulation2.c b/src/simulation2.c new file mode 100644 index 0000000..1d74dfc --- /dev/null +++ b/src/simulation2.c @@ -0,0 +1,48 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** simulation2.c +*/ + +#include +#include +#include +#include "../include/simulation.h" +#include "../include/map.h" +#include "../include/my.h" + +extern Aircraft* aircrafts; +extern ControlTower* towers; +extern int num_aircrafts; +extern int num_towers; +extern int num_landed_aircrafts; +extern int num_destroyed_aircrafts; +extern int show_hitboxes; +float babylonian_sqrt(float num); + +void check_end_simulation(csfml *csfml) +{ + if (num_aircrafts == 0) { + my_printf("Nombre d'avions atterris : %d\n", num_landed_aircrafts); + my_printf("Nombre d'avions détruits : %d\n", num_destroyed_aircrafts); + if (csfml && csfml->window && sfRenderWindow_isOpen(csfml->window)) { + sfRenderWindow_close(csfml->window); + } + } +} + +void end_simulation(csfml *csfml, sfSprite*) +{ + for (int i = 0; i < num_aircrafts; i++) { + sfSprite_destroy(aircrafts[i].sprite); + aircrafts[i].sprite = NULL; + } + (aircrafts); + for (int i = 0; i < num_towers; i++) { + sfSprite_destroy(towers[i].sprite); + towers[i].sprite = NULL; + } + (towers); + unload_map(csfml->map); +} \ No newline at end of file diff --git a/src/window.c b/src/window.c new file mode 100644 index 0000000..c634a5c --- /dev/null +++ b/src/window.c @@ -0,0 +1,67 @@ +/* +** EPITECH PROJECT, 2024 +** B-MUL-100-REN-1-1-myradar-nathan.barbet +** File description: +** window.c +*/ + +#include +#include +#include "../include/simulation.h" +#include "../include/map.h" +#include +#include "../include/window.h" +#include "../include/my.h" + +extern int show_hitboxes; + +void draw_aircraft(csfml *csfml, int i) +{ + float angle; + + if (aircrafts[i].sprite != NULL) { + sfSprite_setPosition(aircrafts[i].sprite, aircrafts[i].pos); + angle = atan2(aircrafts[i].direction.y, + aircrafts[i].direction.x) * 180 / M_PI; + sfSprite_setRotation(aircrafts[i].sprite, angle); + sfRenderWindow_drawSprite(csfml->window, aircrafts[i].sprite, NULL); + } + if (show_hitboxes) { + draw_aircraft_hitbox(csfml, i); + } +} + +void update_and_draw_aircrafts(csfml *csfml, float deltaTime) +{ + for (int i = 0; i < num_aircrafts; i++) { + handle_aircraft_interactions(i, deltaTime); + draw_aircraft(csfml, i); + } +} + +void draw_towers(csfml *csfml) +{ + for (int i = 0; i < num_towers; i++) { + if (towers[i].sprite != NULL) { + sfRenderWindow_drawSprite(csfml->window, towers[i].sprite, NULL); + } + if (show_hitboxes) { + draw_tower_radius(csfml, i); + } + } +} + +void update_and_draw(SimulationData simData) +{ + sfRenderWindow_clear(simData.csfml->window, sfBlack); + draw_map(simData.csfml->window, simData.csfml->map); + update_timer(simData.csfml->window, simData.timerText, + simData.elapsed_time); + update_and_draw_aircrafts(simData.csfml, simData.deltaTime); + draw_towers(simData.csfml); + check_end_simulation(simData.csfml); + if (!simData.csfml || !simData.csfml->window || + !sfRenderWindow_isOpen(simData.csfml->window) || *simData.should_close) + return; + sfRenderWindow_display(simData.csfml->window); +} \ No newline at end of file