Geeky Minds

Innovation, Inspiration, Instigation

Oct 15, 2017 - 2 minute read - Comments - Problem Solving Ruby

Solving Project Euler Problem 13 – Large Sum

For my next problem, I decided to take one of the popular routes and experimented with few of the simpler problems from Project Euler

The first problem that I tried was Problem 13 – Large Sum

Problem Statement

Work out the first ten digits of the sum of N 50-digit numbers.

Input Format

The first line contains N, next N lines contain a 50 digit number each.

Output Format

Print only first 10 digits of the final sum

Constraints

1 ≤ N ≤ 10^3

Oct 14, 2017 - 3 minute read - Comments - Problem Solving Ruby

Simple Program For Finding Symmetrical Point

Following up from the earlier post, I first started with a very simple mathematical problem of finding the symmetrical point, given a set of coordinates.

The problem statement is as follows:

Given two points P and Q, output the symmetric point of point P about Q.

Input Format

The first line contains an integer T representing the number of test cases

Each test case is a line containing four space-separated integers Px Py Qx Qy representing the (x,y) coordinates of P and Q.