Codeforces Round #408 (Div. 2), problem: (A) Buying A House Solution in C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>

#define MAX 1000000009

int main()
{
	int i,n,m,k,min=MAX,t,temp;
	scanf("%d %d %d",&n,&m,&k);
	for(i=1;i<=n;i++)
	{
		scanf("%d",&t);
		if(t>0 && t<=k)
		{
			temp=abs(m-i);
			if(temp<min)
				min=temp;
		}
	}
	printf("%d\n",(min*10));
	return 0;
}

Why Everyone Is Talking...

📢 As an Amazon Associate, I earn from qualifying...

Why Everyone Is Talking...

📢 As an Amazon Associate, I earn from qualifying...

Why Everyone Is Talking...

📢 As an Amazon Associate, I earn from qualifying...

Why Everyone Is Talking...

📢 As an Amazon Associate, I earn from qualifying...

GLP-1 Drugs Like Ozempic...

Understanding the Risks of GLP-1 Drugs for Older Adults GLP-1...

Renew your MSIG car...

Renewing your car insurance is often perceived as a...

Why Everyone Is Talking About the Smart Home Hacks

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Smart Home Hacks?The Smart Home Hacks...

Why Everyone Is Talking About the Viral Kitchen Gadgets

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Viral Kitchen Gadgets?The Viral Kitchen Gadgets...

Why Everyone Is Talking About the Travel Organization Gear

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Travel Organization Gear?The Travel Organization Gear...

Why Everyone Is Talking About the Travel Organization Gear

📢 As an Amazon Associate, I earn from qualifying purchases.💰 Official Price: Check on Amazon🌟 Why Buy the Travel Organization Gear?The Travel Organization Gear...

GLP-1 Drugs Like Ozempic Carry Elevated Risks of Muscle Loss and Malnutrition in Adults Over 65

Understanding the Risks of GLP-1 Drugs for Older Adults GLP-1 receptor agonists, such as Ozempic, Wegovy, and Mounjaro, have transformed the landscape of weight management...

Renew your MSIG car insurance online in minutes — and get 10% off with promo PAULTAN

Renewing your car insurance is often perceived as a tedious chore, historically involving back-and-forth communication with agents, waiting for manual quotes, and dealing with...

When healthcare stops being a promise: AbdulRazaq’a quiet revolution in Kwara

For decades, healthcare delivery in many parts of Nigeria has been defined by broken promises, decaying infrastructure, and a demoralized medical workforce. However, in...

What is the Mowat Wilson syndrome?

Mowat-Wilson syndrome (MWS) is a rare genetic disorder that affects many parts of the body. First identified in 1998 by Dr. D. R. Mowat...

BTS to perform at FIFA World Cup 2026: Streaming date, time, venue and where to watch on OTT in India. Shakira, Madonna and Justin...

The countdown to the FIFA World Cup 2026 has officially begun, and music lovers across the globe have a massive reason to celebrate. In...