## T-primes

This problem asks you to find positive integers that can be divided by three different positive integers.
Ideal candidates for T-Prime numbers would be numbers that is formed by power of two of an integer. This means that the number supplied by the problem must have integer square root.
However, that is not enough to ensure that it would be a T-Prime number. If the roots are not prime, the number supplied can be divided by more than 3 positive integers.
Hence the root should be prime.

## Holiday Of Equality

This problem asks you how many burles (currency in the story) would it take so that the citizens will have same amount of money.
It is stated in the problem we can’t take money from citizens, so the only way is to increment each citizen’s money until they have the same amount ( we are not supposed to increment a citizen’s money that has the highest value among all)

It’s possible to skip using arrays to store number of money each citizen has, by simply summing the number of money each citizen has and find out how much money the richest citizen has.
Doing so will allow us to count how much money would all citizen have in total, and then we simply substract it with amount of money all citizens have at first.

## One-dimensional Japanese Crossword

In a nutshell, this problem simply asks you to list down how many lines of black squares, and their lengths.
A simple iteration would do. Just don’t forget to check after the end of iteration if your counter still have some length in them – print them out. Doing so would also take care of a case where there is only one line of black squares.

## New Year and Hurry

This problem requires you to count how many problems Limak can do in 240 – k minutes.

One way I can think of is to manually count how many minutes Limak need to do 1 problem – 10 problems (t1 – t10), and then based on the time left (240 -k), find how many problems he can solve. (Answer is i where ti < 240 -k < ti+1)

Or you can always simulate them. I did simulation and everything is smooth as silk.

## Anton and Danik

This problem requires you to count how many times someone wins, and based on that number of wins decide who is the winner. No actual array needed since the problem has only two players, and each round’s outcome is never draw. I counted how many times Anton won, and based on number of Anton’s win and total round , I decide the winner.

## Harnessing the magical power of Supervisord

Right, so I deployed a certain Python application on my EC2 instance.
I had a problem at that time : I’ll have to keep the pipe of the console which I am using to run the application alive, else the application would drop dead.
To solve this, I used supervisor. Supervisor is a program that allows you to monitor an app’s status.
In short, it allows me to keep the Python application alive, even if it killed itself at some point. It also mean that I don’t have to ssh to the instance and start the application manually ! Neat, no ?

Long story short, I jammed the command I used to start the app from Command Line, and added some extra modification to the application.
There was an issue with starting the application from Supervisor : it messed the relative directory locations. The app needs config which it imports using relative path. It seems that when supervisor starts the app, the directory supervisor is running the app from is not the directory of the script itself.

After tinkering abit with the app, it was good and still running until today !

## Pashmak and Flowers

This problem asks you to find how many ways you can pick 2 flowers from the flower fields. My approach was : get numbers for most beautiful and least beautiful flower, then multiply those numbers. I used map to store the numbers due to the input.

However, there was a problem: it’s possible that the input has only one kind of flower. So you’ll have to count how many ways you can pick 2 flowers using combinations ( nC2 ).

In case if you don’t know how to code combinations, or if you are too lazy, you can see it here :

http://stackoverflow.com/questions/9330915/number-of-combinations-n-choose-r-in-c

## Onto the unknown and beyond !

So I decided to try AWS. One year ec2 service for 1\$ sounds pretty good.

Had some problems with phone verification, sent a ticket and everything got solved smoothly.

The only problem I have is that I can’t really experiment around with multi instance stuff since I’m using the ec2 instance for a certain project.

I guess I’ll have to revisit Lightsail / Vultr and see if the project can actually run there.