You would have to use IG Api.
1. Enter Instagram account credentials into the web application.
2. Enter a tag (#fitness for example) and get 250 posts using that tag.
3. Sort the list (most liked/most commented).
4. Scheduled repost of the chosen post from that list.
5. After the post is posted auto like with 500 Instagram accounts.